/*
 * Flapdoodles, Inc. Enterprise Website - Main Stylesheet
 * Author: Manus AI
 * Date: 2025-12-14
 */

/* ==========================================================================
   1. CSS Variable System (Design Tokens)
   ========================================================================== */
:root {
    /* Flapdoodles palette (per redesign plan) */
    --primary: #2C5282;      /* Navy - professional and trusted */
    --coral: #ED8936;        /* Coral orange - playful energy (CTA) */
    --mint: #48BB78;         /* Mint green - fresh and sustainable */
    --soft-pink: #FED7D7;    /* Soft pink - gentle warmth */
    --sky-blue: #BEE3F8;     /* Sky blue - youthful clarity */
    --cream: #FFFAF0;        /* Warm neutral */
    --white: #FFFFFF;
    --text-primary: #2D3748;
    --text-secondary: #718096;
    --surface: #FFFFFF;
    --surface-muted: #F7FAFC;
    --border: rgba(45, 55, 72, 0.12);
    --header-bg: rgba(255, 255, 255, 0.92);
    --footer-bg: #1A202C;
    --hero-overlay: rgba(44, 82, 130, 0.30);

    /* Back-compat (existing pages use these variables) */
    --color-primary: var(--coral);
    --color-secondary: var(--mint);
    --color-accent: var(--primary);
    --color-text-dark: var(--text-primary);
    --color-text-secondary: var(--text-secondary);
    --color-text-light: #FFFFFF;
    --color-background: var(--surface-muted);
    --color-header-bg: var(--white);
    --color-footer-bg: var(--footer-bg);

    /* Typography */
    --font-family-heading: 'Quicksand', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    --font-family-body: 'Nunito', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    --font-family-brand: 'Fredoka One', 'Quicksand', system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
    --font-size-base: 16px;
    --font-size-sm: 0.9375rem;
    --font-size-lg: 1.125rem;
    --font-size-xl: 1.25rem;

    /* Spacing */
    --space-xs: 4px;
    --space-sm: 8px;
    --space-md: 16px;
    --space-lg: 32px;
    --space-xl: 64px;
    --space-2xl: 96px;

    /* Design Elements */
    --border-radius-sm: 10px;
    --border-radius: 16px;
    --border-radius-lg: 22px;
    --box-shadow-light: 0 6px 18px rgba(26, 32, 44, 0.08);
    --box-shadow-heavy: 0 14px 36px rgba(26, 32, 44, 0.14);
    --focus-ring: 0 0 0 3px rgba(190, 227, 248, 0.7);
}

/* ==========================================================================
   2. Global Reset and Typography
   ========================================================================== */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-family-body);
    font-size: var(--font-size-base);
    line-height: 1.6;
    color: var(--text-primary);
    background-color: var(--white);
    padding-top: 84px; /* Space for fixed header */
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family-heading);
    line-height: 1.2;
    margin-bottom: var(--space-md);
    color: var(--text-primary);
}

a {
    color: var(--primary);
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: #234266; /* slightly darker navy */
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

::selection {
    background: rgba(254, 215, 215, 0.8);
}

/* Focus and motion */
:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
    border-radius: 10px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
    }
}

/* ==========================================================================
   3. Responsive Grid Layout (Core Structure)
   ========================================================================== */
.container {
    width: 100%;
    padding: 0 16px;
}

.container.narrow {
    max-width: 860px;
    margin: 0 auto;
}

.grid {
    display: grid;
    gap: var(--space-lg);
    margin-bottom: var(--space-xl);
}

/* Default for mobile (single column) */
.grid-2-col, .grid-3-col, .grid-4-col {
    grid-template-columns: 1fr;
}

