/* ============================================================
   Heron Lakes — Store Cards (Stores archive + reusable elsewhere)
   Mobile-first grid: 1 col → 2 (768px) → 3 (1024px) → 4 (1200px)
   ============================================================ */

/* -------------------------------------------------------
   Category Filter Bar — horizontal scroll-snap chip row.
   Same interaction on every breakpoint: native touch/trackpad scroll.
   Arrow buttons are an aid for mouse-only desktop users, so they're
   hidden on touch devices via the hover/pointer media query below.
   ------------------------------------------------------- */
.store-filter-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-sm);
    margin-block-end: var(--space-xl);
}

.store-filter-track {
    display: flex;
    min-width: 0;
    gap: var(--space-sm);
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scrollbar-width: none;
    padding-inline: 4px;
}

.store-filter-track::-webkit-scrollbar {
    display: none;
}

.store-filter-chip {
    flex-shrink: 0;
    scroll-snap-align: start;
    padding: 10px 22px;
    background-color: var(--color-white);
    border: 1px solid var(--color-blue-bright);
    border-radius: var(--radius-full);
    color: var(--color-navy);
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
    cursor: pointer;
    transition: background-color var(--transition-fast), color var(--transition-fast);
}

.store-filter-chip:hover {
    background-color: #029DE514;
}

.store-filter-chip.is-active {
    background-color: var(--color-blue-bright);
    border-color: var(--color-blue-bright);
    color: var(--color-white);
}

.store-filter-arrow {
    flex-shrink: 0;
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    background-color: var(--color-white);
    border: 1px solid var(--overlay-black-16);
    border-radius: var(--radius-full);
    color: var(--color-navy);
    cursor: pointer;
    transition: border-color var(--transition-fast), color var(--transition-fast);
}

.store-filter-arrow:hover {
    border-color: var(--color-blue-bright);
    color: var(--color-blue-bright);
}

.store-filter-arrow-icon {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-inline-end: 2px solid currentColor;
    border-block-end: 2px solid currentColor;
}

.store-filter-arrow--prev .store-filter-arrow-icon {
    transform: rotate(135deg);
    margin-inline-start: 3px;
}

.store-filter-arrow--next .store-filter-arrow-icon {
    transform: rotate(-45deg);
    margin-inline-end: 3px;
}

/* Scroll arrows only make sense when (a) the device benefits from them —
   touch already has native swipe — and (b) the chips actually overflow the
   container. store-cards.js adds .has-overflow once it measures that. */
@media (hover: hover) and (pointer: fine) {
    .store-filter-bar.has-overflow .store-filter-arrow {
        display: flex;
    }
}

/* -------------------------------------------------------
   Grid — cards and their detail panels are siblings here.
   A panel spans the full row (grid-column: 1 / -1). store-cards.js
   keeps each open panel positioned right after the last card of its
   own row, so it renders full-width below that row without pushing
   later cards out of place.
   ------------------------------------------------------- */
.stores-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-xl);
}

@media (min-width: 768px) {
    .stores-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .stores-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (min-width: 1200px) {
    .stores-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Filtered out by the category chip bar */
.store-card.is-hidden {
    display: none;
}

/* -------------------------------------------------------
   Store Card
   ------------------------------------------------------- */
.store-card {
    display: flex;
    flex-direction: column;
    background-color: var(--color-white);
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
    transition: box-shadow var(--transition-base);
}

.store-card:hover {
    box-shadow: var(--shadow-md), var(--shadow-lg);
}

/* Active state — this card's details panel is open */
.store-card.is-open {
    box-shadow: 0 0 0 2px var(--color-blue-bright), var(--shadow-lg);
}

.store-card-media {
    position: relative;
    aspect-ratio: 4 / 3;
    background-color: var(--color-blue-grey);
}

.store-card-image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Logo badge — straddles the image/body boundary, centered.
   Real logo assets already come as a finished graphic with their own
   shape/border baked in, so this wrapper only positions and sizes it —
   no background/border/radius of its own. Real logos vary in proportion
   (square, circular, wide wordmarks), so the box uses a mild 4:3 ratio
   rather than a narrow one: object-fit: contain then gives square/round
   logos generous room while still handling wider ones reasonably. */
.store-card-logo {
    position: absolute;
    inset-inline-start: 50%;
    inset-block-end: 0;
    transform: translate(-50%, 50%);
    z-index: 1;
    width: clamp(155px, 20vw, 180px);
    aspect-ratio: 4 / 3;
}

.store-card-logo img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: drop-shadow(var(--shadow-sm));
}

/* Placeholder shown until a real logo is uploaded — same look language
   as the card itself (white, card's own radius) instead of an empty gap */
.store-card-logo--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-white);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-sm);
}

