@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@300;400;500;600&family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;1,400&display=swap');

html {
    scroll-behavior: smooth;
}

:root {
    /* Premium Color Palette */
    --color-purple-dark: #2A0A4A;
    /* Deep Royal Purple */
    --color-purple: #4A1A72;
    /* Rich Purple */
    --color-purple-light: #7B4B94;

    --color-gold: #C5A065;
    /* Muted Gold Accent */
    --color-gold-hover: #D4AF75;

    --color-cream: #F9F9F7;
    /* Off-White Background */
    --color-white: #FFFFFF;

    --color-text: #1A1A1A;
    /* Charcoal Black */
    --color-text-light: #666666;
    --color-text-muted: #888888;

    --color-border: #E5E5E0;

    /* Typography */
    --font-heading: 'Playfair Display', serif;
    --font-body: 'Manrope', sans-serif;

    /* Spacing */
    --spacing-xs: 0.5rem;
    --spacing-sm: 1.5rem;
    --spacing-md: 3rem;
    --spacing-lg: 6rem;
    --spacing-xl: 10rem;

    /* Effects */
    --radius-sm: 4px;
    /* Sharper corners for premium feel */
    --radius-md: 8px;
    --radius-lg: 2px;

    --shadow-subtle: 0 10px 40px -10px rgba(42, 10, 74, 0.05);
    --shadow-hover: 0 20px 50px -10px rgba(42, 10, 74, 0.15);

    --transition-smooth: 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* CMS Rich Text — extra-bold & accent underline */
p strong,
p b {
    font-weight: 900;
    color: var(--color-purple-dark);
}

.hero strong,
.hero b {
    font-weight: 900;
    color: var(--color-gold);
}

p u {
    text-decoration-color: var(--color-gold);
    text-underline-offset: 3px;
}

html,
body {
    min-height: 100vh;
}

body {
    font-family: var(--font-body);
    background-color: var(--color-cream);
    color: var(--color-text);
    line-height: 1.8;
    overflow-x: hidden;
    width: 100%;
    max-width: 100%;
    font-weight: 300;
    font-size: 16px;
    display: flex;
    flex-direction: column;
}

body.menu-open {
    overflow: hidden !important;
    /* touch-action: none REMOVED - it kills menu scrolling */
    width: 100%;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition-smooth);
}

ul {
    list-style: none;
}

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

/* Typography Overrides */
h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-heading);
    color: var(--color-purple-dark);
    font-weight: 400;
    /* Elegant, not too bold */
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

h1 {
    font-size: 4.5rem;
    letter-spacing: -0.02em;
}

h2 {
    font-size: 3rem;
    letter-spacing: -0.01em;
}

h3 {
    font-size: 2rem;
}

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

.text-uppercase {
    text-transform: uppercase;
    letter-spacing: 0.15em;
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 0.75rem;
}

/* Premium Buttons */
.btn {
    display: inline-block;
    padding: 1.2rem 3rem;
    border: 1px solid transparent;
    border-radius: 0;
    /* Boxy/Sharp feel */
    font-family: var(--font-body);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.2em;
    cursor: pointer;
    transition: var(--transition-smooth);
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-primary {
    background-color: var(--color-purple-dark);
    color: var(--color-white);
    border: 1px solid var(--color-purple-dark);
}

.btn-primary:hover {
    background-color: transparent;
    color: var(--color-purple-dark);
}

.btn-outline {
    background: transparent;
    border-color: var(--color-text);
    color: var(--color-text);
}

.btn-outline:hover {
    background-color: var(--color-text);
    color: var(--color-white);
}

/* Layout */
.container {
    max-width: 1400px;
    /* Wider container */
    margin: 0 auto;
    padding: 0 4rem;
}

/* Global About Section Spacing (Desktop Fix) */
#about {
    padding-top: 12rem;
    /* Restore the spacing removed from HTML */
}

section {
    padding: var(--spacing-xl) 0;
}

/* Navigation - Minimalist */
header {
    padding: 2rem 0;
    position: fixed;
    width: 100%;
    top: 0;
    z-index: 1000;
    background: rgba(249, 249, 247, 0.95);
    /* Matches --color-cream */
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
}

/* Fix iOS Safari Stacking Context Bug on Mobile */
@media (max-width: 992px) {
    header {
        backdrop-filter: none !important;
        -webkit-backdrop-filter: none !important;
        transform: none !important;
        background: #F9F9F7;
    }
}

/* Social Media Icons */
.social-links {
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    margin-top: 0.4rem;
    /* Reduced from 0.75rem */
}

.social-icon {
    width: 24px;
    height: 24px;
    fill: var(--color-gold);
    transition: all 0.3s ease;
}

