@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&family=Manrope:wght@600;700;800&subset=cyrillic,cyrillic-ext&display=swap');

/**
 * LOOP MARKET - Global Enterprise Design System
 * Official Campus Marketplace UI Kit & A11y Foundation
 * Version: 2.0.0
 */

/* ==========================================================================
   1. DESIGN TOKENS & CSS VARIABLES
   ========================================================================== */

:root,
[data-theme="light"] {
    /* Brand & Accent (Cohesive Slate & Emerald) */
    --brand-primary: #0f172a;           /* Deep Slate Executive */
    --brand-primary-rgb: 15, 23, 42;
    --brand-emerald: #059669;           /* Emerald 600 - Verified */
    --brand-emerald-light: #10b981;     /* Emerald 500 */
    --brand-emerald-dark: #047857;      /* Emerald 700 */
    --brand-emerald-soft: rgba(16, 185, 129, 0.12);
    --brand-emerald-border: rgba(16, 185, 129, 0.3);

    /* Canvas & Surfaces (Soft Comfort Light Theme, no hospital glare) */
    --bg-canvas: #efe9de;               /* Distinct warm beige canvas */
    --bg-subtle: #e2dac9;               /* Soft warm beige accent */
    --surface-card: #ffffff;
    --surface-elevated: #ffffff;
    --surface-glass: rgba(255, 255, 255, 0.94);
    --surface-backdrop: rgba(15, 23, 42, 0.45);

    /* Typography & Contrast */
    --text-primary: #181512;            /* Sharp charcoal black 14:1 contrast */
    --text-secondary: #3d362c;          /* Deep warm slate */
    --text-muted: #665e52;              /* Legible warm muted 5.5:1 contrast */
    --text-inverse: #ffffff;

    /* Borders & Distinct Edges */
    --border-subtle: #ded6c8;
    --border-default: #c9bea9;          /* Solid, clearly visible warm border */
    --border-strong: #94a3b8;
    --border-focus: #10b981;

    /* Semantic Status */
    --status-success: #16a34a;
    --status-success-soft: #ecfdf5;
    --status-warning: #d97706;
    --status-warning-soft: #fffbeb;
    --status-danger: #dc2626;
    --status-danger-soft: #fef2f2;
    --status-info: #0284c7;
    --status-info-soft: #f0f9ff;

    /* Shadows & Elevation - Defined and physical */
    --shadow-xs: 0 1px 2px 0 rgba(15, 23, 42, 0.05);
    --shadow-sm: 0 1px 3px 0 rgba(15, 23, 42, 0.08), 0 1px 2px -1px rgba(15, 23, 42, 0.05);
    --shadow-md: 0 4px 10px -2px rgba(15, 23, 42, 0.08), 0 2px 4px -2px rgba(15, 23, 42, 0.05);
    --shadow-lg: 0 12px 20px -3px rgba(15, 23, 42, 0.09), 0 4px 6px -4px rgba(15, 23, 42, 0.04);
    --shadow-xl: 0 20px 25px -5px rgba(15, 23, 42, 0.1), 0 8px 10px -6px rgba(15, 23, 42, 0.04);
    --shadow-card-hover: 0 14px 28px -4px rgba(15, 23, 42, 0.12), 0 0 0 1.5px rgba(16, 185, 129, 0.35);

    /* Radii */
    --radius-sm: 6px;
    --radius-md: 10px;
    --radius-lg: 14px;
    --radius-xl: 18px;
    --radius-full: 9999px;

    /* Focus Rings */
    --focus-ring: 0 0 0 3px rgba(16, 185, 129, 0.35);
    --focus-ring-danger: 0 0 0 3px rgba(220, 38, 38, 0.35);

    /* Motion Transitions */
    --transition-fast: 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-base: 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-smooth: 0.35s cubic-bezier(0.16, 1, 0.3, 1);

    /* Legacy Alias compatibility */
    --primary: var(--brand-primary);
    --primary-light: var(--brand-emerald-light);
    --primary-hover: var(--brand-emerald-dark);
    --primary-soft: var(--brand-emerald-soft);
    --surface: var(--surface-card);
    --bg-color: var(--bg-canvas);
    --text-main: var(--text-primary);
    --border-color: var(--border-default);
    --trust-bg: var(--bg-subtle);
    --card-shadow: var(--shadow-sm);
    --card-shadow-hover: var(--shadow-card-hover);
    /* Theme Glows & Header Glass */
    --glow-blue: rgba(37, 99, 235, 0.05);
    --glow-emerald: rgba(16, 185, 129, 0.04);
    --header-glass: rgba(255, 255, 255, 0.94);
}

/* ==========================================================================
   DARK THEME PALETTE
   ========================================================================== */

[data-theme="dark"] {
    /* Brand & Accent */
    --brand-primary: #f8fafc;
    --brand-primary-rgb: 248, 250, 252;
    --brand-emerald: #10b981;
    --brand-emerald-light: #34d399;
    --brand-emerald-dark: #059669;
    --brand-emerald-soft: rgba(16, 185, 129, 0.14);
    --brand-emerald-border: rgba(52, 211, 153, 0.3);

    /* Canvas & Surfaces (Dark Theme) */
    --bg-canvas: #090d16;               /* Ultra-deep Slate (No pitch-black eye fatigue) */
    --bg-subtle: #0f172a;               /* Slate 900 */
    --surface-card: #131b2e;            /* Modern dark surface */
    --surface-elevated: #1e293b;        /* Elevated dark surface */
    --surface-glass: rgba(19, 27, 46, 0.88);
    --surface-backdrop: rgba(0, 0, 0, 0.7);

    /* Typography & Contrast */
    --text-primary: #f8fafc;            /* 14.2:1 contrast */
    --text-secondary: #94a3b8;          /* Slate 400 - clean readability */
    --text-muted: #64748b;              /* Slate 500 */
    --text-inverse: #0f172a;

    /* Borders & Dividers */
    --border-subtle: #1e293b;
    --border-default: #26334d;
    --border-strong: #334155;
    --border-focus: #34d399;

    /* Semantic Status (Softened for dark theme eye comfort) */
    --status-success: #34d399;
    --status-success-soft: rgba(52, 211, 153, 0.12);
    --status-warning: #fbbf24;
    --status-warning-soft: rgba(251, 191, 36, 0.12);
    --status-danger: #f87171;
    --status-danger-soft: rgba(248, 113, 113, 0.12);
    --status-info: #38bdf8;
    --status-info-soft: rgba(56, 189, 248, 0.12);

    /* Shadows & Elevation (Dark Theme) */
    --shadow-xs: 0 1px 2px 0 rgba(0, 0, 0, 0.4);
    --shadow-sm: 0 2px 4px 0 rgba(0, 0, 0, 0.45);
    --shadow-md: 0 6px 12px -2px rgba(0, 0, 0, 0.55);
    --shadow-lg: 0 12px 20px -3px rgba(0, 0, 0, 0.65);
    --shadow-xl: 0 20px 30px -5px rgba(0, 0, 0, 0.75);
    --shadow-card-hover: 0 16px 36px -4px rgba(0, 0, 0, 0.65), 0 0 0 1px rgba(52, 211, 153, 0.2);

    /* Focus Rings */
    --focus-ring: 0 0 0 3px rgba(52, 211, 153, 0.4);
    --focus-ring-danger: 0 0 0 3px rgba(248, 113, 113, 0.4);

    /* Legacy Alias compatibility */
    --primary: var(--brand-primary);
    --primary-light: var(--brand-emerald-light);
    --primary-hover: var(--brand-emerald-dark);
    --primary-soft: var(--brand-emerald-soft);
    --surface: var(--surface-card);
    --bg-color: var(--bg-canvas);
    --text-main: var(--text-primary);
    --border-color: var(--border-default);
    --trust-bg: var(--bg-subtle);
    /* Theme Glows & Header Glass */
    --glow-blue: rgba(37, 99, 235, 0.05);
    --glow-emerald: rgba(16, 185, 129, 0.04);
    --header-glass: rgba(255, 255, 255, 0.92);
}

