/* ============================================================
   RC South — Shop Directory Styles
   Loaded conditionally on /shops, /shops/<slug>, /, /map
   ============================================================ */

/* ---------- Visually-hidden helper ---------- */
.visually-hidden {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* ---------- Alpine cloak (hide before init) ---------- */
[x-cloak] { display: none !important; }

/* ---------- Generic badges ---------- */
.badge {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.6rem;
    border-radius: var(--q2-radius-pill, 9999px);
    font-family: var(--font-body);
    font-size: 0.75rem;
    font-weight: 600;
    background: rgba(253, 62, 4, 0.10);
    color: var(--rc-orange);
    line-height: 1.4;
}

.badge--floor {
    background: rgba(0, 6, 85, 0.08);
    color: var(--rc-navy);
}

/* ============================================================
   Shop directory page (/shops)
   ============================================================ */

.shops-directory__intro {
    margin-bottom: 2rem;
}

.shops-directory__intro h1 {
    margin-top: 0;
}

.shops-directory__count {
    margin: 1rem 0;
    font-size: 0.875rem;
    color: var(--rc-grey);
}

/* ---------- Filter bar ---------- */
.shop-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: center;
    padding: 1rem;
    background: var(--rc-white);
    border: 1px solid var(--rc-light-grey);
    border-radius: 10px;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
}

.shop-filters__search {
    flex: 2 1 280px;
    min-width: 200px;
}

.shop-filters__search input,
.shop-filters__select select {
    width: 100%;
    padding: 0.55rem 0.85rem;
    font-family: var(--font-body);
    font-size: 0.95rem;
    color: var(--rc-dark);
    background: var(--rc-bg);
    border: 1px solid var(--rc-light-grey);
    border-radius: 6px;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.shop-filters__search input:focus,
.shop-filters__select select:focus {
    outline: none;
    border-color: var(--rc-orange);
    box-shadow: 0 0 0 3px color-mix(in oklab, var(--rc-orange) 25%, transparent);
}

.shop-filters__select {
    flex: 1 1 160px;
    min-width: 140px;
}

.shop-filters__reset {
    flex: 0 0 auto;
    padding: 0.55rem 1rem;
    background: transparent;
    border: 1px solid var(--rc-light-grey);
    color: var(--rc-grey);
    border-radius: 6px;
    font-family: var(--font-body);
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
}

.shop-filters__reset:hover {
    border-color: var(--rc-orange);
    color: var(--rc-orange);
}

/* ---------- Shop grid ---------- */
.shop-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
}

.shop-grid__item {
    min-width: 0;  /* prevent overflow */
}

/* ---------- Shop card ---------- */
.shop-card {
    height: 100%;
    aspect-ratio: 1 / 1;
    background: var(--rc-white);
    border: 1px solid var(--rc-light-grey);
    border-radius: 10px;
    transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
    overflow: hidden;
}

.shop-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px -8px rgba(0, 6, 85, 0.18);
    border-color: var(--rc-orange);
}

.shop-card__link {
    display: block;
    position: relative;
    height: 100%;
    color: inherit;
    text-decoration: none;
}

/* Square visual zone: contextual photo cover fills the card, logo tile
   sits bottom-left on it, title/badges bottom-right over a dark
   gradient — Columbus-mall style. Without a photo the logo centers. */
.shop-card__visual {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 8px;
    overflow: hidden;
    background: var(--rc-bg);
}

.shop-card__cover {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.shop-card:hover .shop-card__cover {
    transform: scale(1.05);
}

.shop-card__logo {
    position: absolute;
    left: 0.75rem;
    bottom: 0.75rem;
    z-index: 2;
    width: 25%;
    max-width: 84px;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.08);
    border-radius: 8px;
    padding: 0.175rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.18);
}

.shop-card__logo img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 6px;
}

.shop-card--no-cover .shop-card__logo {
    position: static;
    margin: 1.25rem auto 0;
    width: 45%;
    max-width: 104px;
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0.5rem;
    box-shadow: none;
}

.shop-card--no-cover .shop-card__logo img {
    border-radius: 0;
}

