/* digital-store-mobile.css */
/* Mobile responsive styles for all breakpoints */

/* Tablet Landscape and below (1200px) */
@media (max-width: 1200px) {
    :root {
        --desktop-padding: 4%;
    }

    /* Product Modal adjustments */
    .modal-body {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .product-gallery {
        position: relative;
        max-width: 600px;
        margin: 0 auto;
    }

    /* Filters adjustments */
    .filters-container {
        flex-direction: column;
        gap: 15px;
    }

    .filter-group {
        width: 100%;
        justify-content: flex-start;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 5px;
    }

    .filter-group::-webkit-scrollbar {
        display: none;
    }

    .price-range-container {
        width: 100%;
        justify-content: center;
    }

    /* Navigation adjustments */
    .nav-links {
        padding: 0 30px;
    }

    /* Footer grid adjustment */
    .footer-content {
        grid-template-columns: repeat(2, 1fr);
    }
}

/* Tablet Portrait and below (968px) */
@media (max-width: 968px) {
    :root {
        --mobile-padding: 20px;
        --nav-height: 60px;
        --nav-height-scrolled: 50px;
    }

    /* Navigation mobile menu */
    nav {
        padding: 10px var(--mobile-padding);
    }

    .logo {
        font-size: 24px;
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 100%;
        height: 100vh;
        background: var(--bg-light);
        flex-direction: column;
        justify-content: center;
        gap: 20px;
        transition: right 0.5s cubic-bezier(0.68, -0.55, 0.265, 1.55);
        backdrop-filter: blur(20px);
        -webkit-backdrop-filter: blur(20px);
        padding: 0;
    }

    body.dark-mode .nav-links {
        background: var(--bg-dark);
    }

    .nav-links.active {
        right: 0;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    /* Sidebars full width on mobile */
    .cart-sidebar,
    .favorites-sidebar {
        width: 100%;
        right: -100%;
    }

    .cart-sidebar.active,
    .favorites-sidebar.active {
        right: 0;
    }

    /* Game board smaller */
    .game-board {
        max-width: 280px;
        gap: 12px;
        padding: 20px;
    }

    /* Products grid adjustment */
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }

    /* Hero section */
    .store-hero {
        padding: calc(var(--nav-height) + 30px) var(--mobile-padding) 30px;
    }

    .hero-title {
        font-size: 2rem;
    }

    .hero-subtitle {
        font-size: 1rem;
    }

    /* Filters section mobile */
    .filters-section {
        padding: 20px var(--mobile-padding);
    }

    .filters-section.compact {
        padding: 10px var(--mobile-padding);
    }

    .filter-group {
        justify-content: center;
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        gap: 10px;
    }

    .sort-button,
    .category-button {
        padding: 8px 16px;
        font-size: 13px;
    }

    /* Price range mobile */
    .price-range-wrapper {
        flex-direction: column;
        gap: 15px;
        padding: 15px 20px;
    }

    .price-inputs {
        order: 2;
    }

    .price-slider-container {
        order: 1;
        width: 100%;
    }

    /* Sections padding */
    .products-section {
        padding: 40px var(--mobile-padding);
    }

    .free-product-section,
    .game-section,
    .random-products-section {
        padding: 60px var(--mobile-padding);
    }

    .game-section {
        margin: 0 var(--mobile-padding) 60px;
    }

    .telegram-promo {
        padding: 50px var(--mobile-padding);
    }

    .telegram-content {
        padding: 40px 30px;
    }

    footer {
        padding: 60px var(--mobile-padding) 30px;
    }

    /* Modal adjustments */
    .file-types-grid {
        grid-template-columns: 1fr;
    }

    .meta-row {
        flex-direction: column;
        gap: 15px;
    }

    .modal-body {
        padding: 30px 20px;
    }

    .modal-close {
        width: 35px;
        height: 35px;
        top: 15px;
        right: 15px;
    }

    .purchase-section {
        flex-direction: column;
        gap: 15px;
        padding: 20px;
    }

    .quantity-selector {
        width: 100%;
        justify-content: center;
    }

    .btn-purchase {
        width: 100%;
    }

    .related-products {
        padding: 40px 20px;
    }

    /* Checkout adjustments */
    .checkout-content {
        padding: 30px 20px;
    }

    /* Floating buttons */
    .cart-button,
    .favorites-button {
        width: 50px;
        height: 50px;
        font-size: 18px;
    }

    .cart-button {
        bottom: 20px;
        right: 20px;
    }

    .favorites-button {
        bottom: 20px;
        right: 80px;
    }

    /* Notification */
    .notification {
        max-width: calc(100% - 40px);
        right: -100%;
    }

    .notification.show {
        right: 20px;
    }

    /* Free product section */
    .free-product-title {
        font-size: 2rem;
    }

    .free-timer {
        padding: 15px 25px;
        gap: 15px;
        flex-wrap: wrap;
    }

    /* Modal content padding fix */
    .modal-content {
        padding-bottom: 100px;
    }
}

/* Mobile Landscape and below (768px) */
@media (max-width: 768px) {
    /* Products grid single column option */
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    }

    /* Currency modal */
    .currency-modal-content {
        padding: 30px 20px;
    }

    .currency-modal h2 {
        font-size: 1.5rem;
    }

    /* Timer adjustments */
    .free-timer {
        gap: 15px;
        padding: 15px 25px;
    }

    .timer-value {
        font-size: 1.5rem;
    }

    .timer-label {
        font-size: 0.7rem;
    }

    /* Game section */
    .game-title {
        font-size: 1.5rem;
    }

    .game-description {
        font-size: 1rem;
    }

    /* Random products */
    .random-products-title {
        font-size: 1.5rem;
    }

    /* Telegram section */
    .telegram-icon {
        font-size: 2.5rem;
    }

    .telegram-title {
        font-size: 1.5rem;
    }

    /* Product modal mobile */
    .modal-product-title {
        font-size: 1.8rem;
    }

    .modal-product-price {
        font-size: 2rem;
    }

    .main-product-image {
        height: 250px;
    }

    .thumbnail img {
        height: 60px;
    }

    /* Cart and favorites headers */
    .cart-header,
    .favorites-header {
        padding: 20px;
    }

    .cart-items,
    .favorites-items {
        padding: 20px;
    }

    .cart-footer {
        padding: 20px;
    }

    .cart-item,
    .favorite-item {
        padding: 12px;
    }

    .cart-item-image,
    .favorite-item-image {
        width: 60px;
        height: 60px;
    }

    /* Footer mobile */
    .footer-content {
        grid-template-columns: 1fr;
        text-align: center;
        gap: 40px;
    }

    .social-links {
        justify-content: center;
    }

    /* Notification mobile */
    .notification {
        padding: 15px 20px;
    }

    .notification-icon {
        width: 35px;
        height: 35px;
        font-size: 16px;
    }

    /* Checkout mobile */
    .checkout-title {
        font-size: 1.6rem;
    }

    .order-summary {
        padding: 20px;
    }

    /* Pagination mobile */
    .pagination {
        gap: 5px;
    }

    .pagination-btn {
        padding: 8px 15px;
        font-size: 14px;
    }

    .page-info {
        padding: 0 10px;
        font-size: 14px;
    }

    /* Search container */
    .search-container {
        margin-bottom: 30px;
    }

    /* Centered filters on tablet */
    .filter-group {
        justify-content: center;
    }

    .sort-dropdown,
    .category-dropdown {
        margin: 0 auto;
    }
}

