/* =============================================
   MASAL PASTANESİ — GLOBAL MOBILE FIX
   Tüm sayfalarda mobil kayma ve taşma önleme
   ============================================= */

/* 1. Temel: Yatay kayma tamamen engelle */
html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
}

* {
    box-sizing: border-box;
}

/* 2. Header — mobile hamburger-free responsive */
@media (max-width: 768px) {
    header {
        padding: 10px 4% !important;
        flex-wrap: wrap !important;
        gap: 8px !important;
        justify-content: space-between !important;
        align-items: center !important;
    }

    header .logo,
    header a.logo {
        flex: 0 0 auto !important;
    }

    header .logo-text,
    header a.logo .logo-text {
        font-size: 2rem !important;
    }

    header nav {
        flex: 0 0 100% !important;
        display: flex !important;
        flex-wrap: wrap !important;
        gap: 10px 18px !important;
        justify-content: center !important;
        margin-bottom: 6px !important;
        order: 3 !important;
    }

    header nav a {
        font-size: 0.72rem !important;
        letter-spacing: 0.5px !important;
        white-space: nowrap !important;
    }

    header > div:last-child {
        flex: 0 0 auto !important;
        display: flex !important;
        justify-content: flex-end !important;
    }
}

/* 3. Hero section */
@media (max-width: 768px) {
    .hero {
        height: 100svh !important;
        min-height: 500px !important;
    }

    .hero-content {
        padding: 0 16px !important;
        max-width: 100% !important;
        transform: translateY(-180px) !important;
    }

    .hero h1 {
        font-size: clamp(2.2rem, 10vw, 4rem) !important;
        letter-spacing: 2px !important;
        word-break: break-word !important;
    }

    .hero p {
        font-size: 0.9rem !important;
        letter-spacing: 2px !important;
    }

    .btn-group {
        flex-direction: column !important;
        align-items: center !important;
        gap: 12px !important;
    }

    .hero .btn {
        width: 240px !important;
        height: 52px !important;
        font-size: 0.78rem !important;
    }
}

/* 4. Sections & Grid */
@media (max-width: 768px) {
    section {
        padding: 90px 4% 50px !important;
    }

    .section-title h2 {
        font-size: 1.9rem !important;
        word-break: break-word !important;
    }

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

    .product-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 16px !important;
        padding: 0 !important;
    }

    .product-card {
        width: 100% !important;
    }

    .product-info h3 {
        font-size: 1rem !important;
    }

    .product-info p {
        font-size: 0.78rem !important;
    }
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    .product-card {
        max-width: 400px !important;
        margin: 0 auto !important;
    }
}

/* 5. Menu category cards on main page */
@media (max-width: 768px) {
    .menu-grid,
    .categories-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 14px !important;
    }

    .menu-item,
    .category-card {
        padding: 10px !important;
    }

    .menu-item h3,
    .category-card h3 {
        font-size: 0.95rem !important;
    }
}

/* 6. Footer */
@media (max-width: 768px) {
    footer {
        padding: 40px 5% 30px !important;
        font-size: 0.9rem !important;
    }

    footer .footer-grid {
        flex-direction: column !important;
        gap: 30px !important;
    }

    footer > div {
        flex-direction: column !important;
        gap: 15px !important;
    }

    .footer-business-details {
        font-size: 0.9rem !important;
        line-height: 1.8 !important;
        margin-top: 35px !important;
        padding: 15px !important;
        background: rgba(45, 62, 51, 0.04);
        border-radius: 12px;
        border: 1px dashed rgba(230, 160, 122, 0.4);
    }

    footer .footer-col {
        width: 100% !important;
    }

    .payment-logos {
        flex-wrap: wrap !important;
        gap: 10px !important;
        justify-content: center !important;
    }

    .payment-logos i {
        font-size: 1.6rem !important;
    }
}


/* =============================================
   GLOBAL FOOTER STANDARDIZATION
   ============================================= */
footer {
    background-color: var(--sage);
    color: var(--forest);
    padding: 80px 5% 40px;
    border-top: 1px solid var(--border-gold);
    text-align: center;
}

.footer-logo {
    font-family: 'Playfair Display', serif;
    font-size: 2.2rem;
    color: var(--forest);
    letter-spacing: 4px;
    margin-bottom: 20px;
    font-weight: 700;
}

