/*
 * Charles Francis Gallery — Storefront (homepage) styles
 * Extracted from the inline <style> block in templates/gallery-storefront.php
 * so it loads render-blocking in <head> (prevents product-card FOUC).
 */
/* ========================================================================
   Storefront Sections
   ======================================================================== */
.sf-section {
    padding: var(--space-2xl) 0;
    background: var(--gallery-white);
}

.sf-section-header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: var(--space-lg);
}

.gallery-theme .sf-section-title {
    font-family: var(--font-body) !important;
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--gallery-text);
    margin: 0;
    letter-spacing: 0;
}

.sf-section-subtitle {
    font-size: 0.875rem;
    color: var(--gallery-text-muted);
    font-weight: 400;
    margin-left: var(--space-md);
}

.sf-section-link {
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--gallery-gold);
    text-decoration: none;
    margin-left: auto;
}

.sf-section-link:hover {
    text-decoration: underline;
}

/* ========================================================================
   Horizontal Scrollable Product Row (Walmart Flash Deals style)
   ======================================================================== */
.sf-product-row {
    position: relative;
    padding: 0 28px;
}

.sf-row-track {
    display: flex;
    gap: 16px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 4px 0;
}

.sf-row-track::-webkit-scrollbar {
    display: none;
}

.sf-row-track .gallery-artwork-card {
    flex: 0 0 245px;
    min-width: 245px;
}

.sf-row-arrow {
    position: absolute;
    top: 40%;
    transform: translateY(-50%);
    z-index: 20;
    width: 48px;
    height: 48px;
    border-radius: 100%;
    border: none;
    background: var(--gallery-white);
    color: var(--gallery-text);
    font-size: 1.75rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 3px 12px rgba(0,0,0,0.2);
    transition: all var(--transition-fast);
}

.sf-row-arrow:hover {
    box-shadow: 0 4px 16px rgba(0,0,0,0.3);
}

.sf-row-arrow-left {
    left: 0;
}

.sf-row-arrow-right {
    right: 0;
}

.sf-row-arrow[hidden] {
    display: none;
}

/* Two-row variant (Walmart "1,000s of Rollbacks" style) */
.sf-row-track-2 {
    display: grid !important;
    grid-template-rows: 1fr 1fr;
    grid-auto-flow: column;
    grid-auto-columns: 200px;
    gap: 16px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 4px 0;
}

.sf-row-track-2::-webkit-scrollbar {
    display: none;
}

.sf-row-track-2 .gallery-artwork-card {
    flex: none;
    min-width: unset;
    width: 100%;
}

/* Taller arrow for two-row variant */
.sf-product-row-2 .sf-row-arrow {
    top: 45%;
}

@media (max-width: 768px) {
    .sf-row-arrow {
        display: none;
    }

    .sf-row-track .gallery-artwork-card {
        flex: 0 0 180px;
        min-width: 180px;
    }

    .sf-row-track-2 {
        grid-auto-columns: 160px;
    }

    /* Fade gradient on scrollable product rows — mobile only (arrows hidden) */
    .sf-product-row {
        padding: 0;
    }

    .sf-product-row::after {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 40px;
        background: linear-gradient(to left, var(--gallery-white) 0%, transparent 100%);
        pointer-events: none;
        z-index: 10;
    }

    .sf-product-row-2::after {
        background: linear-gradient(to left, var(--gallery-cream, #faf9f7) 0%, transparent 100%);
    }

    /* Category circles: fade on mobile */
    .sf-category-circles .gallery-container::after {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        bottom: 0;
        width: 40px;
        background: linear-gradient(to left, var(--gallery-white) 0%, transparent 100%);
        pointer-events: none;
        z-index: 3;
    }

}

/* ========================================================================
   Hero Row: Sidebars + Carousel (Shein-style)
   ======================================================================== */
.sf-carousel {
    background: var(--gallery-white);
    padding: var(--space-lg) 0 0;
}

.sf-carousel-row {
    display: flex;
    gap: 12px;
    align-items: stretch;
    height: 260px;
}

.sf-hero-sidebar {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex: 0 0 160px;
}

.sf-hero-sidebar-left .sf-hero-cat-btn {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    border-radius: var(--radius-md);
    background-size: cover;
    background-position: center;
    position: relative;
    overflow: hidden;
    text-decoration: none;
    transition: transform 0.2s ease;
}

.sf-hero-cat-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.7) 0%, rgba(0,0,0,0.15) 100%);
    border-radius: inherit;
}

