/* ============================================
   Gameetaime - Responsive Stylesheet
   استایل ریسپانسیو کامل (Mobile-First)
============================================ */

/* ===== Desktop Large (1440px+) ===== */
@media (min-width: 1440px) {
    .gmb-container { max-width: 1400px; }
    .gmb-products-grid,
    .woocommerce ul.products,
    .woocommerce-page ul.products {
        grid-template-columns: repeat(5, 1fr);
    }
    .gmb-cat-latest-block .gmb-carousel-item {
        flex: 0 0 calc(20% - 13px);
        min-width: calc(20% - 13px);
        max-width: calc(20% - 13px);
    }
}

/* ===== Desktop (1024px - 1280px) ===== */
@media (max-width: 1280px) {
    .gmb-products-grid,
    .woocommerce ul.products,
    .woocommerce-page ul.products {
        grid-template-columns: repeat(4, 1fr);
    }
    .gmb-hero-title { font-size: 48px; }

    .gmb-cat-latest-block .gmb-carousel-item,
    #gmb-flash-carousel .gmb-carousel-item {
        flex: 0 0 calc(25% - 12px);
        min-width: calc(25% - 12px);
        max-width: calc(25% - 12px);
    }
}

/* ===== Tablet Landscape (max 1024px) ===== */
@media (max-width: 1024px) {
    /* Navigation → Hamburger */
    .gmb-nav { display: none; }
    .gmb-mobile-toggle { display: flex; }

    .gmb-nav.mobile-active {
        display: block;
        position: fixed;
        top: 0;
        right: -320px;
        width: 300px;
        max-width: 85vw;
        height: 100vh;
        background: var(--gmb-bg-panel);
        border-left: 1px solid var(--gmb-border);
        z-index: 1001;
        padding: 80px 20px 20px;
        overflow-y: auto;
        transition: right 0.3s ease;
    }

    .gmb-nav.mobile-active.open { right: 0; }

    .gmb-nav.mobile-active .gmb-nav-menu,
    .gmb-nav.mobile-active > div,
    .gmb-nav.mobile-active .menu {
        flex-direction: column;
        align-items: stretch;
        gap: 4px;
        text-align: right;
    }

    .gmb-nav.mobile-active .gmb-nav-menu > li > a,
    .gmb-nav.mobile-active .gmb-nav-item > a {
        padding: 14px 18px;
        border-radius: var(--gmb-radius-sm);
    }

    .gmb-nav.mobile-active .gmb-nav-menu > li .sub-menu,
    .gmb-nav.mobile-active .gmb-nav-item .sub-menu {
        position: static;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        background: var(--gmb-bg-card);
        margin-top: 4px;
        padding: 4px;
    }

    /* Products 3 columns */
    .gmb-products-grid,
    .woocommerce ul.products,
    .woocommerce-page ul.products {
        grid-template-columns: repeat(3, 1fr);
    }

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

    .gmb-hero { height: 420px; }
    .gmb-hero-title { font-size: 40px; }

    .gmb-wc-single-grid { grid-template-columns: 1fr; gap: 24px; }

    .gmb-search-wrap { max-width: 380px; }

    /* Carousels 3 items */
    .gmb-cat-latest-block .gmb-carousel-item,
    #gmb-flash-carousel .gmb-carousel-item {
        flex: 0 0 calc(33.333% - 11px);
        min-width: calc(33.333% - 11px);
        max-width: calc(33.333% - 11px);
    }

    .gmb-cat-banners-carousel .gmb-carousel-item {
        flex: 0 0 calc(50% - 8px);
        min-width: calc(50% - 8px);
        max-width: calc(50% - 8px);
    }
}

/* ===== Tablet Portrait (max 900px) ===== */
@media (max-width: 900px) {
    .gmb-content-grid {
        grid-template-columns: 1fr;
    }

    .gmb-sidebar { order: 2; }

    .gmb-cta h2 { font-size: 32px; }
    .gmb-cta p { font-size: 16px; }

    .gmb-hero-title { font-size: 36px; }

    .gmb-section { padding: 40px 0; }

    .gmb-cat-latest-block { padding: 22px; }
    .gmb-cat-latest-header {
        flex-direction: column;
        align-items: flex-start;
    }
    .gmb-cat-latest-title { font-size: 19px; }

    .woocommerce-account .woocommerce-MyAccount-navigation,
    .woocommerce-account .woocommerce-MyAccount-content {
        float: none;
        width: 100%;
        margin-bottom: 20px;
    }

    .gmb-404-code { font-size: 100px; }

    .gmb-flash-sale-title { font-size: 26px; }

    .gmb-flash-sale-section { padding: 40px 0; }
}

