/* =============================================================
   HF Freebase Collection Showcase — v1.4.0
   FIX: tabs overflow on mobile/tablet, arrow slide incorrect on mobile
   Prefix: hf-fbcs-
   HTML structure (from class-hf-freebase-shortcode.php & class-hf-freebase-ajax.php):

   <section class="hf-fbcs-section hf-fbcs-accent-gold|red">
     <div class="hf-fbcs-inner">
       <div class="hf-fbcs-left">
         <div class="hf-fbcs-heading">
           <span class="hf-fbcs-title-accent">...</span>
           <span class="hf-fbcs-title-plain">...</span>
         </div>
         <div class="hf-fbcs-description"><p>...</p></div>
         <a class="hf-fbcs-view-all">VIEW ALL</a>
       </div>
       <div class="hf-fbcs-right">
         <div class="hf-fbcs-tabs">
           <button class="hf-fbcs-tab [is-active]">
             <img> or <span class="hf-fbcs-tab-placeholder">
             <span class="hf-fbcs-tab-label">...</span>
           </button>
         </div>
         <div class="hf-fbcs-carousel-wrap">
           <button class="hf-fbcs-arrow hf-fbcs-arrow-prev">SVG</button>
           <div class="hf-fbcs-carousel">
             <div class="hf-fbcs-products-track">
               <div class="hf-fbcs-product-card">
                 <a class="hf-fbcs-product-image-wrap"><img></a>
                 <div class="hf-fbcs-product-info">
                   <a class="hf-fbcs-product-name">...</a>
                   <div class="hf-fbcs-product-price">...</div>
                   <a class="hf-fbcs-add-to-cart">...</a>
                 </div>
               </div>
             </div>
           </div>
           <button class="hf-fbcs-arrow hf-fbcs-arrow-next">SVG</button>
         </div>
       </div>
     </div>
   </section>
============================================================= */

/* ----------------------------------------------------------
   Reset scope
---------------------------------------------------------- */
.hf-fbcs-section,
.hf-fbcs-section * {
    box-sizing: border-box;
}

/* ----------------------------------------------------------
   CSS Variables
---------------------------------------------------------- */
.hf-fbcs-section {
    --accent:      #F5C518;
    --accent-glow: rgba(245, 197, 24, 0.10);
    --bg:          #0A0A0A;
    --card-bg:     #151515;
    --card-border: #222222;
    --tab-bg:      #1A1A1A;
    --white:       #FFFFFF;
    --muted:       #888888;
    --radius:      8px;
    --font-head:   'Bebas Neue', 'Arial Narrow', Arial, sans-serif;
    --font-body:   'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    /* card gap — read by JS via getComputedStyle */
    --card-gap:    12px;
}

.hf-fbcs-section.hf-fbcs-accent-red {
    --accent:      #E31E24;
    --accent-glow: rgba(227, 30, 36, 0.10);
}

/* ----------------------------------------------------------
   Section
---------------------------------------------------------- */
.hf-fbcs-section {
    background: var(--bg);
    padding: 60px 0;
    overflow: hidden;
}

/* ----------------------------------------------------------
   Inner — desktop: side by side
---------------------------------------------------------- */
.hf-fbcs-inner {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 40px;
    max-width: 1320px;
    margin: 0 auto;
    padding: 0 40px;
}

/* ----------------------------------------------------------
   LEFT column
---------------------------------------------------------- */
.hf-fbcs-left {
    flex: 0 0 220px;
    width: 220px;
}

.hf-fbcs-heading {
    display: flex;
    flex-direction: column;
    line-height: 1;
    margin-bottom: 14px;
}

.hf-fbcs-title-accent {
    font-family: var(--font-head);
    font-size: 46px;
    color: var(--accent);
    text-transform: uppercase;
    display: block;
}

.hf-fbcs-title-plain {
    font-family: var(--font-head);
    font-size: 40px;
    color: var(--white);
    text-transform: uppercase;
    display: block;
}

.hf-fbcs-description {
    margin-bottom: 20px;
}

.hf-fbcs-description p {
    font-family: var(--font-body);
    font-size: 12px;
    color: var(--muted);
    line-height: 1.7;
    margin: 0;
}

.hf-fbcs-view-all {
    display: inline-flex;
    align-items: center;
    font-family: var(--font-body);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: var(--accent);
    border: 1px solid var(--accent);
    padding: 9px 18px;
    border-radius: 3px;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
	margin-top:150px;
}