.sf-hero-cat-btn:hover {
    transform: scale(1.02);
}

.sf-hero-cat-label {
    position: relative;
    z-index: 1;
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    text-shadow: 0 1px 3px rgba(0,0,0,0.4);
}

/* Disabled category tile (e.g. Originals — launching later): not a link,
   visually muted, stacks a "Coming Soon" pill under the label. */
.sf-hero-cat-btn--disabled {
    cursor: default;
    filter: grayscale(0.55);
    flex-direction: column;
    gap: 6px;
}
.sf-hero-cat-btn--disabled:hover {
    transform: none;
}
.sf-hero-cat-soon {
    position: relative;
    z-index: 1;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #f5d98b;
    background: rgba(0,0,0,0.5);
    padding: 2px 9px;
    border-radius: 999px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* Right sidebar: Artist buttons */
.sf-hero-sidebar-right .sf-hero-artist-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 10px 10px;
    border-radius: var(--radius-md);
    background-color: #353535;
    text-decoration: none;
    transition: background-color 0.2s ease;
}

.sf-hero-artist-btn:hover {
    background-color: #444;
}

/* Small "Artwork by" eyebrow above the artist name. */
.sf-hero-artist-eyebrow {
    color: #9a9a9a;
    font-size: 0.62rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 6px;
}

.sf-hero-artist-label {
    color: #fff;
    font-size: 1.15rem;
    font-weight: 700;
    text-align: center;
    line-height: 1.25;
}

/* "View Works" — the primary action of this now-single big button, so larger. */
.sf-hero-artist-sub {
    color: var(--gallery-gold-light);
    font-size: 0.95rem;
    font-weight: 600;
    margin-top: 10px;
    letter-spacing: 0.03em;
}
.sf-hero-artist-btn:hover .sf-hero-artist-sub {
    text-decoration: underline;
}

/* Center carousel */
.sf-hero-center {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.sf-carousel-track {
    position: relative;
    flex: 1;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--gallery-border);
}

/* Hide sidebars on mobile, full-width carousel */
@media (max-width: 768px) {
    .sf-carousel-row {
        flex-direction: column;
        height: auto;
    }
    .sf-hero-sidebar {
        flex-direction: row;
        flex: none;
    }
    .sf-hero-sidebar-left {
        order: 2;
    }
    .sf-hero-sidebar-right {
        order: 3;
    }
    .sf-hero-center {
        order: 1;
    }
    .sf-hero-cat-btn,
    .sf-hero-artist-btn {
        min-height: 70px;
        align-items: center;
        justify-content: center;
    }
    .sf-hero-cat-label,
    .sf-hero-artist-label {
        text-align: center;
    }
}

.sf-carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    transform: translateX(100%);
    transition: transform 0.6s ease;
    z-index: 0;
}

.sf-carousel-slide.active {
    transform: translateX(0);
    z-index: 1;
}

.sf-carousel-slide.slide-out {
    transform: translateX(-100%);
    z-index: 1;
}

.sf-carousel-image {
    flex: 1;
    overflow: hidden;
}

.sf-carousel-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sf-carousel-content {
    flex: 0 0 40%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: var(--space-md) var(--space-lg);
    background: var(--gallery-light);
    border-left: 4px solid var(--gallery-gold);
}

.sf-carousel-artist {
    font-size: 0.75rem;
    color: var(--gallery-text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-weight: 600;
    margin-bottom: var(--space-xs);
}

.gallery-theme .sf-carousel-title {
    font-family: var(--font-body) !important;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--gallery-text);
    margin: 0 0 var(--space-sm);
    line-height: 1.25;
    letter-spacing: 0;
}

