/* assets/css/style.css */
/* ============================================================
   TIMEPIECE WEBAPP — Light / Dark Mode Ready
   ============================================================ */

/* ---------- 1. CSS VARIABLES (Light default) ---------- */
:root {
    --bg-color: #f8f9fa;
    --text-color: #212529;
    --primary-color: #111111;
    --secondary-color: #6c757d;
    --border-color: #e9ecef;
    --card-bg: #ffffff;
    --input-bg: #f8f9fa;
    --shadow-color: rgba(0, 0, 0, 0.06);
    --shadow-strong: rgba(0, 0, 0, 0.12);
    --danger: #ff3b30;
    --success: #2ecc71;
    --warning: #f39c12;
    --overlay-bg: rgba(0, 0, 0, 0.45);
    --toast-bg: #ffffff;
    --reels-bg: #000000;
    --btn-primary-bg: #111111;
    --btn-primary-text: #ffffff;
}

[data-theme="dark"] {
    --bg-color: #0f0f0f;
    --text-color: #f1f1f1;
    --primary-color: #ffffff;
    --secondary-color: #a0a0a0;
    --border-color: #2a2a2a;
    --card-bg: #1a1a1a;
    --input-bg: #242424;
    --shadow-color: rgba(0, 0, 0, 0.35);
    --shadow-strong: rgba(0, 0, 0, 0.55);
    --danger: #ff453a;
    --success: #30d158;
    --warning: #ffd60a;
    --overlay-bg: rgba(0, 0, 0, 0.7);
    --toast-bg: #2c2c2e;
    --reels-bg: #000000;
    --btn-primary-bg: #ffffff;
    --btn-primary-text: #111111;
}

/* Optional: respect system preference when no manual choice */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg-color: #0f0f0f;
        --text-color: #f1f1f1;
        --primary-color: #ffffff;
        --secondary-color: #a0a0a0;
        --border-color: #2a2a2a;
        --card-bg: #1a1a1a;
        --input-bg: #242424;
        --shadow-color: rgba(0, 0, 0, 0.35);
        --shadow-strong: rgba(0, 0, 0, 0.55);
        --danger: #ff453a;
        --success: #30d158;
        --warning: #ffd60a;
        --overlay-bg: rgba(0, 0, 0, 0.7);
        --toast-bg: #2c2c2e;
    }
}

/* ---------- 3. BASE RESET ---------- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    -webkit-tap-highlight-color: transparent;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    overflow: hidden;
    transition: background-color 0.25s ease, color 0.25s ease;
}

/* ---------- 4. HEADER ---------- */
.app-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 60px;
    background-color: var(--card-bg);
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    box-shadow: 0 1px 3px var(--shadow-color);
    z-index: 100;
    transition: background-color 0.25s ease;
}

.app-header .logo {
    font-weight: 800;
    font-size: 20px;
    letter-spacing: 1px;
    color: var(--text-color);
}

.icon-btn {
    background: none;
    border: none;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    color: var(--text-color);
}

/* Theme Toggle Button */
.theme-toggle {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    transition: all 0.2s ease;
    color: var(--text-color);
    flex-shrink: 0;
}

.theme-toggle:active {
    transform: scale(0.92);
}

/* Barcha ikonkalar boshida yashirin */
.theme-toggle .icon-sun,
.theme-toggle .icon-moon,
.theme-toggle .icon-auto {
    display: none;
    line-height: 1;
}

/* data-theme-mode bo'yicha ko'rsatish (JS o'rnatadi) */
[data-theme-mode="light"] .theme-toggle .icon-sun {
    display: block;
}

[data-theme-mode="dark"] .theme-toggle .icon-moon {
    display: block;
}

[data-theme-mode="auto"] .theme-toggle .icon-auto {
    display: block;
}

/* Fallback: agar data-theme-mode yo'q bo'lsa, eski mantiq */
:root:not([data-theme-mode]) [data-theme="light"] .theme-toggle .icon-sun,
:root:not([data-theme-mode]):not([data-theme="dark"]) .theme-toggle .icon-sun {
    display: block;
}