.hf-fbcs-view-all:hover {
    background: var(--accent);
    color: #000;
    text-decoration: none;
	color:#f5c518!important;
}

/* ----------------------------------------------------------
   RIGHT column
   FIX: min-width:0 + overflow:hidden prevents tabs from
   breaking out when layout is still row (1024px range).
---------------------------------------------------------- */
.hf-fbcs-right {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ----------------------------------------------------------
   Category tabs
   FIX: width:100% + max-width:100% ensures tabs row never
   exceeds the right column width; overflow-x:auto adds
   horizontal scroll for many tabs instead of breaking out.
---------------------------------------------------------- */
.hf-fbcs-tabs {
    display: flex;
    flex-direction: row;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 2px;
    box-sizing: border-box;
}

.hf-fbcs-tabs::-webkit-scrollbar {
    display: none;
}

.hf-fbcs-tab {
    flex: 0 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    background: var(--tab-bg);
    border: 1px solid #2A2A2A;
    border-radius: var(--radius);
    padding: 10px 12px 8px;
    min-width: 78px;
    cursor: pointer;
    user-select: none;
    -webkit-user-select: none;
    transition: border-color 0.2s, background 0.2s;
}

.hf-fbcs-tab:hover,
.hf-fbcs-tab.is-active {
    border-color: var(--accent);
    background: var(--accent-glow);
}

.hf-fbcs-tab img,
.hf-fbcs-tab-placeholder {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    background: #222;
}

.hf-fbcs-tab-label {
    font-family: var(--font-body);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--muted);
    white-space: nowrap;
}

.hf-fbcs-tab:hover .hf-fbcs-tab-label,
.hf-fbcs-tab.is-active .hf-fbcs-tab-label {
    color: var(--accent);
}

/* ----------------------------------------------------------
   Carousel wrap — arrow | track | arrow
---------------------------------------------------------- */
.hf-fbcs-carousel-wrap {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 8px;
    width: 100%;
    min-width: 0;
}

/* ----------------------------------------------------------
   Arrow buttons
---------------------------------------------------------- */
.hf-fbcs-arrow {
    flex-shrink: 0;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #1A1A1A;
    border: 1px solid #2A2A2A;
    border-radius: 50%;
    cursor: pointer;
    color: var(--white);
    transition: background 0.2s, border-color 0.2s, color 0.2s;
    padding: 0;
}

.hf-fbcs-arrow:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #000;
}

.hf-fbcs-arrow:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.hf-fbcs-arrow svg {
    display: block;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

/* ----------------------------------------------------------
   Carousel viewport
---------------------------------------------------------- */
.hf-fbcs-carousel {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    position: relative;
}

/* ----------------------------------------------------------
   Products track
   FIX: gap uses CSS variable --card-gap so JS can read it
   via getComputedStyle for accurate card+gap width calculation.
---------------------------------------------------------- */
.hf-fbcs-products-track {
    display: flex;
    flex-direction: row;
    gap: var(--card-gap);
    transition: transform 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
    cursor: grab;
}

.hf-fbcs-products-track:active {
    cursor: grabbing;
}

/* ----------------------------------------------------------
   Product card
---------------------------------------------------------- */
.hf-fbcs-product-card {
    flex: 0 0 150px;
    width: 150px;
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius);
    overflow: hidden;
    transition: border-color 0.2s, transform 0.2s;
}

.hf-fbcs-product-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.hf-fbcs-product-image-wrap {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1.1;
    overflow: hidden;
    background: #111;
}

.hf-fbcs-product-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 10px;
    display: block;
    pointer-events: none;
    -webkit-user-drag: none;
    transition: transform 0.3s;
}

.hf-fbcs-product-card:hover .hf-fbcs-product-image-wrap img {
    transform: scale(1.05);
}

.hf-fbcs-product-info {
    padding: 8px 10px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.hf-fbcs-product-name {
    font-family: var(--font-body);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.4px;
    text-transform: uppercase;
    color: var(--white);
    text-decoration: none;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.hf-fbcs-product-name:hover {
    color: var(--accent);
}

.hf-fbcs-product-price {
    font-family: var(--font-body);
    font-size: 12px;
    font-weight: 700;
    color: var(--accent);
}

.hf-fbcs-product-price del {
    color: #555;
    font-weight: 400;
    font-size: 10px;
}

.hf-fbcs-product-price ins {
    text-decoration: none;
}

.hf-fbcs-add-to-cart {
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-body);
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #000;
    background: var(--accent);
    padding: 6px 4px;
    border-radius: 3px;
    text-decoration: none;
    min-height: 28px;
    margin-top: 2px;
    transition: opacity 0.2s;
}

.hf-fbcs-add-to-cart:hover {
    opacity: 0.85;
    color: #000;
    text-decoration: none;
	color:#f5c518!important;
}

/* ----------------------------------------------------------
   Loading spinner
---------------------------------------------------------- */
.hf-fbcs-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 28px;
    height: 28px;
    border: 3px solid #2A2A2A;
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: hffbcsSpin 0.7s linear infinite;
    z-index: 10;
}