.shop-card__initials {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    border-radius: 6px;
    background: linear-gradient(135deg, var(--rc-navy) 0%, var(--rc-navy-light, #0A1A7A) 100%);
    color: var(--rc-white);
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 2rem;
}

/* Text block over the cover (bottom-right), off to the side of the logo */
.shop-card__body {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    padding: 2.25rem 0.75rem 0.75rem calc(25% + 1.4rem);
    min-height: 92px;
    background: linear-gradient(to top,
        rgba(0, 0, 0, 0.92) 0%,
        rgba(0, 0, 0, 0.65) 38%,
        rgba(0, 0, 0, 0) 100%);
}

.shop-card--no-cover .shop-card__body {
    background: none;
    padding: 2.25rem 0.75rem 0.75rem;
    min-height: 0;
}

.shop-card__title {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 1rem;
    font-weight: 700;
    line-height: 1.25;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
    word-wrap: break-word;
}

.shop-card:hover .shop-card__title {
    opacity: 0.75;
}

.shop-card__tagline {
    margin: 0;
    font-size: 0.875rem;
    color: var(--rc-grey);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: none;
}

.shop-card__meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.5rem;
    align-items: center;
}

/* Badges sit on the dark gradient over the cover — glassy light pills.
   On no-cover cards they fall back to the theme's colored pills. */
.shop-card__badge {
    display: inline-flex;
    align-items: center;
    padding: 0.2rem 0.55rem;
    border-radius: 9999px;
    font-size: 0.7rem;
    font-weight: 600;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    backdrop-filter: blur(2px);
}

.shop-card__badge--floor {
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
}

.shop-card--no-cover .shop-card__badge {
    background: rgba(253, 62, 4, 0.10);
    color: var(--rc-orange);
}

.shop-card--no-cover .shop-card__badge--floor {
    background: rgba(0, 6, 85, 0.08);
    color: var(--rc-navy);
}

.shop-card__pavilion {
    font-size: 0.75rem;
    color: rgba(255, 255, 255, 0.85);
    margin-left: auto;
}

.shop-card--no-cover .shop-card__pavilion {
    color: var(--rc-grey);
}

/* Compact card variant (homepage) */
.shop-card--compact .shop-card__title {
    font-size: 1rem;
}

/* ---------- No results ---------- */
.shops-directory__empty {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--rc-grey);
}

.shops-directory__empty p {
    margin-bottom: 1rem;
    font-size: 1.05rem;
}

/* ============================================================
   Single shop detail page (/shops/<slug>)
   ============================================================ */

.shop-hero {
    background: linear-gradient(135deg, var(--rc-navy) 0%, var(--rc-navy-light, #0A1A7A) 100%);
    color: var(--rc-white);
    padding: 2rem 0;
    position: relative;
}

.shop-hero::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 4px;
    background: var(--rc-orange);
}

.shop-hero__back {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: rgba(255, 255, 255, 0.8);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    transition: color 0.2s;
}

.shop-hero__back:hover {
    color: var(--rc-orange);
}

.shop-hero__head {
    display: flex;
    gap: 1.5rem;
    align-items: center;
    flex-wrap: wrap;
}

.shop-hero__logo {
    flex: 0 0 auto;
    width: 100px;
    height: 100px;
    border-radius: 12px;
    background: var(--rc-white);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.25rem;
}

.shop-hero__logo img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.shop-hero__initials {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 2.5rem;
    color: var(--rc-navy);
}

.shop-hero__title h1 {
    color: var(--rc-white);
    margin: 0 0 0.25rem 0;
    font-size: 2rem;
    line-height: 1.2;
}

.shop-hero__tagline {
    color: rgba(255, 255, 255, 0.85);
    font-size: 1.05rem;
    margin: 0 0 0.75rem 0;
}

.shop-hero__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.shop-hero__badges .badge {
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    backdrop-filter: blur(2px);
}

/* ---------- Shop detail layout ---------- */
.shop-detail {
    padding: 2rem 0;
}

.shop-detail__grid {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 2.5rem;
    align-items: start;
}

.shop-detail__main {
    min-width: 0;
}

.shop-section {
    margin-bottom: 2rem;
}

.shop-section h2 {
    font-family: var(--font-heading);
    font-size: 1.25rem;
    color: var(--rc-navy);
    margin: 0 0 1rem 0;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid var(--rc-orange);
    display: inline-block;
}

.shop-section--content {
    font-size: 1rem;
    line-height: 1.7;
}

.shop-section--content p {
    margin: 0 0 1rem 0;
}

/* ---------- Services list ---------- */
.shop-services {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 0.5rem;
}

.shop-services li {
    padding: 0.5rem 0.75rem 0.5rem 1.75rem;
    background: rgba(253, 62, 4, 0.04);
    border-radius: 6px;
    font-size: 0.9rem;
    color: var(--rc-dark);
    position: relative;
}

.shop-services li::before {
    content: '✓';
    position: absolute;
    left: 0.6rem;
    top: 0.5rem;
    color: var(--rc-orange);
    font-weight: 700;
}

/* ---------- Gallery ---------- */
.shop-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 0.75rem;
}

