/* ==========================================================================
   FILE: custom.css
   PURPOSE: Custom extensions layered on top of main.min.css
   Add new UI components, overrides, and feature styles here.
   This file is loaded AFTER main.min.css so it takes priority.
   ========================================================================== */


/* ==========================================================================
   FEAT-CARD LAYOUT OVERRIDES
   Goal: uniform card height regardless of title length, price, or MOQ presence.
   
   Layout per card:
     [IMAGE]
     [TITLE  — always exactly 2 lines tall, clipped if longer]
     [Starting from   KSh XXX /pc]   ← same line, smaller "Starting from"
     [MOQ badge]                      ← own line, only if present
     [ORDER BUTTON]                   ← always at bottom
   ========================================================================== */

/* ── Title: lock to 2-line height so all cards align ── */
.feat-title {
    font-size: 1.05rem !important;         /* slightly tighter than 1.25 default */
    line-height: 1.35 !important;
    min-height: calc(1.05rem * 1.35 * 2); /* exactly 2 lines */
    max-height: calc(1.05rem * 1.35 * 2);
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    margin-bottom: 0.6rem !important;
}

/* ── Price area: flex row so label + value share one line ── */
.feat-price {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    gap: 0.25rem 0.45rem !important;
    margin-bottom: 1.25rem !important;
    /* Fixed min-height so cards without MOQ stay same height as cards with MOQ */
    min-height: 3.4rem;
}

/* ── "Starting from" — inline, 50% smaller ── */
.price-label {
    display: inline !important;            /* was block — that caused the separate line */
    font-size: 0.52rem !important;         /* ~50% of original 0.8rem */
    color: #888 !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.08em !important;
    margin-bottom: 0 !important;
    flex-shrink: 0;
    white-space: nowrap;
}

/* ── Price value — 20% smaller than 1.4rem default ── */
.price-value {
    font-size: 1.12rem !important;         /* 80% of 1.4rem */
    font-weight: 900 !important;
    flex-shrink: 0;
    white-space: nowrap;
}

/* ── MOQ badge — always on its OWN line ──
   flex-basis: 100% forces a line-break in the flex-wrap container.
   Cards without an MOQ badge have no second line → min-height on .feat-price
   keeps the layout height consistent across all cards.
   ── */
.moq-badge {
    flex-basis: 100% !important;           /* force to new line */
    display: inline-flex;
    align-items: center;
    gap: 0;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.10);
    border: none;
    width: fit-content;
    margin-top: 0.15rem;
}

/* ── MOQ Label chip — dark slate, not red ── */
.moq-label {
    background: #1e293b;                   /* dark slate — professional, not red */
    color: #e2e8f0;
    padding: 2px 7px;
    font-size: 0.58rem !important;
    font-weight: 800;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    font-family: 'Inter', 'Outfit', sans-serif;
    line-height: 1.7;
    border-radius: 6px 0 0 6px;
}

/* ── MOQ Value chip — light background, accent text ── */
.moq-value {
    background: #f1f5f9;                   /* light slate background */
    color: #334155;                        /* dark slate text */
    padding: 2px 8px;
    font-size: 0.65rem !important;
    font-weight: 700;
    font-family: 'Inter', 'Outfit', sans-serif;
    line-height: 1.7;
    white-space: nowrap;
    border-radius: 0 6px 6px 0;
    border-left: 1px solid #e2e8f0;
}

