/**
 * Van Wall Store Selector — Styles (v1.4.0)
 *
 * Designed to sit at the very top of the page, above Shoptimizer's existing
 * header. Matches the existing dark utility bar aesthetic with John Deere
 * green accents.
 *
 * COLOR REFERENCE (Van Wall / John Deere brand):
 *   Dark bar background:  #1a1a1a (matching existing top bar)
 *   JD Green accent:      #367c2b
 *   JD Yellow accent:     #ffde00
 *   Text:                 #ffffff
 *   Muted text:           #a0a0a0
 */

/* ============================================================
   BAR — Main horizontal strip at top of page
   ============================================================ */

.vwss-bar {
    background-color: #1a1a1a;
    color: #ffffff;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
    font-size: 13px;
    line-height: 1.4;
    position: relative;
    z-index: 9999;
    border-bottom: 1px solid #333;
}

.vwss-bar__inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 7px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

/* ---- Store + Hours + Phone (left side) ---- */

.vwss-bar__store {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.vwss-bar__icon {
    display: inline-flex;
    align-items: center;
    color: #367c2b;
    flex-shrink: 0;
}

.vwss-bar__label {
    font-weight: 600;
    white-space: nowrap;
}

/* ---- Hours Status ---- */

.vwss-bar__hours {
    white-space: nowrap;
    font-size: 12px;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.vwss-bar__hours[hidden] {
    display: none;
}

/* Status dot indicator */
.vwss-bar__hours::before {
    content: "";
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    flex-shrink: 0;
}

/* Open — green */
.vwss-bar__hours--open {
    color: #8fdf82;
}

.vwss-bar__hours--open::before {
    background-color: #4caf50;
    box-shadow: 0 0 4px rgba(76, 175, 80, 0.5);
}

/* Closing soon — amber */
.vwss-bar__hours--closing {
    color: #ffd54f;
}

.vwss-bar__hours--closing::before {
    background-color: #ffc107;
    box-shadow: 0 0 4px rgba(255, 193, 7, 0.5);
}

/* Closed — gray */
.vwss-bar__hours--closed {
    color: #a0a0a0;
}

.vwss-bar__hours--closed::before {
    background-color: #777;
}

/* Extended hours note — shown when store is on extended tier but not confirmed */
.vwss-bar__extended-note {
    font-style: italic;
    color: #ffd54f;
    font-size: 11px;
    font-weight: 400;
}

/* Sunday scope note — shown when today is Sunday and store is publishing Sunday */
.vwss-bar__sunday-note {
    font-style: italic;
    color: #ffd54f;
    font-size: 11px;
    font-weight: 400;
}

/* ---- Phone ---- */

.vwss-bar__phone {
    white-space: nowrap;
}

.vwss-bar__phone a {
    color: #ffde00;
    text-decoration: none;
    font-weight: 600;
    letter-spacing: 0.02em;
}

.vwss-bar__phone a:hover {
    text-decoration: underline;
    color: #fff;
}

/* Separator dot between phone and previous element */
.vwss-bar__phone::before {
    content: "—";
    margin-right: 8px;
    color: #555;
}

/* "Change" button */
.vwss-bar__change {
    background: none;
    border: 1px solid #555;
    color: #a0a0a0;
    font-size: 11px;
    padding: 2px 10px;
    border-radius: 3px;
    cursor: pointer;
    transition: all 0.15s ease;
    white-space: nowrap;
    font-family: inherit;
    line-height: 1.4;
}

.vwss-bar__change:hover,
.vwss-bar__change:focus {
    color: #fff;
    border-color: #888;
    outline: none;
}

.vwss-bar__change:focus-visible {
    outline: 2px solid #367c2b;
    outline-offset: 2px;
}

/* ---- Other Sites links (right side) ---- */

.vwss-bar__links {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    white-space: nowrap;
}

.vwss-bar__links-label {
    color: #888;
}

.vwss-bar__links a {
    color: #ccc;
    text-decoration: none;
}

.vwss-bar__links a:hover {
    color: #fff;
    text-decoration: underline;
}

.vwss-bar__links a + a::before {
    content: "|";
    margin-right: 6px;
    color: #444;
}


/* ============================================================
   DROPDOWN — Location picker panel
   ============================================================ */

.vwss-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    color: #333;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.25);
    z-index: 10000;
    border-bottom: 3px solid #367c2b;
}

.vwss-dropdown[hidden] {
    display: none;
}

.vwss-dropdown__inner {
    max-width: 520px;
    margin: 0 auto;
    padding: 20px;
}

/* Header row */
.vwss-dropdown__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
}