/* ==========================================================================
   2. CSS RESET & GLOBAL TYPOGRAPHY
   ========================================================================== */

*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

html, body {
    overflow-x: hidden !important;
    max-width: 100vw !important;
    width: 100% !important;
}

body {
    font-family: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 0.9375rem;
    line-height: 1.55;
    color: var(--text-primary);
    background-color: var(--bg-canvas);
    background-image: 
        radial-gradient(ellipse 80% 50% at 50% 0%, rgba(37, 99, 235, 0.04), transparent 65%),
        radial-gradient(ellipse 60% 40% at 100% 100%, rgba(16, 185, 129, 0.04), transparent 55%);
    background-repeat: no-repeat;
    background-attachment: fixed;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    transition: background-color var(--transition-base), color var(--transition-base);
    overflow-x: hidden;
}

[data-theme="dark"] body {
    background-color: #0c0e14 !important;
    background-image: 
        radial-gradient(circle at 50% -10%, rgba(16, 185, 129, 0.05) 0%, transparent 600px),
        radial-gradient(circle at 100% 100%, rgba(37, 99, 235, 0.03) 0%, transparent 500px) !important;
    background-repeat: no-repeat !important;
    background-attachment: fixed !important;
}

/* Light Theme Component Harmony - Crisp Borders & High Visibility */
[data-theme="light"] header,
html:not([data-theme="dark"]) header {
    background: rgba(255, 255, 255, 0.96) !important;
    border-bottom: 1.5px solid #c9bea9 !important;
    box-shadow: 0 2px 10px rgba(24, 21, 18, 0.05) !important;
}

[data-theme="light"] .card,
[data-theme="light"] .product-card,
[data-theme="light"] .listing-card,
[data-theme="light"] .creation-card,
[data-theme="light"] .auth-card,
[data-theme="light"] .sidebar,
[data-theme="light"] .filters-card,
[data-theme="light"] .info-panel,
[data-theme="light"] .image-showcase,
[data-theme="light"] .seller-card,
[data-theme="light"] .specs-box,
[data-theme="light"] .description-block,
[data-theme="light"] .settings-box,
html:not([data-theme="dark"]) .card,
html:not([data-theme="dark"]) .product-card,
html:not([data-theme="dark"]) .listing-card,
html:not([data-theme="dark"]) .sidebar,
html:not([data-theme="dark"]) .info-panel,
html:not([data-theme="dark"]) .image-showcase,
html:not([data-theme="dark"]) .seller-card,
html:not([data-theme="dark"]) .specs-box,
html:not([data-theme="dark"]) .settings-box {
    background: #ffffff !important;
    border: 1.5px solid #c9bea9 !important;
    box-shadow: 0 2px 8px -1px rgba(24, 21, 18, 0.08), 0 4px 14px -2px rgba(24, 21, 18, 0.06) !important;
}

[data-theme="light"] .card:hover,
[data-theme="light"] .product-card:hover,
[data-theme="light"] .listing-card:hover,
html:not([data-theme="dark"]) .card:hover,
html:not([data-theme="dark"]) .product-card:hover,
html:not([data-theme="dark"]) .listing-card:hover {
    border-color: #10b981 !important;
    box-shadow: 0 10px 24px -4px rgba(24, 21, 18, 0.14), 0 0 0 1.5px #10b981 !important;
}

[data-theme="light"] .modern-input,
[data-theme="light"] input[type="text"],
[data-theme="light"] input[type="number"],
[data-theme="light"] input[type="email"],
[data-theme="light"] input[type="password"],
[data-theme="light"] input[type="tel"],
[data-theme="light"] textarea,
[data-theme="light"] select,
[data-theme="light"] .search-input,
html:not([data-theme="dark"]) .modern-input,
html:not([data-theme="dark"]) .search-input {
    background: #ffffff !important;
    border: 1.5px solid #c9bea9 !important;
    color: #181512 !important;
}

[data-theme="light"] .modern-input:focus,
[data-theme="light"] input[type="text"]:focus,
[data-theme="light"] input[type="number"]:focus,
[data-theme="light"] input[type="email"]:focus,
[data-theme="light"] input[type="password"]:focus,
[data-theme="light"] input[type="tel"]:focus,
[data-theme="light"] textarea:focus,
[data-theme="light"] select:focus,
[data-theme="light"] .search-input:focus,
html:not([data-theme="dark"]) .modern-input:focus,
html:not([data-theme="dark"]) .search-input:focus {
    border-color: #10b981 !important;
    background: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.22) !important;
}

/* Hero Search Bar: Seamless warm beige pill without inner white input box */
.hero-search-bar,
[data-theme="light"] .hero-search-bar,
html:not([data-theme="dark"]) .hero-search-bar {
    background: #efe9de !important;
    border: 1.5px solid #c9bea9 !important;
}

.hero-search-bar:focus-within,
[data-theme="light"] .hero-search-bar:focus-within,
html:not([data-theme="dark"]) .hero-search-bar:focus-within {
    background: #efe9de !important;
    border-color: #10b981 !important;
    box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.22) !important;
}

[data-theme="light"] .hero-search-bar input,
[data-theme="light"] .hero-search-input,
[data-theme="light"] input#heroSearchInput,
html:not([data-theme="dark"]) .hero-search-bar input,
html:not([data-theme="dark"]) .hero-search-input,
html:not([data-theme="dark"]) input#heroSearchInput,
.hero-search-bar .hero-search-input,
.hero-search-input,
#heroSearchInput {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
    color: #181512 !important;
}

[data-theme="light"] .hero-search-bar input:focus,
[data-theme="light"] .hero-search-input:focus,
[data-theme="light"] input#heroSearchInput:focus,
html:not([data-theme="dark"]) .hero-search-bar input:focus,
html:not([data-theme="dark"]) .hero-search-input:focus,
html:not([data-theme="dark"]) input#heroSearchInput:focus,
.hero-search-bar .hero-search-input:focus,
.hero-search-input:focus,
#heroSearchInput:focus {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    outline: none !important;
}

