/* Smartwatch Adaptation (324px - 480px) */

@media screen and (max-width: 480px) {

    /* Base Font & Spacing */
    body.is-watch {
        font-size: 14px;
        overflow-x: hidden;
    }

    /* Simplify Header */
    body.is-watch header {
        height: 60px !important;
        padding: 0 8px !important;
    }

    body.is-watch .logo-full {
        display: block !important;
        height: auto !important;
        max-height: 48px !important;
        width: auto !important;
        max-width: 160px !important;
        margin-top: 2px;
    }

    body.is-watch .logo-mini {
        display: none !important;
    }

    /* Hide background weapons and spacers on watches */
    body.is-watch .home-bg-weapon-left,
    body.is-watch .home-bg-weapon-left-lower,
    body.is-watch .home-bg-weapon-right,
    body.is-watch .weapon-overlay,
    body.is-watch .weapon-overlay-right,
    body.is-watch .bottom-spacer,
    body.is-watch .bottom-blur-gradient {
        display: none !important;
    }

    body.is-watch .nav-desktop,
    body.is-watch .social,
    body.is-watch .language-selector-btn,
    body.is-watch .balance-container,
    body.is-watch .profile-container {
        display: none !important;
    }

    /* Filters Hiding - EXTREME SPECIFICITY */
    body.is-watch .filters:not(.is-open),
    body.is-watch div.filters:not(.is-open),
    .is-watch .cases-section .filters:not(.is-open) {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
        position: absolute !important;
        left: -9999px !important;
        transform: scale(0) !important;
    }

    body.is-watch .filters.is-open {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        width: 100% !important;
        z-index: 10000 !important;
        background: rgba(26, 11, 46, 0.98) !important;
        backdrop-filter: blur(25px) !important;
        padding: 15px 10px 10px !important;
        /* Reduced bottom padding */
        margin: 0 !important;
        border-radius: 20px 20px 0 0 !important;
        border-top: 2px solid #7e22ce !important;
        border-bottom: none !important;
        box-shadow: 0 -20px 50px rgba(0, 0, 0, 0.9) !important;
        transform: none !important;
    }

    /* Dropdowns must open UPWARDS from the bottom panel */
    .is-watch .skin-type-dropdown,
    .is-watch .search-dropdown,
    .is-watch #skin-search-dropdown {
        top: auto !important;
        bottom: 100% !important;
        margin-bottom: 2px !important;
        margin-top: 0 !important;
        border-radius: 15px 15px 0 0 !important;
        border-top: 2px solid #7e22ce !important;
        border-bottom: none !important;
        max-height: 180px !important;
    }

    /* Flip trigger rounded corners when open */
    .is-watch .skin-type-selected.open,
    .is-watch .skin-name-input-wrap.open input {
        border-radius: 0 0 15px 15px !important;
        border-bottom-color: rgba(147, 51, 234, 0.4) !important;
        border-top-color: transparent !important;
    }

    /* Toggle Button - Lower position */
    .watch-search-toggle {
        display: none;
        position: fixed;
        bottom: 25px;
        /* Lower position */
        right: 15px;
        width: 50px;
        height: 50px;
        border-radius: 50%;
        background: #7e22ce;
        color: white;
        z-index: 20000 !important;
        box-shadow: 0 4px 20px rgba(126, 34, 206, 0.6);
        align-items: center;
        justify-content: center;
        font-size: 26px;
        border: 2px solid white;
        cursor: pointer;
        animation: watchPulse 2s infinite;
        pointer-events: auto !important;
    }

    @keyframes watchPulse {
        0% {
            box-shadow: 0 0 0 0 rgba(126, 34, 206, 0.6);
        }

        70% {
            box-shadow: 0 0 0 15px rgba(126, 34, 206, 0);
        }

        100% {
            box-shadow: 0 0 0 0 rgba(126, 34, 206, 0);
        }
    }

    .is-watch .watch-search-toggle {
        display: flex !important;
    }

    /* Hide standard mobile search bar when in watch mode */
    .is-watch #mobile-search-bar {
        display: none !important;
    }

    /* Grid: 2 columns "Cube" style again as requested */
    .is-watch .cases-grid,
    .is-watch .featured-cases-grid,
    .is-watch .classic-cases-grid,
    .is-watch .beginners-cases-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
        padding: 8px !important;
    }

    .is-watch .case-card {
        aspect-ratio: 1/1 !important;
        height: auto !important;
        border-radius: 12px !important;
        padding: 5px !important;
    }

    .is-watch .case-card-title {
        font-size: 10px !important;
        margin-top: 5px !important;
        white-space: nowrap !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        width: 100% !important;
        text-align: center !important;
    }

    .is-watch .case-price {
        font-size: 11px !important;
        margin-top: 2px !important;
        text-align: center !important;
    }

    .is-watch .case-card .case-content {
        display: flex !important;
        flex-direction: column !important;
        align-items: center !important;
        justify-content: center !important;
        height: 100% !important;
        width: 100% !important;
        padding: 5px !important;
    }

    .is-watch .case-card .case-image {
        width: 80% !important;
        height: auto !important;
        aspect-ratio: 1/1 !important;
        margin: 0 auto !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* HIGH SPECIFICITY Scaling for Watch Mode ( مرکزی ) */
    /* Ensure no clipping for zoomed images */
    body.is-watch .cases-grid,
    body.is-watch .featured-cases-grid,
    body.is-watch .classic-cases-grid,
    body.is-watch .beginners-cases-grid,
    body.is-watch .case-card,
    body.is-watch .case-card .case-content,
    body.is-watch .case-card .case-image {
        overflow: visible !important;
        clip: auto !important;
        clip-path: none !important;
    }

    /* Ordinary/Featured/Beginner Cases - 1.4x Scale (Reduced from 1.7x) */
    body.is-watch .featured-cases-grid .case-card .case-image img,
    body.is-watch .beginners-cases-grid .case-card .case-image img,
    body.is-watch .cases-grid .case-card .case-image img,
    body.is-watch .cases-grid .case-card[id^="case-card-user-"] .case-image img {
        transform: scale(1.4) !important;
        transform-origin: center center !important;
        margin-bottom: 15px !important;
        max-width: none !important;
        max-height: none !important;
        object-fit: contain !important;
        filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.4)) !important;
    }

    /* Classic Cases - 1.3x Scale (Reduced from 1.5x) */
    body.is-watch .classic-cases-grid .case-card .case-image img {
        transform: scale(1.3) translateY(2px) !important;
        transform-origin: center center !important;
        margin-bottom: 8px !important;
        max-width: none !important;
        max-height: none !important;
        object-fit: contain !important;
        filter: drop-shadow(0 4px 10px rgba(0, 0, 0, 0.4)) !important;
    }

    /* Title positioning - lowered from the "ceiling" */
    body.is-watch .case-card-title {
        margin-top: 2px !important;
        position: relative !important;
        z-index: 10 !important;
    }

    /* --- MOBILE MENU WATCH OPTIMIZATION --- */
    body.is-watch .mobile-menu-overlay {
        background: #2a0e41 !important;
        /* Solid Dark Purple Background for the whole screen */
        opacity: 0;
        visibility: hidden;
    }

    body.is-watch .mobile-menu-overlay.active {
        opacity: 1 !important;
        visibility: visible !important;
    }

    body.is-watch .mobile-menu-content {
        width: 100% !important;
        min-width: 100vw !important;
        max-width: 100vw !important;
        left: 0 !important;
        right: 0 !important;
        border-left: none !important;
        background: #2a0e41 !important;
        /* Solid Dark Purple */
        box-shadow: none !important;
    }

    body.is-watch .mobile-menu-header {
        padding: 12px 16px !important;
        justify-content: space-between !important;
        background: #2a0e41 !important;
        border-bottom: 1px solid rgba(168, 85, 247, 0.2) !important;
    }

    body.is-watch .mobile-menu-body {
        padding: 16px !important;
        gap: 18px !important;
        background: #2a0e41 !important;
    }

    /* Hide floating search button when menu is open */
    body.is-watch .mobile-menu-overlay.active~.watch-search-toggle {
        display: none !important;
    }

    body.is-watch .mobile-balance-block,
    body.is-watch .mobile-profile-link,
    body.is-watch .mobile-auth-link {
        padding: 10px !important;
        font-size: 0.95rem !important;
    }

    body.is-watch .mobile-user-controls {
        gap: 8px !important;
    }

    body.is-watch .mobile-social-section h3 {
        font-size: 1rem !important;
        margin-bottom: 12px !important;
    }

    body.is-watch .mobile-social-link {
        padding: 8px 12px !important;
        font-size: 0.9rem !important;
    }

    /* Simplify Hero */
    .is-watch .hero-banner {
        padding: 0 10px !important;
        margin-top: 10px !important;
    }

    .is-watch .banner-content {
        flex-direction: column !important;
        gap: 12px !important;
    }

    .is-watch .hero-left-col {
        display: flex !important;
        min-width: 0 !important;
        max-width: 100% !important;
        gap: 8px !important;
    }

    .is-watch .hero-right-col {
        display: none !important;
    }

    .is-watch .lorem-block,
    .is-watch .invite-friends-bonus {
        min-height: 0 !important;
        padding: 10px 14px !important;
        border-radius: 12px !important;
        background: linear-gradient(to right, rgba(38, 35, 78, 0.9), rgba(23, 19, 61, 0.9)) !important;
    }

    .is-watch .lorem-block h3,
    .is-watch .invite-friends-bonus h3 {
        font-size: 0.9rem !important;
        margin-bottom: 2px !important;
    }

    .is-watch .lorem-block p,
    .is-watch .invite-friends-bonus p,
    .is-watch .invite-friends-bonus ol,
    .is-watch .invite-friends-bonus .invite-note,
    .is-watch #bonus-card-img,
    .is-watch #invite-card-img {
        display: none !important;
    }

    .is-watch #bonus-balance-text,
    .is-watch #invite-link-text {
        font-size: 1rem !important;
        margin-top: 2px !important;
        display: block !important;
    }

    /* Compact horizontal strips for bonus/invite blocks */
    .is-watch #bonus-block,
    .is-watch #invite-block {
        height: auto !important;
        min-height: 0 !important;
        padding: 8px 12px !important;
        /* Assuming background and border glow are handled by .lorem-block / .invite-friends-bonus or inherited */
    }

    .is-watch #bonus-block #bonus-card-img,
    .is-watch #invite-block #invite-card-img,
    .is-watch #bonus-block p,
    .is-watch #invite-block p,
    .is-watch #invite-block ol,
    .is-watch #invite-block .invite-note {
        display: none !important;
    }

    .is-watch .hero-center-mobile {
        height: 160px !important;
        order: -1;
        /* Slider stays on top */
    }
}