.vwss-dropdown__title {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
}

.vwss-dropdown__close {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s;
}

.vwss-dropdown__close:hover {
    color: #333;
}

.vwss-dropdown__close:focus-visible {
    outline: 2px solid #367c2b;
    outline-offset: 2px;
}

/* Search input */
.vwss-dropdown__search-wrap {
    margin-bottom: 10px;
}

.vwss-dropdown__search {
    width: 100%;
    padding: 10px 14px;
    font-size: 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    outline: none;
    transition: border-color 0.15s;
    font-family: inherit;
    box-sizing: border-box;
}

.vwss-dropdown__search:focus {
    border-color: #367c2b;
}

.vwss-dropdown__search::placeholder {
    color: #aaa;
}

/* Store list */
.vwss-dropdown__list {
    list-style: none;
    margin: 0;
    padding: 0;
    max-height: 340px;
    overflow-y: auto;
    border: 1px solid #eee;
    border-radius: 6px;
}

.vwss-dropdown__list::-webkit-scrollbar {
    width: 6px;
}

.vwss-dropdown__list::-webkit-scrollbar-track {
    background: #f5f5f5;
}

.vwss-dropdown__list::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

/* Dropdown item — updated layout for hours info */
.vwss-dropdown__item {
    padding: 10px 14px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    transition: background-color 0.1s;
}

.vwss-dropdown__item:last-child {
    border-bottom: none;
}

.vwss-dropdown__item:hover,
.vwss-dropdown__item:focus {
    background-color: #f0f7ee;
    outline: none;
}

.vwss-dropdown__item[aria-selected="true"] {
    background-color: #e8f5e3;
    font-weight: 600;
}

.vwss-dropdown__item[aria-selected="true"]::after {
    content: "✓";
    color: #367c2b;
    font-weight: 700;
    font-size: 14px;
    flex-shrink: 0;
    margin-left: 4px;
}

/* Info column (left side of item) */
.vwss-dropdown__item-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.vwss-dropdown__item-top {
    display: flex;
    align-items: baseline;
}

.vwss-dropdown__item-name {
    font-weight: 600;
    color: #1a1a1a;
}

.vwss-dropdown__item-state {
    color: #888;
    font-weight: 400;
    margin-left: 2px;
}

/* Hours status line under the city name */
.vwss-dropdown__item-bottom {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 11px;
    line-height: 1.3;
}

.vwss-dropdown__item-status {
    font-weight: 500;
}

.vwss-dropdown__item-status--open {
    color: #2e7d32;
}

.vwss-dropdown__item-status--closing {
    color: #e65100;
}

.vwss-dropdown__item-status--closed {
    color: #999;
}

.vwss-dropdown__item-hours {
    color: #aaa;
    font-size: 11px;
}

/* Extended note in dropdown */
.vwss-dropdown__item-ext-note {
    display: block;
    font-size: 10px;
    font-style: italic;
    color: #e65100;
    margin-top: 1px;
}

/* Sunday scope note in dropdown */
.vwss-dropdown__item-sunday-note {
    display: block;
    font-size: 10px;
    font-style: italic;
    color: #e65100;
    margin-top: 1px;
}

/* Phone (right side of item) */
.vwss-dropdown__item-phone {
    font-size: 12px;
    color: #888;
    white-space: nowrap;
    flex-shrink: 0;
}

.vwss-dropdown__item--no-results {
    padding: 20px 14px;
    text-align: center;
    color: #999;
    font-style: italic;
    cursor: default;
}