.sf-carousel-price {
    font-size: 1.375rem;
    font-weight: 700;
    color: var(--gallery-text);
    margin-bottom: var(--space-lg);
}

.sf-carousel-cta {
    display: inline-block;
    padding: 11px 28px;
    background: var(--gallery-white);
    color: var(--gallery-text);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: 5px;
    border: 1.5px solid var(--gallery-text);
    transition: all var(--transition-fast);
    align-self: flex-start;
}

.sf-carousel-cta:hover {
    background: var(--gallery-text);
    color: var(--gallery-white);
}

.sf-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: var(--space-sm) 0;
    background: var(--gallery-light);
}

.sf-carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    border: 2px solid var(--gallery-text-muted);
    background: transparent;
    cursor: pointer;
    padding: 0;
    transition: all var(--transition-fast);
}

.sf-carousel-dot.active {
    background: var(--gallery-text);
    border-color: var(--gallery-text);
}

/* ========================================================================
   Category Showcase — Staggered Product Grid
   Layout: Large left | Middle (top + 2 bottom) | Tall right
   ======================================================================== */
.sf-cat-showcase {
    padding: var(--space-xl) 0;
    background: var(--gallery-white);
}

.sf-cat-grid {
    display: flex;
    gap: 12px;
    height: 500px;
}

.sf-cat-large { flex: 0 0 42%; }
.sf-cat-mid { flex: 1; display: flex; flex-direction: column; gap: 12px; }
.sf-cat-top { flex: 0 0 45%; }
.sf-cat-bottom-row { flex: 1; display: flex; gap: 12px; }
.sf-cat-bottom { flex: 1; }
.sf-cat-tall { flex: 0 0 26%; }

.sf-cat-card {
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    text-decoration: none;
    display: block;
    background: var(--gallery-light);
    transition: transform var(--transition-fast);
}

.sf-cat-card:hover {
    transform: translateY(-2px);
}

.sf-cat-card:hover .sf-cat-img {
    transform: scale(1.05);
}

.sf-cat-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.sf-cat-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 20px;
    background: linear-gradient(transparent 0%, rgba(0,0,0,0.75) 100%);
    color: #fff;
}

.gallery-theme .sf-cat-name {
    font-family: var(--font-body) !important;
    font-size: 1.25rem;
    font-weight: 700;
    margin: 0 0 4px;
    color: #fff;
    letter-spacing: 0;
}

.gallery-theme .sf-cat-name-sm {
    font-family: var(--font-body) !important;
    font-size: 0.875rem;
    font-weight: 600;
    margin: 0 0 2px;
    color: #fff;
    letter-spacing: 0;
}

.sf-cat-artist {
    font-size: 0.75rem;
    opacity: 0.85;
    display: block;
    margin-bottom: 4px;
}

.sf-cat-price {
    font-size: 1rem;
    font-weight: 700;
    display: block;
}

.sf-cat-bottom .sf-cat-overlay {
    padding: 14px;
}

.sf-cat-bottom .sf-cat-price {
    font-size: 0.875rem;
}

/* ========================================================================
   Hero + Product Row (Walmart "Baby savings" style)
   Large image left ~50% + scrollable 3-product row right ~50%
   ======================================================================== */
.sf-hero-row {
    display: flex;
    gap: 16px;
    height: 420px;
}

.sf-hero-row-image {
    flex: 0 0 48%;
    position: relative;
    overflow: hidden;
    border-radius: 12px;
    display: block;
    text-decoration: none;
}

.sf-hero-row-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.sf-hero-row-image:hover img {
    transform: scale(1.03);
}

.sf-hero-row-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 24px;
    background: linear-gradient(transparent 0%, rgba(0,0,0,0.7) 100%);
    color: #fff;
}

.gallery-theme .sf-hero-row-title {
    font-family: var(--font-body) !important;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 0 4px;
    color: #fff;
    letter-spacing: 0;
}

