/* css/components/ingredient-orbit.css
   EXACT Figma "Special Offers" layout replica
*/

.ingredients-section {
    padding: var(--section-spacing-mobile) 0;
    background: var(--color-off-white);
}

@media (min-width: 768px)  { .ingredients-section { padding: var(--section-spacing-tablet) 0; } }
@media (min-width: 1024px) { .ingredients-section { padding: var(--section-spacing-desktop) 0; } }


/* ─── Box wrapper (lets nav buttons escape overflow:hidden) ─── */
.ing-box-wrapper {
    position: relative;
}
/* ─── Outer frame ─── */
.ing-special-offers {
    position: relative;
    border-radius: 32px;
    background: var(--color-baby-pink-dark); 
    display: flex;
    align-items: stretch;
    height: 447px; 
    overflow: hidden;
}

.ing-bg-vector {
    position: absolute;
    top: 0; left: 0;
    width: 350px; height: 100%;
    background: radial-gradient(circle at top left, rgba(255,255,255,0.1) 0%, transparent 70%);
    z-index: 1;
    pointer-events: none;
}

/* ─── Left text column ─── */
.ing-text-col {
    position: relative;
    z-index: 2;
    flex: 0 0 420px;
    padding: 0 40px 0 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 24px;
}

.ing-heading {
    font-family: 'Fraunces', 'Playfair Display', serif;
    font-size: 40px; 
    font-weight: 700;
    color: #FFFFFF;
    line-height: 1.15;
    margin: 0;
}

.ing-subheading {
    font-family: 'Plus Jakarta Sans', 'Open Sans', sans-serif;
    font-size: 15px;
    font-weight: 400;
    color: rgba(255,255,255,0.95);
    line-height: 1.6;
    margin: 0;
}

.ing-explore-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    background: var(--color-baby-pink); 
    border-radius: 32px;
    color: var(--color-baby-pink-dark);
    font-family: 'Fraunces', serif;
    font-weight: 700;
    font-size: 16px;
    text-decoration: none;
    align-self: flex-start;
    transition: transform 0.2s ease, opacity 0.2s ease;
}
.ing-explore-btn svg { width: 18px; height: 18px; stroke-width: 2.5px; }
.ing-explore-btn:hover { transform: translateX(4px); opacity: 0.95; }

/* ─── Dashed divider with Ticket Cutouts ─── */
.ing-dash-divider {
    position: relative;
    z-index: 5;
    width: 2px;
    min-height: 100%;
    align-self: stretch;
    flex-shrink: 0;
    background: repeating-linear-gradient(to bottom, transparent 0px, transparent 8px, rgba(255,255,255,0.4) 8px, rgba(255,255,255,0.4) 16px);
}
.ing-dash-divider::before, .ing-dash-divider::after {
    content: '';
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 40px;
    background: var(--color-off-white);
    border-radius: 50%;
}
.ing-dash-divider::before { top: -20px; }
.ing-dash-divider::after  { bottom: -20px; }

/* ─── Scroll Area ─── */
.ing-cards-area-wrapper {
    position: relative;
    flex: 1;
    min-width: 0; /* FIX: allow flex item to shrink below content size */
    display: flex;
    flex-direction: column;
    justify-content: center;
    overflow: visible;
    margin-left: 12px;
}

/* Nav Buttons - sit outside overflow:hidden, positioned on .section-container */
.ing-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 999;
    width: 44px; height: 44px;
    border-radius: 50%;
    background: #FFFFFF;
    color: var(--color-charcoal);
    border: none;
    box-shadow: 0 4px 16px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease;
}
.ing-nav-btn:hover {
    background: var(--color-off-white);
    box-shadow: 0 6px 20px rgba(0,0,0,0.2);
    transform: translateY(-50%);
}
#ingPrev { left: 435px; z-index: 999; }
#ingNext { right: 16px; z-index: 999; }