:root:not([data-theme-mode]) [data-theme="dark"] .theme-toggle .icon-moon {
    display: block;
}

/* ---------- 5. APP CONTENT ---------- */
#app-content {
    position: fixed;
    top: 60px;
    bottom: 75px;
    left: 0;
    right: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background-color: var(--bg-color);
    transition: background-color 0.25s ease;
}

/* Keyboard open */
body.keyboard-is-open #app-content {
    bottom: 0 !important;
}

body.keyboard-is-open .bottom-nav {
    display: none !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    box-shadow: none !important;
    background: transparent !important;
}

body.keyboard-is-open .bottom-nav::before,
body.keyboard-is-open .bottom-nav::after {
    display: none !important;
    content: none !important;
}

/* ---------- 6. TABS ---------- */
.tab-content {
    display: none;
    padding: 15px;
    animation: fadeIn 0.3s ease;
}

.tab-content.active {
    display: block;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(5px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ---------- 7. BOTTOM NAV ---------- */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 75px;
    padding-bottom: calc(15px + env(safe-area-inset-bottom));
    background-color: var(--card-bg);
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -1px 10px var(--shadow-color);
    z-index: 100;
    transition: all 0.2s ease, background-color 0.25s ease;
}

.bottom-nav.keyboard-open,
.bottom-nav.keyboard-open::before,
.bottom-nav.keyboard-open::after {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    height: 0 !important;
    min-height: 0 !important;
    max-height: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    border: none !important;
    pointer-events: none !important;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    color: var(--secondary-color);
    font-size: 11px;
    cursor: pointer;
    position: relative;
    width: 20%;
    transition: color 0.2s;
}

.nav-item i {
    font-size: 24px;
    margin-bottom: 3px;
    transition: all 0.2s;
}

.nav-item.active {
    color: var(--primary-color);
}

.nav-item.active i {
    transform: translateY(-2px);
}

.badge {
    position: absolute;
    top: -2px;
    right: 15px;
    background-color: var(--danger);
    color: white;
    font-size: 10px;
    font-weight: bold;
    padding: 2px 5px;
    border-radius: 10px;
    display: none;
}

/* ---------- 8. PRODUCT GRID & CARDS ---------- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 15px;
}

.product-card {
    background: var(--card-bg);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px var(--shadow-color);
    cursor: pointer;
    border: 1px solid var(--border-color);
    transition: background-color 0.25s ease, border-color 0.25s ease;
}

.product-card img {
    width: 100%;
    height: 160px;
    object-fit: cover;
    background: var(--input-bg);
}

.product-info {
    padding: 10px;
}

.product-title {
    font-size: 13px;
    margin-bottom: 5px;
    color: var(--secondary-color);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-price {
    font-weight: 700;
    font-size: 15px;
    color: var(--primary-color);
}

/* Like button on cards */
.card-like-btn {
    background: var(--card-bg) !important;
    border: 1px solid var(--border-color) !important;
}

/* ---------- 9. REELS ---------- */
#tab-reels {
    padding: 0 !important;
    position: absolute !important;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    background-color: var(--reels-bg);
    overflow: hidden;
}

.reels-container {
    padding: 0 !important;
    width: 100% !important;
    height: 100% !important;
    overflow-y: scroll;
    scroll-snap-type: y mandatory;
    background-color: var(--reels-bg);
}

.reel-item {
    height: 100% !important;
    width: 100% !important;
    scroll-snap-align: start;
    position: relative;
    overflow: hidden;
}

.reel-item .video-js {
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
}

.reel-item .vjs-tech {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
}

.reels-header {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    padding: 15px 10px;
    z-index: 101;
    background: linear-gradient(to bottom, rgba(0,0,0,0.6) 0%, rgba(0,0,0,0) 100%);
    pointer-events: none;
}

.reels-filter-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding-bottom: 5px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    pointer-events: auto;
}

.reels-filter-scroll::-webkit-scrollbar { display: none; }

.reels-chip {
    flex: 0 0 auto;
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 6px 16px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s;
}

.reels-chip.active {
    background: #fff;
    color: #000;
}