.social-icon:hover {
    fill: var(--color-white);
    transform: translateY(-2px);
}

nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    /* Important for mobile */
}

.logo {
    font-family: var(--font-heading);
    font-size: 2rem;
    font-weight: 700;
    /* Bold logo */
    color: var(--color-purple-dark);
    letter-spacing: -0.03em;
}

.nav-links {
    display: flex;
    gap: 3rem;
    align-items: center;
}

.nav-links a {
    font-family: var(--font-body);
    font-weight: 500;
    text-transform: uppercase;
    font-size: 0.75rem;
    letter-spacing: 0.15em;
    color: var(--color-text);
    position: relative;
    padding: 0.5rem 0;
}

.nav-links a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 1px;
    bottom: 0;
    left: 0;
    background-color: var(--color-gold);
    transition: var(--transition-smooth);
}

.nav-links a:hover::after,
.nav-links a.active::after {
    width: 100%;
}

/* Dropdown Menu */
.dropdown {
    position: relative;
    height: 100%;
    display: flex;
    align-items: center;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--color-white);
    min-width: 260px;
    box-shadow: var(--shadow-hover);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition-smooth);
    border-top: 3px solid var(--color-gold);
    padding: 1rem 0;
    z-index: 1000;
}

@media (min-width: 993px) {
    .dropdown:hover .dropdown-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }
}

.dropdown-menu li {
    display: block;
    margin: 0;
}

.dropdown-menu a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 2rem;
    font-size: 0.8rem;
    color: var(--color-text);
    text-transform: uppercase;
    transition: all 0.2s;
}

.dropdown-menu a::after {
    display: none;
}

.dropdown-menu a:hover {
    background-color: rgba(0, 0, 0, 0.02);
    color: var(--color-purple);
    padding-left: 2.2rem;
}

/* Submenu */
.has-submenu {
    position: relative;
}

.submenu {
    position: absolute;
    left: 100%;
    top: -1rem;
    background: var(--color-white);
    min-width: 260px;
    box-shadow: var(--shadow-hover);
    opacity: 0;
    visibility: hidden;
    transform: translateX(10px);
    transition: var(--transition-smooth);
    border-top: 3px solid var(--color-gold);
    padding: 1rem 0;
}

.has-submenu:hover .submenu {
    opacity: 1;
    visibility: visible;
    transform: translateX(0);
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    background-color: var(--color-purple-dark);
    /* Fallback */
    overflow: hidden;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(42, 10, 74, 0.4);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
    text-align: center;
    color: var(--color-white);
}

/* Cards */
.card {
    background: var(--color-white);
    border: none;
    border-radius: var(--radius-sm);
    box-shadow: none;
    /* Flat style first */
    transition: var(--transition-smooth);
    overflow: hidden;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-hover);
}

/* Footer */
footer {
    background-color: var(--color-purple-dark);
    color: var(--color-white);
    padding: 1.25rem 0;
    /* Reduced from 2.5rem */
    text-align: center;
    font-size: 0.9rem;
    font-family: var(--font-body);
}

/* Utilities */
/* Map Section Info Panel */
.info-panel {
    background: #fff;
    padding: 3rem;
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-height: 400px;
    max-width: 500px;
    width: 100%;
}

.grid-2-cols {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6rem;
    align-items: center;
}

/* Mobile */
.menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--color-text);
}

@media (max-width: 992px) {
    .container {
        padding: 0 2rem;
    }

    h1 {
        font-size: 3.5rem;
    }

    .grid-2-cols {
        grid-template-columns: 1fr;
        gap: 3rem;
    }
}

@media (max-width: 768px) {

    /* 1. Global Layout Resets & Overflow Protection */
    html {
        overflow-x: hidden;
        width: 100%;
        max-width: 100%;
    }

    body {
        overflow-x: hidden;
        width: 100%;
        max-width: 100%;
        position: relative;
    }

    .container {
        width: 100%;
        max-width: 100%;
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
        overflow-x: hidden;
    }

    section {
        padding: 2rem 0;
        /* Tighter mobile spacing */
        width: 100%;
    }

    /* 2. Typography Adjustments */
    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 1.8rem;
    }
}

/* 3. Navigation - Hamburger Overlay (Tablet/Mobile) */
@media (max-width: 992px) {
    .menu-toggle {
        display: block;
        /* Show hamburger */
        font-size: 2rem;
        cursor: pointer !important;
        z-index: 10015 !important;
        /* Above nav-links (10010) */
        padding: 0.5rem;
        /* Touch target */
        position: relative;
    }

    nav {
        width: 100%;
        justify-content: space-between;
        /* Ensure logo left, burger right */
        align-items: center;
        position: relative;
        z-index: 1001;
    }
}