/* Breakpoints (mobile-first, per redesign plan) */
@media (min-width: 768px) {
    .container { max-width: 720px; margin: 0 auto; }
    .grid-2-col { grid-template-columns: repeat(2, 1fr); }
    .grid-3-col { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1024px) {
    .container { max-width: 960px; }
    .grid-4-col { grid-template-columns: repeat(4, 1fr); }
}

@media (min-width: 1280px) {
    .container { max-width: 1200px; }
}

/* ==========================================================================
   4. Fixed Navigation Bar with Dropdown
   ========================================================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    background-color: var(--header-bg);
    backdrop-filter: saturate(180%) blur(14px);
    border-bottom: 1px solid var(--border);
    z-index: 1000;
}

.nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--space-sm) var(--space-md);
    height: 84px;
}

.logo {
    font-size: 1.8rem;
    font-weight: bold;
    color: var(--primary);
    font-family: var(--font-family-brand);
    letter-spacing: 0.5px;
    display: inline-flex;
    align-items: baseline;
    gap: 8px;
}

.logo::after {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 999px;
    background: var(--coral);
    box-shadow: 14px 0 0 var(--mint), 28px 0 0 var(--sky-blue);
    transform: translateY(-2px);
}

/* Skip link (accessibility) */
.skip-link {
    position: absolute;
    left: 16px;
    top: 10px;
    padding: 10px 14px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 999px;
    box-shadow: var(--box-shadow-light);
    transform: translateY(-200%);
    transition: transform 0.2s ease;
    z-index: 2000;
}

.skip-link:focus {
    transform: translateY(0);
}

/* Mobile menu toggle (CSS-only) */
.nav-toggle {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    cursor: pointer;
    border: 1px solid var(--border);
    border-radius: 12px;
    background: var(--white);
    color: var(--text-primary);
    box-shadow: 0 2px 10px rgba(26, 32, 44, 0.06);
    user-select: none;
}

.menu-toggle .menu-icon {
    width: 18px;
    height: 2px;
    background: var(--text-primary);
    position: relative;
    border-radius: 99px;
}

.menu-toggle .menu-icon::before,
.menu-toggle .menu-icon::after {
    content: '';
    position: absolute;
    left: 0;
    width: 18px;
    height: 2px;
    background: var(--text-primary);
    border-radius: 99px;
}

.menu-toggle .menu-icon::before { top: -6px; }
.menu-toggle .menu-icon::after { top: 6px; }

.nav {
    position: relative;
}

.nav-menu {
    list-style: none;
    display: none; /* Hidden by default on mobile (enabled via checkbox) */
    position: absolute;
    right: 0;
    top: calc(100% + 10px);
    width: min(92vw, 360px);
    max-height: calc(100vh - 120px);
    overflow: auto;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-heavy);
    padding: 14px;
}

.nav-toggle:checked ~ .nav .nav-menu {
    display: grid;
    gap: 10px;
}

.nav-item {
    position: relative;
    padding: 0;
}

.nav-link {
    display: block;
    padding: 10px 12px;
    color: var(--text-primary);
    font-weight: 700;
    border-radius: 12px;
    letter-spacing: 0.2px;
}

.nav-link:hover {
    color: var(--primary);
    background: rgba(190, 227, 248, 0.35);
}

/* Dropdown Menu (Level 2) */
.dropdown-menu {
    list-style: none;
    display: block; /* mobile: always visible for no-JS usability */
    padding: 6px 0 2px;
}

.dropdown-item a {
    padding: 8px 12px;
    display: block;
    white-space: nowrap;
    color: var(--text-secondary);
    border-radius: 10px;
}

.dropdown-item a:hover {
    background-color: rgba(254, 215, 215, 0.45);
    color: var(--text-primary);
}

/* Desktop Navigation */
@media (min-width: 1024px) {
    .nav-menu {
        display: flex;
        position: static;
        width: auto;
        max-height: none;
        overflow: visible;
        background: transparent;
        border: 0;
        border-radius: 0;
        box-shadow: none;
        padding: 0;
    }
    .nav-item {
        padding: 0;
    }
    .nav-link {
        padding: 10px 12px;
    }
    .dropdown-menu {
        position: absolute;
        top: calc(100% + 10px);
        left: 50%;
        transform: translateX(-50%);
        min-width: 220px;
        background: var(--white);
        border: 1px solid var(--border);
        border-radius: var(--border-radius);
        box-shadow: var(--box-shadow-heavy);
        padding: 10px;
        display: none; /* desktop: hover/focus dropdown */
    }

    .nav-item:hover > .dropdown-menu,
    .nav-item:focus-within > .dropdown-menu {
        display: block;
    }
}

