/**
 * Nutraceutical Products Archive — Stylesheet
 * File: nutra-products.css
 *
 * Uses the same green brand colour as cosm-products.css (#009365 / #15803d).
 * All class names are prefixed with `nutra-` to avoid conflicts.
 *
 * Enqueue in functions.php:
 *   wp_enqueue_style( 'nutra-products',
 *       get_stylesheet_directory_uri() . '/nutra-products.css', [], '1.0.0' );
 */


/* ============================================================================
   1. DESIGN TOKENS
   ============================================================================ */

:root {
    /* Nutraceutical brand — same green palette as cosmetics */
    --color-nutra:            #009365;
    --color-nutra-dark:       #15803d;
    --color-nutra-light:      #dcfce7;
    --color-nutra-muted:      rgba(22, 163, 74, 0.08);
    --color-nutra-border:     rgba(0, 147, 101, 0.25);
    --color-nutra-foreground: #ffffff;
    --color-nutra-text:       #6b7280;
    --color-background:       #f4f9f7;
    --color-card:             #ffffff;
    --color-border:           #d1e8df;
    --color-input:            #d1e8df;
    --color-foreground:       #0d1a15;
    --color-muted-foreground: #6b7280;
    --color-secondary-fg:     #1a4a35;
    --color-accent:           rgba(0, 147, 101, 0.08);
    --color-accent-foreground:#009365;
    --color-ring:             #009365;
    --color-primary:          #009365;

    --shadow-sm:         0 1px 3px 0 rgba(0,0,0,.06), 0 1px 2px -1px rgba(0,0,0,.04);
    --shadow-card-hover: 0 8px 24px 0 rgba(0,147,101,.12);

    --radius-sm:   0.375rem;
    --radius-md:   0.75rem;
    --radius-lg:   0.875rem;
    --radius-full: 9999px;
    --radius-xl:   1.25rem;

    --ease-fast: 0.15s ease;
    --ease-base: 0.25s ease;
}


/* ============================================================================
   2. BASE
   ============================================================================ */

*, *::before, *::after { box-sizing: border-box; }

.nutra-main {
    min-height: 100vh;
    background-color: var(--color-background);
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border-width: 0;
}

.mb-3 {
    margin-bottom: 12px !important;
}


/* ============================================================================
   3. ARCHIVE HERO
   ============================================================================ */

.nutra-archive-hero {
    background: #f4f9f7;
    border-bottom: 1px solid #c8e8dd;
    padding: 50px 0;
}

.nutra-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.nutra-breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--color-muted-foreground);
    margin-bottom: 15px;
}
.nutra-breadcrumb a {
    color: var(--color-muted-foreground);
    text-decoration: none;
    transition: color var(--ease-fast);
}
.nutra-breadcrumb a:hover { color: var(--color-foreground); }
.nutra-breadcrumb .separator { color: #7abfab; }
.nutra-breadcrumb .current   { color: var(--color-foreground); font-weight: 500; }

.nutra-title {
    font-size: 36px;
    font-weight: 700;
    color: var(--color-foreground);
    margin-bottom: 12px;
}

.nutra-description {
    max-width: 650px;
    color: var(--color-muted-foreground);
    line-height: 1.6;
    font-size: 15px;
}

@media (max-width: 768px) {
    .nutra-archive-hero { padding: 35px 0; }
    .nutra-title         { font-size: 26px; }
    .nutra-description   { font-size: 14px; }
}


/* ============================================================================
   4. LAYOUT
   ============================================================================ */

.nutra-layout-container {
    max-width: 1280px;
    margin-inline: auto;
    padding-inline: 1rem;
    padding-block: 2.5rem;
}
@media (min-width: 768px) {
    .nutra-layout-container { padding-inline: 1.5rem; }
}

.nutra-layout-grid {
    display: grid;
    gap: 2rem;
    align-items: start;
    grid-template-columns: 1fr;
}
@media (min-width: 1024px) {
    .nutra-layout-grid { grid-template-columns: 260px 1fr; }
}


/* ============================================================================
   5. DESKTOP SIDEBAR
   ============================================================================ */

.nutra-sidebar-desktop {
    display: none;
}
@media (min-width: 1024px) {
    .nutra-sidebar-desktop { display: block; }
}

.nutra-sidebar-sticky {
    position: sticky;
    top: 6rem;
}


/* ── Filter panel (shared: sidebar + drawer) ─────────────────────────────── */

.nutra-filter-panel {
    background-color: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
}

.nutra-drawer .nutra-filter-panel {
    border: none;
    border-radius: 0;
    box-shadow: none;
    padding: 0;
    background: transparent;
}

.nutra-filter-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
    min-height: 1.5rem;
}