.sf-hero-row-artist {
    font-size: 0.8125rem;
    opacity: 0.85;
    display: block;
    margin-bottom: 8px;
}

.sf-hero-row-cta {
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.sf-hero-row-products {
    flex: 1;
    min-width: 0;
    overflow: visible;
}

.sf-hero-row-products .sf-product-row {
    height: 100%;
    padding: 0 24px;
}

.sf-row-track-hero {
    display: flex !important;
    gap: 12px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    height: 100%;
    align-items: stretch;
    padding: 4px 0;
}

.sf-row-track-hero::-webkit-scrollbar {
    display: none;
}

.sf-row-track-hero .gallery-artwork-card {
    flex: 0 0 220px;
    min-width: 220px;
    display: flex;
    flex-direction: column;
}

.sf-row-track-hero .gallery-artwork-image-wrapper {
    flex: 1;
    aspect-ratio: unset;
}

.sf-row-track-hero .gallery-artwork-info {
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .sf-hero-row {
        flex-direction: column;
        height: auto;
    }

    .sf-hero-row-image {
        flex: none;
        height: 250px;
    }

    .sf-hero-row-products {
        height: 320px;
    }

    .sf-row-track-hero .gallery-artwork-card {
        flex: 0 0 160px;
        min-width: 160px;
    }
}

@media (max-width: 768px) {
    .sf-cat-grid {
        flex-direction: column;
        height: auto;
    }

    .sf-cat-large, .sf-cat-tall {
        flex: none;
        height: 240px;
    }

    .sf-cat-top {
        flex: none;
        height: 180px;
    }

    .sf-cat-bottom-row {
        flex-direction: column;
    }

    .sf-cat-bottom {
        height: 160px;
    }
}

/* ========================================================================
   Promotional Banner
   ======================================================================== */
.sf-promo-banner {
    color: #fff;
}

.sf-promo-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: var(--space-xl) 0;
    gap: var(--space-xl);
}

.gallery-theme .sf-promo-headline {
    font-family: var(--font-body) !important;
    font-size: 1.375rem;
    font-weight: 700;
    margin: 0;
    color: inherit;
    letter-spacing: 0;
}

.sf-promo-subtext {
    margin: var(--space-xs) 0 0;
    font-size: 0.9375rem;
    opacity: 0.85;
}

.sf-promo-cta {
    display: inline-block;
    padding: 12px 32px;
    background: var(--gallery-white);
    color: var(--gallery-text);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.875rem;
    border-radius: var(--radius-sm);
    white-space: nowrap;
    transition: all var(--transition-fast);
    flex-shrink: 0;
}

.sf-promo-cta:hover {
    background: var(--gallery-gold);
    color: var(--gallery-white);
}

/* ========================================================================
   Trust Strip
   ======================================================================== */
.sf-trust-strip {
    border-top: 1px solid var(--gallery-border);
    border-bottom: 1px solid var(--gallery-border);
    padding: var(--space-md) 0;
}

@media (max-width: 768px) {
    .sf-trust-strip {
        display: none;
    }
}

.sf-trust-items {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-xl);
}

.sf-trust-item {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
    font-size: 0.8125rem;
    color: var(--gallery-text-muted);
}

.sf-trust-item svg {
    stroke: var(--gallery-gold);
    flex-shrink: 0;
}

/* ========================================================================
   Category Circles
   ======================================================================== */
.sf-category-circles {
    padding: var(--space-xl) 0;
    background: var(--gallery-white);
}

.sf-category-circles .gallery-container {
    position: relative;
}

.sf-circles-arrow {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 28px;
    padding: 0;
    border: none;
    background: #dfd8c1;
    color: #ffffff;
    font-size: 1.4rem;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, color 0.2s ease;
    box-shadow: 0 0 8px rgba(0,0,0,0.2);
    z-index: 4;
}

/* Hidden by default (row starts scrolled to the left); the scroll script reveals
   it via inline style once the user scrolls right. Prevents a flash-then-hide on
   load, when the CSS default painted it before the script could hide it. */
