/*
 * Winchell's Store Picker — Desktop Presentation
 * Visual/layout only. Mobile layout is intentionally left to app.css.
 */


@media (min-width: 1100px) {
    :root {
        --picker-burgundy: #8b004b;
        --picker-burgundy-dark: #70003c;
        --picker-page: #f7f7f5;
    }

    html,
    body {
        min-height: 100%;
        background: var(--picker-page);
    }

    body {
        max-width: none;
    }

    main {
        width: min(1440px, calc(100vw - 64px));
        max-width: 1440px;
        height: calc(100vh - 70px - 48px);
        min-height: 620px;
        margin: 0 auto;
        padding: 20px 0 18px;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
    }

    .desktop-left {
        display: block;
        flex: 0 0 auto;
    }

    .hero {
        margin: 0 0 18px;
        padding: 0;
        text-align: center;
        display: flex;
        justify-content: center;
        align-items: baseline;
        gap: 8px;
    }

    .hero h1 {
        margin: 0;
        color: var(--picker-burgundy);
        font-size: 30px;
        line-height: 1.15;
        font-weight: 800;
        letter-spacing: -.4px;
    }

    .hero p {
        margin: 0;
        color: #777;
        font-size: 14px;
        line-height: 1.3;
    }

    .desktop-right {
        flex: 1 1 auto;
        min-height: 0;
        display: grid;
        grid-template-columns: minmax(420px, .82fr) minmax(620px, 1.38fr);
        grid-template-areas: "stores map";
        gap: 22px;
        align-items: stretch;
    }

    .stores-panel {
        grid-area: stores;
        min-width: 0;
        min-height: 0;
        overflow: hidden;
    }

    .map-panel {
        grid-area: map;
        min-width: 0;
        min-height: 0;
    }

    .map-panel .map {
        width: 100%;
        height: 100%;
        margin: 0;
        max-width: none;
        border-radius: 22px;
        overflow: hidden;
        background: #eee;
        box-shadow: 0 10px 30px rgba(0,0,0,.07);
        border: 1px solid rgba(0,0,0,.05);
    }

    .map-panel .map iframe {
        width: 100%;
        height: 100%;
        display: block;
        border: 0;
    }

    .stores-panel .stores {
        width: 100%;
        height: 100%;
        max-width: none;
        margin: 0;
        padding: 0 4px 0 0;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
        gap: 11px;
        overflow-y: auto;
        overflow-x: hidden;
        scrollbar-width: thin;
        scrollbar-color: rgba(139,0,75,.25) transparent;
    }

    .stores-panel .stores::-webkit-scrollbar {
        width: 6px;
    }

    .stores-panel .stores::-webkit-scrollbar-track {
        background: transparent;
    }

    .stores-panel .stores::-webkit-scrollbar-thumb {
        background: rgba(139,0,75,.25);
        border-radius: 999px;
    }

    .stores-panel .store {
        position: relative;
        display: grid;
        grid-template-columns: 156px minmax(0, 1fr);
        align-items: center;
        gap: 18px;
        flex: 0 0 112px;
        width: 100%;
        min-height: 112px;
        margin: 0;
        padding: 12px 176px 12px 14px;
        box-sizing: border-box;
        border: 1.5px solid transparent;
        border-radius: 18px;
        background: #fff;
        text-align: left;
        box-shadow: 0 7px 22px rgba(0,0,0,.055);
        overflow: hidden;
        cursor: pointer;
        transition:
            border-color .22s ease,
            box-shadow .22s ease,
            transform .22s ease,
            background .22s ease;
    }

    .stores-panel .store:hover:not(:disabled) {
        transform: translateY(-1px);
        box-shadow: 0 10px 26px rgba(0,0,0,.08);
    }

    .stores-panel .store.active {
        border-color: var(--picker-burgundy);
        box-shadow: 0 10px 28px rgba(139,0,75,.13);
    }

    .stores-panel .store:disabled {
        cursor: default;
    }

    .stores-panel .store-image {
        width: 156px;
        height: 88px;
        margin: 0;
        border-radius: 14px;
        overflow: hidden;
        flex-shrink: 0;
        background: #f0f0f0;
    }

    .stores-panel .store-image img {
        width: 100%;
        height: 100%;
        display: block;
        object-fit: cover;
        object-position: center;
    }

    .stores-panel .store-info {
        width: auto;
        min-width: 0;
        margin: 0;
        padding: 0;
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: flex-start;
        gap: 5px;
    }

    .stores-panel .store-info h3 {
        margin: 0;
        color: #6f123b;
        font-size: 17px;
        line-height: 1.15;
        font-weight: 800;
        text-align: left;
        width: 100%;
    }

    .stores-panel .store-address {
        margin: 0;
        color: #555;
        font-size: 12px;
        line-height: 1.35;
        text-align: left;
        width: 100%;
    }

    .stores-panel .store-hours {
        margin-top: 1px;
        font-size: 11px;
        line-height: 1.2;
    }

    .stores-panel .store-status {
        display: inline-flex;
        align-items: center;
        min-height: 22px;
        padding: 3px 9px;
        border-radius: 999px;
        background: #e9f8ef;
        color: #168449;
        font-size: 11px;
        font-weight: 800;
        white-space: nowrap;
    }

    .stores-panel .store-status.closed {
        background: #f5f5f5;
        color: #777;
    }

    .stores-panel .coming-soon {
        margin: 0;
        color: #b15a7e;
        font-size: 11px;
        font-weight: 800;
    }

    .stores-panel .store.disabled {
        opacity: .64;
        filter: none;
    }

    .stores-panel .store.disabled .store-image img {
        opacity: .78;
    }

    /*
     * Fixed action slot:
     * Every desktop store card reserves the same button position.
     * The button is always visible, but only the selected store activates it.
     * This prevents any layout shift when selection changes.
     */
    .stores-panel .store-continue {
        position: absolute;
        right: 14px;
        top: 50%;
        transform: translateY(-50%);
        display: inline-flex;
        align-items: center;
        justify-content: center;
        gap: 0;
        width: 146px;
        height: 44px;
        padding: 0 14px 0 18px;
        box-sizing: border-box;
        border: 1px solid rgba(139,0,75,.10);
        border-radius: 999px;
        background: #f3f3f3;
        color: #8a8a8a;
        font-size: 12px;
        font-weight: 800;
        letter-spacing: .1px;
        line-height: 1;
        box-shadow: none;
        opacity: 1;
        pointer-events: none;
        transition:
            background .22s ease,
            color .22s ease,
            border-color .22s ease,
            box-shadow .22s ease,
            transform .22s ease;
        z-index: 2;
    }

    .stores-panel .store.active .store-continue {
        background: linear-gradient(135deg, #8b004b, #a9005c);
        color: #fff;
        border-color: transparent;
        box-shadow: 0 8px 18px rgba(139,0,75,.22);
        pointer-events: auto;
        cursor: pointer;
        transform: translateY(-50%);
    }

    .stores-panel .store.disabled .store-continue {
        background: #f6f6f6;
        color: #aaa;
        border-color: #ededed;
    }

    /* Bottom Continue is desktop-only hidden; mobile keeps the existing one. */
    .continue-panel {
        display: none !important;
    }

}

/* Give shorter desktop screens a little more usable room. */
@media (min-width: 1100px) and (max-height: 820px) {
    main {
        padding-top: 14px;
        padding-bottom: 12px;
    }

    .hero {
        margin-bottom: 12px;
    }

    .stores-panel .store {
        flex-basis: 98px;
        min-height: 98px;
    }

    .stores-panel .store-image {
        width: 136px;
        height: 76px;
    }

    .stores-panel .store {
        grid-template-columns: 136px minmax(0, 1fr);
        gap: 15px;
        padding-right: 164px;
    }

    .stores-panel .store-info h3 {
        font-size: 16px;
    }

    .stores-panel .store-address {
        font-size: 11px;
    }

    .stores-panel .store-continue {
        width: 136px;
        height: 40px;
    }
}

/* v6: fixed three-column desktop store card. The action has its own reserved column. */
@media (min-width: 1100px) {
    .stores-panel .store {
        display: grid;
        grid-template-columns: 156px minmax(0, 1fr) 146px;
        align-items: center;
        column-gap: 18px;
        height: 132px;
        min-height: 132px;
        flex: 0 0 132px;
        padding: 12px 14px;
        box-sizing: border-box;
    }

    .stores-panel .store-image {
        grid-column: 1;
        grid-row: 1;
        width: 156px;
        height: 106px;
    }

    .stores-panel .store-info {
        grid-column: 2;
        grid-row: 1;
        min-width: 0;
        width: 100%;
        padding: 0 !important;
        margin: 0;
        justify-content: center;
        overflow: visible;
    }

    .stores-panel .store-info h3,
    .stores-panel .store-address,
    .stores-panel .store-hours {
        max-width: 100%;
    }

    .stores-panel .store-info h3 {
        font-size: 17px;
        line-height: 1.18;
    }

    .stores-panel .store-address {
        font-size: 12px;
        line-height: 1.35;
    }

    .stores-panel .store-action {
        grid-column: 3;
        grid-row: 1;
        width: 146px;
        height: 48px;
        display: flex;
        align-items: center;
        justify-content: flex-end;
        flex: 0 0 146px;
        min-width: 146px;
    }

    .stores-panel .store-continue {
        position: relative;
        inset: auto;
        width: 146px;
        min-width: 146px;
        height: 46px;
        margin: 0;
        transform: none;
        opacity: 1;
        pointer-events: none;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 0 18px;
        box-sizing: border-box;
        border: 1px solid #ececec;
        border-radius: 999px;
        background: #f4f4f4;
        color: #a4a4a4;
        font-size: 12px;
        font-weight: 800;
        line-height: 1;
        box-shadow: none;
        transition: background .22s ease, color .22s ease, border-color .22s ease, box-shadow .22s ease, transform .22s ease;
    }

    .stores-panel .store.active .store-continue {
        transform: translateX(0);
        pointer-events: auto;
        background: linear-gradient(135deg, #8b004b, #a9005c);
        color: #fff;
        border-color: transparent;
        box-shadow: 0 9px 20px rgba(139,0,75,.22);
        cursor: pointer;
    }

    /* The list owns the scroll; the map remains fixed beside it. */
    .stores-panel .stores {
        height: 100%;
        overflow-y: auto;
        overflow-x: hidden;
        padding-right: 8px;
        box-sizing: border-box;
        align-content: flex-start;
    }
}

/* Keep the compact desktop sizing from changing the card structure on short screens. */
@media (min-width: 1100px) and (max-height: 820px) {
    .stores-panel .store {
        height: 124px;
        min-height: 124px;
        flex-basis: 124px;
        grid-template-columns: 142px minmax(0, 1fr) 136px;
        column-gap: 14px;
    }

    .stores-panel .store-image {
        width: 142px;
        height: 100px;
    }

    .stores-panel .store-action,
    .stores-panel .store-continue {
        width: 136px;
        min-width: 136px;
    }
}

/* Mobile: keep the existing mobile card behavior exactly as before. */
@media (max-width: 1099px) {
    .stores-panel .store-action {
        display: none !important;
    }
}