[data-theme="light"] .modal-box,
[data-theme="light"] .dialog-box,
[data-theme="light"] .dropdown-menu,
[data-theme="light"] .user-dropdown,
html:not([data-theme="dark"]) .modal-box,
html:not([data-theme="dark"]) .dialog-box,
html:not([data-theme="dark"]) .dropdown-menu,
html:not([data-theme="dark"]) .user-dropdown {
    background: #ffffff !important;
    border: 1.5px solid #c9bea9 !important;
    box-shadow: 0 16px 36px -4px rgba(24, 21, 18, 0.18) !important;
}

[data-theme="light"] .price-tag,
[data-theme="light"] .card-price,
html:not([data-theme="dark"]) .card-price {
    color: #059669 !important;
    font-weight: 800 !important;
}

[data-theme="light"] .trust-banner,
html:not([data-theme="dark"]) .trust-banner {
    background: #e2dac9 !important;
    border-bottom: 1px solid #c9bea9 !important;
    color: #3d362c !important;
}

/* ==========================================================================
   3. ACCESSIBILITY (A11Y) FOUNDATIONS
   ========================================================================== */

/* Skip link for keyboard users */
.skip-link {
    position: absolute;
    top: -100px;
    left: 20px;
    background: var(--brand-emerald);
    color: #ffffff;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    font-weight: 700;
    font-size: 0.875rem;
    z-index: 9999;
    text-decoration: none;
    box-shadow: var(--shadow-lg);
    transition: top var(--transition-fast);
}

.skip-link:focus {
    top: 20px;
    outline: none;
    box-shadow: var(--focus-ring);
}

/* Visible focus states on keyboard navigation */
:focus-visible {
    outline: none;
    box-shadow: var(--focus-ring) !important;
    border-color: var(--brand-emerald) !important;
}

/* Screen reader only utility */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Reduced motion preference */
@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;
    }
}

/* ==========================================================================
   4. CORPORATE BUTTON SYSTEM
   ========================================================================== */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    user-select: none;
    transition: all var(--transition-fast);
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background-color: var(--brand-emerald);
    color: #ffffff !important;
    border-color: var(--brand-emerald);
    box-shadow: var(--shadow-sm);
}

.btn-primary:hover {
    background-color: var(--brand-emerald-dark);
    border-color: var(--brand-emerald-dark);
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.28);
}

.btn-outline {
    background-color: transparent;
    color: var(--text-primary);
    border-color: var(--border-default);
}

.btn-outline:hover {
    background-color: var(--brand-emerald-soft);
    border-color: var(--brand-emerald);
    color: var(--brand-emerald);
}

.btn-secondary {
    background-color: var(--bg-subtle);
    color: var(--text-primary);
    border-color: var(--border-default);
}

.btn-secondary:hover {
    background-color: var(--border-default);
    color: var(--text-primary);
}

.btn-danger {
    background-color: var(--status-danger-soft);
    color: var(--status-danger) !important;
    border-color: rgba(220, 38, 38, 0.2);
}

.btn-danger:hover {
    background-color: var(--status-danger);
    color: #ffffff !important;
    border-color: var(--status-danger);
}

.btn-sm {
    padding: 6px 12px;
    font-size: 0.8125rem;
    border-radius: var(--radius-sm);
}

.btn-lg {
    padding: 13px 24px;
    font-size: 1rem;
    border-radius: var(--radius-lg);
}

/* ==========================================================================
   5. FORM CONTROLS & INPUTS
   ========================================================================== */

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 18px;
}

.form-label {
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.form-label .required {
    color: var(--status-danger);
}

.form-control,
.search-input,
.modern-input {
    width: 100%;
    font-family: inherit;
    font-size: 0.9375rem;
    color: var(--text-primary);
    background-color: var(--surface-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-md);
    padding: 10px 14px;
    outline: none;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.form-control:hover,
.search-input:hover,
.modern-input:hover {
    border-color: var(--border-strong);
}

.form-control:focus,
.search-input:focus,
.modern-input:focus {
    border-color: var(--brand-emerald);
    box-shadow: var(--focus-ring);
}

.form-hint {
    font-size: 0.775rem;
    color: var(--text-muted);
}

.form-error {
    font-size: 0.8rem;
    color: var(--status-danger);
    font-weight: 500;
}

/* ==========================================================================
   6. VERIFICATION BADGES & PILLS
   ========================================================================== */

.badge-verified {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 4px 10px;
    background: var(--brand-emerald-soft);
    border: 1px solid var(--brand-emerald-border);
    color: var(--brand-emerald-light);
    font-size: 0.775rem;
    font-weight: 700;
    border-radius: var(--radius-full);
    letter-spacing: 0.2px;
}

.badge-verified svg {
    color: var(--brand-emerald);
    flex-shrink: 0;
}

.trust-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.825rem;
    font-weight: 600;
    color: var(--text-secondary);
    padding: 6px 14px;
    background: var(--surface-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-full);
    box-shadow: var(--shadow-xs);
}

/* ==========================================================================
   7. EMPTY STATES & USER GUIDANCE
   ========================================================================== */

.empty-state {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 60px 24px;
    background: var(--surface-card);
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-xl);
    margin: 20px 0;
}

.empty-state-icon {
    width: 64px;
    height: 64px;
    border-radius: var(--radius-full);
    background: var(--brand-emerald-soft);
    color: var(--brand-emerald);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.empty-state-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 6px;
}

.empty-state-desc {
    font-size: 0.9rem;
    color: var(--text-secondary);
    max-width: 420px;
    margin-bottom: 20px;
}

/* ==========================================================================
   8. CARD GRID SYMMETRY & PRODUCT PRESENTATION
   ========================================================================== */

.listings-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
    align-items: stretch;
}

.card {
    background: var(--surface-card);
    border: 1px solid var(--border-default);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
    box-shadow: var(--shadow-sm);
    position: relative;
}

.card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-card-hover);
    border-color: var(--border-strong);
}

.card-img-wrapper {
    position: relative;
    width: 100%;
    padding-top: 66.66%; /* 3:2 aspect ratio */
    background: var(--bg-subtle);
    overflow: hidden;
    cursor: pointer;
}

.card-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-smooth);
}

.card-media-box {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #0b0f19;
}

.card:hover .card-img {
    transform: scale(1.035);
}

.card-content {
    padding: 14px 16px 16px 16px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.card-category {
    font-size: 0.725rem;
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.5px;
    color: var(--brand-emerald);
    margin-bottom: 6px;
}

.card-title {
    font-size: 0.95rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--text-primary);
    margin-bottom: 10px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.7em;
    cursor: pointer;
}

.card-price-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-bottom: 12px;
}

.card-price {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

.card-footer {
    margin-top: auto;
    padding-top: 10px;
    border-top: 1px solid var(--border-subtle);
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.785rem;
    color: var(--text-muted);
}

/* ==========================================================================
   9. STAR RATINGS
   ========================================================================== */

.stars-rating {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    color: #f59e0b;
}

.stars-rating svg {
    flex-shrink: 0;
}


/* Custom Sleek Dark Scrollbars */
* {
    scrollbar-width: thin;
    scrollbar-color: rgba(255, 255, 255, 0.2) transparent;
}

::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.2);
    border-radius: 999px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(255, 255, 255, 0.38);
}