.play-indicator {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 70px;
    color: rgba(255, 255, 255, 0.85);
    z-index: 98;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    text-shadow: 0 2px 10px rgba(0,0,0,0.4);
}

.reel-item.is-paused .play-indicator {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.reel-item:not(.is-paused) .play-indicator {
    transform: translate(-50%, -50%) scale(1.2);
}

.reel-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 60px 15px 25px 15px;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0) 100%);
    z-index: 99;
    color: #ffffff;
    pointer-events: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.reel-overlay .reel-title {
    font-size: 15px;
    font-weight: 600;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-shadow: 0px 1px 3px rgba(0,0,0,0.8);
}

.reel-action-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.reel-overlay .reel-price {
    font-size: 19px;
    font-weight: 800;
    text-shadow: 0px 1px 3px rgba(0,0,0,0.8);
}

.reel-overlay .btn-order {
    background: #ffffff;
    color: #000000;
    padding: 10px 22px;
    border-radius: 25px;
    font-weight: 700;
    font-size: 13px;
    border: none;
    pointer-events: auto;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    transition: transform 0.1s;
}

.reel-overlay .btn-order:active {
    transform: scale(0.95);
}

.reel-click-zone {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 90;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
}

.reels-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100vh;
    background: linear-gradient(135deg, #2b2b2b 0%, #111111 100%);
    padding: 20px;
}

.reels-side-actions {
    position: absolute;
    right: 15px;
    bottom: 130px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 100;
    pointer-events: none;
}

.action-btn-wrapper {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.reel-action-btn {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    pointer-events: auto;
    transition: all 0.2s;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
}

.reel-action-btn:active {
    transform: scale(0.9);
}

.reel-action-btn.active {
    background: #ffffff;
    color: #000000;
}

.action-btn-wrapper .action-label {
    font-size: 11px;
    font-weight: 700;
    color: #fff;
    margin-top: 5px;
    text-shadow: 0 1px 3px rgba(0,0,0,0.9);
}

.reel-action-btn.liked {
    color: #ff3b30 !important;
}

.reel-action-btn.liked i {
    animation: heartBeat 0.3s ease-in-out;
}

@keyframes heartBeat {
    0% { transform: scale(1); }
    50% { transform: scale(1.3); }
    100% { transform: scale(1); }
}

/* ---------- 10. PRODUCT MODAL ---------- */
.product-modal,
#product-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: var(--bg-color);
    z-index: 1000;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    transition: transform 0.25s cubic-bezier(0.1, 0.9, 0.2, 1), opacity 0.25s ease, background-color 0.25s ease;
    transform: translateX(0);
}

.product-modal.active,
#product-modal.active {
    display: block;
    animation: slideInRight 0.3s forwards;
}

@keyframes slideInRight {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.product-details-body {
    height: 100%;
    padding-bottom: 110px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background-color: var(--bg-color);
}

.pd-carousel-wrapper {
    position: relative;
    width: 100%;
    background: var(--card-bg);
    aspect-ratio: 4/5;
}

.pd-carousel {
    display: flex;
    overflow-x: auto;
    overflow-y: hidden; /* Ichki vertikal skrollni yopamiz, lekin ota elementga o'tkazib beradi */
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    height: 100%;
    
    /* FAQAT SHU QOLADI (qochib ketishning oldini oladi) */
    overscroll-behavior-x: contain;
    -ms-overflow-style: none;
}

.pd-carousel::-webkit-scrollbar { 
    display: none; 
}

.pd-slide {
    flex: 0 0 100%;
    scroll-snap-align: center;
    position: relative;
    /* touch-action olib tashlandi */
}

.pd-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pd-dots {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 10;
}

.pd-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    transition: all 0.3s;
}

.pd-dot.active {
    background: #ffffff;
    width: 20px;
    border-radius: 4px;
}

.pd-video-icon {
    position: absolute;
    bottom: 15px;
    right: 15px;
    width: 45px;
    height: 45px;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 24px;
    z-index: 10;
    cursor: pointer;
    border: 1px solid rgba(255,255,255,0.3);
}

