/*
 * Listeo Business Profiles — form styling
 *
 * One stylesheet for every component the plugin injects into the Business
 * Profile form: the Business Type selector, the map + address block, and the
 * opening-hours week. Replaces lbp-listeo-native-style.css and
 * lbp-location-hours-test.css, which styled the same elements twice with
 * competing !important rules.
 *
 * Change the tokens below to retheme; nothing further down hardcodes a colour.
 */

.lbp-ajax-business-type,
.lbp-map-address-row,
.lbp-location-map-wrap,
.lbp-opening-hours-test {
    --lbp-ink: #16202c;
    --lbp-muted: #6b7a8c;
    --lbp-line: #dfe5ec;
    --lbp-line-strong: #c3cedc;
    --lbp-surface: #ffffff;
    --lbp-sunken: #f7f9fb;
    --lbp-accent: #2f6fed;
    --lbp-accent-soft: #eaf1ff;
    --lbp-open: #1f9d6b;
    --lbp-radius: 8px;
    --lbp-radius-sm: 6px;
    --lbp-control-h: 46px;
    --lbp-gap: 10px;
}

/* ------------------------------------------------------------------ shared */

.lbp-ajax-business-type *,
.lbp-map-address-row *,
.lbp-location-map-wrap *,
.lbp-opening-hours-test * {
    box-sizing: border-box;
}

.lbp-ajax-business-type :focus-visible,
.lbp-map-address-row :focus-visible,
.lbp-opening-hours-test :focus-visible {
    outline: 2px solid var(--lbp-accent);
    outline-offset: 2px;
}

/* ------------------------------------------------- business type selector */

.lbp-ajax-business-type {
    position: relative;
    width: 100%;
    z-index: 20;
}

.lbp-bt-control {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    min-height: var(--lbp-control-h);
    width: 100%;
    padding: 7px 40px 7px 12px;
    border: 1px solid var(--lbp-bt-border-color, var(--lbp-line));
    border-radius: var(--lbp-radius);
    background: var(--lbp-bt-bg, var(--lbp-surface));
    color: var(--lbp-bt-color, var(--lbp-ink));
    font-family: var(--lbp-bt-font-family, inherit);
    font-size: var(--lbp-bt-font-size, inherit);
    cursor: text;
    position: relative;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.lbp-bt-control:hover {
    border-color: var(--lbp-line-strong);
}

.lbp-ajax-business-type.open .lbp-bt-control,
.lbp-bt-control:focus-within {
    border-color: var(--lbp-accent);
    box-shadow: 0 0 0 3px var(--lbp-accent-soft);
}

.lbp-bt-tags {
    display: flex;
    flex: 0 1 auto;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    min-width: 0;
}

.lbp-bt-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 6px 5px 10px;
    border: 0;
    border-radius: 999px;
    background: var(--lbp-accent-soft);
    color: var(--lbp-accent);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
}

.lbp-bt-tag-label {
    display: inline-block;
}

.lbp-bt-tag-remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 18px !important;
    height: 18px !important;
    min-width: 0 !important;
    min-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 50%;
    background: transparent !important;
    color: inherit;
    font-size: 15px;
    line-height: 1 !important;
    box-shadow: none !important;
    cursor: pointer;
    opacity: .65;
    transition: opacity .15s ease, background-color .15s ease;
}

.lbp-bt-tag-remove:hover {
    opacity: 1;
    background: rgba(47, 111, 237, .14) !important;
}

.lbp-bt-inline-search {
    flex: 1 1 130px !important;
    width: auto !important;
    min-width: 130px !important;
    height: 30px !important;
    padding: 4px 2px !important;
    margin: 0 !important;
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    font: inherit;
    color: inherit;
}

.lbp-bt-inline-search::placeholder {
    color: var(--lbp-muted);
    opacity: 1;
}

.lbp-bt-arrow {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    color: var(--lbp-muted);
    font-size: 12px;
    transition: transform .18s ease;
}

.lbp-ajax-business-type.open .lbp-bt-arrow {
    transform: translateY(-50%) rotate(180deg);
}

/* dropdown panel */

.lbp-bt-panel {
    display: none;
    position: absolute;
    z-index: 999999;
    left: 0;
    right: 0;
    top: calc(100% + 6px);
    width: 100%;
    padding: 8px;
    border: 1px solid var(--lbp-line);
    border-radius: var(--lbp-radius);
    background: var(--lbp-surface);
    box-shadow: 0 12px 28px rgba(22, 32, 44, .12);
}