.nutra-filter-title {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--color-foreground);
    margin: 0;
}

.nutra-clear-btn {
    font-size: 0.75rem;
    color: var(--color-muted-foreground);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color var(--ease-fast);
}
.nutra-clear-btn:hover { color: var(--color-nutra); }
.nutra-clear-btn.hidden { display: none !important; }


/* ── Accordion ───────────────────────────────────────────────────────────── */

.nutra-accordion { }
.nutra-accordion.border-b { border-bottom: 1px solid var(--color-border); }

.nutra-accordion-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 1rem 0;
    background: none;
    border: none;
    cursor: pointer;
    text-align: left;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--color-foreground);
    gap: 0.5rem;
    transition: color var(--ease-fast);
}
.nutra-accordion-btn:hover { background-color: transparent; color: var(--color-nutra); text-decoration: underline; }
.nutra-accordion-btn:focus { background-color: transparent; color: var(--color-foreground); }

.nutra-chevron {
    flex-shrink: 0;
    width: 1rem;
    height: 1rem;
    color: var(--color-muted-foreground);
    transition: transform var(--ease-base);
}

.nutra-accordion-panel {
    overflow: hidden;
    padding-bottom: 1rem;
    padding-top: 0;
}

.nutra-filter-options {
    display: flex;
    flex-direction: column;
    gap: 0.625rem;
    padding-top: 0.25rem;
}

.nutra-filter-label {
    display: flex;
    align-items: center;
    gap: 0.625rem;
    font-size: 0.875rem;
    color: var(--color-foreground);
    cursor: pointer;
    transition: color var(--ease-fast);
}
.nutra-filter-label:hover { color: var(--color-nutra); }

.nutra-checkbox {
    display: grid;
    place-content: center;
    width: 1rem;
    height: 1rem;
    flex-shrink: 0;
    border-radius: 0.25rem;
    border: 1px solid var(--color-primary);
    box-shadow: var(--shadow-sm);
    transition: background-color var(--ease-fast), border-color var(--ease-fast);
    background-color: var(--color-card);
}

.nutra-check-icon {
    width: 0.625rem;
    height: 0.625rem;
    display: none;
    color: #fff;
}


/* ============================================================================
   6. MOBILE TOP BAR
   ============================================================================ */

.nutra-mobile-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.25rem;
}
@media (min-width: 1024px) {
    .nutra-mobile-topbar { display: none; }
}

.nutra-count-text {
    font-size: 0.875rem;
    color: var(--color-muted-foreground);
    margin: 0;
}
.nutra-count-number {
    font-weight: 600;
    color: var(--color-foreground);
}

.nutra-mobile-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.45rem 0.875rem;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-md);
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--color-foreground);
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: border-color var(--ease-fast), color var(--ease-fast);
    position: relative;
}
.nutra-mobile-filter-btn:hover {
    border-color: var(--color-nutra-border);
    color: var(--color-nutra);
}
button.nutra-mobile-filter-btn:focus,
button.nutra-mobile-filter-btn:focus-visible {
    background-color: var(--color-card) !important;
    color: var(--color-foreground) !important;
    outline: none;
}

.nutra-active-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.125rem;
    height: 1.125rem;
    border-radius: 50%;
    background-color: var(--color-nutra);
    color: #fff;
    font-size: 0.6875rem;
    font-weight: 700;
    line-height: 1;
}
.nutra-active-badge.hidden { display: none !important; }


/* ── Desktop count bar ──────────────────────────────────────────────────── */
.nutra-desktop-count-bar {
    display: none;
    margin-bottom: 1.5rem;
}
@media (min-width: 1024px) {
    .nutra-desktop-count-bar { display: flex; align-items: center; }
}


/* ============================================================================
   7. MOBILE FILTER DRAWER
   ============================================================================ */

.nutra-drawer-backdrop {
    position: fixed;
    inset: 0;
    z-index: 40;
    background-color: rgba(13, 26, 21, 0.45);
    backdrop-filter: blur(2px);
}

.nutra-drawer {
    position: fixed;
    inset-block: 0;
    inset-inline-end: 0;
    z-index: 50;
    width: min(340px, 90vw);
    background-color: var(--color-card);
    display: flex;
    flex-direction: column;
    box-shadow: -4px 0 24px rgba(13,26,21,0.14);
    overflow: hidden;
}

