/* --- RESPONSIVE STYLES --- */

/* Header Actions Wrapper */
.header-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
}

/* Burger Menu Button (Default Hidden) */
.burger-menu {
    display: none;
    flex-direction: column;
    justify-content: space-around;
    width: 30px;
    height: 25px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    z-index: 1100;
    /* Above mobile menu */
}

.burger-menu span {
    width: 30px;
    height: 3px;
    background: var(--color-text-main);
    border-radius: 10px;
    transition: all 0.3s linear;
    position: relative;
    transform-origin: 1px;
}

/* Scrolled/Light Header Burger Color */
.site-header.scrolled .burger-menu span,
.site-header.light-text .burger-menu span {
    background: #ffffff;
}

.site-header.scrolled .burger-menu.active span {
    background: #ffffff;
}

/* Burger Animation */
.burger-menu.active span:first-child {
    transform: rotate(45deg);
}

.burger-menu.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(20px);
}

.burger-menu.active span:nth-child(3) {
    transform: rotate(-45deg);
}

/* Mobile Menu Overlay */
.mobile-menu {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: #3E2723;
    /* Dark Coffee hardcoded fallback */
    background: var(--color-text-main);
    z-index: 1050;
    transform: translateX(100%);
    transition: transform 0.3s ease-in-out;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-menu.active {
    transform: translateX(0);
}

.mobile-menu-inner {
    text-align: center;
    width: 100%;
    max-width: 400px;
}

.mobile-nav-links {
    list-style: none;
    padding: 0;
    margin: 0 0 2rem 0;
}

.mobile-nav-links li {
    margin: 1.5rem 0;
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.3s ease;
}

.mobile-menu.active .mobile-nav-links li {
    transform: translateY(0);
    opacity: 1;
}

/* Stagger delay for items */
.mobile-menu.active .mobile-nav-links li:nth-child(1) {
    transition-delay: 0.1s;
}

.mobile-menu.active .mobile-nav-links li:nth-child(2) {
    transition-delay: 0.2s;
}

.mobile-menu.active .mobile-nav-links li:nth-child(3) {
    transition-delay: 0.3s;
}

.mobile-menu.active .mobile-nav-links li:nth-child(4) {
    transition-delay: 0.4s;
}

.mobile-menu.active .mobile-nav-links li:nth-child(5) {
    transition-delay: 0.5s;
}

.mobile-nav-links a {
    color: #ffffff;
    font-size: 1.5rem;
    font-family: 'Playfair Display', serif;
    /* Fallback */
    font-family: var(--font-display);
    text-decoration: none;
}

.mobile-nav-links a:hover {
    color: #C5A059;
    /* Fallback */
    color: var(--color-accent);
}

/* Laptop Adaptation (< 1366px mostly, but let's use 1024-1440 range tweak) */
@media (max-width: 1440px) {
    .container {
        max-width: 1200px;
    }

    h1 {
        font-size: 3.5rem;
    }
}

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

    .nav-links {
        gap: 1.5rem;
    }

    .nav-links a {
        font-size: 0.85rem;
    }
}