@keyframes hffbcsSpin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.hf-fbcs-carousel.is-loading .hf-fbcs-products-track {
    opacity: 0;
    pointer-events: none;
}

.hf-fbcs-no-products {
    font-family: var(--font-body);
    font-size: 13px;
    color: var(--muted);
    padding: 40px 20px;
    text-align: center;
}

/* =============================================================
   RESPONSIVE
   Breakpoints:
   - 1024px  tablet landscape
   - 767px   tablet portrait / large phone
   - 480px   small phone
============================================================= */

/* --- 1024px: shrink left col + cards slightly --- */
@media (max-width: 1024px) {
    .hf-fbcs-inner {
        gap: 28px;
        padding: 0 24px;
    }

    .hf-fbcs-left {
        flex: 0 0 190px;
        width: 190px;
    }

    .hf-fbcs-title-accent,
    .hf-fbcs-title-plain {
        font-size: 38px;
    }

    .hf-fbcs-product-card {
        flex: 0 0 142px;
        width: 142px;
    }

    /* FIX: right column overflow hidden at this breakpoint too */
    .hf-fbcs-right {
        overflow: hidden;
    }
}

/* --- 767px: stack layout, smaller arrows --- */
@media (max-width: 767px) {
    .hf-fbcs-section {
        padding: 36px 0;
    }

    .hf-fbcs-inner {
        flex-direction: column;
        padding: 0 16px;
        gap: 18px;
    }

    .hf-fbcs-left {
        flex: none;
        width: 100%;
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        gap: 10px;
    }

    .hf-fbcs-heading {
        flex: 1;
        margin-bottom: 0;
    }

    .hf-fbcs-title-accent,
    .hf-fbcs-title-plain {
        font-size: 30px;
    }

    .hf-fbcs-description {
        flex-basis: 100%;
        order: 3;
        margin-bottom: 0;
    }

    .hf-fbcs-view-all {
        order: 2;
        padding: 7px 13px;
        font-size: 10px;
        letter-spacing: 1.5px;
    }

    /* FIX: right col full width + overflow hidden so tabs clip correctly */
    .hf-fbcs-right {
        width: 100%;
        overflow: hidden;
    }

    /* FIX: tabs explicitly full-width on mobile */
    .hf-fbcs-tabs {
        width: 100%;
        max-width: 100%;
    }

    .hf-fbcs-arrow {
        width: 30px;
        height: 30px;
    }

    .hf-fbcs-arrow svg {
        width: 14px;
        height: 14px;
    }

    .hf-fbcs-carousel-wrap {
        gap: 6px;
    }

    .hf-fbcs-product-card {
        flex: 0 0 132px;
        width: 132px;
    }

    .hf-fbcs-tab {
        min-width: 68px;
        padding: 8px 8px 6px;
    }

    .hf-fbcs-tab img,
    .hf-fbcs-tab-placeholder {
        width: 38px;
        height: 38px;
    }
}

/* --- 480px: small phones --- */
@media (max-width: 480px) {
    .hf-fbcs-inner {
        padding: 0 12px;
    }

    .hf-fbcs-title-accent,
    .hf-fbcs-title-plain {
        font-size: 26px;
    }

    .hf-fbcs-product-card {
        flex: 0 0 120px;
        width: 120px;
    }

    .hf-fbcs-arrow {
        width: 26px;
        height: 26px;
    }

    .hf-fbcs-arrow svg {
        width: 12px;
        height: 12px;
    }

    .hf-fbcs-tab {
        min-width: 60px;
        padding: 6px 6px 5px;
    }

    .hf-fbcs-tab img,
    .hf-fbcs-tab-placeholder {
        width: 32px;
        height: 32px;
    }

    .hf-fbcs-tab-label {
        font-size: 8px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .hf-fbcs-products-track { transition: none; }
    .hf-fbcs-spinner { animation: none; }
}
