/* ============================================
   ABUXAY.UZ - Design System & Core Styles
   Premium Men's Fashion E-Commerce
   ============================================ */

/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800;900&family=Outfit:wght@300;400;500;600;700;800;900&display=swap');

/* ============ CSS VARIABLES ============ */
:root {
  /* Colors - Light Premium Blue Theme */
  --bg-darkest: #f3f4f6; /* Body bg */
  --bg-darker: #f9fafb;
  --bg-dark: #f3f4f6;
  --bg-card: #ffffff;
  --bg-card-hover: #f9fafb;
  --bg-surface: #ffffff;
  --bg-elevated: #ffffff;
  --bg-input: #f9fafb;

  /* Blue Accent */
  --gold-primary: #3b82f6;
  --gold-light: #60a5fa;
  --gold-lighter: #93c5fd;
  --gold-dark: #2563eb;
  --gold-darker: #1d4ed8;
  --gold-gradient: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  --gold-gradient-subtle: linear-gradient(135deg, rgba(59, 130, 246, 0.1) 0%, rgba(37, 99, 235, 0.05) 100%);

  /* Text Colors */
  --text-primary: #1f2937;
  --text-secondary: #4b5563;
  --text-tertiary: #6b7280;
  --text-muted: #9ca3af;
  --text-gold: #3b82f6;

  /* Border Colors */
  --border-subtle: rgba(0, 0, 0, 0.05);
  --border-light: rgba(0, 0, 0, 0.08);
  --border-medium: rgba(0, 0, 0, 0.12);
  --border-gold: rgba(59, 130, 246, 0.3);
  --border-gold-strong: rgba(59, 130, 246, 0.6);

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.1);
  --shadow-gold: 0 4px 14px 0 rgba(59, 130, 246, 0.39);
  --shadow-gold-lg: 0 6px 20px rgba(59, 130, 246, 0.4);

  /* Status Colors */
  --success: #10b981;
  --error: #ef4444;
  --warning: #f59e0b;
  --info: #3b82f6;

  /* Typography */
  --font-primary: 'Outfit', 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-secondary: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Font Sizes */
  --text-xs: 0.7rem;
  --text-sm: 0.8rem;
  --text-base: 0.95rem;
  --text-md: 1.05rem;
  --text-lg: 1.2rem;
  --text-xl: 1.5rem;
  --text-2xl: 1.8rem;
  --text-3xl: 2.2rem;
  --text-4xl: 3rem;
  --text-5xl: 4rem;

  /* Spacing */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;

  /* Border Radius */
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --radius-xl: 24px;
  --radius-full: 9999px;

  /* Transitions */
  --transition-fast: 150ms ease;
  --transition-base: 250ms ease;
  --transition-slow: 400ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Z-Index */
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-header: 300;
  --z-modal-overlay: 400;
  --z-modal: 500;
  --z-notification: 600;
  --z-tooltip: 700;

  /* Layout */
  --header-height: 64px;
  --sidebar-width: 260px;
  --max-content-width: 1400px;
}

/* ============ RESET & BASE ============ */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior: none;
}

body {
  font-family: var(--font-primary);
  background-color: var(--bg-darkest);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  overscroll-behavior: none;
}

/* Custom Scrollbar */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--bg-darker);
}

::-webkit-scrollbar-thumb {
  background: #333333;
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--gold-dark);
}

/* Selection */
::selection {
  background: rgba(201, 169, 78, 0.3);
  color: var(--text-primary);
}

/* Links */
a {
  color: var(--gold-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--gold-light);
}

/* Images */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Lists */
ul, ol {
  list-style: none;
}