.pd-info-box {
    padding: 20px 15px;
    background: var(--card-bg);
    margin-bottom: 10px;
    border-radius: 0 0 20px 20px;
    box-shadow: 0 4px 10px var(--shadow-color);
    transition: background-color 0.25s ease;
}

.pd-info-box .pd-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 10px;
    line-height: 1.3;
    color: var(--text-color);
}

.pd-info-box .pd-price {
    font-size: 22px;
    font-weight: 800;
    color: var(--primary-color);
    margin-bottom: 15px;
}

.pd-info-box .pd-desc {
    font-size: 14px;
    color: var(--secondary-color);
    line-height: 1.5;
}

/* Footer */
.pd-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 12px 15px max(15px, env(safe-area-inset-bottom));
    background: var(--card-bg);
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 -4px 20px var(--shadow-strong);
    z-index: 2000;
    transition: background-color 0.25s ease;
}

.pd-btn-back {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 0 16px;
    height: 48px;
    border-radius: 14px;
    background: var(--input-bg);
    border: 1px solid var(--border-color);
    font-size: 14px;
    font-weight: 600;
    color: var(--text-color);
    cursor: pointer;
    flex-shrink: 0;
}

.pd-btn-back i {
    font-size: 18px;
}

.pd-btn-add {
    flex: 1;
    height: 48px;
    border-radius: 14px;
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    border: none;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px var(--shadow-color);
}

.pd-footer-content {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 10px;
}

.pd-dynamic-qty {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex: 1;
    background: var(--input-bg);
    border-radius: 14px;
    height: 48px;
    padding: 0 8px;
    border: 1px solid var(--border-color);
}

.pd-dyn-btn {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--card-bg);
    border: none;
    font-size: 18px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-color);
    box-shadow: 0 2px 5px var(--shadow-color);
}

.pd-dyn-val {
    font-size: 16px;
    font-weight: 700;
    color: var(--text-color);
}

.pd-btn-gotocart {
    flex: 1;
    height: 48px;
    border-radius: 12px;
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    border: none;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

#pd-similar-products {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 5px 15px 15px 15px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    
    /* FAQAT SHU QOLADI */
    overscroll-behavior-x: contain;
    -ms-overflow-style: none;
}

#pd-similar-products::-webkit-scrollbar { 
    display: none; 
}

#pd-similar-products .product-card {
    flex: 0 0 calc((100vw - 45px) / 2);
    width: calc((100vw - 45px) / 2);
    scroll-snap-align: start;
}

/* Fullscreen */
#pd-fullscreen,
.pd-fullscreen-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000000;
    z-index: 9999;
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

#pd-fullscreen.active,
.pd-fullscreen-overlay.active {
    display: flex;
}

#pd-fullscreen-content {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pd-close-fullscreen {
    position: absolute;
    top: calc(env(safe-area-inset-top, 15px) + 5px);
    right: 20px;
    color: #fff;
    font-size: 30px;
    background: rgba(255,255,255,0.2);
    backdrop-filter: blur(5px);
    -webkit-backdrop-filter: blur(5px);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10001;
    cursor: pointer;
}

.fs-counter {
    position: absolute;
    top: calc(env(safe-area-inset-top, 15px) + 10px);
    left: 20px;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    background: rgba(0,0,0,0.5);
    padding: 4px 12px;
    border-radius: 15px;
    z-index: 10001;
}