/* ==========================================================================
   10. UNIVERSAL ADAPTIVE VIEWPORTS & RESPONSIVE LAYOUT SYSTEM
   ========================================================================== */

/* Universal Fluid Container */
.container {
    width: 100%;
    max-width: 1440px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 20px;
    padding-right: 20px;
}

@media (max-width: 768px) {
    .container {
        padding-left: 12px;
        padding-right: 12px;
    }
}

/* ==========================================================================
   11. UNIFIED RESPONSIVE HEADER & MOBILE DRAWER NAVIGATION
   ========================================================================== */

header {
    background-color: var(--surface) !important;
    border-bottom: 1px solid var(--border-color) !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 1000 !important;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.04) !important;
    transition: background-color 0.3s ease, border-color 0.3s ease !important;
}

.header-content {
    width: 100%;
    max-width: 1440px;
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 64px;
    padding: 0 20px;
    gap: 12px;
}

/* Mobile Hamburger Button */
.btn-mobile-menu-toggle {
    display: none;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--surface);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    cursor: pointer;
    transition: all 0.2s;
}

.btn-mobile-menu-toggle:hover {
    border-color: var(--brand-emerald);
    color: var(--brand-emerald);
}

/* Slide-out Mobile Navigation Drawer */
.mobile-nav-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 9998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.mobile-nav-overlay.active {
    opacity: 1;
    pointer-events: auto;
}

.mobile-nav-drawer {
    position: fixed;
    top: 0;
    right: -320px;
    width: min(320px, 86vw);
    height: 100%;
    background: var(--surface-card);
    border-left: 1px solid var(--border-default);
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.25);
    z-index: 9999;
    display: flex;
    flex-direction: column;
    transition: right 0.32s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 20px;
    overflow-y: auto;
}

.mobile-nav-drawer.active {
    right: 0;
}

.mobile-drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--border-subtle);
    margin-bottom: 16px;
}

.mobile-drawer-close {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.mobile-drawer-links {
    display: flex;
    flex-direction: column;
    gap: 8px;
    flex-grow: 1;
}

.mobile-drawer-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-primary);
    font-weight: 600;
    font-size: 0.95rem;
    background: var(--bg-subtle);
    border: 1px solid transparent;
    transition: all 0.2s;
}

.mobile-drawer-link:hover, .mobile-drawer-link.active {
    background: var(--brand-emerald-soft);
    border-color: var(--brand-emerald);
    color: var(--brand-emerald);
}

.mobile-drawer-link svg {
    flex-shrink: 0;
}

/* Header Responsiveness (< 992px) */
@media (max-width: 992px) {
    .header-content {
        height: 60px !important;
        padding: 0 14px !important;
    }
    
    .nav-actions .nav-link {
        display: none !important;
    }
    
    .btn-mobile-menu-toggle {
        display: inline-flex !important;
    }

    .btn-create-top {
        padding: 7px 12px !important;
        font-size: 0.82rem !important;
    }

    .notif-dropdown {
        right: 14px !important;
        width: min(340px, 92vw) !important;
    }
}

/* ==========================================================================
   12. MOBILE APP-LIKE BOTTOM NAVIGATION BAR (< 768px)
   ========================================================================== */

.mobile-bottom-bar {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: calc(60px + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    background: var(--surface-glass);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-top: 1px solid var(--border-default);
    z-index: 9990;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
}

.mobile-bottom-bar-inner {
    height: 60px;
    max-width: 600px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-around;
    padding: 0 8px;
}

.bottom-bar-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    text-decoration: none;
    color: var(--text-muted);
    font-size: 0.68rem;
    font-weight: 700;
    flex: 1;
    height: 100%;
    position: relative;
    transition: all 0.2s;
}

.bottom-bar-item svg {
    width: 20px;
    height: 20px;
}

/* Guard against duplicate mobile avatars */
.bottom-bar-item img ~ img,
.bottom-nav-item img ~ img {
    display: none !important;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

.bottom-bar-item:hover, .bottom-bar-item.active {
    color: var(--brand-emerald);
}

.bottom-bar-item.create-fab {
    margin-top: -16px;
}

.bottom-bar-item.create-fab .fab-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 16px rgba(16, 185, 129, 0.4);
    transition: transform 0.2s, box-shadow 0.2s;
}

.bottom-bar-item.create-fab:active .fab-circle {
    transform: scale(0.92);
}

@media (max-width: 768px) {
    .mobile-bottom-bar {
        display: block !important;
    }
    
    /* Ensure content is not hidden behind the fixed bottom bar on phones */
    body:not(.messages-page) {
        padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px)) !important;
    }
}

/* ==========================================================================
   13. RESPONSIVE CATALOG LAYOUT & MOBILE FILTER TOGGLE (index.html)
   ========================================================================== */

/* Category Quick Horizontal Scroller */
.categories-scroll-wrapper {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 10px 0 6px 0;
    margin-bottom: 12px;
}

.categories-scroll-wrapper::-webkit-scrollbar {
    display: none;
}

.categories-scroll-list {
    display: flex;
    gap: 8px;
    padding: 0 4px;
    width: max-content;
}

.cat-pill {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 8px 16px;
    border-radius: 10px;
    background: var(--surface-card);
    border: 1px solid var(--border-default);
    color: var(--text-secondary);
    font-size: 0.84rem;
    font-weight: 600;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.15s ease;
    user-select: none;
}

.cat-pill:hover {
    background: var(--bg-subtle);
    border-color: var(--border-strong);
    color: var(--text-primary);
}

.cat-pill.active {
    background: #0f172a !important;
    border-color: #0f172a !important;
    color: #ffffff !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.15);
    font-weight: 700;
}

[data-theme="dark"] .cat-pill.active {
    background: #10b981 !important;
    border-color: #10b981 !important;
    color: #0b0f19 !important;
    box-shadow: 0 2px 8px rgba(16, 185, 129, 0.25);
}

/* Mobile Filter Bar & Trigger */
.mobile-filter-bar {
    display: none;
    margin-bottom: 14px;
    gap: 10px;
}

.btn-filter-trigger {
    flex: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 12px;
    background: var(--surface-card);
    border: 1px solid var(--border-default);
    color: var(--text-primary);
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    box-shadow: var(--shadow-xs);
    transition: all 0.2s;
}

.btn-filter-trigger:hover, .btn-filter-trigger.active {
    border-color: var(--brand-emerald);
    color: var(--brand-emerald);
    background: var(--brand-emerald-soft);
}

@media (max-width: 960px) {
    .mobile-filter-bar {
        display: flex !important;
    }

    .main-layout {
        display: flex !important;
        flex-direction: column !important;
        padding: 12px 14px !important;
        gap: 14px !important;
    }

    .sidebar {
        display: none !important; /* Hidden by default on mobile, toggled with .mobile-visible */
        width: 100% !important;
        position: static !important;
        margin-bottom: 12px !important;
        border-radius: 16px !important;
        box-shadow: var(--shadow-md) !important;
    }

    .sidebar.mobile-visible {
        display: block !important;
        animation: fadeInSlide 0.25s ease-out;
    }
}