.ing-cards-area {
    position: relative;
    z-index: 2;
    width: 100%;
    min-width: 0; /* FIX: allow flex item to scroll instead of expand */
    display: flex;
    align-items: center;
    overflow-x: auto;
    overflow-y: hidden;
    padding-top: 24px;
    padding-bottom: 24px;
    scroll-behavior: smooth;
    scrollbar-width: none;
}
.ing-cards-area::-webkit-scrollbar { display: none; }

.ing-cards-row {
    display: flex;
    gap: 24px; 
    align-items: stretch;
    padding-right: 32px; /* Breathing room at the end */
}

/* Bulletproof spacing for flex scroll containers */
.ing-cards-row::before {
    content: '';
    display: block;
    width: 16px; 
    flex-shrink: 0;
}



/* ─── Exact Card ─── */
.ing-card {
    width: 308px;
    height: 371px;
    background: #FFFFFF;
    border-radius: 24px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    box-shadow: 0px 4px 16px rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
    scroll-snap-align: start;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.ing-card:hover {
    transform: translateY(-4px);
    box-shadow: 0px 12px 24px rgba(0, 0, 0, 0.12);
}

/* Image/Icon frame */
.ing-card-img-frame {
    position: relative;
    width: 100%;
    height: 208px;
    border-radius: 12px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f0f0f0; /* Default if no image */
    display: flex;
    align-items: center;
    justify-content: center;
}

.ing-card-img-frame img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.ing-molecule-art {
    width: 100%;
    height: 100%;
    display: block;
}

.ing-pct-badge {
    position: absolute;
    top: 12px; left: 12px;
    background: var(--color-baby-pink-dark);
    color: #FFFFFF;
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 8px;
    letter-spacing: 0.02em;
    z-index: 2;
}

.ing-cat-tag {
    position: absolute;
    top: 12px; right: 12px;
    background: #FAE7F5; 
    color: var(--color-baby-pink-dark);
    font-family: 'Plus Jakarta Sans', sans-serif;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 8px;
    z-index: 2;
}

.ing-card-text {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 24px 8px 16px;
    flex: 1;
}
.ing-card-title {
    font-family: 'Fraunces', serif;
    font-size: 22px;
    font-weight: 700;
    color: var(--color-charcoal);
}
.ing-card-desc {
    font-size: 14px;
    color: var(--color-text-mid);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}




/* ─── Mobile Adjustments ─── */
@media (max-width: 960px) {
    .ing-special-offers {
        flex-direction: column;
        height: auto;
    }
    .ing-text-col { flex: none; padding: 40px 24px; }
    .ing-dash-divider {
        width: 100%; height: 2px;
        background: repeating-linear-gradient(to right, transparent 0, transparent 8px, rgba(255,255,255,0.4) 8px, rgba(255,255,255,0.4) 16px);
    }
    .ing-dash-divider::before, .ing-dash-divider::after { top: 50%; transform: translateY(-50%); }
    .ing-dash-divider::before { left: -20px; }
    .ing-dash-divider::after { left: auto; right: -20px; }
    
    .ing-cards-area-wrapper { margin-left: 0; margin-top: 12px; } /* Reset horizontal, add vertical */

    .ing-cards-area { padding: 32px 0; }

    /* Show exactly one full card per snap, centered with equal side margins
       instead of the desktop's fixed 308px card (which overflowed the box) */
    .ing-cards-row {
        gap: 16px;
        padding-left: 16px;
        padding-right: 16px;
    }
    .ing-cards-row::before {
        display: none;
    }
    .ing-card {
        width: calc(90vw - 32px);
    }

    /* Fix nav buttons on mobile */
    .ing-nav-btn {
        top: auto;
        bottom: 200px; /* Vertically centered over the cards area */
        transform: none; /* Remove translateY */
        width: 36px; height: 36px; /* slightly smaller on mobile */
    }
    #ingPrev { left: -14px; z-index: 999; }
    #ingNext { right: -14px; z-index: 999; }
}