/* Tablet & Mobile Breakpoint (Using 992px as cut-off for burger) */
@media (max-width: 992px) {
    .main-nav {
        display: none;
        /* Hide Desktop Nav */
    }

    .mobile-hide {
        display: none;
        /* Hide Desktop CTA */
    }

    .burger-menu {
        display: flex;
        /* Show Burger */
    }

    /* Layout Adjustments */
    .container {
        padding: 0 1.5rem;
    }

    /* Hero Adjustments */
    .hero .container {
        display: flex !important;
        flex-direction: column;
        text-align: center;
        padding-top: 100px;
    }

    .hero-content {
        align-items: center;
        order: 2;
        width: 100%;
    }

    .hero-visual {
        height: 450px !important;
        order: 1;
        min-height: auto !important;
        width: 100%;
    }

    /* About Premium Layout */
    .about-layout {
        flex-direction: column;
        gap: 2rem;
    }

    .about-content {
        transform: none !important;
        border-left: none !important;
        border-top: 5px solid var(--color-accent);
        padding: 2rem;
        max-width: 100% !important;
    }

    .about-visual {
        max-width: 100% !important;
    }

    /* Catalog Sidebar */
    .catalog-container {
        grid-template-columns: 1fr !important;
    }

    .catalog-sidebar {
        /* Keep sidebar but maybe stack it or simplify */
        margin-bottom: 2rem;
    }

    /* Contact Page */
    .map-form-section {
        grid-template-columns: 1fr !important;
    }

    .info-grid {
        grid-template-columns: 1fr !important;
    }

    /* Services Page: Button Fix for Tablet */
    .price-block .btn {
        white-space: nowrap;
        font-size: 0.9rem;
        padding: 0.8rem 1.5rem;
    }

    /* Products Page: Hero Order on Mobile/Tablet */
    .page-header .container {
        display: flex !important;
        flex-direction: column;
        justify-content: center;
        text-align: center;
        gap: 0 !important;
        /* Reduce gap between animation and text */
    }

    #catalog-hero-container {
        order: -1;
        /* Move to top */
        height: 450px !important;
        /* Specific height for mobile */
        width: 100% !important;
        margin-bottom: 0;
        margin-top: 120px;
        /* Increased from 50px to push down further */
    }

    .header-content {
        margin-bottom: 2rem;
    }
}

/* Compact Laptops / Small Tablets */
@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem !important;
    }

    h2 {
        font-size: 2rem !important;
    }

    .categories-grid {
        grid-template-columns: 1fr;
    }

    .service-grid {
        grid-template-columns: 1fr;
    }

    .advantages-grid {
        grid-template-columns: 1fr;
    }

    .adv-stack {
        grid-template-columns: 1fr;
    }

    /* Catalog Filters on mobile */
    .filter-group {
        margin-bottom: 1rem;
    }

    .catalog-sidebar {
        display: block;
        /* Ensure it's visible, maybe collapsed in future */
        background: #f9f9f9;
        padding: 1rem;
    }

    /* Services Block Mobile Adjustments */
    .service-card h3 {
        font-size: 1.35rem;
    }

    .service-card p {
        font-size: 1.05rem !important;
        /* Override inline styles */
        line-height: 1.5;
        opacity: 0.9 !important;
    }
}

