/* 
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   CITRUS PAGE STYLES — REFINED v2
   Senior-grade responsive CSS
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
*/

/* ── CSS Variables ── */
:root {
    --green-dark:   #1a472a;
    --green-mid:    #155724;
    --green-light:  #2d6a4f;
    --orange:       #e67e22;
    --orange-light: #f39c12;
    --cream:        #fffaf5;
    --white:        #ffffff;
    --text-dark:    #1a1a1a;
    --text-muted:   rgba(255,255,255,0.65);
    --card-radius:  999px;          /* pill shape */
    --card-radius-mobile: 24px;     /* card shape on mobile */
    --transition:   0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ── Base Reset ── */
.citrus-body {
    background-color: var(--cream);
    overflow-x: hidden;
}

.citrus-body *,
.citrus-body *::before,
.citrus-body *::after {
    box-sizing: border-box;
}

/* ── Cursor: always visible ── */
.citrus-body,
.citrus-body a,
.citrus-body button,
.citrus-body .btn,
.citrus-body .pill-card {
    cursor: auto;
}
.citrus-body .pill-card { cursor: pointer; }
.custom-cursor { display: none !important; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   1. NAVBAR
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.citrus-body header,
.citrus-body .navbar,
.citrus-body nav {
    background-color: var(--green-dark) !important;
    position: relative;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.citrus-body .navbar a,
.citrus-body .nav-link,
.citrus-body .navbar-brand {
    color: var(--white) !important;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   2. HERO
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.citrus-hero {
    position: relative;
    height: 60vh;
    min-height: 440px;
    background-color: var(--cream);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    color: var(--green-dark);
    text-align: center;
    padding-top: 80px;
    padding-bottom: 0;
    z-index: 1;
}

.citrus-hero::before {
    content: '';
    position: absolute;
    top: -5%;
    right: -5%;
    width: 60%;
    height: 120%;
    background-image: url('../assets/images/leaf.svg');
    background-size: contain;
    background-repeat: no-repeat;
    background-position: center right;
    opacity: 0.10;
    transform: rotate(20deg);
    z-index: 0;
    pointer-events: none;
}

#citrus-3d-container {
    position: absolute;
    inset: 0;
    z-index: 2;
}

#citrus-3d-canvas {
    width: 100%;
    height: 100%;
    display: block;
}

.hero-container {
    position: relative;
    z-index: 3;
    pointer-events: none;
}

.hero-content h1 {
    font-size: clamp(3.5rem, 10vw, 8rem);
    font-weight: 900;
    margin-bottom: 10px;
    letter-spacing: -2px;
    line-height: 1;
}

.hero-content p {
    font-size: clamp(1rem, 2vw, 1.4rem);
    opacity: 0.75;
    font-weight: 600;
}

/* Wave Divider */
.wave-divider {
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    line-height: 0;
    z-index: 4;
}
.wave-divider svg   { width: 100%; height: 100px; display: block; }
.wave-divider .shape-fill { fill: var(--white); }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   3. PRODUCTS SECTION
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.citrus-products-section {
    padding: 80px 0 100px;
    background-color: var(--white);
    position: relative;
    z-index: 5;
}

/* Section Header */
.section-header {
    text-align: center;
    margin-bottom: 50px;
}

.eyebrow {
    display: block;
    font-size: 12px;
    font-weight: 800;
    color: var(--orange);
    text-transform: uppercase;
    letter-spacing: 3px;
    margin-bottom: 12px;
}

.section-header h2 {
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 900;
    color: var(--green-dark);
    margin-bottom: 16px;
}

.header-line {
    width: 60px;
    height: 3px;
    background: var(--orange);
    margin: 0 auto;
    border-radius: 2px;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   4. PILL GRID
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.citrus-pill-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   5. PILL CARD — Slim & Polished
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.pill-card {
    background: var(--green-mid);
    border-radius: var(--card-radius);
    padding: 10px 20px 10px 10px;   /* tighter padding for slim look */
    display: flex;
    align-items: center;
    gap: 18px;
    border: 1.5px solid rgba(255,255,255,0.06);
    box-shadow: 0 4px 20px rgba(26,71,42,0.10);
    transition:
        transform var(--transition),
        box-shadow var(--transition),
        border-color var(--transition);
    will-change: transform;
    position: relative;
    overflow: hidden;               /* clip any overflowing image */
}

/* subtle shine streak on hover */
.pill-card::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        105deg,
        transparent 40%,
        rgba(255,255,255,0.06) 50%,
        transparent 60%
    );
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    border-radius: inherit;
}

.pill-card:hover {
    transform: translateY(-6px) scale(1.015);
    box-shadow: 0 18px 45px rgba(26,71,42,0.18);
    border-color: var(--orange);
}
.pill-card:hover::after { opacity: 1; }

/* ── Image Wrapper ──
   Handles any aspect ratio from DB:
   square, portrait, landscape — all cropped to circle */
.pill-image-wrapper {
    flex-shrink: 0;
    width: 100px;               /* slimmer than before */
    height: 100px;
    border-radius: 50%;
    background: radial-gradient(circle at 60% 40%, #fffaf5, #f0ede8);
    box-shadow:
        0 0 0 3px rgba(255,255,255,0.12),
        inset 0 2px 8px rgba(0,0,0,0.06);
    overflow: hidden;           /* ← KEY: clips any shape/size image */
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.in-season-tag {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: var(--orange);
    color: white;
    font-size: 9px;
    padding: 3px 8px;
    border-radius: 30px;
    font-weight: 800;
    letter-spacing: 0.5px;
    z-index: 10;
    text-align: center;
    box-shadow: 0 4px 8px rgba(0,0,0,0.2);
    pointer-events: none;
    opacity: 0.9;
}

/* The actual <img> — fills circle regardless of source dimensions */
.pill-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;          /* crops to fill — handles squares/rectangles */
    object-position: center;
    display: block;
    transition: transform 0.5s ease;
}

/* If image has transparent background (PNG without bg from DB),
   use contain so it doesn't crop awkwardly */
.pill-image-wrapper img[data-fit="contain"],
.pill-image-wrapper.img-contain img {
    object-fit: contain;
    padding: 10%;
}

.pill-card:hover .pill-image-wrapper img {
    transform: scale(1.08);
}

/* ── Text Info ── */
.pill-info {
    flex: 1;
    min-width: 0;               /* prevent text overflow in flex */
}

.season-label {
    display: block;
    font-size: 11px;
    font-weight: 800;
    color: var(--orange);
    margin-bottom: 4px;
    letter-spacing: 1px;
    text-transform: uppercase;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pill-info h3 {
    font-size: clamp(20px, 2.2vw, 26px);
    font-weight: 800;
    color: var(--white);
    margin: 0;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ── Action Button ── */
.pill-action {
    flex-shrink: 0;
    padding-left: 8px;
}

.btn-details {
    display: inline-block;
    padding: 9px 22px;
    border: 2px solid var(--orange);
    border-radius: 50px;
    color: var(--orange);
    font-weight: 700;
    font-size: 13px;
    text-decoration: none;
    white-space: nowrap;
    transition:
        background-color 0.25s ease,
        color 0.25s ease,
        transform 0.2s ease;
}

.btn-details:hover {
    background-color: var(--orange);
    color: var(--white);
    transform: scale(1.04);
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   6. SCROLL REVEAL ANIMATION
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.reveal-up {
    opacity: 0;
    transform: translateY(30px);
    transition:
        opacity 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94),
        transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.reveal-up.is-visible {
    opacity: 1;
    transform: translateY(0);
}

/* Stagger delay for grid items */
.citrus-pill-grid .pill-card:nth-child(1) { transition-delay: 0.05s; }
.citrus-pill-grid .pill-card:nth-child(2) { transition-delay: 0.12s; }
.citrus-pill-grid .pill-card:nth-child(3) { transition-delay: 0.19s; }
.citrus-pill-grid .pill-card:nth-child(4) { transition-delay: 0.26s; }
.citrus-pill-grid .pill-card:nth-child(5) { transition-delay: 0.33s; }
.citrus-pill-grid .pill-card:nth-child(6) { transition-delay: 0.40s; }

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   7. RESPONSIVE
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */

/* ── Large Desktop (>1200px): 3 columns if many items ── */
@media (min-width: 1200px) {
    .citrus-pill-grid.has-many {   /* add class via JS if > 4 items */
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ── Tablet (900–1099px): single column, wider cards ── */
@media (max-width: 1099px) {
    .citrus-pill-grid {
        grid-template-columns: 1fr;
        max-width: 640px;
        gap: 16px;
    }

    .pill-info h3 {
        font-size: 22px;
    }
}

/* ── Mobile (≤768px): card layout, NOT stacked columns ── */
@media (max-width: 768px) {
    .citrus-products-section {
        padding: 60px 0 80px;
    }

    .citrus-pill-grid {
        grid-template-columns: repeat(2, 1fr);
        max-width: 100%;
        gap: 12px;
        padding: 0 16px;
    }

    /* On mobile: compact vertical card */
    .pill-card {
        flex-direction: column;
        border-radius: var(--card-radius-mobile);
        padding: 20px 16px 16px;
        text-align: center;
        gap: 12px;
        align-items: center;
    }

    .pill-image-wrapper {
        width: 80px;
        height: 80px;
    }

    .pill-info {
        width: 100%;
    }

    .season-label {
        white-space: normal;
        font-size: 10px;
    }

    .pill-info h3 {
        font-size: 18px;
        white-space: normal;
    }

    .pill-action {
        padding-left: 0;
        width: 100%;
    }

    .btn-details {
        width: 100%;
        text-align: center;
        padding: 10px 16px;
        font-size: 13px;
    }

    .hero-content h1 {
        font-size: clamp(2.8rem, 12vw, 5rem);
    }
}

/* ── Small Mobile (≤480px): single column ── */
@media (max-width: 480px) {
    .citrus-pill-grid {
        grid-template-columns: 1fr;
        max-width: 340px;
        margin: 0 auto;
    }

    .pill-card {
        max-width: 100%;
    }

    .pill-image-wrapper {
        width: 90px;
        height: 90px;
    }

    .pill-info h3 {
        font-size: 20px;
    }

    .hero-content h1 {
        font-size: clamp(2.4rem, 14vw, 4rem);
    }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   8. IMAGE LOADING STATE
   (placeholder shimmer while DB image loads)
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.pill-image-wrapper img[src=""],
.pill-image-wrapper img:not([src]) {
    background: linear-gradient(
        90deg,
        rgba(255,255,255,0.08) 25%,
        rgba(255,255,255,0.18) 50%,
        rgba(255,255,255,0.08) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
}

@keyframes shimmer {
    0%   { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
   9. BROKEN IMAGE FALLBACK
   ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ */
.pill-image-wrapper img::after {
    content: '🍊';
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    background: rgba(255,255,255,0.9);
}