@keyframes fadeInSlide {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive Catalog Grid across All Screen Sizes */
@media (min-width: 1441px) {
    .listings-grid {
        grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)) !important;
        gap: 20px !important;
    }
}

@media (max-width: 1440px) and (min-width: 961px) {
    .listings-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
        gap: 16px !important;
    }
}

@media (max-width: 960px) and (min-width: 601px) {
    .listings-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
        gap: 14px !important;
    }
}

@media (max-width: 600px) {
    .listings-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 8px !important;
    }
    
    .card {
        border-radius: 12px !important;
    }

    .card-img-wrapper {
        height: 130px !important;
        padding-top: 0 !important;
    }
    
    .card-content {
        padding: 8px 8px 10px 8px !important;
        gap: 2px !important;
    }
    
    .card-title {
        font-size: 0.88rem !important;
        line-height: 1.35 !important;
        min-height: 2.7em !important;
        max-height: 2.85em !important;
        display: -webkit-box !important;
        -webkit-line-clamp: 2 !important;
        -webkit-box-orient: vertical !important;
        overflow: hidden !important;
        text-overflow: ellipsis !important;
        word-break: break-word !important;
        font-weight: 700 !important;
        margin-bottom: 4px !important;
    }
    
    .card-price {
        font-size: 1.05rem !important;
        font-weight: 800 !important;
    }

    .btn-view {
        display: none !important;
    }
}

@media (max-width: 360px) {
    .listings-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 6px !important;
    }

    .card-img-wrapper {
        height: 115px !important;
        padding-top: 0 !important;
    }

    .card-title {
        font-size: 0.78rem !important;
    }

    .card-price {
        font-size: 0.98rem !important;
    }
}

/* ==========================================================================
   14. RESPONSIVE PRODUCT DETAILS & ORDER MODAL (details.html)
   ========================================================================== */

@media (max-width: 992px) {
    .product-layout {
        grid-template-columns: 1fr !important;
        gap: 18px !important;
        padding: 0 !important;
    }
    
    .image-showcase {
        max-height: none !important; height: auto !important; overflow: visible !important;
    }

    .main-image {
        max-height: min(360px, 46vh) !important; height: auto !important;
    }
}

@media (max-width: 768px) {
    .order-modal-container {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        max-height: 92vh !important;
        border-radius: 20px 20px 0 0 !important;
        position: fixed !important;
        bottom: 0 !important;
        padding: 20px 16px 30px 16px !important;
        margin: 0 !important;
        overflow-y: auto !important;
    }

    .order-modal-grid {
        grid-template-columns: 1fr !important;
        gap: 18px !important;
    }
}

/* ==========================================================================
   15. ACCESSIBILITY, TOUCH TARGETS & FORM INPUT SIZES
   ========================================================================== */

@media (hover: none) and (pointer: coarse) {
    /* Touch devices: ensure minimum comfortable tap area */
    button, .btn, .btn-icon, .nav-link, .cat-pill, .bottom-bar-item {
        min-height: 44px;
    }

    input, select, textarea {
        font-size: 16px !important; /* Prevents auto-zoom in mobile Safari */
        min-height: 44px;
    }
}


/* ==========================================================================
   16. MOBILE MENU & HEADER RESPONSIVENESS
   ========================================================================== */
.mobile-menu-btn, .btn-mobile-menu-toggle {
    display: none;
    background: transparent;
    border: none;
    color: var(--text-primary);
    cursor: pointer;
    padding: 6px;
    border-radius: 8px;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    flex-shrink: 0;
}
.mobile-menu-btn:hover, .btn-mobile-menu-toggle:hover {
    background: rgba(255, 255, 255, 0.08);
}

/* ==========================================================================
   UNIVERSAL MOBILE DRAWER & BACKDROP SYSTEM (ALL PAGES)
   ========================================================================== */
.mobile-drawer-backdrop,
.mobile-nav-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    height: 100dvh !important;
    background: rgba(0, 0, 0, 0.65) !important;
    backdrop-filter: blur(5px) !important;
    -webkit-backdrop-filter: blur(5px) !important;
    z-index: 199999 !important;
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
    transition: opacity 0.25s ease !important;
}

.mobile-drawer-backdrop.active,
.mobile-nav-overlay.active {
    display: block !important;
    opacity: 1 !important;
    pointer-events: auto !important;
}

.mobile-nav-drawer {
    position: fixed !important;
    top: 0 !important;
    right: -340px !important;
    width: min(320px, 86vw) !important;
    height: 100vh !important;
    height: 100dvh !important;
    background: var(--surface) !important;
    border-left: 1px solid var(--border-color) !important;
    box-shadow: -10px 0 35px rgba(0, 0, 0, 0.45) !important;
    z-index: 200000 !important;
    display: flex !important;
    flex-direction: column !important;
    transition: right 0.28s cubic-bezier(0.16, 1, 0.3, 1) !important;
    padding: 20px !important;
    overflow-y: auto !important;
    box-sizing: border-box !important;
}

.mobile-nav-drawer.active {
    right: 0 !important;
}

/* ==========================================================================
   UNIVERSAL HEADER MOBILE RULES (<= 992px)
   Prevents header overflow and guarantees hamburger button is always visible!
   ========================================================================== */
@media (max-width: 992px) {
    /* Hide desktop 'Create' / 'Sell' buttons in header to prevent pushing ☰ off screen */
    .btn-create-top,
    .btn-create-mobile,
    .header-create-btn,
    #headerCreateBtn,
    .btn-primary.header-create,
    header .btn-create,
    header a[href*="create.html"],
    header a[href*="create"] {
        display: none !important;
    }

    #btnLogoutHeader, .btn-logout-header, header #btnLogout {
        display: none !important;
    }

    /* Guarantee Hamburger button is ALWAYS visible in header */
    .mobile-menu-btn,
    .btn-mobile-menu-toggle,
    #mobileMenuBtn {
        display: inline-flex !important;
        align-items: center !important;
        justify-content: center !important;
        flex-shrink: 0 !important;
        width: 40px !important;
        height: 40px !important;
        min-width: 40px !important;
        border-radius: 10px !important;
        background: var(--surface-hover, rgba(255,255,255,0.06)) !important;
        border: 1px solid var(--border-color) !important;
        color: var(--text-main) !important;
        cursor: pointer !important;
        padding: 0 !important;
    }

    header {
        padding: 0 12px !important;
        overflow-x: clip !important;
    }
    header .header-content {
        max-width: 100% !important;
        overflow: hidden !important;
        gap: 8px !important;
    }
    header .nav-actions, header .header-right {
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
        flex-shrink: 0 !important;
    }
}

/* ==========================================================================
   CHAT VIEWPORT & BOTTOM BAR SPACING
   messages.html sizes <main> to stop above #mobileBottomBar cleanly.
   ========================================================================== */