/* Mobile Portrait (480px and below) */
@media (max-width: 480px) {
    :root {
        --mobile-padding: 15px;
    }

    /* Single column products */
    .products-grid {
        grid-template-columns: 1fr;
    }

    /* Product card mobile */
    .product-card {
        border-radius: 15px;
    }

    .product-info {
        padding: 15px;
    }

    .product-title {
        font-size: 1rem;
    }

    .product-price {
        font-size: 1.2rem;
    }

    .add-to-cart {
        width: 35px;
        height: 35px;
    }

    /* Compact filters mobile */
    .filters-section.compact .sort-button,
    .filters-section.compact .category-button {
        padding: 6px 12px;
        font-size: 12px;
    }

    .category-menu,
    .sort-menu {
        min-width: 200px;
        max-height: 300px;
    }

    /* Price range mobile */
    .price-slider-container {
        width: 150px;
    }

    .price-display {
        font-size: 12px;
    }

    .price-input {
        width: 60px;
        font-size: 13px;
    }

    .price-range-label {
        font-size: 13px;
    }

    /* Hero mobile */
    .hero-title {
        font-size: 1.8rem;
        letter-spacing: -0.5px;
    }

    .hero-subtitle {
        font-size: 0.95rem;
    }

    /* Search mobile */
    .search-bar {
        padding: 12px 45px 12px 15px;
        font-size: 14px;
    }

    .search-button {
        width: 35px;
        height: 35px;
        right: 3px;
    }

    /* Free timer mobile */
    .free-timer {
        gap: 10px;
        padding: 12px 20px;
    }

    .timer-value {
        font-size: 1.2rem;
    }

    /* Game stats mobile */
    .game-stats {
        gap: 20px;
    }

    .stat-value {
        font-size: 1.5rem;
    }

    /* Cart/Favorites titles */
    .cart-title,
    .favorites-title {
        font-size: 1.1rem;
    }

    .total-value {
        font-size: 1.5rem;
    }

    /* Carousel mobile */
    .carousel-product {
        min-width: 220px;
    }

    /* Game board mobile */
    .game-board {
        padding: 15px;
        gap: 10px;
    }

    .game-card {
        font-size: 1.5rem;
    }

    .card-front {
        font-size: 1.5rem;
    }

    .card-back {
        font-size: 1.3rem;
    }

    /* Currency modal mobile */
    .currency-modal-content {
        padding: 25px 15px;
    }

    .currency-input {
        padding: 12px;
        font-size: 14px;
    }

    .location-btn {
        padding: 12px;
        font-size: 14px;
    }

    /* Form inputs mobile */
    .form-input {
        padding: 12px 15px;
        font-size: 14px;
    }

    .complete-order-btn {
        padding: 16px;
        font-size: 14px;
    }

    /* Modal content mobile */
    .modal-content {
        border-radius: 20px;
    }

    .modal-body {
        padding: 20px 15px;
    }

    .related-products {
        padding: 30px 15px;
    }

    .related-title {
        font-size: 1.5rem;
    }

    /* Features mobile */
    .product-features {
        font-size: 0.9rem;
    }

    .features-list li {
        padding: 10px 0;
        padding-left: 30px;
        font-size: 0.9rem;
    }

    .file-type-item {
        padding: 12px;
    }

    /* Meta icons mobile */
    .meta-icon {
        font-size: 1.5rem;
    }

    .meta-value {
        font-size: 1rem;
    }

    .meta-label {
        font-size: 0.8rem;
    }

    /* Purchase section mobile */
    .purchase-section {
        padding: 15px;
        border-radius: 20px;
    }

    .btn-purchase {
        padding: 12px 20px;
        font-size: 14px;
    }

    /* Success animation mobile */
    .success-circle {
        width: 120px;
        height: 120px;
    }

    .success-icon {
        font-size: 3rem;
    }

    .btn-favorite-modal {
        width: 45px;
        height: 45px;
        font-size: 18px;
    }

    /* Pagination mobile */
    .pagination-btn {
        padding: 6px 12px;
        font-size: 12px;
    }

    .page-info {
        font-size: 12px;
    }

    /* Floating buttons mobile */
    .cart-button,
    .favorites-button {
        width: 45px;
        height: 45px;
        font-size: 16px;
    }

    .cart-button {
        bottom: 15px;
        right: 15px;
    }

    .favorites-button {
        bottom: 15px;
        right: 70px;
    }

    /* Sections padding mobile */
    .free-product-section,
    .game-section,
    .random-products-section {
        padding: 40px var(--mobile-padding);
    }

    .game-section {
        margin: 0 var(--mobile-padding) 40px;
        border-radius: 20px;
    }

    /* Telegram content mobile */
    .telegram-content {
        padding: 30px 20px;
        border-radius: 20px;
    }

    .telegram-icon {
        font-size: 2rem;
    }

    .telegram-title {
        font-size: 1.3rem;
    }

    .telegram-content p {
        font-size: 0.95rem;
    }

    .telegram-link {
        padding: 12px 25px;
        font-size: 14px;
    }

    /* Free product mobile */
    .free-product-title {
        font-size: 1.5rem;
    }

    #freeProductDisplay .product-card {
        max-width: 100%;
    }

    /* Game title mobile */
    .game-title {
        font-size: 1.3rem;
    }

    .game-description {
        font-size: 0.9rem;
    }

    .game-start-btn {
        padding: 12px 30px;
        font-size: 14px;
    }

    /* Discount code mobile */
    .discount-code {
        font-size: 1.4rem;
    }

    .copy-code-btn {
        padding: 8px 12px;
        font-size: 14px;
    }

    #continueCode {
        padding: 10px 25px;
        font-size: 14px;
    }

    /* Random products mobile */
    .random-products-title {
        font-size: 1.3rem;
    }

    /* Footer mobile */
    footer {
        padding: 40px var(--mobile-padding) 30px;
    }

    .footer-section h3 {
        font-size: 1.2rem;
    }

    .footer-section p,
    .footer-link {
        font-size: 0.9rem;
    }

    .social-link {
        width: 40px;
        height: 40px;
    }

    /* Nav links mobile */
    .nav-link {
        font-size: 16px;
        padding: 10px 0;
    }

    /* Logo mobile */
    .logo {
        font-size: 20px;
    }
}