.fs-carousel {
    display: flex;
    width: 100%;
    height: 100%;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.fs-carousel::-webkit-scrollbar { display: none; }

.fs-slide {
    flex: 0 0 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    scroll-snap-align: center;
}

.fs-slide img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.fs-video-wrapper {
    width: 100%;
    padding: 0 15px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.fs-video-wrapper video {
    width: 100%;
    max-height: 85vh;
    border-radius: 16px;
    background: #111;
    box-shadow: 0 10px 30px rgba(0,0,0,0.8);
    outline: none;
}

/* Out of stock badges */
.badge-out-of-stock {
    position: absolute;
    top: 8px;
    right: 8px;
    background: var(--danger);
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    padding: 4px 8px;
    border-radius: 8px;
    z-index: 10;
    box-shadow: 0 2px 5px rgba(255,59,48,0.3);
    pointer-events: none;
}

.pd-badge-out {
    display: inline-block;
    background: var(--danger);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 8px;
    margin-bottom: 8px;
}

/* ---------- 11. CART ---------- */
#tab-cart {
    padding: 15px 15px 100px 15px;
    height: 100vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: var(--bg-color);
}

.cart-empty-state {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding-top: 100px;
    text-align: center;
}

/* ---------- 12. FORMS ---------- */
.form-group {
    margin-bottom: 16px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 700;
    color: var(--secondary-color);
}

.form-group input,
.form-group textarea,
.custom-select-wrapper select {
    width: 100%;
    padding: 14px 16px;
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 15px;
    font-family: inherit;
    color: var(--text-color);
    outline: none;
    transition: all 0.2s ease;
}

.form-group input:focus,
.form-group textarea:focus,
.custom-select-wrapper select:focus {
    border-color: var(--primary-color);
    background-color: var(--card-bg);
}

.custom-select-wrapper {
    position: relative;
    width: 100%;
}

.custom-select-wrapper select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding-right: 45px;
    cursor: pointer;
}

.custom-select-wrapper::after {
    content: '\ebcc';
    font-family: 'boxicons';
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 22px;
    color: var(--secondary-color);
    pointer-events: none;
}

.btn-secondary {
    width: 100%;
    padding: 12px;
    background: var(--input-bg);
    color: var(--text-color);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

/* ---------- 13. HOME SECTIONS ---------- */
.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 20px 0 10px;
}

.section-title {
    font-size: 16px;
    font-weight: 800;
    margin: 0;
    color: var(--text-color);
}

.btn-more {
    font-size: 12px;
    color: var(--primary-color);
    font-weight: 600;
    background: none;
    border: none;
    cursor: pointer;
}

.h-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    padding-bottom: 10px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    will-change: scroll-position;
    transform: translateZ(0);
}

.h-scroll::-webkit-scrollbar { display: none; }

.cat-card {
    flex: 0 0 auto;
    width: 80px;
    scroll-snap-align: start;
    text-align: center;
    cursor: pointer;
}

.cat-card img {
    width: 65px;
    height: 65px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
    background: var(--card-bg);
    box-shadow: 0 2px 5px var(--shadow-color);
}

.cat-name {
    font-size: 11px;
    margin-top: 6px;
    line-height: 1.35;
    min-height: 30px;
    height: auto;
    overflow: visible;
    font-weight: 700;
    color: var(--text-color);
    word-break: normal;
    white-space: normal;
}


.brand-card {
    flex: 0 0 auto;
    width: 80px;
    scroll-snap-align: start;
    text-align: center;
    cursor: pointer;
}

.brand-frame {
    width: 80px;
    height: 80px;
    background: var(--card-bg);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    padding: 8px;
    box-shadow: 0 2px 4px var(--shadow-color);
    overflow: hidden;
}

.brand-frame img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.brand-name {
    font-size: 11px;
    margin-top: 5px;
    line-height: 1.25;
    height: 28px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    font-weight: 600;
    color: var(--text-color);
}

.product-card-slide {
    flex: 0 0 calc((100vw - 45px) / 2);
    width: calc((100vw - 45px) / 2);
    scroll-snap-align: start;
}

/* ---------- 14. BANNER ---------- */
.banner-scroll {
    position: relative;
    width: 100%;
    height: 180px;
    perspective: 1200px;
    margin-bottom: 20px;
    border-radius: 16px;
    overflow: hidden;
    touch-action: pan-y;
}

.banner-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
}

.banner-item {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 16px;
    overflow: hidden;
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1), opacity 0.6s ease;
    opacity: 0;
    pointer-events: none;
    transform-origin: center center;
}

.banner-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.banner-item.active {
    opacity: 1;
    transform: translateX(0) rotateY(0deg) translateZ(0) scale(1);
    z-index: 3;
    pointer-events: auto;
}

.banner-item.next {
    opacity: 0;
    transform: translateX(50%) rotateY(-60deg) translateZ(-100px) scale(0.85);
    z-index: 2;
}