/* Ensure menu toggle is hidden on desktop */
@media (min-width: 993px) {
    .menu-toggle {
        display: none !important;
    }
}

@media (max-width: 992px) {
    .nav-links {
        display: none;
        /* Hidden by default */
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        min-height: -webkit-fill-available;
        background: #F9F9F7 !important;
        flex-direction: column;
        justify-content: flex-start !important;
        /* Start from top, don't center */
        align-items: center;
        padding: 8rem 2rem 4rem 2rem !important;
        /* More top padding for header space */
        z-index: 10010 !important;
        /* Nuclear z-index for iOS */
        border-top: none;
        gap: 1.5rem !important;
        overflow-y: auto !important;
        /* Ensure scrollability */
        -webkit-overflow-scrolling: touch;
    }

    .nav-links.active {
        display: flex;
        /* Show when active */
    }

    .nav-links a {
        font-size: 1.5rem;
        margin: 0 !important;
        /* Remove individual margins */
        display: block;
    }

    .nav-links a::after {
        display: none;
        /* Remove underline animation on mobile */
    }

    /* Mobile Dropdown */
    .dropdown {
        display: block;
        width: 100%;
        text-align: center;
        height: auto;
    }

    .dropdown-menu,
    .submenu {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100vw !important;
        height: 100vh !important;
        background-color: #F9F9F7 !important;
        transform: translateX(100%);
        transition: transform 0.3s ease-in-out;
        opacity: 1 !important;
        visibility: visible !important;
        display: block !important;
        z-index: 10005 !important;
        padding: 6rem 2rem 2rem 2rem !important;
        overflow-y: auto !important;
        box-sizing: border-box;
    }

    /* Active state slides in */
    .dropdown-menu.active,
    .submenu.active {
        transform: translateX(0);
    }

    /* Back Button Styling */
    .menu-back {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: flex-start !important;
        width: 100%;
        text-align: left;
        padding: 1.5rem 2rem;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        color: var(--color-purple-dark);
        font-weight: 700;
        text-transform: uppercase;
        letter-spacing: 0.1em;
        cursor: pointer !important;
        background: #F9F9F7;
        /* Match background */
        border: none;
        position: absolute;
        /* Fix to top of the sliding drawer */
        top: 0;
        left: 0;
        z-index: 20000 !important;
        /* Nuclear Option Z-Index */
        height: 80px;
        /* Consistent header height */
        pointer-events: auto !important;
        /* Force clickable */
        list-style: none !important;
        /* Ensure no bullet */
        margin: 0 !important;
    }

    /* Remove pseudo-element arrow as we inject it in HTML now */
    .menu-back::before {
        content: none !important;
        display: none !important;
    }

    .dropdown-menu a {
        justify-content: flex-start;
        /* Align left for readability */
        padding: 1rem;
        font-size: 1.2rem;
        /* Larger for tap targets */
        text-align: left;
    }

    .has-submenu>a::after {
        content: ' ▼';
        font-size: 0.8em;
        margin-left: 0.5rem;
    }

    .nav-links a.dropdown-toggle {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        justify-content: center !important;
        white-space: nowrap !important;
    }

    /* CRITICAL FIX: Reset all underline properties for the arrow */
    .nav-links a.dropdown-toggle::after {
        content: ' ▼' !important;
        font-size: 0.8em !important;
        margin-left: 0.5rem !important;
        display: inline-block !important;
        position: static !important;
        /* Reset absolute positioning */
        background: transparent !important;
        /* Remove gold underline background */
        width: auto !important;
        height: auto !important;
        transform: none !important;
        /* Add rotation later if needed */
    }

    /* Ensure menu is scrollable on mobile if items expand */
    .nav-links {
        overflow-y: auto;
        padding-bottom: 4rem;
        /* Space for scroll */
    }
}

/* Desktop: Hide back button */
@media (min-width: 993px) {

    .menu-back,
    .dropdown-menu .menu-back,
    body .menu-back {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        height: 0 !important;
        padding: 0 !important;
        margin: 0 !important;
        border: none !important;
        pointer-events: none !important;
    }
}

