/* ============================================
   RESPONSIVE BREAKPOINTS - Mobile First
   ============================================ */

/* ============================================
   MAX 1200px (Laptop)
   ============================================ */
@media (max-width: 1200px) {
    .grid-4 { grid-template-columns: repeat(3, 1fr); }
    .grid-5 { grid-template-columns: repeat(3, 1fr); }
    .grid-6 { grid-template-columns: repeat(4, 1fr); }

    .products-grid { grid-template-columns: repeat(3, 1fr); }
    .footer-grid { grid-template-columns: 2fr 1fr 1fr 1.5fr; gap: var(--space-6); }
}

/* ============================================
   MAX 992px (Tablet Landscape)
   ============================================ */
@media (max-width: 992px) {
    :root {
        --header-height: 70px;
    }

    .grid-3 { grid-template-columns: repeat(2, 1fr); }
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
    .grid-5 { grid-template-columns: repeat(2, 1fr); }
    .grid-6 { grid-template-columns: repeat(3, 1fr); }

    /* Header - Mobile Nav */
    .main-nav {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100vh;
        height: 100dvh;
        background: rgba(10, 15, 30, 0.98); /* Deep modern dark slate */
        backdrop-filter: blur(25px);
        -webkit-backdrop-filter: blur(25px);
        flex-direction: column;
        align-items: flex-start;
        justify-content: flex-start;
        padding: 90px var(--space-6) var(--space-12) var(--space-6);
        gap: 0;
        z-index: var(--z-modal);
        transform: translateX(100%);
        transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        overflow-y: auto;
    }

    .main-nav.open {
        transform: translateX(0);
    }

    .nav-link {
        font-size: 1.35rem;
        font-weight: 700;
        color: rgba(255, 255, 255, 0.85);
        border-bottom: 1px solid rgba(255, 255, 255, 0.06);
        width: 100%;
        padding: var(--space-4) var(--space-2);
        display: flex;
        align-items: center;
        justify-content: space-between;
        transition: all 0.3s ease;
    }

    .nav-link:hover,
    .nav-link.active {
        color: var(--primary);
        background: transparent;
        padding-left: var(--space-4);
    }

    .nav-dropdown {
        width: 100%;
    }

    .nav-dropdown-menu {
        position: static;
        transform: none;
        opacity: 1;
        visibility: visible;
        min-width: auto;
        background: rgba(255, 255, 255, 0.02);
        border-left: 2px solid var(--primary);
        margin: var(--space-2) 0 var(--space-4) var(--space-4);
        padding: var(--space-2) 0 var(--space-2) var(--space-4);
        box-shadow: none;
        display: none;
        backdrop-filter: none;
        width: calc(100% - var(--space-4));
    }

    .nav-dropdown-menu a {
        color: rgba(255, 255, 255, 0.6);
        font-size: var(--text-base);
        font-weight: 500;
        padding: var(--space-2) 0;
        display: block;
        transition: all 0.2s ease;
    }

    .nav-dropdown-menu a:hover {
        color: #fff;
        padding-left: var(--space-2);
    }

    .nav-dropdown.open .nav-dropdown-menu {
        display: block;
    }

    .mobile-menu-btn {
        display: flex;
        z-index: 1010; /* Ensure button stays on top of menu overlay */
    }

    .mobile-menu-btn.active span {
        background: #fff !important; /* Make X lines white on dark menu */
    }

    .main-nav::after {
        content: "Seyrantepe Mah. Cihangir Sk. No:18 Kağıthane - İstanbul\n+90 212 284 82 72 • info@hasmakservis.com";
        white-space: pre-wrap;
        display: block;
        width: 100%;
        margin-top: auto;
        padding-top: var(--space-6);
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        color: rgba(255, 255, 255, 0.4);
        font-size: var(--text-xs);
        line-height: 1.6;
        font-weight: 400;
        font-family: var(--font-base);
    }

    /* Hero */
    .hero-section { min-height: 70vh; }
    .hero-float { display: none; }
    .hero-title { font-size: clamp(2rem, 5vw, 3rem); }

    /* Shop Layout */
    .shop-layout {
        grid-template-columns: 1fr;
    }

    .sidebar-filters {
        position: static;
        display: none;
    }

    .sidebar-filters.open {
        display: block;
    }

    .products-grid { grid-template-columns: repeat(2, 1fr); }

    /* Product Detail */
    .product-detail .grid-2 {
        grid-template-columns: 1fr;
    }

    .product-info {
        padding-left: 0;
        padding-top: var(--space-6);
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }

    /* Contact */
    .contact-grid {
        grid-template-columns: 1fr;
    }

    /* Cart */
    .cart-layout {
        grid-template-columns: 1fr;
    }

    .cart-summary {
        position: static;
    }

    .products-grid.list-view .product-card {
        flex-direction: column;
    }

    .products-grid.list-view .product-card-image {
        width: 100%;
        aspect-ratio: 4/3;
    }
}

/* ============================================
   MAX 768px (Tablet Portrait)
   ============================================ */