.sf-circles-arrow-left { left: 0; border-radius: 0 6px 6px 0; display: none; }
.sf-circles-arrow-right { right: 0; border-radius: 6px 0 0 6px; }

.sf-circles-arrow:hover,
.sf-circles-arrow:focus {
    background: var(--gallery-gold-dark, #8b6508);
    color: #fff;
    outline: none;
}


.sf-circles-track {
    display: grid;
    grid-template-columns: repeat(12, min-content);
    grid-auto-rows: auto;
    gap: 20px 24px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px 40px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.sf-circles-track::-webkit-scrollbar {
    display: none;
}

.sf-circles-track::-webkit-scrollbar {
    display: none;
}


.sf-circle-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    flex-shrink: 0;
    min-width: 80px;
}

.sf-circle-img {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--gallery-border);
    transition: border-color 0.2s ease, transform 0.2s ease;
}

.sf-circle-item:hover .sf-circle-img {
    border-color: var(--gallery-gold);
    transform: scale(1.05);
}

.sf-circle-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sf-circle-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--gallery-light);
    color: var(--gallery-text-muted);
}

.sf-circle-label {
    font-size: 1rem;
    font-weight: 500;
    color: var(--gallery-text);
    text-align: center;
    line-height: 1.2;
    max-width: 90px;
}

.sf-circle-item:hover .sf-circle-label {
    color: var(--gallery-gold);
}

/* Disabled (empty) category circles */
.sf-circle-disabled {
    cursor: default;
    pointer-events: none;
}

.sf-circle-img-disabled {
    filter: grayscale(100%);
    opacity: 0.4;
    border-color: #ccc !important;
}

.sf-circle-disabled .sf-circle-label {
    color: #aaa;
}

/* Category circles — smaller on mobile */
@media (max-width: 768px) {
    .sf-circle-img {
        width: 85px;
        height: 85px;
    }
    .sf-circle-label {
        font-size: 0.8rem;
        max-width: 85px;
    }
    .sf-circles-track {
        gap: 12px 16px;
        padding: 8px 20px;
    }
    .sf-circle-item {
        min-width: 70px;
        gap: 5px;
    }
}

/* ========================================================================
   Artist CTA
   ======================================================================== */
.sf-artist-cta {
    background: var(--gallery-light);
    padding: var(--space-lg) 0;
}

.sf-artist-cta-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-lg);
    flex-wrap: wrap;
}

.sf-artist-cta-text {
    font-size: 1rem;
    color: var(--gallery-text);
    font-weight: 500;
}

.sf-artist-cta-btn {
    display: inline-block;
    padding: 8px 24px;
    background: var(--gallery-gold);
    color: var(--gallery-white);
    text-decoration: none;
    font-size: 0.875rem;
    font-weight: 600;
    border-radius: var(--radius-sm);
    transition: background var(--transition-fast);
}

.sf-artist-cta-btn:hover {
    background: var(--gallery-text);
    color: var(--gallery-white);
}

/* ========================================================================
   Mobile Responsive
   ======================================================================== */
@media (max-width: 768px) {
    .sf-carousel-track {
        height: auto;
    }

    .sf-carousel-slide {
        position: relative;
        flex-direction: column;
    }

    .sf-carousel-slide:not(.active) {
        display: none;
    }

    .sf-carousel-image {
        flex: none;
        height: calc(100svh - 450px);
        min-height: 120px;
        max-height: 220px;
    }

    .sf-carousel-content {
        flex: none;
        padding: var(--space-md);
    }

    .sf-carousel-title {
        font-size: 1.1rem;
        margin-bottom: var(--space-xs);
    }

    .sf-carousel-price {
        font-size: 1rem;
        margin-bottom: var(--space-xs);
    }

    .sf-carousel-cta {
        padding: 8px 20px;
        font-size: 0.8125rem;
    }

    .sf-promo-content {
        flex-direction: column;
        text-align: center;
    }

    .sf-promo-headline {
        font-size: 1.25rem;
    }

    .sf-section-title {
        font-size: 1.25rem;
    }
}