/* ===== Mobile Large (max 768px) ===== */
@media (max-width: 768px) {
    .gmb-container { padding: 0 16px; }

    /* Header restructure */
    .gmb-header-inner {
        flex-wrap: wrap;
        gap: 12px;
        padding: 12px 0;
    }

    .gmb-logo-wrap { order: 1; flex: 1; }
    .gmb-header-actions { order: 2; gap: 8px; }
    .gmb-search-wrap {
        order: 3;
        flex: 1 1 100%;
        max-width: 100%;
        margin-top: 4px;
    }

    .gmb-logo-text { font-size: 22px; }
    .gmb-header-action { width: 40px; height: 40px; }
    .gmb-cart-count { font-size: 10px; min-width: 18px; height: 18px; }

    /* Products 2 columns */
    .gmb-products-grid,
    .woocommerce ul.products,
    .woocommerce-page ul.products {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }

    .gmb-categories-grid { grid-template-columns: repeat(2, 1fr); }
    .gmb-why-grid { grid-template-columns: 1fr; }
    .gmb-footer-grid { grid-template-columns: 1fr 1fr; }
    .gmb-posts-grid { grid-template-columns: 1fr; }

    /* Hero */
    .gmb-hero { height: 340px; }
    .gmb-hero-title { font-size: 26px; margin-bottom: 14px; }
    .gmb-hero-subtitle { font-size: 12px; padding: 4px 12px; }
    .gmb-hero-btn { padding: 12px 24px; font-size: 14px; }
    .gmb-hero-controls { display: none; }
    .gmb-hero-content { max-width: 100%; padding: 0 8px; }

    .gmb-section { padding: 35px 0; }
    .gmb-section-title { font-size: 22px; margin-bottom: 20px; }
    .gmb-section-title::before { height: 24px; }

    /* Product cards mobile */
    .gmb-product-info,
    .gmb-wc-product-info { padding: 12px; }

    .gmb-product-title,
    .gmb-wc-product-title {
        font-size: 13px;
        margin-bottom: 6px;
        overflow: hidden;
        text-overflow: ellipsis;
        display: -webkit-box;
        -webkit-line-clamp: 2;
        -webkit-box-orient: vertical;
    }

    .gmb-product-price,
    .gmb-wc-product-price { font-size: 15px; margin-bottom: 10px; }

    .gmb-add-cart-ajax,
    .gmb-btn-view { padding: 8px 6px; font-size: 11px; gap: 4px; }
    .gmb-add-cart-ajax svg { width: 14px; height: 14px; }

    .gmb-sale-badge,
    .gmb-new-badge { font-size: 10px; padding: 3px 8px; top: 8px; }
    .gmb-sale-badge { right: 8px; }
    .gmb-new-badge { left: 8px; }

    .gmb-product-actions,
    .gmb-wc-quick-actions { bottom: 8px; right: 8px; }
    .gmb-quick-action,
    .gmb-wc-quick-btn { width: 34px; height: 34px; }
    .gmb-quick-action svg,
    .gmb-wc-quick-btn svg { width: 16px; height: 16px; }

    /* Carousels 2 items */
    .gmb-cat-latest-block .gmb-carousel-item,
    #gmb-flash-carousel .gmb-carousel-item {
        flex: 0 0 calc(50% - 8px);
        min-width: calc(50% - 8px);
        max-width: calc(50% - 8px);
    }

    .gmb-cat-banners-carousel .gmb-carousel-item {
        flex: 0 0 calc(50% - 8px);
        min-width: calc(50% - 8px);
        max-width: calc(50% - 8px);
    }

    .gmb-cat-banners-carousel,
    #gmb-flash-carousel.gmb-carousel { padding: 0 40px; }
    .gmb-flash-nav { width: 36px; height: 36px; }

    /* Category latest */
    .gmb-cat-latest-block { padding: 16px; margin-bottom: 20px; }
    .gmb-cat-latest-icon { font-size: 24px; width: 44px; height: 44px; }
    .gmb-cat-latest-icon svg { width: 22px; height: 22px; }
    .gmb-cat-latest-title { font-size: 16px; }
    .gmb-cat-latest-sub { font-size: 11px; }
    .gmb-cat-latest-count { font-size: 11px; padding: 6px 10px; }
    .gmb-cat-more-btn {
        min-width: 100%;
        padding: 12px 18px;
        font-size: 14px;
    }

    /* Flash sale */
    .gmb-flash-sale-section { padding: 30px 0; }
    .gmb-flash-sale-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 16px;
    }
    .gmb-flash-sale-title { font-size: 22px; }
    .gmb-flash-sale-icon svg { width: 26px; height: 26px; }
    .gmb-flash-sale-badge { font-size: 11px; padding: 5px 12px; }
    .gmb-countdown-num { font-size: 22px; }
    .gmb-countdown-label { font-size: 10px; }
    .gmb-countdown-box { min-width: 56px; padding: 6px 10px; }
    .gmb-countdown-sep { font-size: 22px; }

    /* CTA */
    .gmb-cta { padding: 50px 0; }
    .gmb-cta h2 { font-size: 26px; }
    .gmb-cta p { font-size: 14px; }

    /* Why us cards */
    .gmb-why-card { padding: 24px 18px; }
    .gmb-why-icon { width: 52px; height: 52px; }
    .gmb-why-icon svg { width: 36px; height: 36px; }
    .gmb-why-card h3 { font-size: 16px; }
    .gmb-why-card p { font-size: 13px; }

    /* Single product */
    .gmb-wc-single-product { padding: 16px; }
    .gmb-wc-single-summary .product_title { font-size: 22px; }
    .gmb-wc-single-summary .price { font-size: 24px !important; }
    .gmb-wc-thumbnails { grid-template-columns: repeat(3, 1fr); }

    /* Posts */
    .gmb-single-post { padding: 20px; }
    .gmb-single-thumb { margin: -20px -20px 20px; }
    .gmb-single-title { font-size: 24px; }
    .gmb-post-navigation,
    .nav-links { grid-template-columns: 1fr; }

    /* Footer */
    .gmb-footer-widgets { padding: 35px 0; }
    .gmb-features-bar { padding: 24px 0; }
    .gmb-features { grid-template-columns: 1fr; gap: 16px; }
    .gmb-feature { justify-content: center; text-align: center; flex-direction: column; }
    .gmb-feature-icon { margin: 0 auto; }
    .gmb-feature h4 { font-size: 14px; }
    .gmb-feature p { font-size: 11px; }

    .gmb-footer-grid { grid-template-columns: 1fr; gap: 24px; }
    .gmb-footer-logo { font-size: 20px; }
    .gmb-footer-about-text { font-size: 13px; }

    .gmb-copyright-inner {
        justify-content: center;
        text-align: center;
        flex-direction: column;
        gap: 8px;
        font-size: 12px;
    }

    /* Topbar */
    .gmb-topbar-content {
        justify-content: center;
        text-align: center;
    }
    .gmb-topbar-links { display: none; }
    .gmb-topbar-text { font-size: 11px; justify-content: center; }

    /* Toast & back-top */
    .gmb-toast {
        right: 12px;
        left: 12px;
        bottom: 12px;
        min-width: auto;
        font-size: 13px;
        padding: 14px 18px;
    }

    .gmb-back-top {
        width: 44px;
        height: 44px;
        bottom: 20px;
        left: 20px;
    }

    /* 404 */
    .gmb-404-code { font-size: 72px; }
    .gmb-404-title { font-size: 22px; }
    .gmb-404-text { font-size: 14px; }
    .gmb-404-actions { flex-direction: column; }
    .gmb-404-actions .gmb-btn { width: 100%; }

    /* Page title */
    .gmb-page-title,
    .woocommerce-products-header__title { font-size: 24px; }

    /* Search results */
    .gmb-search-results { max-height: 280px; }

    /* WooCommerce cart scroll */
    .woocommerce-cart-form { overflow-x: auto; }
    .woocommerce table.shop_table { min-width: 500px; }

    .woocommerce-checkout .col2-set .col-1,
    .woocommerce-checkout .col2-set .col-2 { width: 100%; }
}