.shop-gallery__item {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    border: 0;
    padding: 0;
    background: var(--rc-bg);
    border-radius: 8px;
    overflow: hidden;
    cursor: pointer;
    font: inherit;
    color: inherit;
    transition: transform 0.2s;
}

.shop-gallery__item:hover {
    transform: scale(1.03);
}

.shop-gallery__item:focus-visible {
    outline: 2px solid var(--rc-orange);
    outline-offset: 2px;
}

.shop-gallery__item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    pointer-events: none; /* clicks land on the button, not the img */
}

/* ---------- Gallery lightbox ---------- */
.lightbox {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

.lightbox[hidden] {
    display: none;
}

.lightbox__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.85);
}

.lightbox__panel {
    position: relative;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    grid-template-rows: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 0.75rem;
    max-width: min(1200px, 100%);
    max-height: 100%;
}

.lightbox__stage {
    grid-column: 1 / -1;
    grid-row: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 0;
    max-height: 78vh;
}

.lightbox__stage img {
    display: block;
    max-width: 100%;
    max-height: 78vh;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.5);
}

.lightbox__nav,
.lightbox__close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 1.05rem;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
    z-index: 1;
}

.lightbox__nav:hover,
.lightbox__close:hover {
    background: rgba(255, 255, 255, 0.25);
}

.lightbox__nav:active,
.lightbox__close:active {
    transform: scale(0.94);
}

.lightbox__nav:focus-visible,
.lightbox__close:focus-visible {
    outline: 2px solid var(--rc-orange);
    outline-offset: 2px;
}

.lightbox__nav--prev {
    grid-column: 1;
    grid-row: 2;
}

.lightbox__nav--next {
    grid-column: 3;
    grid-row: 2;
}

.lightbox__close {
    grid-column: 3;
    grid-row: 1;
    justify-self: end;
    width: 38px;
    height: 38px;
}

.lightbox__meta {
    grid-column: 1 / -1;
    grid-row: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    color: #fff;
    font-size: 0.9rem;
}

.lightbox__counter {
    min-width: 3.5rem;
    text-align: right;
    color: rgba(255, 255, 255, 0.7);
    font-variant-numeric: tabular-nums;
}

.lightbox__caption {
    text-align: center;
    opacity: 0.9;
}

@media (max-width: 640px) {
    .lightbox__panel {
        grid-template-columns: minmax(0, 1fr) auto;
        grid-template-rows: auto auto auto;
        gap: 0.5rem;
    }

    .lightbox__stage {
        grid-column: 1 / -1;
        grid-row: 2;
    }

    .lightbox__close {
        grid-column: 1 / -1;
        grid-row: 1;
        justify-self: end;
    }

    .lightbox__nav {
        grid-row: 3;
        align-self: center;
        width: 40px;
        height: 40px;
    }

    .lightbox__nav--prev {
        grid-column: 1;
        justify-self: end;
    }

    .lightbox__nav--next {
        grid-column: 2;
        justify-self: start;
    }

    .lightbox__meta {
        grid-row: 4;
        grid-column: 1 / -1;
    }
}

/* ---------- Contacts aside ---------- */
.shop-contacts {
    background: var(--rc-white);
    border: 1px solid var(--rc-light-grey);
    border-radius: 10px;
    padding: 1.5rem;
    position: sticky;
    top: 90px;
}