.lbp-ajax-business-type.open .lbp-bt-panel {
    display: block;
}

.lbp-bt-search {
    display: block !important;
    width: 100% !important;
    height: 40px !important;
    padding: 9px 12px !important;
    margin: 0 0 8px !important;
    border: 1px solid var(--lbp-line) !important;
    border-radius: var(--lbp-radius-sm) !important;
    background: var(--lbp-sunken) !important;
    color: var(--lbp-ink);
    font: inherit;
}

.lbp-bt-results {
    max-height: 264px;
    overflow-y: auto;
    overflow-x: hidden;
    width: 100%;
}

.lbp-bt-option {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    min-height: 40px;
    padding: 9px 10px;
    margin: 0;
    border: 0;
    border-radius: var(--lbp-radius-sm);
    background: transparent;
    color: var(--lbp-ink);
    text-align: left;
    line-height: 1.35;
    cursor: pointer;
}

.lbp-bt-option:hover:not(.is-selected) {
    background: var(--lbp-sunken);
}

.lbp-bt-option.is-selected {
    color: var(--lbp-muted);
    cursor: not-allowed;
}

.lbp-bt-option-check {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 18px;
    width: 18px;
    height: 18px;
}

.lbp-bt-option-check input {
    appearance: none;
    -webkit-appearance: none;
    width: 17px !important;
    height: 17px !important;
    min-width: 17px !important;
    min-height: 17px !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 1px solid var(--lbp-line-strong) !important;
    border-radius: 5px !important;
    background: var(--lbp-surface) !important;
    box-shadow: none !important;
    position: static !important;
    opacity: 1 !important;
}

.lbp-bt-option-check input:checked {
    border-color: var(--lbp-accent) !important;
    background: var(--lbp-accent) !important;
}

.lbp-bt-option-label {
    flex: 1;
}

.lbp-bt-empty,
.lbp-bt-loading {
    padding: 14px 10px;
    color: var(--lbp-muted);
    font-size: 14px;
    line-height: 1.45;
}

/* ---------------------------------------------------- address + map block */

.lbp-map-address-row {
    display: flex;
    align-items: stretch;
    gap: var(--lbp-gap);
    width: 100%;
}

.lbp-map-address-row > input,
.lbp-map-address-row > textarea,
.lbp-map-address-row > select {
    flex: 1 1 auto;
    min-width: 0;
    height: var(--lbp-control-h);
}

.lbp-location-test-controls {
    flex: 0 0 auto;
    display: flex;
    align-items: stretch;
}

.lbp-use-current-location {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    height: var(--lbp-control-h);
    padding: 0 16px;
    border: 1px solid var(--lbp-line);
    border-radius: var(--lbp-radius);
    background: var(--lbp-surface);
    color: var(--lbp-ink);
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}

.lbp-use-current-location:hover:not(:disabled) {
    border-color: var(--lbp-accent);
    background: var(--lbp-accent-soft);
    color: var(--lbp-accent);
}

.lbp-use-current-location:disabled {
    opacity: .55;
    cursor: default;
}

.lbp-location-icon {
    display: inline-flex;
    flex: 0 0 auto;
    line-height: 0;
}

.lbp-location-text {
    display: inline-block;
}

.lbp-location-map-wrap {
    width: 100%;
    margin-top: var(--lbp-gap);
    border: 1px solid var(--lbp-line);
    border-radius: var(--lbp-radius);
    overflow: hidden;
    background: var(--lbp-sunken);
}

.lbp-google-map,
.lbp-submit-map {
    width: 100%;
    min-height: 300px;
    height: 300px;
}

.lbp-friendly-address textarea {
    min-height: 92px;
    resize: vertical;
}

/* -------------------------------------------------------- opening hours */

.lbp-opening-hours-test {
    width: 100%;
    margin-top: 6px;
    border: 1px solid var(--lbp-line);
    border-radius: var(--lbp-radius);
    background: var(--lbp-surface);
    overflow: hidden;
}

.lbp-oh-title-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--lbp-gap);
    padding: 14px 16px;
    border-bottom: 1px solid var(--lbp-line);
    background: var(--lbp-sunken);
}

.lbp-oh-title-row h4 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--lbp-ink);
}

