/* Ana Site Responsive Stiller (v4) — Mobile-First */
/* Hamburger menu, full-screen nav drawer, optimized mobile */

/* Hidden on desktop by default */
.mobile-menu-btn { display: none; }

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

@media (max-width: 768px) {
    /* ─── HAMBURGER MENU ─── */
    .mobile-menu-btn {
        display: flex;
        align-items: center;
        justify-content: center;
        background: none;
        border: none;
        cursor: pointer;
        color: var(--foreground);
        padding: 0.3rem;
        border-radius: 0.4rem;
        order: 10;
    }
    .mobile-menu-btn:hover { background: var(--muted); }

    header { position: sticky; top: 0; z-index: 1000; padding-bottom: 0; }
    header .container {
        flex-direction: row !important;
        height: auto;
        padding-top: 0.6rem;
        padding-bottom: 0.6rem;
        gap: 0.4rem;
    }
    .logo { font-size: 1.15rem; flex: 1; width: auto !important; }

    /* Nav: hidden by default on mobile */
    nav { overflow: visible !important; padding: 0; width: auto; }
    nav::-webkit-scrollbar { display: block; }
    nav ul { display: none !important; }

    /* Active nav: full-screen overlay */
    nav.active {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100vh !important;
        background: var(--card);
        z-index: 1000;
        padding: 4rem 1.5rem 1.5rem;
        display: flex !important;
        flex-direction: column;
        overflow-y: auto;
        animation: fadeIn 0.2s ease;
    }
    nav.active ul {
        display: flex !important;
        flex-direction: column;
        gap: 1rem;
        width: 100%;
        margin: 0;
        padding: 0;
    }
    nav.active a {
        font-size: 1rem;
        padding: 0.7rem 0;
        border-bottom: 1px solid var(--border);
        white-space: normal;
    }

    /* Body scroll lock */
    body.nav-open { overflow: hidden; }

    /* Close button inside nav drawer */
    .nav-close-btn {
        position: absolute;
        top: 0.75rem;
        right: 0.75rem;
        background: var(--muted);
        border: none;
        width: 36px;
        height: 36px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        color: var(--foreground);
        font-size: 1.1rem;
    }

    /* ─── HERO ─── */
    .hero { padding: 1.5rem 0.75rem 1rem; }
    .hero-title { font-size: clamp(1.5rem, 6vw, 2rem) !important; }
    .hero-subtitle { font-size: 0.9rem !important; margin-bottom: 1.25rem !important; }
    .hero-buttons { gap: 0.5rem !important; flex-wrap: wrap !important; justify-content: center !important; }
    .btn-hero {
        padding: 0.6rem 1.4rem !important;
        font-size: 0.85rem !important;
        border-radius: var(--radius-md) !important;
    }
    .btn-hero-outline {
        padding: 0.6rem 1.4rem !important;
        font-size: 0.85rem !important;
        border-radius: var(--radius-md) !important;
    }
    .hero .hero-bg { min-height: auto !important; }

    /* ─── SECTION HEADER ─── */
    .section-header {
        flex-wrap: wrap !important;
        gap: 0.5rem !important;
        margin-bottom: 1rem !important;
    }
    .section-title { font-size: 1.15rem !important; }
    .section-link { font-size: 0.75rem !important; }

    /* ─── PAGE HEADER ─── */
    .page-header { padding: 0.4rem 0; margin-bottom: 0.75rem; }
    .page-header h1 { font-size: 1rem; }

    /* ─── ÜRÜN GRID ─── */
    .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 0.5rem;
        padding: 0;
    }
    .product-card { border-radius: 0.4rem; }
    .product-content { padding: 0.4rem 0.45rem 0.45rem; }
    .product-title { font-size: 0.7rem; height: 1.8rem; }
    .price-new { font-size: 0.78rem; }
    .price-old { font-size: 0.6rem; }
    .discount-badge { font-size: 0.55rem; padding: 0.12rem 0.35rem; top: 4px; left: 4px; }

    /* ─── CARDS ─── */
    .card { padding: 1rem; border-radius: 0.75rem; }

    /* ─── FOOTER ─── */
    footer { padding: 1.5rem 0 1rem; text-align: center; }
    footer .container > div:first-child { grid-template-columns: 1fr !important; gap: 1.5rem !important; }
    footer .container > div:first-child > div:last-child { grid-template-columns: 1fr 1fr !important; }
    footer .container > div:last-child {
        flex-direction: column !important;
        gap: 0.5rem !important;
        text-align: center !important;
    }
    footer .logo { justify-content: center !important; }

    /* ─── NEWSLETTER (other pages) ─── */
    #newsletter-email { font-size: 0.85rem !important; padding: 0.6rem 0.8rem !important; width: 100% !important; margin-bottom: 0.5rem !important; }
    #newsletter-btn { font-size: 0.8rem !important; padding: 0.6rem 1rem !important; width: 100% !important; }
    footer [style*="display: flex"][style*="gap: 0.5rem"] { flex-direction: column !important; align-items: stretch !important; }
    footer [style*="display:flex"][style*="gap:0.5rem"] { flex-direction: column !important; align-items: stretch !important; }

    /* ─── HEADER USER ICONS ─── */
    header [style*="display: flex"][style*="gap: 1.25rem"] { gap: 0.5rem !important; }
    header [style*="display:flex"][style*="gap:1.25rem"] { gap: 0.5rem !important; }

    /* ─── ABOUT / CONTACT ─── */
    [id="about-image"] { height: 200px !important; }
    [id="contact-image"] { height: 200px !important; }
    .contact-card { padding: 1.25rem !important; }
    [style*="padding: 3rem"][style*="background: var(--card)"] { padding: 1.25rem !important; }
    .about-text { font-size: 0.9rem !important; line-height: 1.6 !important; }
    .section-heading { font-size: 1.5rem !important; }

    /* Contact page grid - single column */
    .contact-page-grid {
        grid-template-columns: 1fr !important;
        gap: 1.25rem !important;
    }

    /* ─── DASHBOARD ─── */
    .dash-layout { flex-direction: column !important; }
    .dash-sidebar { width: 100% !important; position: static !important; }
    .dash-content { margin-left: 0 !important; }

    /* Dashboard profile form rows */
    .dash-form-row {
        grid-template-columns: 1fr !important;
    }

    /* ─── CART / CHECKOUT ─── */
    .cart-item { grid-template-columns: 55px 1fr !important; gap: 0.65rem !important; }
    .cart-item-actions { grid-column: span 2; display: flex; justify-content: space-between; align-items: center; }
    .checkout-layout { grid-template-columns: 1fr !important; }
    .cart-items { padding: 0.75rem !important; }
    .cart-summary { padding: 1rem !important; }

    /* ─── AUTH FORMS ─── */
    .auth-container { padding: 1.25rem !important; }

    /* ─── TOAST (mobile) ─── */
    .toast, [class*="toast"] {
        bottom: 0.75rem !important;
        right: 0.75rem !important;
        left: 0.75rem !important;
        text-align: center;
    }

    /* ─── WHATSAPP WIDGET (mobile) ─── */
    .whatsapp-widget {
        bottom: 0.75rem !important;
        right: 0.75rem !important;
        width: 44px !important;
        height: 44px !important;
    }
    /* When mobile buy bar is present, move whatsapp widget up */
    .has-mobile-buy-bar .whatsapp-widget {
        bottom: 5rem !important;
    }

    /* ─── POLICY PAGE ─── */
    .policy-container {
        margin: 1.25rem auto !important;
        padding: 1rem !important;
    }
    .policy-title { font-size: 1.2rem !important; }
    .policy-content { font-size: 0.85rem !important; }

    /* ─── ABOUT PAGE TEXT ─── */
    .about-page-text { font-size: 0.9rem !important; line-height: 1.6 !important; }

    /* ─── PRODUCT DETAIL ─── */
    .product-detail-grid { grid-template-columns: 1fr; gap: 1.25rem; }
    .detail-info h1 { font-size: 1.3rem; }
    .detail-price-new { font-size: 1.3rem; }
    .mobile-buy-bar { display: flex; }
    main { padding-bottom: 4rem; }

    /* ─── ANNOUNCEMENT BAR ─── */
    .announcement-bar { font-size: 0.8rem !important; padding: 0.35rem 0 !important; }
}

