/* CSS Design System for SnapShop */
:root {
  /* Colors */
  --primary: #d31e28; /* Premium Red */
  --primary-hover: #b1131c;
  --secondary: #111111; /* Off-black */
  --text-main: #222222;
  --text-muted: #666666;
  --bg-main: #ffffff;
  --bg-light: #f7f7f8;
  --bg-card: #ffffff;
  --border-color: #e2e2e7;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.08);
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;

  /* Typography */
  --font-sans: 'Outfit', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --font-serif: 'Playfair Display', Georgia, serif;
}

/* =====================
   THEME DEFINITIONS
   Applied via [data-theme] on <html>
   ===================== */

/* Classic Light (Default) */
[data-theme="light"] {
  --primary: #d31e28;
  --primary-hover: #b1131c;
  --secondary: #111111;
  --text-main: #222222;
  --text-muted: #666666;
  --bg-main: #ffffff;
  --bg-light: #f7f7f8;
  --bg-card: #ffffff;
  --border-color: #e2e2e7;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.08);
}

/* Sleek Dark Mode */
[data-theme="dark"] {
  --primary: #ef4444;
  --primary-hover: #dc2626;
  --secondary: #f1f5f9;
  --text-main: #e2e8f0;
  --text-muted: #94a3b8;
  --bg-main: #0f172a;
  --bg-light: #1e293b;
  --bg-card: #1e293b;
  --border-color: #334155;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.2);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.3);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.4);
}

/* Glassmorphism Overlay */
[data-theme="glass"] {
  --primary: #8b5cf6;
  --primary-hover: #7c3aed;
  --secondary: #1e1b4b;
  --text-main: #1e1b4b;
  --text-muted: #6b7280;
  --bg-main: rgba(255, 255, 255, 0.6);
  --bg-light: rgba(243, 244, 246, 0.5);
  --bg-card: rgba(255, 255, 255, 0.7);
  --border-color: rgba(255, 255, 255, 0.3);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 8px 32px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 16px 48px rgba(0, 0, 0, 0.12);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

/* Vibrant */
[data-theme="vibrant"] {
  --primary: #f59e0b;
  --primary-hover: #d97706;
  --secondary: #7c2d12;
  --text-main: #431407;
  --text-muted: #9a3412;
  --bg-main: #fffbeb;
  --bg-light: #fef3c7;
  --bg-card: #ffffff;
  --border-color: #fde68a;
  --shadow-sm: 0 1px 2px rgba(245, 158, 11, 0.1);
  --shadow-md: 0 4px 12px rgba(245, 158, 11, 0.15);
  --shadow-lg: 0 10px 30px rgba(245, 158, 11, 0.2);
}

/* Minimal */
[data-theme="minimal"] {
  --primary: #3b82f6;
  --primary-hover: #2563eb;
  --secondary: #1e293b;
  --text-main: #334155;
  --text-muted: #94a3b8;
  --bg-main: #ffffff;
  --bg-light: #f8fafc;
  --bg-card: #ffffff;
  --border-color: #e2e8f0;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.03);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.05);
}

/* Midnight */
[data-theme="midnight"] {
  --primary: #06b6d4;
  --primary-hover: #0891b2;
  --secondary: #e2e8f0;
  --text-main: #cbd5e1;
  --text-muted: #64748b;
  --bg-main: #020617;
  --bg-light: #0f172a;
  --bg-card: #1e293b;
  --border-color: #1e293b;
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 10px 30px rgba(0, 0, 0, 0.5);
}

/* Nature */
[data-theme="nature"] {
  --primary: #22c55e;
  --primary-hover: #16a34a;
  --secondary: #14532d;
  --text-main: #052e16;
  --text-muted: #15803d;
  --bg-main: #f0fdf4;
  --bg-light: #dcfce7;
  --bg-card: #ffffff;
  --border-color: #bbf7d0;
  --shadow-sm: 0 1px 2px rgba(34, 197, 94, 0.08);
  --shadow-md: 0 4px 12px rgba(34, 197, 94, 0.12);
  --shadow-lg: 0 10px 30px rgba(34, 197, 94, 0.16);
}

/* Base Reset */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  max-width: 100%;
  overflow-x: hidden;
}

body {
  font-family: var(--font-sans);
  color: var(--text-main);
  background-color: var(--bg-light);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  max-width: 100%;
  overflow-x: hidden;
  position: relative;
}