.vwss-dropdown__item--no-results:hover {
    background-color: transparent;
}

/* Footer */
.vwss-dropdown__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #eee;
    font-size: 12px;
    flex-wrap: wrap;
    gap: 8px;
}

.vwss-dropdown__all-link {
    color: #367c2b;
    text-decoration: none;
    font-weight: 600;
}

.vwss-dropdown__all-link:hover {
    text-decoration: underline;
}

.vwss-dropdown__tollfree {
    color: #888;
}

.vwss-dropdown__tollfree a {
    color: #555;
    text-decoration: none;
}

.vwss-dropdown__tollfree a:hover {
    text-decoration: underline;
}


/* ============================================================
   OVERLAY — Click-outside backdrop to close dropdown
   ============================================================ */

.vwss-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 9998;
}

.vwss-overlay[hidden] {
    display: none;
}


/* ============================================================
   STATE: Loading / Detecting
   ============================================================ */

.vwss-bar--detecting .vwss-bar__label {
    color: #aaa;
}


/* ============================================================
   SCREEN READER ONLY
   ============================================================ */

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}


/* ============================================================
   RESPONSIVE — Tablet and Mobile
   ============================================================ */

@media (max-width: 768px) {
    .vwss-bar__inner {
        padding: 6px 15px;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .vwss-bar__links {
        display: none; /* Hide "Our Other Sites" on mobile to save space */
    }

    .vwss-bar__store {
        width: 100%;
        justify-content: flex-start;
    }

    /* Hours status wraps to its own line on mobile */
    .vwss-bar__hours {
        order: 10;
        width: 100%;
        font-size: 11px;
        padding-left: 22px; /* Align with text after the map pin icon (14px icon + 8px gap) */
    }

    .vwss-bar__phone::before {
        content: "·";
        margin-right: 6px;
    }

    .vwss-dropdown__inner {
        padding: 15px;
    }

    .vwss-dropdown__list {
        max-height: 280px;
    }

    .vwss-dropdown__footer {
        flex-direction: column;
        align-items: flex-start;
    }

    /* Simplify dropdown items on mobile */
    .vwss-dropdown__item-hours {
        display: none;
    }

    /* Hide extended note on mobile — not enough space */
    .vwss-bar__extended-note {
        display: none;
    }

    .vwss-bar__sunday-note {
        display: none;
    }

    .vwss-dropdown__item-ext-note {
        display: none;
    }

    .vwss-dropdown__item-sunday-note {
        display: none;
    }
}

@media (max-width: 480px) {
    .vwss-bar {
        font-size: 12px;
    }

    .vwss-bar__store {
        gap: 5px;
    }

    .vwss-bar__change {
        font-size: 10px;
        padding: 2px 8px;
    }

    .vwss-bar__hours {
        padding-left: 19px; /* 14px icon + 5px gap at this breakpoint */
    }

    .vwss-dropdown__search {
        font-size: 16px; /* Prevent iOS zoom on focus */
    }
}

/* ================================================================
   STORE DIRECTORY — [vwss_store_directory] shortcode styles
   ================================================================ */

.vwss-directory {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0;
}

.vwss-directory__loading {
    text-align: center;
    padding: 40px 20px;
    color: #888;
    font-size: 14px;
}

/* Group headers */
.vwss-directory__group {
    margin-bottom: 32px;
}

.vwss-directory__group-title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0 0 16px 0;
    padding-bottom: 8px;
    border-bottom: 2px solid #367C2B;
}

.vwss-directory__group-icon {
    display: inline-flex;
    color: #367C2B;
}

.vwss-directory__group-count {
    font-weight: 400;
    color: #999;
    font-size: 14px;
}

/* Grid layout */
.vwss-directory__grid {
    display: grid;
    gap: 12px;
}

.vwss-directory__grid--2col { grid-template-columns: repeat(2, 1fr); }
.vwss-directory__grid--3col { grid-template-columns: repeat(3, 1fr); }
.vwss-directory__grid--4col { grid-template-columns: repeat(4, 1fr); }