/* 4. Hero Section & Rest of Content (Mobile Layout) */
@media (max-width: 768px) {
    .hero {
        padding-top: 6rem !important;
        padding-bottom: 3rem !important;
        background-position: center top !important;
        background-size: cover !important;
    }

    .hero-content {
        padding: 0 1rem;
        flex-direction: column;
    }

    .hero-content .btn {
        width: 100%;
        text-align: center;
        margin-bottom: 1rem;
    }

    /* Stack the buttons container */
    .hero-content>div:last-child {
        flex-direction: column;
        width: 100%;
    }

    /* 5. General Grid Reset (Stacking) */
    .grid-2-cols {
        display: flex;
        flex-direction: column;
        gap: 1.5rem;
        /* Reduced gap */
    }

    /* Tighten text spacing inside grids on mobile to override inline styles */
    .grid-2-cols h2,
    .grid-2-cols p {
        margin-bottom: 1rem !important;
    }

    /* 6. About Section Specifics */
    /* Image div (order:1 inline) should appear first on mobile too - no override needed */

    /* Map Section: Override above rule - show map first, then info panel on mobile */
    .map-section .grid-2-cols>div:first-child {
        order: 0 !important;
    }

    .map-section .grid-2-cols>div:nth-child(2),
    .map-section .info-panel,
    .map-section #distributor-info {
        order: 1 !important;
    }

    /* Decorative border - keep visible but adjust for mobile */
    #about .grid-2-cols>div>div[style*="border"] {
        top: -15px !important;
        left: -15px !important;
        width: 100% !important;
        height: 100% !important;
        display: block !important;
    }

    /* Reduce #about padding on mobile */
    #about {
        padding-top: 4rem !important;
    }

    /* Fix inline order overrides on mobile - image first, text second */
    #about .grid-2-cols>div:first-child {
        order: 2 !important;
    }

    #about .grid-2-cols>div:nth-child(2) {
        order: 1 !important;
        margin-bottom: 2rem;
        /* Add spacing between image and text */
        padding-left: 15px;
        /* Offset for the border */
        padding-top: 15px;
        /* Offset for the border */
    }

    /* Responsive image height on mobile (override inline 600px) */
    #about .grid-2-cols>div>div[style*="height"] {
        height: auto !important;
        aspect-ratio: 4/5 !important;
        /* Portrait aspect ratio looking good on mobile */
        max-height: 500px !important;
        background-position: center top !important;
    }

    /* Education program section needs side padding */
    .program-section {
        padding-left: 1.5rem !important;
        padding-right: 1.5rem !important;
    }

    /* 7. Products Grid */
    .products-grid {
        grid-template-columns: 1fr !important;
    }

    /* 8. Map & Contact */
    svg.map {
        width: 100%;
        height: auto;
        min-height: 400px;
        display: block;
    }

    #distributor-info {
        min-height: auto !important;
        padding: 2rem !important;
        display: block !important;
    }
}

/* Poland Map Interaction */
.voivodship {
    fill: #e0e0e0;
    stroke: #ffffff;
    stroke-width: 1px;
    transition: all 0.3s ease;
    cursor: pointer;
}

.voivodship:hover {
    fill: var(--color-purple);
    filter: drop-shadow(0 0 5px rgba(0, 0, 0, 0.2));
}

.voivodship.active {
    fill: var(--color-purple);
    filter: drop-shadow(0 0 8px rgba(0, 0, 0, 0.3));
}

/* ─── SCROLL REVEAL ANIMATIONS ────────────────────────────────────── */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.6s ease-out, transform 0.6s ease-out;
    will-change: opacity, transform;
}

.reveal.revealed {
    opacity: 1;
    transform: translateY(0);
}

/* ─── MICRO-INTERACTIONS ──────────────────────────────────────────── */
.card,
.stat-card,
.value-card,
.educator-card,
.event-card,
.bestseller-card,
.news-card,
.product-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.card:hover,
.stat-card:hover,
.value-card:hover,
.educator-card:hover,
.event-card:hover,
.bestseller-card:hover,
.news-card:hover,
.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(42, 10, 74, 0.15);
}

.btn,
button:not(#back-to-top) {
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.btn:hover,
button:not(#back-to-top):hover {
    transform: translateY(-2px);
}

.btn:active,
button:not(#back-to-top):active {
    transform: translateY(0);
}

/* ─── BACK TO TOP BUTTON ──────────────────────────────────────────── */
#back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: var(--color-purple-dark);
    color: var(--color-white);
    font-size: 1.4rem;
    cursor: pointer;
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease, background-color 0.3s ease;
    pointer-events: none;
    box-shadow: 0 4px 15px rgba(42, 10, 74, 0.3);
}

#back-to-top.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

#back-to-top:hover {
    background: var(--color-gold);
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(42, 10, 74, 0.4);
}

/* ─── ACCESSIBILITY: REDUCED MOTION ───────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .card:hover,
    .stat-card:hover,
    .value-card:hover,
    .educator-card:hover,
    .event-card:hover,
    .bestseller-card:hover,
    .news-card:hover,
    .product-card:hover {
        transform: none;
    }

    #back-to-top {
        transition: opacity 0.3s ease;
    }

    #back-to-top.visible {
        transform: none;
    }

    html {
        scroll-behavior: auto;
    }
}