/* ─── 480px: Extra small phones ─── */
@media (max-width: 480px) {
    .hero-title { font-size: 1.4rem !important; }
    .hero-subtitle { font-size: 0.85rem !important; }
    .btn-hero { padding: 0.55rem 1.2rem !important; font-size: 0.8rem !important; }
    .btn-hero-outline { padding: 0.55rem 1.2rem !important; font-size: 0.8rem !important; }
    .hero-buttons { gap: 0.4rem !important; flex-direction: column !important; align-items: center !important; }

    .products-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 0.4rem; }
    .product-title { font-size: 0.65rem; height: 1.6rem; }
    .price-new { font-size: 0.72rem; }
    .product-content { padding: 0.3rem 0.35rem 0.35rem; }
    .product-card { border-radius: 0.35rem; }

    .section-title { font-size: 1rem !important; }

    footer { padding: 1rem 0 0.75rem; }

    [id="about-image"] { height: 180px !important; }
    [id="contact-image"] { height: 180px !important; }
    .contact-card { padding: 1rem !important; }
    [style*="padding: 3rem"][style*="background: var(--card)"] { padding: 1rem !important; }
    .about-text { font-size: 0.85rem !important; }
    .section-heading { font-size: 1.3rem !important; }

    .auth-container { padding: 1rem !important; }

    /* Policy */
    .policy-container {
        margin: 0.75rem auto !important;
        padding: 0.75rem !important;
    }
    .policy-title { font-size: 1.1rem !important; }

    /* Nav drawer on very small screens */
    nav.active { padding: 3.5rem 1rem 1rem; }
    nav.active a {
        font-size: 0.9rem;
        padding: 0.6rem 0;
    }
}