/* ============ TYPOGRAPHY ============ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-primary);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-primary);
}

h1 { font-size: var(--text-4xl); letter-spacing: -0.02em; }
h2 { font-size: var(--text-3xl); letter-spacing: -0.01em; }
h3 { font-size: var(--text-2xl); }
h4 { font-size: var(--text-xl); }
h5 { font-size: var(--text-lg); }
h6 { font-size: var(--text-md); }

p {
  color: var(--text-secondary);
  line-height: 1.7;
}

.text-gold {
  color: var(--gold-primary);
}

.text-gradient {
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* ============ LAYOUT UTILITIES ============ */
.container {
  width: 100%;
  max-width: var(--max-content-width);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.flex {
  display: flex;
}

.flex-col {
  flex-direction: column;
}

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

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

.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

.grid {
  display: grid;
}

.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* ============ ANIMATIONS ============ */
@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

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

@keyframes fadeInScale {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-40px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.8);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes shimmer {
  0% { background-position: -200% center; }
  100% { background-position: 200% center; }
}

@keyframes goldPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(37, 99, 235, 0.4); }
  50% { box-shadow: 0 0 0 10px rgba(37, 99, 235, 0); }
}

@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
    max-height: 0;
  }
  to {
    opacity: 1;
    transform: translateY(0);
    max-height: 500px;
  }
}

@keyframes ripple {
  to {
    transform: scale(4);
    opacity: 0;
  }
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

/* Animation Utilities */
.animate-fadeIn { animation: fadeIn 0.5s ease forwards; }
.animate-fadeInUp { animation: fadeInUp 0.6s ease forwards; }
.animate-fadeInDown { animation: fadeInDown 0.5s ease forwards; }
.animate-fadeInScale { animation: fadeInScale 0.4s ease forwards; }
.animate-slideInRight { animation: slideInRight 0.5s ease forwards; }
.animate-slideInLeft { animation: slideInLeft 0.5s ease forwards; }
.animate-scaleIn { animation: scaleIn 0.4s ease forwards; }
.animate-float { animation: float 3s ease-in-out infinite; }

/* Stagger delays */
.delay-1 { animation-delay: 0.1s; }
.delay-2 { animation-delay: 0.2s; }
.delay-3 { animation-delay: 0.3s; }
.delay-4 { animation-delay: 0.4s; }
.delay-5 { animation-delay: 0.5s; }

/* ============ GLASSMORPHISM ============ */
.glass {
  background: rgba(10, 10, 10, 0.8);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-subtle);
}

.glass-gold {
  background: rgba(201, 169, 78, 0.08);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid var(--border-gold);
}

/* ============ PAGE TRANSITION ============ */
.page-content {
  /* Removed animation to prevent jumping on re-renders */
}

/* ============ RESPONSIVE BREAKPOINTS ============ */
/* Mobile first approach */
/* sm: 640px, md: 768px, lg: 1024px, xl: 1280px */

@media (max-width: 1280px) {
  :root {
    --max-content-width: 1100px;
  }
}

@media (max-width: 1024px) {
  :root {
    --sidebar-width: 220px;
  }
  h1 { font-size: var(--text-3xl); }
  h2 { font-size: var(--text-2xl); }
}

@media (max-width: 768px) {
  :root {
    --header-height: 56px;
  }
  html { font-size: 15px; }
  h1 { font-size: var(--text-2xl); }
  h2 { font-size: var(--text-xl); }
  .container { padding: 0 var(--space-4); }
}

@media (max-width: 480px) {
  html { font-size: 14px; }
  h1 { font-size: var(--text-xl); }
  .container { padding: 0 var(--space-3); }
}