.shop-contacts h2 {
    font-family: var(--font-heading);
    font-size: 1.1rem;
    color: var(--rc-navy);
    margin: 0 0 1rem 0;
}

.shop-contacts dl {
    margin: 0 0 1.25rem 0;
    padding: 0;
}

.shop-contacts__row {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.15rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--rc-light-grey);
}

.shop-contacts__row:last-child {
    border-bottom: none;
}

.shop-contacts dt {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--rc-grey);
}

.shop-contacts dd {
    margin: 0;
    font-size: 0.95rem;
    color: var(--rc-dark);
    word-break: break-word;
}

.shop-contacts dd a {
    color: var(--rc-orange);
    text-decoration: none;
}

.shop-contacts dd a:hover {
    text-decoration: underline;
}

.button--block {
    display: block;
    width: 100%;
    text-align: center;
    margin-top: 0.5rem;
}

/* ============================================================
   Featured shops (homepage module)
   ============================================================ */

.featured-shops {
    padding: 3rem 0;
    background: var(--rc-bg);
}

.featured-shops__head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.featured-shops__head h2 {
    margin: 0;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--rc-navy);
}

.featured-shops__intro {
    flex-basis: 100%;
    color: var(--rc-grey);
    font-size: 0.95rem;
}

.featured-shops__all {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--rc-orange);
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
}

.featured-shops__all:hover {
    text-decoration: underline;
}

/* ============================================================
   Responsive
   ============================================================ */

@media (max-width: 900px) {
    .shop-detail__grid {
        grid-template-columns: 1fr;
    }
    .shop-contacts {
        position: static;
        order: -1;
    }
}

@media (max-width: 640px) {
    .shop-hero {
        padding: 1.5rem 0;
    }
    .shop-hero__head {
        gap: 1rem;
    }
    .shop-hero__logo {
        width: 72px;
        height: 72px;
    }
    .shop-hero__title h1 {
        font-size: 1.5rem;
    }
    .shop-hero__tagline {
        font-size: 0.95rem;
    }
    .shop-filters {
        padding: 0.75rem;
    }
    .shop-filters__search,
    .shop-filters__select {
        flex-basis: 100%;
    }
    .shop-grid {
        grid-template-columns: 1fr;
    }
}

/* ============================================================
   Dark mode
   ============================================================ */

:root[data-theme='dark'] .shop-card {
    background: var(--rc-white);
    border-color: var(--rc-light-grey);
}

:root[data-theme='dark'] .shop-card--no-cover .shop-card__title {
    color: #E0E0E0;
    text-shadow: none;
}

:root[data-theme='dark'] .shop-card__visual,
:root[data-theme='dark'] .shop-filters,
:root[data-theme='dark'] .shop-contacts {
    background: #12122A;
    border-color: var(--rc-light-grey);
}

:root[data-theme='dark'] .shop-filters__search input,
:root[data-theme='dark'] .shop-filters__select select {
    background: #0D0D1A;
    color: #D0D0D0;
    border-color: var(--rc-light-grey);
}

:root[data-theme='dark'] .featured-shops {
    background: #0D0D1A;
}

:root[data-theme='dark'] .featured-shops__head h2,
:root[data-theme='dark'] .shop-section h2 {
    color: #E0E0E0;
}

:root[data-theme='dark'] .shop-services li {
    background: rgba(253, 62, 4, 0.08);
    color: #D0D0D0;
}

:root[data-theme='dark'] .shop-hero__logo {
    background: #12122A;
}

:root[data-theme='dark'] .badge {
    background: rgba(253, 62, 4, 0.15);
}

:root[data-theme='dark'] .badge--floor,
:root[data-theme='dark'] .shop-card__badge--floor {
    background: rgba(255, 255, 255, 0.08);
    color: #E0E0E0;
}

:root[data-theme='dark'] .shop-card--no-cover .shop-card__badge {
    background: rgba(253, 62, 4, 0.18);
    color: #FFB59E;
}

:root[data-theme='dark'] .shop-card--no-cover .shop-card__badge--floor {
    background: rgba(255, 255, 255, 0.1);
    color: #E0E0E0;
}

:root[data-theme='dark'] .shop-contacts dt {
    color: #9A9AA0;
}