a {
  color: inherit;
  text-decoration: none;
  transition: all 0.2s ease;
}

img {
  max-width: 100%;
}

button, input, select, textarea {
  font-family: inherit;
  font-size: inherit;
}

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* =====================
   LAYOUT UTILITIES
   ===================== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

@media (max-width: 480px) {
  .container {
    padding: 0 16px;
  }
}

.flex {
  display: flex;
}

.align-center {
  align-items: center;
}

.justify-between {
  justify-content: space-between;
}

.grid {
  display: grid;
}

/* =====================
   BUTTONS
   ===================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 28px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  border-radius: 50px;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@media (max-width: 480px) {
  .btn {
    padding: 10px 20px;
    font-size: 13px;
  }
}

.btn-primary {
  background-color: var(--primary);
  color: white;
}

.btn-primary:hover {
  background-color: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(211, 30, 40, 0.25);
}

.btn-secondary {
  background-color: white;
  color: var(--secondary);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background-color: var(--bg-light);
  transform: translateY(-2px);
}

.btn-dark {
  background-color: var(--secondary);
  color: white;
}

.btn-dark:hover {
  background-color: #2c2c2c;
  transform: translateY(-2px);
}

/* =====================
   ANIMATIONS
   ===================== */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

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

.fade-in {
  animation: fadeIn 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* =====================
   BADGE / RATING
   ===================== */
.rating-stars {
  color: #fbbf24;
  font-size: 14px;
  display: inline-flex;
  gap: 2px;
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  font-size: 11px;
  font-weight: 600;
  border-radius: 4px;
  text-transform: uppercase;
}

.badge-sale {
  background-color: var(--primary);
  color: white;
}

/* =====================
   FORM STYLES
   ===================== */
.form-group {
  margin-bottom: 18px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 15px;
  transition: all 0.2s ease;
  background-color: var(--bg-main);
}

.form-input:focus {
  outline: none;
  border-color: var(--secondary);
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.05);
}

/* =====================
   NAVBAR RESPONSIVE
   ===================== */

/* Mobile hamburger button - hidden on desktop, shown on mobile */
.mobile-toggle {
  display: none !important;
}

@media (max-width: 768px) {
  .mobile-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    padding: 8px;
    color: var(--secondary);
    z-index: 101;
    order: -1;
  }
}

/* Desktop nav */
.nav-desktop {
  display: flex;
  gap: 32px;
  margin-left: 40px;
  align-items: center;
}

@media (max-width: 768px) {
  .nav-desktop {
    display: none !important;
  }
}

/* Language selector — hide on mobile */
.lang-selector-hide-mobile {
  display: flex;
}

@media (max-width: 600px) {
  .lang-selector-hide-mobile {
    display: none !important;
  }
}

/* Mobile Menu overlay */
.nav-mobile-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.5);
  z-index: 199;
}

.nav-mobile-overlay.open {
  display: block;
}

/* Mobile Menu drawer */
.nav-mobile-drawer {
  position: fixed;
  top: 0;
  left: -100%;
  width: 80%;
  max-width: 320px;
  height: 100vh;
  background: white;
  z-index: 200;
  transition: left 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
  padding: 24px 0;
}

.nav-mobile-drawer.open {
  left: 0;
}

.nav-mobile-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px 24px;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 8px;
}

.nav-mobile-link {
  display: flex;
  align-items: center;
  padding: 14px 24px;
  font-size: 16px;
  font-weight: 500;
  color: var(--text-main);
  border-bottom: 1px solid #f5f5f7;
  transition: background-color 0.2s ease;
}

.nav-mobile-link:hover,
.nav-mobile-link.active {
  background-color: var(--bg-light);
  color: var(--secondary);
}

.nav-mobile-link.active {
  font-weight: 700;
  border-left: 3px solid var(--primary);
}

/* =====================
   SHOP PAGE RESPONSIVE
   ===================== */

/* Shop Filter toggle button on mobile */
.filter-toggle-btn {
  display: none;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background-color: var(--secondary);
  color: white;
  border-radius: var(--radius-md);
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 20px;
  width: 100%;
  justify-content: center;
}

@media (max-width: 768px) {
  .filter-toggle-btn {
    display: flex;
  }
}

/* Shop layout sidebar */
.shop-layout {
  display: flex;
  gap: 40px;
  padding-top: 40px;
  padding-bottom: 80px;
}