@media (min-width: 1024px) {
    .menu-toggle {
        display: none;
    }
}

/* ==========================================================================
   5. Footer Styles
   ========================================================================== */
.footer {
    background-color: var(--footer-bg);
    color: var(--color-text-light);
    padding: var(--space-xl) 0;
}

.footer a {
    color: var(--color-text-light);
    opacity: 0.8;
}

.footer a:hover {
    color: var(--color-primary);
    opacity: 1;
}

.footer-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
}

@media (min-width: 768px) {
    .footer-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.footer-section h4 {
    color: var(--color-text-light);
    margin-bottom: var(--space-md);
}

.footer-section ul {
    list-style: none;
}

.footer-section ul li {
    margin-bottom: var(--space-sm);
}

.footer-bottom {
    text-align: center;
    padding-top: var(--space-lg);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    margin-top: var(--space-lg);
    font-size: 0.85rem;
}

/* ==========================================================================
   6. Utility Classes (For content sections)
   ========================================================================== */
.section-padding {
    padding: var(--space-xl) 0;
}

.section-muted {
    background: var(--surface-muted);
}

.text-center {
    text-align: center;
}

.card {
    background-color: var(--surface);
    padding: var(--space-lg);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-light);
}

.btn {
    display: inline-block;
    padding: 12px 18px;
    background-color: var(--coral);
    color: var(--color-text-light);
    border-radius: 12px;
    font-weight: 800;
    letter-spacing: 0.2px;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.btn:hover {
    background-color: #DD6B20;
    color: var(--color-text-light);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--primary);
}

.btn-secondary:hover {
    background: #234266;
}

.btn-ghost {
    background: transparent;
    color: var(--primary);
    border: 1px solid rgba(44, 82, 130, 0.28);
}

.btn-ghost:hover {
    background: rgba(190, 227, 248, 0.35);
    color: var(--primary);
}

.btn-outline-light {
    background: transparent;
    color: #FFFFFF;
    border: 1px solid rgba(255, 255, 255, 0.55);
}

.btn-outline-light:hover {
    background: rgba(255, 255, 255, 0.14);
    color: #FFFFFF;
}

.hero {
    min-height: 60vh;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--color-text-light);
    position: relative;
    margin-top: -84px; /* Offset the fixed header padding */
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--hero-overlay);
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 860px;
    padding: 0 16px;
}

.hero-content h1 {
    color: var(--color-text-light);
    font-size: clamp(2rem, 4.2vw, 3.4rem);
    margin-bottom: var(--space-md);
}

.hero-content p {
    font-size: 1.1rem;
    margin-bottom: var(--space-lg);
    color: rgba(255, 255, 255, 0.95);
}

.hero-actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.hero-actions .btn,
.hero-actions .btn-ghost,
.hero-actions .btn-secondary {
    min-width: 210px;
}

/* Image-Text Split Section */
.image-text-split {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-lg);
}

.image-text-split .content,
.image-text-split .image-wrapper {
    flex: 1;
    width: 100%;
}

.image-text-split .image-wrapper img {
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-light);
}

@media (min-width: 768px) {
    .image-text-split {
        flex-direction: row;
    }
    .image-text-split.reverse {
        flex-direction: row-reverse;
    }
}

/* ==========================================================================
   7. Page Components (Homepage + shared)
   ========================================================================== */
.section-header {
    display: grid;
    gap: 12px;
    margin-bottom: var(--space-lg);
}

.kicker {
    font-weight: 800;
    color: var(--text-secondary);
    letter-spacing: 0.12em;
    text-transform: uppercase;
    font-size: 0.78rem;
}