/* Cards */
.vwss-directory__card {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 6px;
    padding: 14px 16px;
    transition: border-color 0.15s, box-shadow 0.15s;
    border-left: 3px solid #e5e5e5;
}

.vwss-directory__card:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Card state: Publishing Extended Hours — bold green accent */
.vwss-directory__card--publishing {
    border-left: 4px solid #367C2B;
    background: linear-gradient(135deg, #f6faf5 0%, #fff 60%);
}

.vwss-directory__card--publishing:hover {
    border-color: #367C2B;
    box-shadow: 0 2px 12px rgba(54, 124, 43, 0.15);
}

/* Card state: Weather Permitting — amber accent */
.vwss-directory__card--weather-permitting {
    border-left: 4px solid #F9A825;
    background: linear-gradient(135deg, #fffdf5 0%, #fff 60%);
}

.vwss-directory__card--weather-permitting:hover {
    border-color: #F9A825;
    box-shadow: 0 2px 12px rgba(249, 168, 37, 0.15);
}

/* Card state: Weather Day active — orange accent */
.vwss-directory__card--weather-day {
    border-left: 4px solid #E65100;
    background: linear-gradient(135deg, #fff8f3 0%, #fff 60%);
}

.vwss-directory__card--weather-day:hover {
    border-color: #E65100;
    box-shadow: 0 2px 12px rgba(230, 81, 0, 0.12);
}

/* Card state: Standard — clean neutral */
.vwss-directory__card--standard:hover {
    border-left-color: #367C2B;
}

/* Badges — top of card status indicators */
.vwss-directory__card-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.02em;
    padding: 3px 8px;
    border-radius: 3px;
    margin-bottom: 8px;
}

.vwss-directory__card-badge--extended {
    background: #e8f5e9;
    color: #2E7D32;
}

.vwss-directory__card-badge--weather {
    background: #FFF3E0;
    color: #BF360C;
}

/* Card header — name + link icon */
.vwss-directory__card-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.vwss-directory__card-name {
    font-size: 15px;
    font-weight: 600;
    color: #367C2B;
    text-decoration: none;
    line-height: 1.3;
}

.vwss-directory__card-name:hover {
    text-decoration: underline;
}

.vwss-directory__card-link {
    color: #999;
    flex-shrink: 0;
    padding: 2px;
    line-height: 1;
    transition: color 0.15s;
}

.vwss-directory__card-link:hover {
    color: #367C2B;
}

/* Hours status row */
.vwss-directory__card-hours {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
    font-size: 13px;
}

.vwss-directory__card-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.vwss-directory__card-dot--open { background: #367C2B; }
.vwss-directory__card-dot--closing { background: #F9A825; }
.vwss-directory__card-dot--closed { background: #C62828; }

.vwss-directory__card-status {
    color: #555;
}

/* Today's schedule */
.vwss-directory__card-today {
    font-size: 13px;
    color: #666;
    margin-bottom: 4px;
}

.vwss-directory__card-today-label {
    font-weight: 500;
    color: #888;
}

.vwss-directory__card-today-hours {
    font-weight: 500;
    color: #333;
}

/* Extended note */
.vwss-directory__card-ext-note {
    font-size: 11px;
    color: #F57F17;
    font-style: italic;
    margin-bottom: 4px;
}

/* Phone */
.vwss-directory__card-phone {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #888;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #f0f0f0;
}

.vwss-directory__card-phone svg {
    flex-shrink: 0;
}

.vwss-directory__card-phone a {
    color: #555;
    text-decoration: none;
    font-weight: 500;
}

.vwss-directory__card-phone a:hover {
    color: #367C2B;
}

/* Responsive */
@media (max-width: 900px) {
    .vwss-directory__grid--3col,
    .vwss-directory__grid--4col {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .vwss-directory__grid--2col,
    .vwss-directory__grid--3col,
    .vwss-directory__grid--4col {
        grid-template-columns: 1fr;
    }

    .vwss-directory__card {
        padding: 12px 14px;
    }
}