.banner-item.prev {
    opacity: 0;
    transform: translateX(-50%) rotateY(60deg) translateZ(-100px) scale(0.85);
    z-index: 2;
}

.banner-item.hidden {
    opacity: 0;
    transform: translateX(0) rotateY(180deg) translateZ(-200px) scale(0.6);
    z-index: 1;
}

.banner-pagination {
    position: absolute;
    bottom: 12px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 6px;
    z-index: 10;
}

.banner-pag-line {
    width: 12px;
    height: 4px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 4px;
    transition: all 0.4s ease;
}

.banner-pag-line.active {
    width: 25px;
    background: rgba(255, 255, 255, 1);
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.banner-title {
    position: absolute;
    bottom: 20px;
    left: 15px;
    color: #fff;
    font-size: 18px;
    font-weight: 800;
    text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
}

/* ---------- 15. SEARCH ---------- */
.search-box-container {
    margin-bottom: 12px;
}

.search-input-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.search-input-wrapper input {
    flex: 1;
    width: 100%;
    padding: 12px 36px 12px 42px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    font-size: 14px;
    color: var(--text-color);
    outline: none;
}

.search-input-wrapper input:focus {
    border-color: var(--primary-color);
}

.search-input-wrapper .search-icon {
    position: absolute;
    left: 14px;
    font-size: 18px;
    color: var(--secondary-color);
    pointer-events: none;
}

.clear-input-btn {
    position: absolute;
    right: 95px;
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary-color);
    font-size: 18px;
    padding: 4px;
    border-radius: 50%;
}

.clear-input-btn:hover {
    color: var(--text-color);
    background: var(--border-color);
}

.filter-toggle-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    color: var(--text-color);
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    height: 43px;
    transition: all 0.2s;
}

.filter-toggle-btn i {
    font-size: 16px;
    color: var(--primary-color);
}

.filter-toggle-btn:active {
    background: var(--border-color);
}

.filter-section-wrapper {
    transition: max-height 0.3s ease, opacity 0.3s ease;
    overflow: hidden;
    max-height: 500px;
    opacity: 1;
}

.filter-section-wrapper.collapsed {
    max-height: 0;
    opacity: 0;
    margin-top: 0 !important;
    pointer-events: none;
}

.filter-chips-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 5px;
}

.filter-chips-scroll::-webkit-scrollbar { display: none; }

.filter-chip,
.sort-chip {
    flex: 0 0 auto;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    color: var(--secondary-color);
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.filter-chip.active,
.sort-chip.active {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-text);
    border-color: var(--btn-primary-bg);
}

[data-theme="dark"] .filter-chip.active,
[data-theme="dark"] .sort-chip.active {
    color: #111;
}

.search-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 12px;
}

/* ---------- 16. DESKTOP BLOCKER ---------- */
#desktop-blocker {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: #0f0f0f;
    color: #ffffff;
    z-index: 99999;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 30px;
}

#desktop-blocker i {
    font-size: 64px;
    color: #007aff;
    margin-bottom: 20px;
}

#desktop-blocker h2 {
    font-size: 22px;
    font-weight: 700;
    margin-bottom: 10px;
}

#desktop-blocker p {
    font-size: 14px;
    color: #aaa;
    max-width: 320px;
    line-height: 1.5;
}

@media screen and (min-width: 768px) {
    #desktop-blocker {
        display: flex !important;
    }
}

/* ---------- 17. TOAST / ALERT (theme aware) ---------- */
#premium-toast {
    background: var(--toast-bg) !important;
    color: var(--text-color) !important;
    border: 1px solid var(--border-color) !important;
}

/* ---------- 18. MISC TRANSITIONS ---------- */
.product-card,
.pd-info-box,
.bottom-nav,
.app-header,
.pd-footer,
.form-group input,
.form-group textarea {
    transition: background-color 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

/* JS da background: var(--primary-color) yozilgan tugmalar uchun */
button[style*="var(--primary-color"],
.btn-primary {
    background: var(--btn-primary-bg) !important;
    color: var(--btn-primary-text) !important;
}