/* ==========================================================================
   PRODUCT DETAILS STICKY BAR PROTECTION
   Never overlap with bottom nav bar on details.html
   ========================================================================== */
body.has-sticky-bar #mobileBottomBar,
body.has-sticky-bar .mobile-bottom-bar {
    display: none !important;
}

.btn-sticky-chat, .btn-sticky-chat:hover, .btn-sticky-chat:visited, .btn-sticky-chat:focus {
    text-decoration: none !important;
    border-bottom: 1.5px solid var(--border-color) !important;
}

/* ==========================================================================
   17. BEAUTIFUL MESSAGE STATUS CHECKMARKS (SENT vs READ)
   ========================================================================== */
.msg-status-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: 4px;
    vertical-align: middle;
    line-height: 1;
}
.msg-status-icon.sent {
    color: rgba(255, 255, 255, 0.55);
}
.msg-status-icon.read {
    color: #38bdf8; /* Telegram Sky Blue */
}
[data-theme="light"] .msg-status-icon.sent {
    color: rgba(0, 0, 0, 0.45);
}
[data-theme="light"] .msg-status-icon.read {
    color: #0284c7;
}


/* ==========================================================================
   BEAUTIFUL NOTIFICATION BELL & BADGE SYSTEM
   ========================================================================== */
#notifBtn, .btn-notif {
    position: relative !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    border-radius: 10px !important;
    background: var(--surface) !important;
    border: 1.5px solid var(--border-color) !important;
    color: var(--text-main) !important;
    cursor: pointer !important;
    transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1) !important;
    padding: 0 !important;
    box-sizing: border-box !important;
}

#notifBtn:hover, .btn-notif:hover {
    border-color: #2563eb !important;
    background: var(--surface-hover) !important;
    transform: translateY(-1px) !important;
    color: #2563eb !important;
}

#notifBtn svg {
    width: 19px !important;
    height: 19px !important;
    transition: transform 0.2s ease !important;
    display: block !important;
}

#notifBtn:hover svg {
    transform: rotate(12deg) scale(1.06) !important;
}

.notif-badge {
    position: absolute !important;
    top: 5px !important;
    right: 5px !important;
    width: 8px !important;
    height: 8px !important;
    min-width: 8px !important;
    padding: 0 !important;
    background: #ef4444 !important;
    border-radius: 50% !important;
    border: 2px solid var(--surface) !important;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1) !important;
    box-sizing: content-box !important;
    display: none;
    pointer-events: none !important;
    z-index: 5 !important;
}

.notif-badge:not(:empty) {
    min-width: 16px !important;
    height: 16px !important;
    padding: 0 4px !important;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%) !important;
    color: #ffffff !important;
    font-size: 0.65rem !important;
    font-weight: 800 !important;
    line-height: 14px !important;
    text-align: center !important;
    border-radius: 999px !important;
    border: 2px solid var(--surface) !important;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4) !important;
    top: -3px !important;
    right: -3px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
}

/* ==========================================================================
   SIDEBAR & SEARCH INPUT ALIGNMENT (PREVENTS ICON OVERLAPPING TEXT)
   ========================================================================== */
.search-box {
    position: relative !important;
    width: 100% !important;
    margin-bottom: 16px !important;
}

.search-box .search-icon {
    position: absolute !important;
    left: 14px !important;
    top: 50% !important;
    transform: translateY(-50%) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: var(--text-muted) !important;
    pointer-events: none !important;
    z-index: 2 !important;
}

.search-box .search-input,
.search-box input[type="text"],
.search-wrap .search-input,
.search-input-wrap .search-input,
#searchInput {
    padding-left: 44px !important;
    box-sizing: border-box !important;
}


/* ==========================================================================
   VIDEO SHOWCASE & BADGES FOR BRAND & SELLER LISTINGS
   ========================================================================== */
.btn-video-tab {
    background: var(--surface);
    border: 1.5px solid var(--border-color);
    color: var(--text-muted);
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.btn-video-tab:hover {
    border-color: #2563eb;
    color: var(--text-main);
    background: var(--surface-hover);
}

.btn-video-tab.active {
    background: rgba(37, 99, 235, 0.1);
    border-color: #2563eb;
    color: #2563eb;
    box-shadow: 0 0 0 1px #2563eb;
}

.video-dropzone {
    border: 2px dashed rgba(37, 99, 235, 0.4);
    background: var(--surface);
    border-radius: 12px;
    padding: 22px 18px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
}

.video-dropzone:hover {
    border-color: #2563eb;
    background: rgba(37, 99, 235, 0.05);
    transform: translateY(-1px);
}

.btn-video-apply {
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 10px;
    padding: 0 18px;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    transition: background 0.2s;
    white-space: nowrap;
}

.btn-video-apply:hover {
    background: #1d4ed8;
}

.card-badge-video {
    position: absolute;
    top: auto;
    left: auto;
    bottom: 8px;
    right: 8px;
    width: auto;
    max-width: max-content;
    white-space: nowrap;
    background: rgba(15, 23, 42, 0.88) !important;
    color: #ffffff !important;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.2) !important;
    border-radius: 8px !important;
    padding: 3px 8px !important;
    font-size: 0.72rem !important;
    font-weight: 800 !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 4px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25) !important;
    z-index: 3 !important;
    letter-spacing: 0.3px;
    pointer-events: none;
}

.thumb-video {
    position: relative;
    border: 2px solid #2563eb !important;
    background: #0f172a !important;
    color: #ffffff !important;
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    justify-content: center !important;
    border-radius: 10px !important;
    cursor: pointer !important;
    width: 86px;
    height: 68px;
    overflow: hidden !important;
    flex-shrink: 0 !important;
    transition: transform 0.2s, box-shadow 0.2s !important;
}

.thumb-video:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.4);
}

.thumb-video.active {
    box-shadow: 0 0 0 2px #2563eb, 0 4px 14px rgba(37, 99, 235, 0.45) !important;
}

.thumb-video .tv-play {
    width: 24px;
    height: 24px;
    background: #2563eb;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    margin-bottom: 2px;
}

.thumb-video .tv-label {
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* ==========================================================================
   DESKTOP CREATE LAYOUT & CHAT COMPACT BUBBLE ENFORCEMENT
   ========================================================================== */
.creation-container,
#createListingForm {
    width: 100% !important;
    max-width: 860px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 24px !important;
    box-sizing: border-box !important;
}

.chat-stream-area {
    display: flex !important;
    flex-direction: column !important;
    gap: 5px !important;
    padding: 12px 16px !important;
}

.msg-bubble {
    margin: 0 !important;
    padding: 6px 12px 5px 12px !important;
    line-height: 1.35 !important;
}

/* ==========================================================================
   UNIFIED LOOPMARKET BRAND LOGO & HEADER STABILITY
   ========================================================================== */
.logo {
    display: inline-flex !important;
    align-items: center !important;
    gap: 10px !important;
    text-decoration: none !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    flex-wrap: nowrap !important;
    line-height: 1 !important;
    letter-spacing: -0.5px !important;
}