/* ─── 360px: Very small phones ─── */
@media (max-width: 360px) {
    header .container { gap: 0.2rem; }
    .logo { font-size: 1rem; }
    header [style*="display: flex"][style*="gap: 1.25rem"] { gap: 0.4rem !important; }
    header [style*="display:flex"][style*="gap:1.25rem"] { gap: 0.4rem !important; }
    .mobile-menu-btn { padding: 0.2rem; }

    .hero { padding: 1rem 0.5rem 0.75rem; }
    .hero-title { font-size: 1.2rem !important; }
    .hero-subtitle { font-size: 0.8rem !important; }

    .products-grid { gap: 0.3rem; padding: 0; }
    .product-title { font-size: 0.6rem; height: 1.4rem; }
    .price-new { font-size: 0.68rem; }
    .discount-badge { font-size: 0.45rem; padding: 0.1rem 0.25rem; }

    .cart-item { grid-template-columns: 40px 1fr !important; gap: 0.4rem !important; }
    .cart-item img { width: 40px !important; height: 50px !important; }
    .cart-item-info h4 { font-size: 0.8rem !important; }

    .policy-container { padding: 0.5rem !important; }
    .policy-title { font-size: 1rem !important; }
    .policy-content { font-size: 0.8rem !important; }

    nav.active { padding: 3rem 0.75rem 0.75rem; }
    nav.active a { font-size: 0.85rem; padding: 0.5rem 0; }

    .detail-info h1 { font-size: 1.1rem; }
    .detail-price-new { font-size: 1.1rem; }
    .gallery-thumb { width: 40px !important; height: 40px !important; }

    footer .container > div:last-child { gap: 0.4rem !important; }
}

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