@media (min-width: 1024px) {
    .nutra-drawer,
    .nutra-drawer-backdrop { display: none !important; }
}

.nutra-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 1.25rem;
    border-bottom: 1px solid var(--color-border);
    flex-shrink: 0;
}

.nutra-drawer-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--color-foreground);
}

.nutra-drawer-header-actions {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.nutra-drawer-close {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 2rem;
    height: 2rem;
    border: none;
    background: none;
    cursor: pointer;
    color: var(--color-muted-foreground);
    border-radius: var(--radius-sm);
    transition: color var(--ease-fast), background-color var(--ease-fast);
}
.nutra-drawer-close:hover {
    color: var(--color-foreground);
    background-color: var(--color-nutra-muted);
}

.nutra-drawer-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.25rem;
}

.nutra-drawer-footer {
    padding: 1rem 1.25rem;
    border-top: 1px solid var(--color-border);
    flex-shrink: 0;
}

.nutra-apply-btn {
    width: 100%;
    height: 2.75rem;
    border: none;
    border-radius: var(--radius-md);
    background-color: var(--color-nutra);
    color: #fff;
    font-size: 0.9375rem;
    font-weight: 600;
    cursor: pointer;
    transition: background-color var(--ease-fast), transform var(--ease-fast);
    box-shadow: 0 2px 8px rgba(0,147,101,0.35);
}
.nutra-apply-btn:hover {
    background-color: var(--color-nutra-dark);
    transform: translateY(-1px);
}


/* ============================================================================
   8. PRODUCT GROUPS
   ============================================================================ */

.nutra-category-section {
    margin-bottom: 3rem;
    animation: nutraFadeUp 0.35s ease both;
}

.nutra-section-heading {
    margin-bottom: 1rem;
    padding-left: 0.75rem;
    border-left: 4px solid var(--color-nutra);
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-foreground);
}

.nutra-category-section .grid {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: 1fr;
}
@media (min-width: 640px) {
    .nutra-category-section .grid { grid-template-columns: repeat(2, 1fr); }
}
@media (min-width: 1280px) {
    .nutra-category-section .grid { grid-template-columns: repeat(3, 1fr); }
}


/* ============================================================================
   9. PRODUCT CARD
   ============================================================================ */