/* ============ LIGHT THEME (Override) ============ */
[data-theme='light'] {
  --bg-darkest: #f5f7fa;
  --bg-darker: #eef1f6;
  --bg-dark: #e8ecf2;
  --bg-card: #ffffff;
  --bg-card-hover: #f8fafc;
  --bg-surface: #f0f3f8;
  --bg-elevated: #ffffff;
  --bg-input: #f5f7fa;
  
  --gold-primary: #2563eb;
  --gold-light: #3b82f6;
  --gold-lighter: #93bbfd;
  --gold-dark: #1d4ed8;
  --gold-darker: #1e40af;
  --gold-gradient: linear-gradient(135deg, #2563eb 0%, #3b82f6 50%, #60a5fa 100%);
  --gold-gradient-subtle: linear-gradient(135deg, rgba(37, 99, 235, 0.08) 0%, rgba(59, 130, 246, 0.04) 100%);
  
  --text-primary: #1a1a2e;
  --text-secondary: #4a5568;
  --text-tertiary: #718096;
  --text-muted: #a0aec0;
  --text-gold: #2563eb;
  
  --border-subtle: rgba(0, 0, 0, 0.06);
  --border-light: rgba(0, 0, 0, 0.1);
  --border-medium: rgba(0, 0, 0, 0.15);
  --border-gold: rgba(37, 99, 235, 0.25);
  --border-gold-strong: rgba(37, 99, 235, 0.5);
  
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 15px 50px rgba(0, 0, 0, 0.12);
  --shadow-gold: 0 4px 20px rgba(37, 99, 235, 0.12);
  --shadow-gold-lg: 0 8px 40px rgba(37, 99, 235, 0.18);
}

/* ============ FOOTER ============ */
.footer {
  background-color: var(--bg-surface);
  border-top: 1px solid var(--border-subtle);
  padding: 24px 0;
  margin-top: 32px;
  color: var(--text-secondary);
}
.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
}
.footer-brand h3 {
  font-size: 16px;
  margin-bottom: 4px;
  color: var(--text-primary);
}
.footer-brand p {
  color: var(--text-tertiary);
  font-size: 12px;
}
.footer-contact {
  text-align: right;
}
.footer-contact p {
  color: var(--text-tertiary);
  font-size: 12px;
  margin-bottom: 2px;
}
@media (max-width: 768px) {
  .footer-inner {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  .footer-contact {
    text-align: center;
  }
}

/* ============ LANG SELECTOR ============ */
.lang-dropdown {
  position: relative;
  margin-right: 12px;
}
.lang-btn {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 500;
  padding: 6px 12px;
  border-radius: 6px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
}
.lang-btn:hover {
  background: var(--bg-elevated);
  border-color: var(--border-medium);
}
.lang-dropdown-menu {
  position: absolute;
  top: 110%;
  right: 0;
  background: var(--bg-elevated);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  box-shadow: var(--shadow-md);
  padding: 8px;
  min-width: 160px;
  z-index: var(--z-dropdown);
  display: none;
  flex-direction: column;
  gap: 4px;
}
.lang-dropdown-menu.show {
  display: flex;
  animation: fadeInDown 0.2s ease forwards;
}
.lang-dropdown-item {
  padding: 8px 12px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text-primary);
  transition: all 0.2s ease;
}
.lang-dropdown-item:hover {
  background: var(--bg-surface);
  color: var(--gold-primary);
}

/* ============ DARK THEME ============ */
[data-theme="dark"] {
  --bg-darkest: #050505;
  --bg-darker: #0a0a0a;
  --bg-dark: #111111;
  --bg-card: #161616;
  --bg-card-hover: #1c1c1c;
  --bg-surface: #1a1a1a;
  --bg-elevated: #222222;
  --bg-input: #1a1a1a;

  --gold-primary: #c9a94e;
  --gold-light: #d4af37;
  --gold-lighter: #e8d48b;
  --gold-dark: #b8942e;
  --gold-darker: #8a6d1b;
  --gold-gradient: linear-gradient(135deg, #c9a94e 0%, #d4af37 50%, #e8d48b 100%);
  --gold-gradient-subtle: linear-gradient(135deg, rgba(201, 169, 78, 0.1) 0%, rgba(212, 175, 55, 0.05) 100%);

  --text-primary: #ffffff;
  --text-secondary: #c0c0c0;
  --text-tertiary: #888888;
  --text-muted: #555555;
  --text-gold: #c9a94e;

  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-light: rgba(255, 255, 255, 0.1);
  --border-medium: rgba(255, 255, 255, 0.15);
  --border-gold: rgba(201, 169, 78, 0.3);
  --border-gold-strong: rgba(201, 169, 78, 0.6);

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.5);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.6);
  --shadow-xl: 0 15px 50px rgba(0, 0, 0, 0.7);
  --shadow-gold: 0 4px 20px rgba(201, 169, 78, 0.15);
  --shadow-gold-lg: 0 8px 40px rgba(201, 169, 78, 0.2);
}

