/**
 * Tablet layout — 769px to 1024px (iPad portrait/landscape, small laptops)
 * Desktop (>1024) and mobile (<=768) keep their own rules.
 */

@media (min-width: 769px) and (max-width: 1024px) {
    /* ── Header container (footer.css global .container override fix) ── */
    .header .container {
        padding: 0 15px;
        max-width: 100%;
        box-sizing: border-box;
    }

    .header-top {
        flex-wrap: nowrap;
        gap: 10px;
        padding: 8px 0;
    }

    .logo {
        width: auto;
        min-width: 0;
        max-width: 115px;
        flex-shrink: 0;
    }

    .logo img,
    .logo .site-logo {
        max-width: 110px !important;
        max-height: 40px !important;
    }

    .search-form {
        flex: 1 1 auto;
        min-width: 0;
        max-width: none;
        margin-left: 8px;
        margin-right: 8px;
    }

    .search-form input {
        padding: 10px 40px 10px 12px;
        min-height: 40px;
        font-size: 13px;
    }

    .phone-info {
        flex-shrink: 0;
        gap: 8px;
    }

    .phone-icon {
        width: 36px;
        height: 36px;
        font-size: 14px;
    }

    .phone-label {
        display: none;
    }

    .phone-number {
        font-size: 13px;
        white-space: nowrap;
    }

    .user-actions {
        gap: 8px;
        flex-shrink: 0;
    }

    .mobile-menu-toggle,
    .mobile-search-btn {
        display: none !important;
    }

    /* ── Header bottom nav ── */
    .header-bottom {
        overflow: hidden;
    }

    .header-bottom::before {
        left: 0;
        transform: none;
        width: 100%;
    }

    .nav-container {
        justify-content: flex-start;
        max-width: 100%;
        overflow: hidden;
    }

    .horizontal-menu {
        justify-content: flex-start;
        overflow-x: auto;
        overflow-y: hidden;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        width: 100%;
        height: 44px;
        flex-wrap: nowrap;
    }

    .horizontal-menu::-webkit-scrollbar {
        display: none;
    }

    .menu-item {
        flex-shrink: 0;
    }

    .menu-item > a,
    .menu-link {
        padding: 0 11px;
        font-size: 13px;
        white-space: nowrap;
    }

    /* ── Product grids (3 columns) ── */
    .product-grid,
    .home-container .product-grid,
    .featured-section .product-grid,
    .latest-section .product-grid,
    .category-content .product-grid,
    .category-container .product-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 18px;
        min-height: 280px;
    }

    .product-card {
        min-height: 300px;
    }

    /* ── Promo banner grid ── */
    .banner-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 12px;
    }

    .banner-item {
        min-height: 100px;
    }

    /* ── Category subcategories ── */
    .subcategory-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }

    .category-header h1 {
        font-size: 26px;
    }

    /* ── Section spacing ── */
    .featured-section,
    .latest-section {
        padding: 24px 15px;
    }

    .section-header h2 {
        font-size: 1.6rem;
    }

    .section-header h3 {
        font-size: 1.5rem;
    }

    /* Keep desktop featured sidebar on tablet */
    .desktop-only {
        display: block !important;
    }

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

    /* ── Product detail page ── */
    .modern-product-detail {
        gap: 28px;
    }

    .modern-gallery {
        top: 90px;
    }

    .modern-product-title {
        font-size: 26px;
    }

    .modern-price {
        font-size: 30px;
    }

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

    .reviews-container {
        grid-template-columns: 1fr 1fr;
        gap: 24px;
    }

    /* ── Cart & checkout (side-by-side on tablet) ── */
    .cart-content {
        grid-template-columns: 1fr 300px;
        gap: 24px;
    }

    .checkout-content {
        grid-template-columns: 1fr 320px;
        gap: 24px;
    }

    .contact-content {
        grid-template-columns: 1fr 1fr;
        gap: 24px;
    }

    .order-success-content {
        grid-template-columns: 1fr 340px;
        gap: 24px;
    }

    /* ── Cart modal ── */
    .cart-modal {
        max-width: 520px;
    }

    /* ── Floating actions (no mobile cart bar on tablet) ── */
    .mobile-cart-bar {
        display: none !important;
    }

    .floating-action-stack {
        bottom: 24px;
        right: 24px;
    }

    body.has-mobile-cart .floating-action-stack {
        bottom: 24px;
    }

    body.has-mobile-cart {
        padding-bottom: 0 !important;
    }

    .footer-bottom {
        margin-bottom: 0;
    }
}