/* --- MOBILE FILTERS --- */
@media (max-width: 992px) {

    /* Hide Default Layout */
    .catalog-container {
        display: block !important;
        /* Stack layout */
    }

    .catalog-sidebar {
        display: none;
        /* Hidden by default, becomes drawer */
        position: fixed;
        top: 0;
        left: 0;
        width: 300px;
        /* Compact width */
        max-width: 85vw;
        height: 100vh;
        z-index: 2000;
        background: #fff;
        overflow-y: auto;
        padding: 2rem 1.5rem;
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        /* Smooth iOS-like easing */
        transform: translateX(-100%);
        box-shadow: 10px 0 40px rgba(0, 0, 0, 0.15);
    }

    .catalog-sidebar.active {
        display: block;
        transform: translateX(0);
    }

    /* Backdrop */
    .catalog-sidebar.active::before {
        content: '';
        position: fixed;
        top: 0;
        left: 320px;
        /* Offset by sidebar width */
        width: 100vw;
        height: 100vh;
        background: rgba(0, 0, 0, 0.3);
        z-index: 1999;
        cursor: pointer;
        opacity: 0;
        animation: fadeIn 0.3s forwards;
    }

    @keyframes fadeIn {
        to {
            opacity: 1;
        }
    }

    .sidebar-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        margin-bottom: 2rem;
        padding-bottom: 1rem;
        border-bottom: 1px solid #eee;
    }

    .sidebar-header h3 {
        margin: 0;
        font-size: 1.2rem;
        font-weight: 600;
    }

    .close-filters-btn {
        background: #f5f5f5;
        border: none;
        border-radius: 50%;
        width: 36px;
        height: 36px;
        cursor: pointer;
        color: #333;
        display: flex;
        align-items: center;
        justify-content: center;
        transition: all 0.2s;
    }

    .close-filters-btn:hover {
        background: #ddd;
        transform: rotate(90deg);
    }

    .mobile-only {
        display: flex;
    }

    /* Mobile Sticky Bar (Liquid Glass) */
    .mobile-filter-bar {
        display: flex !important;
        align-items: center;
        gap: 1rem;
        position: -webkit-sticky;
        position: sticky;
        top: 80px;
        /* Header offset */
        z-index: 900;
        background: rgba(255, 255, 255, 0.2);
        /* Very transparent */
        backdrop-filter: blur(25px) saturate(180%);
        /* Strong blur & saturation */
        padding: 0.8rem 1rem;
        /* Slightly reduced padding */
        margin-bottom: 3rem;
        box-shadow: 0 8px 32px 0 rgba(31, 38, 135, 0.1);
        /* Deep soft shadow */
        border: 1px solid rgba(255, 255, 255, 0.4);
        /* Refractive border */
        border-bottom: 1px solid rgba(255, 255, 255, 0.6);
        border-radius: 20px;
        /* Rounded pill shape floating */
        /* Removed horizontal margins to match card width (full grid width) */
        margin-top: 1rem;
    }

    .mobile-cats-scroll {
        flex: 1;
        display: flex;
        gap: 0.5rem;
        overflow-x: auto;
        padding-bottom: 5px;
        -ms-overflow-style: none;
        /* IE and Edge */
        scrollbar-width: none;
        /* Firefox */
    }

    .mobile-cats-scroll::-webkit-scrollbar {
        display: none;
    }

    .mobile-cat-pill {
        white-space: nowrap;
        padding: 0.5rem 1.2rem;
        /* Reduced padding */
        border-radius: 12px;
        background: rgba(255, 255, 255, 0.9);
        color: #666;
        font-size: 0.8rem;
        /* Reduced font size */
        font-weight: 500;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        text-decoration: none;
        transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
        border: 1px solid transparent;
    }

    .mobile-cat-pill:hover {
        color: var(--color-accent);
        background: #fff;
    }

    .mobile-cat-pill.active {
        background: var(--color-accent);
        color: #fff;
        box-shadow: 0 4px 12px rgba(197, 160, 89, 0.4);
        transform: translateY(0);
    }

    .mobile-filter-toggle {
        background: var(--color-text-main);
        color: #fff;
        border: none;
        border-radius: 12px;
        /* Squash circle to rounded rect */
        width: 44px;
        height: 44px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        flex-shrink: 0;
        box-shadow: 0 4px 12px rgba(62, 39, 35, 0.3);
        transition: transform 0.2s;
    }

    .mobile-filter-toggle:active {
        transform: scale(0.95);
    }

    .mobile-filter-toggle svg {
        stroke: #fff;
    }
}

@media (min-width: 993px) {
    .mobile-filter-bar {
        display: none;
    }

    .mobile-only {
        display: none !important;
    }
}

/* Tablet: Force 3 columns for collections */
@media (min-width: 1024px) and (max-width: 1366px) {
    .categories-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.5rem;
    }
}

/* Tablet: Larger image in Philosophy section */
@media (min-width: 1024px) and (max-width: 1366px) {
    .story-grid {
        grid-template-columns: 1.2fr 0.8fr;
        gap: 2rem;
    }
}

/* Tablet: Contact info blocks in a row */
@media (min-width: 1024px) and (max-width: 1366px) {
    .info-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 1.5rem;
    }
}

/* Mobile: Reduce spacing between About and Categories sections */
@media (max-width: 768px) {
    .about-premium {
        padding: 3rem 0 !important;
    }

    .categories-section {
        padding: 3rem 0 !important;
    }
}