/* Small Mobile (360px and below) */
@media (max-width: 360px) {
    /* Ultra small screen adjustments */
    .hero-title {
        font-size: 1.5rem;
    }

    .product-card {
        min-height: auto;
    }

    .filters-section {
        padding: 15px 10px;
    }

    .sort-button,
    .category-button {
        padding: 6px 10px;
        font-size: 11px;
    }

    .pagination-btn {
        padding: 5px 10px;
        font-size: 11px;
    }

    .cart-button {
        width: 40px;
        height: 40px;
        font-size: 14px;
    }

    .favorites-button {
        width: 40px;
        height: 40px;
        font-size: 14px;
        right: 60px;
    }
}

/* iPad Pro and similar large tablets */
@media (min-width: 769px) and (max-width: 1024px) {
    /* Navigation centering fix */
    .nav-links {
        justify-content: center;
        padding: 0 20px;
    }

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

    /* Modal adjustments */
    .modal-body {
        grid-template-columns: 1fr 1fr;
        gap: 40px;
    }

    /* Centered filter group */
    .filter-group {
        justify-content: center;
    }
}

/* Landscape orientation fixes */
@media (max-height: 600px) and (orientation: landscape) {
    /* Reduce vertical spacing */
    .store-hero {
        padding-top: calc(var(--nav-height) + 20px);
        padding-bottom: 20px;
    }

    .hero-title {
        font-size: 1.8rem;
        margin-bottom: 10px;
    }

    .hero-subtitle {
        margin-bottom: 20px;
    }

    /* Compact modals */
    .modal-content {
        max-height: 85vh;
    }

    .checkout-content {
        padding: 25px 20px;
    }

    /* Smaller game board */
    .game-board {
        max-width: 250px;
        padding: 15px;
        gap: 10px;
    }
}