.nutra-card-hover {
    display: flex;
    flex-direction: column;
    background-color: var(--color-card, #ffffff);
    border: 1px solid var(--color-border, #d1e8df);
    border-radius: 1rem;
    padding: 1.25rem;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
    transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.nutra-card-hover:hover {
    box-shadow: 0 8px 24px rgba(0, 147, 101, 0.12);
    border-color: rgba(0, 147, 101, 0.3);
    transform: translateY(-2px);
}

/* Title + Badge row */
.nutra-card-hover .mb-3.flex.items-start {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
}

/* Title */
.nutra-card-hover h3 {
    font-size: 0.9375rem;
    font-weight: 700;
    color: var(--color-foreground, #0d1a15);
    line-height: 1.35;
    margin: 0;
    transition: color 0.15s ease;
}
.nutra-card-hover:hover h3 {
    color: var(--color-nutra, #009365);
}

/* Badge pill */
.nutra-card-hover .shrink-0.rounded-full {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    align-self: flex-start;
    border-radius: 9999px;
    padding: 0.2rem 0.65rem;
    background-color: rgba(0, 147, 101, 0.10) !important;
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--color-nutra, #009365);
    white-space: nowrap;
    line-height: 1.6;
}

/* Metadata label */
.nutra-card-hover p.text-\[10px\].font-semibold,
.nutra-card-hover .text-\[10px\].uppercase {
    font-size: 0.625rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-nutra);
    margin: 0 0 0.2rem;
    line-height: 1.4;
}

.nutra-card-hover p.mt-1.text-xs {
    font-size: 0.75rem;
    color: var(--color-foreground, #0d1a15);
    margin: 0.2rem 0 0;
    line-height: 1.5;
}

/* Excerpt */
.nutra-card-hover p.mb-5 {
    font-size: 0.875rem;
    line-height: 1.6;
    color: var(--color-nutra-text);
    margin: 0 0 1.25rem;
    flex: 1;
}

/* CTA button group */
.nutra-card-hover .flex.flex-col.gap-2 {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: auto;
}

/* Primary — "Get Quote" */
.nutra-btn-primary {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    width: 100% !important;
    height: 2.5rem !important;
    padding-inline: 1rem !important;
    border-radius: 0.5rem !important;
    background-color: var(--color-nutra, #009365) !important;
    color: #ffffff !important;
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    border: none !important;
    cursor: pointer !important;
    box-shadow: 0 1px 4px rgba(0, 147, 101, 0.30) !important;
    transition: background-color 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease !important;
    letter-spacing: 0.01em !important;
}
.nutra-btn-primary:hover {
    background-color: var(--color-nutra-dark, #15803d) !important;
    transform: scale(1.01) !important;
    box-shadow: 0 4px 12px rgba(0, 147, 101, 0.35) !important;
    color: #ffffff !important;
}
.nutra-btn-primary svg {
    width: 0.9rem !important;
    height: 0.9rem !important;
    flex-shrink: 0 !important;
}

/* Outline — "Develop This Product" */
.nutra-btn-outline {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 0.5rem !important;
    width: 100% !important;
    height: 2.5rem !important;
    padding-inline: 1rem !important;
    border-radius: 0.5rem !important;
    background-color: #ffffff !important;
    color: var(--color-secondary-fg, #1a4a35) !important;
    font-size: 0.875rem !important;
    font-weight: 500 !important;
    border: 1px solid var(--color-border, #d1e8df) !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    cursor: pointer !important;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06) !important;
    transition: border-color 0.15s ease, color 0.15s ease, background-color 0.15s ease !important;
}
.nutra-btn-outline:hover {
    border-color: rgba(0, 147, 101, 0.35) !important;
    color: var(--color-nutra, #009365) !important;
    background-color: rgba(0, 147, 101, 0.05) !important;
}


/* ============================================================================
   10. LOADING OVERLAY
   ============================================================================ */

#nutra-loading-overlay {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: none;
    align-items: center;
    justify-content: center;
    background-color: rgba(244,249,247,0.5);
    backdrop-filter: blur(2px);
    pointer-events: none;
}
#nutra-loading-overlay > div {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 50%;
    border: 3px solid var(--color-nutra-light);
    border-top-color: var(--color-nutra);
    animation: nutraSpin 0.7s linear infinite;
}


/* ============================================================================
   11. EMPTY STATE
   ============================================================================ */

.nutra-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-block: 5rem;
    text-align: center;
}
.nutra-empty-heading { font-size: 1rem; font-weight: 600; color: var(--color-foreground); margin-bottom: 0.35rem; }
.nutra-empty-text    { font-size: 0.875rem; color: var(--color-muted-foreground); }


/* ============================================================================
   12. CTA BANNER
   ============================================================================ */

.nutra-cta-section {
    margin: 2.5rem 0;
    background: rgb(225, 240, 233);
    border: 1px solid var(--color-nutra-border);
    border-radius: var(--radius-xl);
    padding: 1.75rem 2rem;
    box-shadow: var(--shadow-sm);
}
.nutra-cta-inner {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
}
@media (min-width: 768px) {
    .nutra-cta-inner {
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }
}
.nutra-cta-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--color-foreground);
    margin: 0;
}
.nutra-cta-text {
    font-size: 0.875rem;
    color: var(--color-muted-foreground);
    margin-top: 0.25rem;
    max-width: 520px;
    line-height: 1.5;
}
.nutra-cta-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.75rem;
    height: 48px;
    border-radius: var(--radius-md);
    background: var(--color-nutra);
    color: #fff;
    font-size: 0.95rem;
    font-weight: 600;
    text-decoration: none;
    transition: all var(--ease-base);
    white-space: nowrap;
    box-shadow: 0 2px 8px rgba(0,147,101,0.35);
    border: none;
    cursor: pointer;
}
.nutra-cta-button:hover {
    background: var(--color-nutra-dark);
    transform: translateY(-1px);
}
.nutra-cta-arrow { width: 16px; height: 16px; }


/* ============================================================================
   13. ANIMATIONS
   ============================================================================ */

@keyframes nutraFadeUp {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes nutraSpin {
    to { transform: rotate(360deg); }
}

.nutra-category-section .nutra-card-hover:nth-child(2) { animation-delay: 0.05s; }
.nutra-category-section .nutra-card-hover:nth-child(3) { animation-delay: 0.10s; }
.nutra-category-section .nutra-card-hover:nth-child(4) { animation-delay: 0.15s; }
.nutra-category-section .nutra-card-hover:nth-child(5) { animation-delay: 0.20s; }
.nutra-category-section .nutra-card-hover:nth-child(6) { animation-delay: 0.25s; }