.logo span {
    white-space: nowrap !important;
    display: inline-block !important;
    line-height: 1 !important;
}

.logo-circle {
    width: 38px !important;
    height: 38px !important;
    min-width: 38px !important;
    min-height: 38px !important;
    border-radius: 11px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #ffffff !important;
    font-family: 'Plus Jakarta Sans', 'Inter', system-ui, -apple-system, sans-serif !important;
    font-weight: 900 !important;
    font-size: 1.25rem !important;
    line-height: 1 !important;
    user-select: none !important;
    flex-shrink: 0 !important;
    position: relative !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.25) !important;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, background 0.35s ease, border-color 0.35s ease !important;
}

/* Light Theme: Fresh, vibrant Emerald-Teal to Deep Sky Gradient */
[data-theme="light"] .logo-circle,
html:not([data-theme="dark"]) .logo-circle {
    background: linear-gradient(135deg, #059669 0%, #0d9488 45%, #0284c7 100%) !important;
    border: 1px solid rgba(5, 150, 105, 0.3) !important;
    box-shadow: 0 4px 14px rgba(5, 150, 105, 0.28), 0 2px 6px rgba(2, 132, 199, 0.15) !important;
}

/* Dark Theme: Electric Neon Emerald to Vibrant Cyan/Cobalt Gradient with Glowing Aura */
[data-theme="dark"] .logo-circle {
    background: linear-gradient(135deg, #10b981 0%, #06b6d4 50%, #2563eb 100%) !important;
    border: 1px solid rgba(52, 211, 153, 0.45) !important;
    box-shadow: 0 4px 18px rgba(16, 185, 129, 0.42), 0 0 24px rgba(6, 182, 212, 0.22) !important;
}

.logo-circle:hover {
    transform: translateY(-1px) scale(1.06) !important;
}
[data-theme="light"] .logo-circle:hover,
html:not([data-theme="dark"]) .logo-circle:hover {
    box-shadow: 0 6px 18px rgba(5, 150, 105, 0.38), 0 3px 8px rgba(2, 132, 199, 0.22) !important;
}
[data-theme="dark"] .logo-circle:hover {
    box-shadow: 0 6px 22px rgba(16, 185, 129, 0.55), 0 0 30px rgba(6, 182, 212, 0.35) !important;
}

@media (max-width: 768px) {
    #adminPanelNavBtn,
    .admin-panel-nav-btn {
        display: none !important; /* Preserves mobile header space; fully accessible in hamburger drawer */
    }
}

@media (max-width: 480px) {
    .logo {
        font-size: 1.25rem !important;
        gap: 7px !important;
    }
    .logo-circle {
        width: 32px !important;
        height: 32px !important;
        min-width: 32px !important;
        min-height: 32px !important;
        font-size: 1.05rem !important;
    }
}


/* ==========================================================================
   2.1 BRAND IDENTITY & HUMAN TYPOGRAPHY SYSTEM (CRAFTED MODERN SANS)
   ========================================================================== */
h1, h2, h3, .heading-brand, .hero-title, .section-title, .modal-title {
    font-family: 'Manrope', 'Inter', system-ui, -apple-system, sans-serif !important;
    letter-spacing: -0.025em;
    font-weight: 700;
}

.logo, .nav-logo {
    font-family: 'Manrope', 'Inter', system-ui, -apple-system, sans-serif !important;
    font-weight: 800 !important;
    letter-spacing: -0.03em !important;
}

.card-price, .listing-card-price, .price-tag, .stat-num, .order-price-num, .details-price, .price {
    font-family: 'Inter', system-ui, -apple-system, sans-serif !important;
    font-feature-settings: 'tnum' 1, 'lnum' 1;
    font-variant-numeric: tabular-nums;
    letter-spacing: -0.02em;
    font-weight: 800;
}

/* Tactile Human Feel for Cards */
.card, .listing-card {
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.25s ease !important;
}
.card:hover, .listing-card:hover {
    transform: translateY(-4px) !important;
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.22) !important;
}


/* ==========================================================================
   UNIFIED MOBILE HAMBURGER DRAWER UI (shared across all pages)
   ========================================================================== */
.mobile-nav-drawer:has(.drawer-user-card) {
    width: min(296px, 86vw) !important;
    padding: 0 !important;
}

.drawer-header {
    padding: 18px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.btn-drawer-close {
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    color: var(--text-muted);
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.btn-drawer-close:hover {
    border-color: var(--brand-emerald);
    color: var(--text-main);
}

.drawer-user-card {
    padding: 16px 20px;
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0;
}

.drawer-links {
    padding: 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-grow: 1;
}

.drawer-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 11px 14px;
    border-radius: 12px;
    text-decoration: none;
    color: var(--text-main);
    font-weight: 700;
    font-size: 0.92rem;
    transition: all 0.2s;
    background: transparent;
    border: 1px solid transparent;
}

.drawer-link:hover,
.drawer-link.active {
    background: var(--bg-color);
    color: #10b981;
}

.drawer-link svg {
    flex-shrink: 0;
}

.drawer-sell-link {
    background: rgba(16, 185, 129, 0.12) !important;
    color: #10b981 !important;
    border: 1.5px dashed rgba(16, 185, 129, 0.35) !important;
    margin: 6px 0;
}

.drawer-admin-link {
    color: #2563eb !important;
    background: rgba(37, 99, 235, 0.08);
}

.drawer-admin-link.active,
.drawer-admin-link:hover {
    background: rgba(37, 99, 235, 0.14);
    color: #3b82f6 !important;
}

.drawer-footer {
    padding: 14px 20px calc(16px + env(safe-area-inset-bottom, 0px));
    border-top: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 10px;
    flex-shrink: 0;
}

.drawer-theme-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.btn-drawer-theme {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 12px;
    border-radius: 10px;
    border: 1px solid var(--border-color);
    background: var(--bg-color);
    color: var(--text-main);
    font-weight: 700;
    font-size: 0.82rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-drawer-theme:hover {
    border-color: var(--brand-emerald);
    color: #10b981;
}

.btn-drawer-logout {
    width: 100%;
    padding: 11px;
    border-radius: 10px;
    border: 1.5px solid rgba(239, 68, 68, 0.3);
    background: rgba(239, 68, 68, 0.08);
    color: #ef4444;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: all 0.2s;
}

.btn-drawer-logout:hover {
    background: rgba(239, 68, 68, 0.15);
}

.badge-count {
    background: #ef4444;
    color: #ffffff;
    font-size: 0.72rem;
    font-weight: 800;
    padding: 1px 6px;
    border-radius: 12px;
    min-width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.45);
    border: 1.5px solid var(--surface);
    line-height: 1;
}

/* ==========================================================================
   RESERVED SYMMETRICAL SIDE AD-BANNER GUTTERS (ALL STOREFRONT PAGES)
   ========================================================================== */
@media (min-width: 1200px) {
    :root {
        --loop-ad-edge: 12px;
        --loop-ad-width: 184px;
        --loop-ad-gap: 14px;
        --loop-ad-gutter: 210px;
        --loop-content-max: 1548px;
        --loop-shell-max: calc(1548px + 2 * var(--loop-ad-gutter));
    }
}

@media (min-width: 1400px) {
    :root {
        --loop-ad-edge: 14px;
        --loop-ad-width: 220px;
        --loop-ad-gap: 16px;
        --loop-ad-gutter: 250px;
    }
}

@media (min-width: 1680px) {
    :root {
        --loop-ad-edge: 18px;
        --loop-ad-width: 240px;
        --loop-ad-gap: 20px;
        --loop-ad-gutter: 278px;
    }
}

@media (min-width: 1200px) {
    body > main:not(.admin-main),
    body > .container,
    body > .main-layout,
    body > main.container,
    body > main.main-container {
        max-width: var(--loop-shell-max) !important;
        width: 100% !important;
        margin-left: auto !important;
        margin-right: auto !important;
        padding-left: var(--loop-ad-gutter) !important;
        padding-right: var(--loop-ad-gutter) !important;
        box-sizing: border-box !important;
    }

    body > .trust-banner {
        padding-left: var(--loop-ad-gutter) !important;
        padding-right: var(--loop-ad-gutter) !important;
        box-sizing: border-box !important;
    }

    body > header .header-content {
        max-width: var(--loop-content-max) !important;
        width: 100% !important;
        margin-left: auto !important;
        margin-right: auto !important;
    }

    body > footer {
        padding-left: var(--loop-ad-gutter) !important;
        padding-right: var(--loop-ad-gutter) !important;
        box-sizing: border-box !important;
    }

    body > footer .footer-content,
    body > footer .footer-grid {
        max-width: var(--loop-content-max) !important;
        width: 100% !important;
        margin-left: auto !important;
        margin-right: auto !important;
        box-sizing: border-box !important;
    }
}

@media (min-width: 1200px) and (max-width: 1520px) {
    body.loop-home-page > .main-layout {
        grid-template-columns: 245px minmax(0, 1fr) !important;
        gap: 20px !important;
    }

    body.loop-home-page > .main-layout .sidebar {
        padding: 20px !important;
    }

    body.loop-home-page > .main-layout .listings-grid {
        grid-template-columns: repeat(auto-fill, minmax(205px, 1fr)) !important;
        gap: 16px !important;
    }
}


/* --- Vector SVG Icon Alignment --- */
.loop-svg-icon {
    display: inline-block;
    vertical-align: -0.15em;
    flex-shrink: 0;
    line-height: 1;
}

.loop-svg-icon-wrap {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

.cat-icon-svg {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--primary, #10b981);
}

/* --- Header Logo Subscription Badges (PRO & VIP) --- */
.loop-logo-sub-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 7px;
    border-radius: 9999px;
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.6px;
    text-transform: uppercase;
    vertical-align: middle;
    margin-left: 8px;
    line-height: 1.2;
    box-shadow: 0 2px 8px rgba(0,0,0,0.18);
    transition: transform 0.2s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.2s ease;
    cursor: pointer;
    text-decoration: none !important;
    user-select: none;
    flex-shrink: 0;
}
.loop-logo-sub-badge:hover {
    transform: translateY(-1px) scale(1.05);
}
.loop-logo-sub-badge.pro {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.22) 0%, rgba(217, 119, 6, 0.35) 100%);
    border: 1.5px solid rgba(245, 158, 11, 0.75);
    color: #fbbf24;
    box-shadow: 0 0 10px rgba(245, 158, 11, 0.25);
}
.loop-logo-sub-badge.vip {
    background: linear-gradient(135deg, rgba(168, 85, 247, 0.22) 0%, rgba(139, 92, 246, 0.38) 100%);
    border: 1.5px solid rgba(168, 85, 247, 0.75);
    color: #e9d5ff;
    box-shadow: 0 0 12px rgba(168, 85, 247, 0.3);
}