/* High resolution screens */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* Sharper images and icons */
    .product-image,
    .cart-item-image,
    .favorite-item-image {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Print styles */
@media print {
    /* Hide unnecessary elements */
    nav,
    .filters-section,
    .cart-button,
    .favorites-button,
    .pagination,
    .game-section,
    .telegram-promo,
    .scroll-progress,
    .particles,
    .cursor,
    .cursor-dot,
    .mobile-menu-toggle,
    .theme-toggle {
        display: none !important;
    }

    /* Adjust layout for print */
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .product-card {
        break-inside: avoid;
        page-break-inside: avoid;
    }

    /* Reset colors for print */
    body {
        background: white !important;
        color: black !important;
    }

    .product-title,
    .modal-product-title {
        color: black !important;
    }
}

/* Accessibility - Forced colors mode */
@media (prefers-contrast: high) {
    .btn,
    .sort-button,
    .category-button,
    .product-card,
    .cart-button,
    .favorites-button {
        border: 2px solid currentColor !important;
    }

    .notification {
        border: 2px solid currentColor;
    }
}

/* Fix for iOS Safari bottom bar */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .cart-button {
        bottom: calc(25px + env(safe-area-inset-bottom));
    }

    .favorites-button {
        bottom: calc(25px + env(safe-area-inset-bottom));
    }

    .purchase-section {
        padding-bottom: calc(25px + env(safe-area-inset-bottom));
    }
}

/* Touch device optimizations */
@media (hover: none) and (pointer: coarse) {
    /* Larger touch targets */
    .nav-link,
    .sort-item,
    .category-item {
        padding: 12px 20px;
    }

    .quantity-btn {
        width: 40px;
        height: 40px;
    }

    /* Remove hover effects on touch */
    .product-card:hover {
        transform: none;
    }

    .product-card:active {
        transform: scale(0.98);
    }

    /* Disable file type icons on hover for mobile */
    .file-type-icons {
        display: none !important;
    }
}