/* ===== Mobile Medium (max 480px) ===== */
@media (max-width: 480px) {
    .gmb-container { padding: 0 12px; }

    /* Logo & header */
    .gmb-logo-text { font-size: 19px; gap: 6px; }
    .gmb-logo-icon svg,
    .gmb-logo-icon .gmb-icon-wrap { width: 22px; height: 22px; }
    .gmb-header-action { width: 38px; height: 38px; }
    .gmb-header-action svg,
    .gmb-cart-btn svg { width: 18px; height: 18px; }
    .gmb-mobile-toggle { width: 38px; height: 38px; }

    /* Products still 2 columns but tighter */
    .gmb-products-grid,
    .woocommerce ul.products,
    .woocommerce-page ul.products {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .gmb-product-image,
    .gmb-wc-product-image { aspect-ratio: 198 / 294; }

    .gmb-product-info,
    .gmb-wc-product-info { padding: 10px; }
    .gmb-product-title,
    .gmb-wc-product-title { font-size: 12px; -webkit-line-clamp: 2; }
    .gmb-product-price,
    .gmb-wc-product-price { font-size: 14px; }
    .gmb-add-cart-ajax { font-size: 10px; padding: 7px 4px; }
    .gmb-add-cart-ajax svg { width: 12px; height: 12px; }

    /* Hero smaller */
    .gmb-hero { height: 300px; }
    .gmb-hero-title { font-size: 22px; margin-bottom: 10px; }
    .gmb-hero-subtitle { font-size: 11px; }
    .gmb-hero-btn { padding: 10px 20px; font-size: 12px; }
    .gmb-hero-dots { display: none; }

    /* Section title */
    .gmb-section-title { font-size: 18px; }
    .gmb-section-title::before { height: 20px; width: 5px; }
    .gmb-section-title small { font-size: 12px; }
    .gmb-section { padding: 30px 0; }

    /* Categories */
    .gmb-categories-grid { grid-template-columns: 1fr; }

    /* Carousels 1 item on very small */
    .gmb-cat-latest-block .gmb-carousel-item,
    #gmb-flash-carousel .gmb-carousel-item,
    .gmb-cat-banners-carousel .gmb-carousel-item {
        flex: 0 0 calc(80% - 7px);
        min-width: calc(80% - 7px);
        max-width: calc(80% - 7px);
    }

    /* Category info */
    .gmb-category-info { padding: 14px; }
    .gmb-category-info h3 { font-size: 16px; }
    .gmb-category-icon-svg svg { width: 50px; height: 50px; }

    /* Single product */
    .gmb-wc-single-grid { gap: 16px; }
    .gmb-wc-single-summary form.cart {
        flex-direction: column;
        align-items: stretch;
    }
    .gmb-wc-single-summary button.single_add_to_cart-button { width: 100%; }

    .gmb-wc-single-summary .product_title { font-size: 20px; }
    .gmb-wc-single-summary .price { font-size: 20px !important; }
}

/* ===== Very Small (max 360px) ===== */
@media (max-width: 360px) {
    .gmb-logo-text { font-size: 17px; }
    .gmb-logo-icon svg,
    .gmb-logo-icon .gmb-icon-wrap { width: 20px; height: 20px; }
    .gmb-header-action { width: 34px; height: 34px; }
    .gmb-header-action svg,
    .gmb-cart-btn svg { width: 16px; height: 16px; }
    .gmb-mobile-toggle { width: 34px; height: 34px; }
    .gmb-mobile-toggle span { width: 16px; }

    .gmb-hero { height: 260px; }
    .gmb-hero-title { font-size: 18px; margin-bottom: 8px; }
    .gmb-hero-btn { padding: 8px 18px; font-size: 11px; }

    .gmb-products-grid,
    .woocommerce ul.products,
    .woocommerce-page ul.products { gap: 8px; }

    .gmb-product-info,
    .gmb-wc-product-info { padding: 8px; }
    .gmb-product-title,
    .gmb-wc-product-title { font-size: 11px; }
    .gmb-product-price,
    .gmb-wc-product-price { font-size: 13px; }

    .gmb-flash-nav { width: 32px; height: 32px; }
    .gmb-flash-nav svg { width: 16px; height: 16px; }
}

/* ===== Print ===== */
@media print {
    .gmb-header,
    .gmb-footer,
    .gmb-sidebar,
    .gmb-back-top,
    .gmb-hero,
    .gmb-mobile-toggle,
    .gmb-mobile-overlay { display: none !important; }

    body {
        background: #fff !important;
        color: #000 !important;
    }

    .gmb-container { max-width: 100%; }
}

/* ===== Reduced Motion (Accessibility) ===== */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