@media (max-width: 768px) {
    :root {
        --header-height: 64px;
        --container-padding: 1rem;
    }

    h1 { font-size: var(--text-3xl); }
    h2 { font-size: var(--text-2xl); }
    h3 { font-size: var(--text-xl); }

    .section { padding: var(--space-12) 0; }
    .section-header { margin-bottom: var(--space-8); }
    .section-header h2 { font-size: var(--text-2xl); }

    .grid-2 { grid-template-columns: 1fr; }
    .grid-3 { grid-template-columns: 1fr; }
    .grid-6 { grid-template-columns: repeat(2, 1fr); }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-4);
    }

    /* Footer */
    .footer-grid {
        grid-template-columns: 1fr;
        gap: var(--space-8);
    }

    .footer-bottom {
        flex-direction: column;
        text-align: center;
    }

    .footer-bottom-links {
        justify-content: center;
    }

    /* Hero */
    .hero-section { min-height: 60vh; }
    .hero-content { padding: var(--space-16) 0; }
    .hero-actions { flex-direction: column; }
    .hero-actions .btn { width: 100%; }

    /* Stats */
    .stats-section .grid-4 {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-6);
    }

    .stat-number { font-size: var(--text-4xl); }

    /* Brands */
    .brands-slider {
        gap: var(--space-6);
    }

    .brand-item {
        width: 130px;
        height: 65px;
    }

    /* Cart */
    .cart-table thead { display: none; }

    .cart-table tr {
        display: flex;
        flex-wrap: wrap;
        padding: var(--space-4) 0;
        border-bottom: 1px solid var(--glass-border);
    }

    .cart-table td {
        padding: var(--space-2);
        border: none;
    }

    /* Contact */
    .contact-info-cards {
        grid-template-columns: 1fr;
    }

    /* Product Detail */
    .product-price-detail {
        flex-wrap: wrap;
    }

    .product-actions-detail {
        flex-direction: column;
    }

    .product-actions-detail .btn {
        width: 100%;
    }

    .tab-headers {
        overflow-x: auto;
        flex-wrap: nowrap;
        -webkit-overflow-scrolling: touch;
    }

    .tab-header {
        white-space: nowrap;
    }

    /* CTA */
    .cta-card {
        padding: var(--space-10) var(--space-5);
    }

    .cta-actions {
        flex-direction: column;
    }

    /* Reference */
    .reference-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    /* Search */
    .header-search {
        display: none;
    }

    .mobile-search {
        display: block;
        padding: var(--space-3) var(--container-padding);
        background: var(--bg-secondary);
        border-bottom: 1px solid var(--glass-border);
    }
}

/* ============================================
   MAX 576px (Mobile Large)
   ============================================ */
@media (max-width: 576px) {
    :root {
        --container-padding: 0.75rem;
    }

    body { font-size: 15px; }

    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: var(--space-3);
    }

    .product-card-body {
        padding: var(--space-3);
    }

    .product-card-title {
        font-size: var(--text-sm);
    }

    .product-card-description {
        display: none;
    }

    .product-card-footer {
        flex-direction: column;
        align-items: stretch;
        gap: var(--space-2);
    }

    .add-to-cart-btn {
        width: 100%;
        justify-content: center;
    }

    .product-price .current-price {
        font-size: var(--text-base);
    }

    /* Header */
    .logo-text .brand-tagline { display: none; }
    .header-action-btn { width: 36px; height: 36px; }

    /* Hero */
    .hero-section { min-height: 50vh; }
    .hero-badge { font-size: var(--text-xs); }

    /* Stats */
    .stats-section .grid-4 {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-4);
    }

    .stat-number { font-size: var(--text-3xl); }

    /* CTA */
    .cta-card h2 { font-size: var(--text-2xl); }

    /* Service Cards */
    .service-card {
        padding: var(--space-5);
    }

    .service-card-icon {
        width: 56px;
        height: 56px;
        font-size: 1.25rem;
    }

    /* Reference */
    .reference-grid {
        grid-template-columns: 1fr 1fr;
        gap: var(--space-3);
    }

    .reference-card {
        padding: var(--space-5) var(--space-3);
    }

    /* Toast */
    .toast-container {
        left: var(--space-3);
        right: var(--space-3);
    }

    .toast {
        min-width: auto;
        width: 100%;
    }

    /* WhatsApp */
    .whatsapp-float {
        bottom: var(--space-4);
        right: var(--space-4);
    }

    .whatsapp-float a {
        width: 48px;
        height: 48px;
        font-size: 1.5rem;
    }

    /* Modal */
    .modal {
        margin: var(--space-3);
        max-height: calc(100vh - var(--space-6));
    }

    /* Brands */
    .brand-item {
        width: 100px;
        height: 50px;
        padding: var(--space-2);
    }

    .brands-slider {
        gap: var(--space-4);
    }
}

/* ============================================
   MAX 400px (Mobile Small)
   ============================================ */
@media (max-width: 400px) {
    .products-grid {
        grid-template-columns: 1fr;
    }

    .stats-section .grid-4 {
        grid-template-columns: 1fr;
    }

    .hero-title { font-size: var(--text-2xl); }
}

/* ============================================
   PRINT STYLES
   ============================================ */
@media print {
    body {
        background: white;
        color: black;
    }

    body::before,
    .site-header,
    .site-footer,
    .whatsapp-float,
    .toast-container,
    .mobile-menu-btn {
        display: none !important;
    }

    .container { max-width: 100%; }

    a { text-decoration: underline; }

    .glass-card,
    .product-card {
        border: 1px solid #ccc;
        background: white;
        backdrop-filter: none;
    }
}

/* ============================================
   REDUCED MOTION
   ============================================ */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }

    .reveal {
        opacity: 1;
        transform: none;
    }
}