/* ============================================
   RESPONSIVE DESKTOP LAYOUT
   ============================================ */
.desktop-sidebar { display: none; }
.desktop-header { display: none; }
.desktop-layout-wrapper { display: block; }
.desktop-main-content { width: 100%; }

@media (min-width: 1024px) {
  .mobile-header { display: none !important; }
  .bottom-nav { display: none !important; }
  
  .desktop-layout-wrapper {
    display: flex;
    min-height: 100vh;
  }
  
  .desktop-sidebar {
    display: flex;
    flex-direction: column;
    width: 260px;
    background: var(--bg-card);
    border-right: 1px solid var(--border-light);
    position: sticky;
    top: 0;
    height: 100vh;
    padding: 24px;
    z-index: 100;
  }
  
  .desktop-sidebar-logo {
    display: flex;
    align-items: center;
    font-size: 20px;
    font-weight: 800;
    color: var(--gold-primary);
    margin-bottom: 40px;
  }
  
  .desktop-sidebar-title {
    font-size: 11px;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 2px;
    margin-bottom: 16px;
  }
  
  .desktop-sidebar-nav {
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  
  .desktop-sidebar-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    color: var(--text-secondary);
    border-radius: 12px;
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
    transition: all 0.2s;
  }
  
  .desktop-sidebar-link:hover, .desktop-sidebar-link.active {
    background: var(--gold-primary);
    color: var(--bg-darkest);
    font-weight: 700;
  }
  
  .desktop-main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
  }
  
  .desktop-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 70px;
    background: var(--bg-surface);
    color: var(--text-primary);
    padding: 0 32px;
    position: sticky;
    top: 0;
    z-index: 99;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  }
  
  .desktop-header-nav {
    display: flex;
    gap: 24px;
  }
  
  .desktop-header-nav a {
    color: var(--bg-darkest);
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    opacity: 0.8;
    transition: opacity 0.2s;
  }
  
  .desktop-header-nav a:hover {
    opacity: 1;
  }
  
  .desktop-header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
  }
  
  .desktop-action-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s;
  }
  
  
  .desktop-action-btn.active {
    background: var(--gold-primary) !important;
    color: #ffffff !important;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(59, 130, 246, 0.45);
  }
  .desktop-action-btn.active svg {
    stroke: #ffffff !important;
  }
  .desktop-action-btn:hover {
    transform: scale(1.1);
  }
  
  .desktop-cart-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #e74c3c;
    color: white;
    font-size: 10px;
    font-weight: 700;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}


.products-grid-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 0 12px 24px;
}
@media (min-width: 1024px) {
  .products-grid-container {
    grid-template-columns: 1fr 1fr 1fr 1fr;
    gap: 20px;
    padding: 0 24px 32px;
  }
}


/* ============ DESKTOP NAV ACTIVE LINKS ============ */
@media (min-width: 1024px) {

  .desktop-nav-link {
    position: relative;
    color: rgba(255, 255, 255, 0.75) !important;
    font-weight: 600;
    font-size: 15px;
    text-decoration: none;
    padding: 6px 2px;
    transition: color 0.2s ease;
  }

  .desktop-nav-link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 2px;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 2px;
    transition: width 0.25s ease;
  }

  .desktop-nav-link:hover {
    color: white !important;
  }

  .desktop-nav-link:hover::after {
    width: 100%;
  }

  .desktop-nav-link.active {
    color: white !important;
    font-weight: 700;
  }

  .desktop-nav-link.active::after {
    width: 100%;
    background: white;
  }
}