.shop-sidebar {
  width: 260px;
  flex-shrink: 0;
}

@media (max-width: 768px) {
  .shop-layout {
    flex-direction: column;
    gap: 0;
    padding-top: 24px;
  }

  .shop-sidebar {
    width: 100%;
    /* collapsible on mobile */
  }

  .shop-sidebar-hidden {
    display: none;
  }
}

/* =====================
   HERO SECTION
   ===================== */
.hero-title-responsive {
  font-size: 56px;
}

@media (max-width: 900px) {
  .hero-title-responsive {
    font-size: 42px;
  }
}

@media (max-width: 600px) {
  .hero-title-responsive {
    font-size: 32px;
  }
}

/* =====================
   PRODUCT GRID
   ===================== */
.products-grid-responsive {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 30px;
}

@media (max-width: 640px) {
  .products-grid-responsive {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

@media (max-width: 360px) {
  .products-grid-responsive {
    grid-template-columns: 1fr;
  }
}

/* =====================
   TRUST SECTION
   ===================== */
.trust-grid-responsive {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
}

@media (max-width: 480px) {
  .trust-grid-responsive {
    grid-template-columns: 1fr;
    gap: 16px;
  }
}

/* =====================
   CART / CHECKOUT
   ===================== */
.cart-layout-responsive {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 32px;
  align-items: start;
}

@media (max-width: 900px) {
  .cart-layout-responsive {
    grid-template-columns: 1fr;
  }
}

/* =====================
   CHECKOUT FORM ROWS
   ===================== */
.form-row-responsive {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 600px) {
  .form-row-responsive {
    grid-template-columns: 1fr;
  }
}

/* =====================
   SECTION HEADER
   ===================== */
.section-header-responsive {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 40px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 16px;
}

@media (max-width: 480px) {
  .section-header-responsive {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
}

/* =====================
   FOOTER RESPONSIVE
   ===================== */
.footer-grid-responsive {
  display: grid !important;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)) !important;
  gap: 40px !important;
}

@media (max-width: 600px) {
  .footer-grid-responsive {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 24px 16px !important;
  }
}

@media (max-width: 360px) {
  .footer-grid-responsive {
    grid-template-columns: 1fr !important;
    gap: 20px !important;
  }
}

/* =====================
   PRODUCT DETAIL
   ===================== */
.product-detail-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 60px;
  align-items: start;
}

@media (max-width: 768px) {
  .product-detail-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }
}

/* =====================
   HIDE / SHOW HELPERS
   ===================== */
@media (max-width: 768px) {
  .hide-mobile {
    display: none !important;
  }
}

@media (min-width: 769px) {
  .hide-desktop {
    display: none !important;
  }
}

/* =====================================
   COMPREHENSIVE MOBILE RESPONSIVE SYSTEM
   ===================================== */

/* Mobile Safe Container */
@media (max-width: 640px) {
  .container {
    padding: 0 16px !important;
  }
}
@media (max-width: 360px) {
  .container {
    padding: 0 12px !important;
  }
}

/* --- SHOP PAGE RESPONSIVE --- */
.shop-mobile-filter-btn {
  display: none !important;
}

@media (max-width: 768px) {
  .shop-mobile-filter-btn {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 100% !important;
    padding: 12px 16px !important;
    background: #0f172a !important;
    color: #ffffff !important;
    border-radius: 10px !important;
    font-size: 14px !important;
    font-weight: 700 !important;
    margin-bottom: 16px !important;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.15) !important;
  }

  .shop-desktop-sidebar {
    display: none !important;
  }

  .shop-layout-wrapper {
    flex-direction: column !important;
    gap: 16px !important;
  }

  .shop-quick-filter-bar {
    padding: 10px 14px !important;
    margin-bottom: 16px !important;
    border-radius: 12px !important;
    gap: 8px !important;
    overflow-x: auto !important;
    scrollbar-width: none !important;
    -ms-overflow-style: none !important;
    -webkit-overflow-scrolling: touch !important;
  }

  .shop-quick-filter-bar::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
  }

  .shop-toolbar {
    flex-direction: column !important;
    align-items: flex-start !important;
    gap: 12px !important;
    margin-bottom: 18px !important;
    width: 100% !important;
  }

  .shop-toolbar-actions {
    width: 100% !important;
    display: flex !important;
    align-items: center !important;
    gap: 8px !important;
  }

  .shop-layout-toggles {
    display: flex !important;
    flex-shrink: 0 !important;
  }

  .shop-select-wrapper {
    flex: 1 !important;
    min-width: 0 !important;
    position: relative !important;
  }

  .shop-select-wrapper select {
    width: 100% !important;
    padding: 8px 24px 8px 10px !important;
    font-size: 12px !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  .shop-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
  }

  .shop-card-image-box {
    height: 180px !important;
  }

  .shop-card-info-box {
    padding: 12px 10px !important;
  }

  .shop-card-title {
    font-size: 13px !important;
  }

  .shop-card-price {
    font-size: 14px !important;
  }
}