.footer-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    text-align: left;
    margin-top: 40px;
    margin-bottom: 40px;
}

.info-box h4 {
    font-family: 'Playfair Display', serif;
    color: var(--gold);
    margin-bottom: 15px;
    font-size: 1.2rem;
}

.info-box p {
    font-size: 0.9rem;
    opacity: 0.8;
    line-height: 1.6;
}

.social-icons {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 30px;
    font-size: 1.8rem;
}

.social-icons a {
    color: var(--gold);
    transition: 0.3s;
}

.social-icons a:hover {
    transform: translateY(-5px);
}

.payment-logos {
    margin-top: 30px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .footer-info {
        grid-template-columns: 1fr;
        text-align: center;
    }
}


/* 7. Tables (sipariş, fiyat tabloları) */
@media (max-width: 768px) {
    table {
        display: block !important;
        overflow-x: auto !important;
        white-space: nowrap !important;
        width: 100% !important;
    }
}

/* 8. Checkout & Form pages */
@media (max-width: 768px) {
    .checkout-container,
    .form-container,
    .order-form {
        padding: 30px 5% !important;
        max-width: 100% !important;
    }

    .checkout-grid {
        flex-direction: column !important;
        gap: 25px !important;
    }

    input, select, textarea {
        font-size: 16px !important; /* iOS zoom fix */
        max-width: 100% !important;
    }
}

/* 9. Delivery/info banner */
@media (max-width: 768px) {
    .delivery-banner > div {
        flex-direction: column !important;
        gap: 20px !important;
        text-align: center !important;
    }

    .banner-divider {
        display: none !important;
    }
}

/* 10. Atelier / design form */
@media (max-width: 768px) {
    #atelier .atelier-grid,
    .atelier-container {
        flex-direction: column !important;
        gap: 20px !important;
    }
}

/* 11. Genel img taşma önleme */
img {
    max-width: 100%;
    height: auto;
}

/* 12. Float/absolute elementlerin taşması */
@media (max-width: 768px) {
    .floating-btn,
    .scroll-to-top {
        right: 16px !important;
        bottom: 16px !important;
    }
}

/* 13. Texts - no overflow */
h1, h2, h3, h4, p, span, a {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* 14. 3-Column Mobile Grid Utility (Standardized) */
@media (max-width: 480px) {
    .grid-3-col-mobile,
    .category-grid,
    .product-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 8px !important;
        padding: 10px 5px !important;
    }

    /* Category Cards Scaling */
    .category-card {
        height: 140px !important;
        padding: 5px !important;
    }

    .category-title {
        font-size: 0.75rem !important;
        margin-bottom: 5px !important;
        line-height: 1.2 !important;
    }

    .category-subtitle {
        font-size: 0.5rem !important;
        letter-spacing: 0.5px !important;
        margin-bottom: 2px !important;
    }

    /* Product Cards Scaling */
    .product-card {
        height: 100% !important;
        display: flex !important;
        flex-direction: column !important;
        padding: 8px 4px !important;
    }
        
    .product-info {
        padding: 0 4px 8px !important;
    }

    .product-info h3 {
        font-size: 0.72rem !important;
        min-height: 2.2rem;
        display: flex;
        align-items: center;
        justify-content: center;
        line-height: 1.1 !important;
        margin-bottom: 5px !important;
    }

    .product-info p, .product-meta {
        display: none !important; /* Hide descriptions & badges to save space */
    }

    .selection-controls {
        padding: 4px 2px !important;
        gap: 5px !important;
    }

    .unified-type-qty {
        padding: 3px !important;
        gap: 3px !important;
    }

    .type-label {
        font-size: 0.52rem !important;
    }

    .price-hint {
        font-size: 0.48rem !important;
    }

    .qty-btn {
        width: 18px !important;
        height: 18px !important;
        font-size: 0.6rem !important;
        padding: 0 !important;
    }

    .qty-input {
        width: 16px !important;
        font-size: 0.7rem !important;
    }

    .add-cart-btn {
        font-size: 0.58rem !important;
        padding: 6px 2px !important;
        letter-spacing: 0 !important;
        width: 100% !important;
    }
}