/* ========================================================
   LoopMarket Footer Accordion (Desktop & Mobile)
   ======================================================== */
.footer-chevron {
    display: none;
}

.footer-col-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-col-body {
    display: block;
}

@media (max-width: 768px) {
    body > footer,
    footer {
        padding: 28px 16px calc(24px + env(safe-area-inset-bottom, 0px)) !important;
    }

    footer .footer-content,
    footer .footer-grid {
        display: flex !important;
        flex-direction: column !important;
        gap: 0 !important;
        width: 100% !important;
    }

    /* Перша колонка (логотип, опис) */
    footer .footer-col:first-child {
        padding-bottom: 14px !important;
        margin-bottom: 8px !important;
        border-bottom: 1px solid var(--border-color) !important;
        text-align: left;
    }

    /* Акордеонні секції футера */
    footer .footer-col.footer-accordion,
    footer .footer-col:has(h4),
    footer .footer-col.has-accordion {
        border-bottom: 1px solid var(--border-color) !important;
        padding: 0 !important;
        margin: 0 !important;
    }

    footer .footer-col-header,
    footer .footer-col > h4 {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        cursor: pointer !important;
        padding: 13px 4px !important;
        margin: 0 !important;
        user-select: none !important;
        -webkit-tap-highlight-color: transparent;
        transition: color 0.2s ease;
    }

    footer .footer-col-header h4,
    footer .footer-col > h4 {
        margin: 0 !important;
        font-size: 0.92rem !important;
        font-weight: 800 !important;
        color: var(--text-main) !important;
        letter-spacing: 0.5px;
        text-transform: uppercase;
        display: flex;
        align-items: center;
        gap: 8px;
    }

    footer .footer-chevron {
        display: inline-block !important;
        color: var(--text-muted);
        transition: transform 0.28s cubic-bezier(0.4, 0, 0.2, 1), stroke 0.2s ease, color 0.2s ease;
        flex-shrink: 0;
    }

    footer .footer-col.open .footer-chevron {
        transform: rotate(180deg) !important;
        color: #10b981 !important;
        stroke: #10b981 !important;
    }

    footer .footer-col.open .footer-col-header h4,
    footer .footer-col.open > h4 {
        color: #10b981 !important;
    }

    footer .footer-col-body {
        display: none;
        padding: 4px 6px 14px 6px;
        animation: footerAccordionFade 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    }

    footer .footer-col.open .footer-col-body {
        display: block !important;
    }

    footer .footer-col-body a,
    footer .footer-col.open > a {
        display: flex !important;
        align-items: center;
        gap: 8px;
        padding: 7px 0 !important;
        margin-bottom: 2px !important;
        font-size: 0.9rem !important;
        color: var(--text-muted) !important;
        text-decoration: none !important;
        transition: color 0.18s ease, transform 0.18s ease;
    }

    footer .footer-col-body a:hover,
    footer .footer-col-body a:active {
        color: #10b981 !important;
        transform: translateX(3px);
    }

    footer .footer-bottom {
        margin-top: 20px !important;
        padding-top: 16px !important;
        font-size: 0.78rem !important;
        line-height: 1.5 !important;
        text-align: center !important;
    }
}

@keyframes footerAccordionFade {
    from {
        opacity: 0;
        transform: translateY(-6px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