.lbp-oh-help {
    margin: 0;
    font-size: 13px;
    color: var(--lbp-muted);
}

/*
 * Each day is a row in a week rail. The marker on the left is the fastest way
 * to read the whole week at a glance: filled means open, hollow means closed.
 */
.lbp-oh-day {
    display: flex;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: var(--lbp-gap);
    padding: 14px 16px 14px 34px;
    border-bottom: 1px solid var(--lbp-line);
    position: relative;
    transition: background-color .15s ease;
}

.lbp-oh-day:last-child {
    border-bottom: 0;
}

.lbp-oh-day:hover {
    background: var(--lbp-sunken);
}

.lbp-oh-day::before {
    content: "";
    position: absolute;
    left: 16px;
    top: 24px;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--lbp-open);
    transition: background-color .15s ease, box-shadow .15s ease;
}

.lbp-oh-day.is-closed::before {
    background: transparent;
    box-shadow: inset 0 0 0 1px var(--lbp-line-strong);
}

.lbp-oh-day-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--lbp-gap);
    flex: 0 0 190px;
    min-height: 38px;
}

.lbp-oh-day-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--lbp-ink);
}

.lbp-oh-day.is-closed .lbp-oh-day-name {
    color: var(--lbp-muted);
    font-weight: 500;
}

.lbp-oh-closed-label {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: 13px;
    color: var(--lbp-muted);
    cursor: pointer;
    user-select: none;
}

.lbp-oh-closed-label input {
    width: 16px !important;
    height: 16px !important;
    min-width: 16px !important;
    min-height: 16px !important;
    margin: 0 !important;
    accent-color: var(--lbp-accent);
    cursor: pointer;
}

.lbp-oh-primary-slot,
.lbp-oh-slots {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 1 1 260px;
    min-width: 0;
}

.lbp-oh-slot {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.lbp-oh-slot input,
.lbp-oh-time {
    height: 40px !important;
    min-width: 0;
    flex: 0 1 132px;
    padding: 8px 10px !important;
    border: 1px solid var(--lbp-line) !important;
    border-radius: var(--lbp-radius-sm) !important;
    background: var(--lbp-surface) !important;
    color: var(--lbp-ink);
    font: inherit;
    font-variant-numeric: tabular-nums;
}

.lbp-oh-slot input:focus,
.lbp-opening-hours-test input:focus {
    border-color: var(--lbp-accent) !important;
    box-shadow: 0 0 0 3px var(--lbp-accent-soft);
}

.lbp-oh-day.is-closed .lbp-oh-primary-slot,
.lbp-oh-day.is-closed .lbp-oh-slots {
    opacity: .4;
    pointer-events: none;
}

/* day-level buttons */

.lbp-oh-add,
.lbp-oh-remove,
.lbp-oh-apply-all {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    height: 34px;
    padding: 0 12px;
    border: 1px solid var(--lbp-line);
    border-radius: var(--lbp-radius-sm);
    background: var(--lbp-surface);
    color: var(--lbp-ink);
    font-size: 13px;
    font-weight: 500;
    line-height: 1;
    white-space: nowrap;
    cursor: pointer;
    transition: border-color .15s ease, background-color .15s ease, color .15s ease;
}

.lbp-oh-add:hover,
.lbp-oh-apply-all:hover {
    border-color: var(--lbp-accent);
    background: var(--lbp-accent-soft);
    color: var(--lbp-accent);
}

.lbp-oh-remove {
    flex: 0 0 auto;
    width: 34px;
    padding: 0;
    color: var(--lbp-muted);
}

.lbp-oh-remove:hover {
    border-color: #e6b3ae;
    background: #fdf1f0;
    color: #c0392b;
}

/* ------------------------------------------------------------- responsive */

@media only screen and (max-width: 768px) {
    .lbp-map-address-row {
        flex-direction: column;
    }

    .lbp-location-test-controls,
    .lbp-use-current-location {
        width: 100%;
    }

    .lbp-google-map,
    .lbp-submit-map {
        min-height: 240px;
        height: 240px;
    }

    .lbp-oh-day {
        padding-left: 30px;
    }

    .lbp-oh-day-head {
        flex: 1 1 100%;
    }

    .lbp-oh-slot input,
    .lbp-oh-time {
        flex: 1 1 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .lbp-ajax-business-type *,
    .lbp-map-address-row *,
    .lbp-opening-hours-test * {
        transition: none !important;
    }
}