.store-card-logo--placeholder span {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.05rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-gray);
}

.store-card-body {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
    flex: 1;
    padding-inline: clamp(16px, 4vw, 20px);
    padding-block-end: clamp(16px, 4vw, 20px);
    /* Half the logo box's rendered height (width * 3/4 aspect-ratio, halved) —
       the logo slot (real or placeholder) is always present, so this always applies */
    padding-block-start: calc(clamp(155px, 20vw, 180px) * 0.375 + var(--space-md));
    text-align: center;
}

.store-card-title {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 1.125rem;
    color: var(--color-navy);
    text-transform: capitalize;
    letter-spacing: 0.04em;
    line-height: 1.3;
}

/* Extends .cta-button (same brand button) — width + chevron are additive */
.store-card-toggle {
    position: relative;
    width: 100%;
    margin-block-start: auto;
    border: none;
    cursor: pointer;
}

/* Active state — clearly distinct from the default blue so it's obvious
   at a glance which card's panel is open */
.store-card-toggle.is-open {
    background-color: var(--color-navy);
}

.store-card-chevron {
    position: absolute;
    inset-inline-end: var(--space-lg);
    inset-block-start: 50%;
    display: inline-block;
    width: 8px;
    height: 8px;
    border-inline-end: 2px solid currentColor;
    border-block-end: 2px solid currentColor;
    transform: translateY(-50%) rotate(45deg);
    transition: transform var(--transition-base);
}

/* Points up while the panel is open */
.store-card-toggle.is-open .store-card-chevron {
    transform: translateY(-50%) rotate(-135deg);
}

/* -------------------------------------------------------
   Store Details Panel — full width of the grid container
   ------------------------------------------------------- */
.store-panel {
    grid-column: 1 / -1;
}

.store-panel-inner {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-xl);
    padding: var(--space-xl);
    background-color: #F7F7F7;
    border-radius: var(--radius-md);
    box-shadow: var(--shadow-sm);
}

/* Description | Hours+Contact split only from 1024px up — single
   stacked column on mobile and tablet. The info column gets a stable
   width band instead of a plain fr split — a proportional split gets
   uncomfortably narrow right at the low end of this breakpoint, once
   its own internal padding is factored in. */
@media (min-width: 1024px) {
    .store-panel-inner.has-info {
        grid-template-columns: minmax(0, 1fr) minmax(260px, 450px);
        gap: var(--space-2xl);
    }
}

.store-panel-description {
    font-family: var(--font-body);
    line-height: 1.7;
    color: var(--color-text);
}

.store-panel-description p + p {
    margin-block-start: var(--space-md);
}

.store-panel-info {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
    padding: var(--space-lg);
    background-color: #EFF9FE;
    border: 1px solid #029DE526;
    border-radius: var(--radius-md);
}

.store-info-heading {
    font-family: var(--font-heading);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-blue-bright);
    margin-block-end: var(--space-sm);
}

/* Business hours — day/time pairs on a crisp two-column grid */
.store-hours {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: var(--space-md);
    row-gap: 6px;
}

.store-hours-day {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--color-text);
}

.store-hours-time {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--color-gray);
}

/* Contact info — same crisp two-column grid as business hours */
.store-contact {
    display: grid;
    grid-template-columns: auto 1fr;
    column-gap: var(--space-md);
    row-gap: 6px;
    align-items: baseline;
}

.store-contact-label {
    font-family: var(--font-heading);
    font-weight: 600;
    font-size: 0.85rem;
    color: var(--color-text);
}

.store-contact-value {
    font-family: var(--font-body);
    font-size: 0.85rem;
    color: var(--color-gray);
    word-break: break-word;
}

a.store-contact-value:hover {
    color: var(--color-blue-bright);
}

/* -------------------------------------------------------
   Empty state
   ------------------------------------------------------- */
.stores-empty {
    font-family: var(--font-body);
    color: var(--color-gray);
    text-align: center;
    padding-block: var(--space-2xl);
}