.section-header p {
    color: var(--text-secondary);
    max-width: 70ch;
}

.quote {
    margin: 16px 0 0;
    padding: 16px 18px;
    border-left: 4px solid rgba(237, 137, 54, 0.55);
    background: rgba(255, 250, 240, 0.9);
    border-radius: 14px;
    color: var(--text-primary);
    box-shadow: 0 2px 14px rgba(26, 32, 44, 0.06);
}

.quote p {
    margin: 0;
}

.collage {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.collage img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-light);
}

@media (min-width: 768px) {
    .collage img {
        height: 210px;
    }
}

.category-scroller {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(240px, 1fr);
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 8px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.category-card {
    scroll-snap-align: start;
    border-radius: var(--border-radius);
    overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface);
    box-shadow: var(--box-shadow-light);
    display: grid;
}

.category-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
}

.category-card .category-body {
    padding: 16px 16px 18px;
    display: grid;
    gap: 10px;
}

.category-card .tag {
    justify-self: start;
    padding: 6px 12px;
    border-radius: 999px;
    background: rgba(237, 137, 54, 0.14);
    color: #A04100;
    font-weight: 800;
    font-size: 0.78rem;
}

.category-card h3 {
    margin: 0;
}

.sustainability-grid {
    display: grid;
    gap: 16px;
}

@media (min-width: 768px) {
    .sustainability-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.sustainability-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--border-radius);
    padding: 22px;
    box-shadow: var(--box-shadow-light);
    text-align: left;
    display: grid;
    gap: 10px;
}

.sustainability-item .icon {
    width: 56px;
    height: 56px;
    border-radius: 16px;
    background: rgba(72, 187, 120, 0.18);
    display: grid;
    place-items: center;
    color: #1F6F3E;
    font-weight: 900;
    font-family: var(--font-family-heading);
}

.partners-strip {
    display: grid;
    gap: 12px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

@media (min-width: 768px) {
    .partners-strip {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

.partner-badge {
    padding: 14px 12px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--white);
    text-align: center;
    font-weight: 800;
    color: var(--text-secondary);
    box-shadow: 0 2px 10px rgba(26, 32, 44, 0.05);
}

.retailer-cta {
    background-color: var(--primary);
    color: #FFFFFF;
    padding: clamp(28px, 4vw, 56px);
    border-radius: var(--border-radius);
    box-shadow: var(--box-shadow-heavy);
    overflow: hidden;
    position: relative;
}

.retailer-cta::after {
    content: '';
    position: absolute;
    inset: -80px -120px auto auto;
    width: 260px;
    height: 260px;
    background: rgba(237, 137, 54, 0.22);
    filter: blur(2px);
    border-radius: 999px;
    transform: rotate(10deg);
}

.retailer-cta > * {
    position: relative;
    z-index: 1;
}

.retailer-cta h2,
.retailer-cta h3,
.retailer-cta p {
    color: #FFFFFF;
}

.retailer-cta ul {
    margin: 12px 0 0;
    padding-left: 18px;
    display: grid;
    gap: 8px;
    color: rgba(255, 255, 255, 0.92);
}

.btn-wholesale {
    background: var(--coral);
}

.btn-wholesale:hover {
    background: #DD6B20;
}

/* Forms */
input, select, textarea {
    font: inherit;
}

input[type="text"],
input[type="email"],
input[type="tel"],
textarea,
select {
    width: 100%;
    padding: 12px 14px;
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--text-primary);
    box-shadow: 0 2px 10px rgba(26, 32, 44, 0.03);
}

input[type="text"]:focus-visible,
input[type="email"]:focus-visible,
input[type="tel"]:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring);
}

label {
    display: inline-block;
    font-weight: 800;
    margin-bottom: 6px;
    color: var(--text-primary);
}

/* Minor helpers used across pages */
.muted {
    color: var(--text-secondary);
}

.divider {
    border: 0;
    border-top: 1px solid var(--border);
    margin: var(--space-lg) 0;
}