/* ── Dark-section variant ── */
.bg-dark-section .moq-label { background: #0f172a; }
.bg-dark-section .moq-value { background: rgba(255,255,255,0.08); color: #cbd5e1; border-left-color: rgba(255,255,255,0.1); }

/* ── Responsive tweaks ── */
@media (max-width: 400px) {
    .moq-label  { font-size: 0.54rem !important; padding: 2px 5px; }
    .moq-value  { font-size: 0.60rem !important; padding: 2px 6px; }
    .price-label { font-size: 0.48rem !important; }
    .price-value { font-size: 1rem !important; }
}



/* ==========================================================================
   CLIENTS MARQUEE SECTION
   Infinite left-scrolling logo strip. Compact height (~120px).
   ========================================================================== */

.clients-marquee-section {
    background: linear-gradient(to bottom, #ffffff, #f8fafc);
    border-top: 1px solid #e2e8f0;
    border-bottom: 1px solid #e2e8f0;
    padding: 3.5rem 0;
    overflow: hidden;
    position: relative;
    box-shadow: inset 0 10px 30px rgba(0,0,0,0.02);
}

.clients-marquee-inner {
    max-width: 1500px;
    margin: 0 auto;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    gap: 3rem;
}

.clients-marquee-label {
    font-family: var(--font-heading, 'Inter', sans-serif);
    font-size: 1rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--color-brand-red, #e11d48);
    white-space: nowrap;
    flex-shrink: 0;
    margin: 0;
    border-right: 2px solid #cbd5e1;
    padding-right: 3rem;
    display: flex;
    flex-direction: column;
    gap: 0.2rem;
}

.clients-marquee-label::after {
    content: 'OUR PARTNERS';
    font-size: 0.65rem;
    color: #64748b;
    letter-spacing: 0.2em;
}

.clients-marquee-viewport {
    flex: 1;
    overflow: hidden;
    -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 5%, #000 95%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0%, #000 5%, #000 95%, transparent 100%);
}

.marquee-track {
    display: flex;
    align-items: center;
    gap: 0;
    width: max-content;
    animation: marqueeScroll 35s linear infinite;
    will-change: transform;
}

.marquee-track:hover { animation-play-state: paused; }

.track-reverse {
    animation-direction: reverse;
}

@keyframes marqueeScroll {
    from { transform: translateX(0); }
    to   { transform: translateX(-50%); }
}

.clients-logo-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 0 3.5rem;
    flex-shrink: 0;
    min-width: 220px;
    border-right: 1px dashed #e2e8f0;
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.clients-logo-item:last-child { border-right: none; }

.clients-logo-item img {
    height: 85px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
    filter: drop-shadow(0 4px 6px rgba(0,0,0,0.05));
    transition: transform 0.3s ease, filter 0.3s ease;
}

.clients-logo-item:hover {
    transform: translateY(-5px);
}
.clients-logo-item:hover img {
    filter: drop-shadow(0 8px 15px rgba(0,0,0,0.1));
}

.clients-logo-item span {
    font-family: 'Inter', 'Outfit', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #334155;
    white-space: nowrap;
    text-align: center;
    background: #f1f5f9;
    padding: 4px 12px;
    border-radius: 20px;
}

/* Responsive Marquee Visibility */
.desktop-marquee { display: block; }
.mobile-marquee { display: none; }

@media (max-width: 768px) {
    .desktop-marquee { display: none !important; }
    .mobile-marquee { display: block !important; }
    
    .clients-marquee-section { padding: 2.5rem 0; }
    .clients-marquee-inner { flex-direction: column; gap: 1.5rem; padding: 0; }
    .clients-marquee-label { 
        border-right: none; 
        border-bottom: 2px solid #cbd5e1; 
        padding-right: 0; 
        padding-bottom: 0.8rem;
        text-align: center;
        align-items: center;
    }
    .clients-marquee-viewport { width: 100%; }
    .clients-logo-item { padding: 0 2.5rem; min-width: 180px; gap: 0.8rem; }
    .clients-logo-item img { height: 65px; }
    .clients-logo-item span { font-size: 0.75rem; }
}

/* ==========================================================================
   HOMEPAGE GRID LIMITS
   Restricts the featured products grid to 8 items on desktop and 5 on mobile.
   ========================================================================== */
#featured-sales .featured-grid .feat-card:nth-child(n+9) {
    display: none !important;
}

@media (max-width: 768px) {
    #featured-sales .featured-grid .feat-card:nth-child(n+6) {
        display: none !important;
    }
}