@media (max-width: 380px) {
  .shop-toolbar-actions {
    flex-wrap: wrap !important;
    gap: 8px !important;
  }
  .shop-layout-toggles {
    order: 1 !important;
  }
  .shop-select-limit {
    flex: 1 !important;
    order: 2 !important;
  }
  .shop-select-sort {
    width: 100% !important;
    flex: 1 1 100% !important;
    order: 3 !important;
  }
}

@media (max-width: 360px) {
  .shop-product-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }

  .shop-card-image-box {
    height: 240px !important;
  }
}

/* --- PRODUCT DETAIL RESPONSIVE --- */
@media (max-width: 768px) {
  .pdetail-grid {
    flex-direction: column !important;
    gap: 24px !important;
  }

  .pdetail-image-col,
  .pdetail-details-col {
    flex: 1 1 100% !important;
    width: 100% !important;
  }

  .pdetail-main-img-wrap {
    height: 320px !important;
    border-radius: 12px !important;
  }

  .pdetail-thumb-row {
    gap: 8px !important;
    overflow-x: auto !important;
    padding-bottom: 4px !important;
  }

  .pdetail-thumb-btn {
    width: 56px !important;
    height: 56px !important;
    flex-shrink: 0 !important;
  }

  .pdetail-title {
    font-size: 22px !important;
    line-height: 1.3 !important;
  }

  .pdetail-btn-section {
    flex-direction: column !important;
    gap: 12px !important;
  }

  .pdetail-trust-row {
    display: grid !important;
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 12px !important;
  }
}

@media (max-width: 480px) {
  .pdetail-main-img-wrap {
    height: 280px !important;
  }
}

/* --- CART PAGE RESPONSIVE --- */
@media (max-width: 768px) {
  .cart-page-layout {
    flex-direction: column !important;
    padding-top: 16px !important;
    padding-bottom: 40px !important;
    gap: 24px !important;
  }

  .cart-page-items-col,
  .cart-page-summary-col {
    flex: 1 1 100% !important;
    width: 100% !important;
  }

  .cart-page-summary-card {
    position: static !important;
    padding: 20px 16px !important;
    border-radius: 14px !important;
  }

  .cart-page-item-card {
    padding: 14px 12px !important;
    gap: 12px !important;
  }

  .cart-page-item-img-wrap {
    width: 72px !important;
    height: 86px !important;
  }

  .cart-page-item-price-qty {
    flex-wrap: wrap !important;
    gap: 10px !important;
  }
}

/* --- CHECKOUT PAGE RESPONSIVE --- */
@media (max-width: 768px) {
  .checkout-page-grid {
    flex-direction: column !important;
    gap: 20px !important;
  }

  .checkout-page-form-col,
  .checkout-page-summary-col {
    flex: 1 1 100% !important;
    width: 100% !important;
  }

  .checkout-page-summary-col {
    position: static !important;
  }

  .checkout-page-card {
    padding: 20px 16px !important;
    border-radius: 12px !important;
  }

  .checkout-page-input-row {
    flex-direction: column !important;
    gap: 0 !important;
  }

  .checkout-payment-option {
    padding: 14px 12px !important;
  }
}

/* --- AUTH (LOGIN / SIGNUP) RESPONSIVE --- */
@media (max-width: 480px) {
  .auth-card-responsive {
    padding: 24px 16px !important;
    border-radius: 14px !important;
  }

  .auth-container-responsive {
    padding: 20px 12px !important;
  }
}

/* Mobile input zoom prevention */
@media (max-width: 768px) {
  input[type="text"],
  input[type="email"],
  input[type="password"],
  input[type="number"],
  input[type="tel"],
  select,
  textarea {
    font-size: 16px !important;
  }
}
