/* ============================================
   3D PrintHub - Main Stylesheet
   Clean & Modern Design with 3D Effects
   ============================================ */

:root {
  --primary: #6C63FF;
  --primary-dark: #5A52D5;
  --primary-light: #8B85FF;
  --secondary: #00D4AA;
  --accent: #FF6B6B;
  --dark: #1A1A2E;
  --dark-2: #16213E;
  --dark-3: #0F3460;
  --gray-100: #F8F9FA;
  --gray-200: #E9ECEF;
  --gray-300: #DEE2E6;
  --gray-400: #CED4DA;
  --gray-500: #ADB5BD;
  --gray-600: #6C757D;
  --gray-700: #495057;
  --gray-800: #343A40;
  --white: #FFFFFF;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.12);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.16);
  --shadow-xl: 0 20px 60px rgba(0,0,0,0.2);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font-main: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-display: 'Space Grotesk', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  font-family: var(--font-main);
  color: var(--gray-800);
  background: var(--white);
  line-height: 1.6;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
a { text-decoration: none; color: inherit; transition: var(--transition); }
img { max-width: 100%; display: block; }
button { cursor: pointer; border: none; font-family: inherit; }
input, select, textarea { font-family: inherit; }
ul { list-style: none; }
h1, h2, h3, h4, h5 { font-family: var(--font-display); font-weight: 700; line-height: 1.2; }
h1 { font-size: clamp(2.2rem, 5vw, 3.8rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.8rem); }
h3 { font-size: clamp(1.3rem, 2.5vw, 1.8rem); }
h4 { font-size: 1.2rem; }

.section-title { text-align: center; margin-bottom: 3rem; }
.section-title h2 { color: var(--dark); margin-bottom: 0.5rem; }
.section-title p { color: var(--gray-600); font-size: 1.1rem; max-width: 600px; margin: 0 auto; }
.container { max-width: 1280px; margin: 0 auto; padding: 0 2rem; }

/* NAVBAR */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(0,0,0,0.06);
  transition: var(--transition);
}
.navbar.scrolled { box-shadow: var(--shadow-sm); }
.nav-container {
  max-width: 1280px; margin: 0 auto; padding: 0 2rem;
  display: flex; align-items: center; justify-content: space-between; height: 72px;
}
.nav-logo {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; color: var(--dark);
}
.nav-logo .logo-icon {
  width: 40px; height: 40px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  color: white; font-size: 1.2rem;
  transform: perspective(200px) rotateY(-10deg);
  transition: var(--transition);
}
.nav-logo:hover .logo-icon { transform: perspective(200px) rotateY(10deg); }
.nav-logo span { color: var(--primary); }
.nav-links { display: flex; align-items: center; gap: 2rem; }
.nav-links a {
  color: var(--gray-700); font-weight: 500; font-size: 0.95rem;
  position: relative; padding: 0.5rem 0;
}
.nav-links a::after {
  content: ''; position: absolute; bottom: 0; left: 0;
  width: 0; height: 2px; background: var(--primary); transition: var(--transition);
}
.nav-links a:hover { color: var(--primary); }
.nav-links a:hover::after, .nav-links a.active::after { width: 100%; }
.nav-links a.active { color: var(--primary); }
.nav-actions { display: flex; align-items: center; gap: 1rem; }
.nav-actions .icon-btn {
  width: 42px; height: 42px; border-radius: 50%; background: var(--gray-100);
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-700); font-size: 1.1rem; transition: var(--transition); position: relative;
}
.nav-actions .icon-btn:hover {
  background: var(--primary); color: white;
  transform: translateY(-2px); box-shadow: 0 4px 15px rgba(108,99,255,0.3);
}
.icon-btn .badge {
  position: absolute; top: -2px; right: -2px;
  background: var(--accent); color: white; font-size: 0.65rem; font-weight: 700;
  width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
}
.mobile-toggle { display: none; flex-direction: column; gap: 5px; background: none; padding: 5px; }
.mobile-toggle span { width: 24px; height: 2px; background: var(--dark); transition: var(--transition); border-radius: 2px; }

/* BUTTONS */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 28px; border-radius: var(--radius-xl); font-weight: 600; font-size: 0.95rem;
  transition: var(--transition); border: 2px solid transparent; white-space: nowrap;
}
.btn-primary { background: var(--primary); color: white; }
.btn-primary:hover { background: var(--primary-dark); transform: translateY(-3px); box-shadow: 0 8px 25px rgba(108,99,255,0.35); }
.btn-secondary { background: transparent; color: var(--primary); border-color: var(--primary); }
.btn-secondary:hover { background: var(--primary); color: white; transform: translateY(-3px); }
.btn-accent { background: var(--secondary); color: white; }
.btn-accent:hover { background: #00b894; transform: translateY(-3px); box-shadow: 0 8px 25px rgba(0,212,170,0.35); }
.btn-dark { background: var(--dark); color: white; }
.btn-dark:hover { background: var(--dark-2); transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.btn-lg { padding: 16px 36px; font-size: 1.05rem; }
.btn-sm { padding: 8px 18px; font-size: 0.85rem; }
.btn-icon { width: 44px; height: 44px; padding: 0; border-radius: 50%; }

/* PRODUCT CARD */
.product-card {
  background: var(--white); border-radius: var(--radius-lg); overflow: hidden;
  transition: var(--transition); border: 1px solid var(--gray-200); position: relative;
}
.product-card:hover { transform: translateY(-10px) scale(1.02); box-shadow: var(--shadow-xl); border-color: transparent; }
.product-card .card-image {
  position: relative; height: 260px; background: var(--gray-100); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.product-card .card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1); }
.product-card:hover .card-image img { transform: scale(1.1); }
.product-card .card-badge {
  position: absolute; top: 12px; left: 12px; padding: 4px 12px; border-radius: 20px;
  font-size: 0.75rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.5px;
}
.badge-new { background: var(--primary); color: white; }
.badge-sale { background: var(--accent); color: white; }
.badge-hot { background: #FF9800; color: white; }
.product-card .card-actions {
  position: absolute; top: 12px; right: 12px;
  display: flex; flex-direction: column; gap: 8px;
  opacity: 0; transform: translateX(10px); transition: var(--transition);
}
.product-card:hover .card-actions { opacity: 1; transform: translateX(0); }
.card-actions button {
  width: 36px; height: 36px; border-radius: 50%; background: white; color: var(--gray-700);
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm); transition: var(--transition); font-size: 0.9rem;
}
.card-actions button:hover { background: var(--primary); color: white; transform: scale(1.1); }
.product-card .card-body { padding: 1.2rem; }
.product-card .card-category { font-size: 0.78rem; color: var(--primary); font-weight: 600; text-transform: uppercase; letter-spacing: 1px; margin-bottom: 0.4rem; }
.product-card .card-title { font-size: 1.05rem; font-weight: 600; color: var(--dark); margin-bottom: 0.5rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-card .card-rating { display: flex; align-items: center; gap: 4px; margin-bottom: 0.6rem; }
.card-rating .stars { color: #FFC107; font-size: 0.85rem; }
.card-rating .count { color: var(--gray-500); font-size: 0.8rem; }
.product-card .card-footer { display: flex; align-items: center; justify-content: space-between; }
.card-footer .price { font-family: var(--font-display); font-size: 1.3rem; font-weight: 700; color: var(--dark); }
.card-footer .price .old-price { font-size: 0.85rem; color: var(--gray-500); text-decoration: line-through; font-weight: 400; margin-left: 6px; }
.card-footer .add-cart-btn {
  width: 40px; height: 40px; border-radius: 50%; background: var(--primary); color: white;
  display: flex; align-items: center; justify-content: center; transition: var(--transition); font-size: 1rem;
}
.card-footer .add-cart-btn:hover { background: var(--primary-dark); transform: scale(1.15) rotate(10deg); box-shadow: 0 4px 15px rgba(108,99,255,0.4); }

/* FORMS */
.form-group { margin-bottom: 1.5rem; }
.form-group label { display: block; margin-bottom: 0.5rem; font-weight: 600; font-size: 0.9rem; color: var(--gray-700); }
.form-control {
  width: 100%; padding: 14px 18px; border: 2px solid var(--gray-300);
  border-radius: var(--radius-md); font-size: 0.95rem; color: var(--dark);
  background: var(--white); transition: var(--transition); outline: none;
}
.form-control:focus { border-color: var(--primary); box-shadow: 0 0 0 4px rgba(108,99,255,0.1); }
.form-control::placeholder { color: var(--gray-400); }
select.form-control {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236C757D' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: right 16px center; padding-right: 40px;
}

/* FOOTER */
.footer { background: var(--dark); color: var(--gray-400); padding: 5rem 0 2rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 3rem; margin-bottom: 3rem; }
.footer-brand .footer-logo {
  font-family: var(--font-display); font-size: 1.5rem; font-weight: 800; color: white;
  margin-bottom: 1rem; display: flex; align-items: center; gap: 8px;
}
.footer-brand .footer-logo span { color: var(--primary-light); }
.footer-brand p { font-size: 0.95rem; line-height: 1.7; margin-bottom: 1.5rem; }
.footer-social { display: flex; gap: 12px; }
.footer-social a {
  width: 40px; height: 40px; border-radius: 50%; background: rgba(255,255,255,0.08);
  display: flex; align-items: center; justify-content: center; color: var(--gray-400); transition: var(--transition);
}
.footer-social a:hover { background: var(--primary); color: white; transform: translateY(-3px); }
.footer-col h4 { color: white; font-size: 1rem; margin-bottom: 1.2rem; font-family: var(--font-display); }
.footer-col ul li { margin-bottom: 0.7rem; }
.footer-col ul li a { color: var(--gray-400); font-size: 0.9rem; transition: var(--transition); }
.footer-col ul li a:hover { color: var(--primary-light); padding-left: 5px; }
.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.08); padding-top: 2rem;
  display: flex; justify-content: space-between; align-items: center; font-size: 0.85rem;
}
.footer-bottom a { color: var(--primary-light); }
.footer-bottom a:hover { color: white; }

/* PAGE HEADER */
.page-header {
  background: linear-gradient(135deg, var(--dark) 0%, var(--dark-3) 100%);
  padding: 8rem 0 4rem; text-align: center; position: relative; overflow: hidden;
}
.page-header::before {
  content: ''; position: absolute; top: -50%; left: -50%; width: 200%; height: 200%;
  background: radial-gradient(circle at 30% 50%, rgba(108,99,255,0.15) 0%, transparent 50%),
              radial-gradient(circle at 70% 80%, rgba(0,212,170,0.1) 0%, transparent 50%);
  animation: floatBg 20s ease-in-out infinite;
}
@keyframes floatBg { 0%,100%{transform:translate(0,0)} 50%{transform:translate(-2%,2%)} }
.page-header h1 { color: white; position: relative; margin-bottom: 0.5rem; }
.page-header .breadcrumb {
  position: relative; display: flex; align-items: center; justify-content: center;
  gap: 8px; color: var(--gray-400); font-size: 0.9rem;
}
.page-header .breadcrumb a { color: var(--primary-light); }
.page-header .breadcrumb a:hover { color: white; }

/* UTILS */
.text-center { text-align: center; }
.text-primary { color: var(--primary); }
.text-muted { color: var(--gray-600); }
.mt-1{margin-top:.5rem} .mt-2{margin-top:1rem} .mt-3{margin-top:1.5rem} .mt-4{margin-top:2rem}
.mb-1{margin-bottom:.5rem} .mb-2{margin-bottom:1rem} .mb-3{margin-bottom:1.5rem} .mb-4{margin-bottom:2rem}
.py-section { padding: 6rem 0; }
.d-flex{display:flex} .align-center{align-items:center} .justify-between{justify-content:space-between} .flex-wrap{flex-wrap:wrap}
.grid-2{display:grid;grid-template-columns:repeat(2,1fr);gap:2rem}
.grid-3{display:grid;grid-template-columns:repeat(3,1fr);gap:2rem}
.grid-4{display:grid;grid-template-columns:repeat(4,1fr);gap:2rem}

.scroll-top {
  position: fixed; bottom: 30px; right: 30px; width: 48px; height: 48px;
  border-radius: 50%; background: var(--primary); color: white;
  display: flex; align-items: center; justify-content: center; font-size: 1.2rem;
  box-shadow: var(--shadow-md); opacity: 0; visibility: hidden;
  transition: var(--transition); z-index: 999; cursor: pointer;
}
.scroll-top.visible { opacity: 1; visibility: visible; }
.scroll-top:hover { transform: translateY(-4px); box-shadow: 0 8px 25px rgba(108,99,255,0.4); }

.toast {
  position: fixed; bottom: 30px; left: 50%; transform: translateX(-50%) translateY(100px);
  background: var(--dark); color: white; padding: 14px 28px; border-radius: var(--radius-xl);
  font-size: 0.9rem; font-weight: 500; box-shadow: var(--shadow-lg); z-index: 10000;
  opacity: 0; transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex; align-items: center; gap: 10px;
}
.toast.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.toast.success { background: var(--secondary); }
.toast.error { background: var(--accent); }

.spinner { width: 40px; height: 40px; border: 3px solid var(--gray-200); border-top-color: var(--primary); border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); backdrop-filter: blur(8px);
  z-index: 5000; display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; transition: var(--transition);
}
.modal-overlay.active { opacity: 1; visibility: visible; }
.modal {
  background: white; border-radius: var(--radius-lg); padding: 2rem;
  max-width: 500px; width: 90%; transform: scale(0.9) translateY(20px); transition: var(--transition);
}
.modal-overlay.active .modal { transform: scale(1) translateY(0); }

@media (max-width: 1024px) {
  .grid-4{grid-template-columns:repeat(2,1fr)} .grid-3{grid-template-columns:repeat(2,1fr)}
  .footer-grid{grid-template-columns:repeat(2,1fr)}
}
@media (max-width: 768px) {
  .nav-links {
    display: none; position: absolute; top: 72px; left: 0; right: 0;
    background: white; flex-direction: column; padding: 1.5rem 2rem; gap: 0;
    box-shadow: var(--shadow-md); border-top: 1px solid var(--gray-200);
  }
  .nav-links.active { display: flex; }
  .nav-links a { padding: 0.8rem 0; width: 100%; }
  .mobile-toggle { display: flex; }
  .grid-2{grid-template-columns:1fr} .grid-3,.grid-4{grid-template-columns:repeat(2,1fr);gap:1rem}
  .footer-grid{grid-template-columns:1fr;gap:2rem}
  .footer-bottom{flex-direction:column;gap:1rem;text-align:center}
  .py-section{padding:4rem 0} .container{padding:0 1.2rem}
}
@media (max-width: 480px) { h1{font-size:2rem} .btn-lg{padding:14px 28px} }

/* Custom Order Nav Link */
.nav-custom-order {
  background: linear-gradient(135deg, var(--primary), var(--secondary)) !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
  background-clip: text !important;
  font-weight: 600 !important;
  position: relative;
}
.nav-custom-order::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  transform: scaleX(0);
  transition: transform 0.3s ease;
}
.nav-custom-order:hover::after {
  transform: scaleX(1);
}

/* Custom Order CTA Banner */
.custom-order-cta {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
  padding: 80px 0;
  position: relative;
  overflow: hidden;
}
.custom-order-cta::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle at 30% 50%, rgba(108,99,255,0.1) 0%, transparent 50%),
              radial-gradient(circle at 70% 50%, rgba(0,212,170,0.1) 0%, transparent 50%);
  animation: float3d 15s ease-in-out infinite;
}
.cta-content {
  max-width: 800px;
  margin: 0 auto;
  text-align: center;
  position: relative;
  z-index: 1;
  padding: 0 20px;
}
.cta-content h2 {
  font-size: 2.5rem;
  font-family: 'Space Grotesk', sans-serif;
  color: white;
  margin-bottom: 16px;
}
.cta-content h2 span {
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.cta-content p {
  color: rgba(255,255,255,0.7);
  font-size: 1.1rem;
  margin-bottom: 32px;
  line-height: 1.7;
}
.cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 16px 40px;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
  color: white;
  border-radius: 50px;
  font-size: 1.1rem;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s ease;
  box-shadow: 0 4px 20px rgba(108,99,255,0.4);
}
.cta-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 30px rgba(108,99,255,0.6);
}
.cta-features {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin-top: 40px;
  flex-wrap: wrap;
}
.cta-feature {
  display: flex;
  align-items: center;
  gap: 8px;
  color: rgba(255,255,255,0.6);
  font-size: 0.9rem;
}
.cta-feature i {
  color: var(--secondary);
}
@media (max-width: 768px) {
  .cta-content h2 { font-size: 1.8rem; }
  .cta-features { gap: 20px; }
}

/* ===== DARK MODE ===== */
[data-theme="dark"] {
  --dark: #f0f0f0;
  --gray-100: #1a1a2e;
  --gray-200: #252540;
  --gray-300: #303050;
  --gray-400: #8888aa;
  --gray-500: #9999bb;
  --gray-600: #aaaacc;
  --white: #0f0f1a;
}
[data-theme="dark"] body {
  background: #0f0f1a;
  color: #e0e0e0;
}
[data-theme="dark"] .navbar {
  background: rgba(15,15,26,0.95);
  border-bottom-color: rgba(255,255,255,0.05);
}
[data-theme="dark"] .navbar.scrolled {
  background: rgba(15,15,26,0.98);
  box-shadow: 0 4px 20px rgba(0,0,0,0.4);
}
[data-theme="dark"] .nav-links a {
  color: #ccc;
}
[data-theme="dark"] .nav-links a:hover,
[data-theme="dark"] .nav-links a.active {
  color: var(--primary);
}
[data-theme="dark"] .product-card,
[data-theme="dark"] .category-card {
  background: #1a1a2e;
  border-color: rgba(255,255,255,0.05);
}
[data-theme="dark"] .card-body {
  background: #1a1a2e;
}
[data-theme="dark"] .card-title a {
  color: #e0e0e0;
}
[data-theme="dark"] .footer {
  background: #0a0a15;
}
[data-theme="dark"] .page-header {
  background: linear-gradient(135deg, #0f0f1a, #1a1a2e);
}
[data-theme="dark"] .model-viewer {
  background: #1a1a2e;
}
[data-theme="dark"] .viewer-badge {
  background: rgba(26,26,46,0.9);
  color: #aaa;
}
[data-theme="dark"] .tab-content,
[data-theme="dark"] .product-tabs {
  background: #1a1a2e;
  border-color: rgba(255,255,255,0.05);
}
[data-theme="dark"] .tab-header {
  color: #999;
}
[data-theme="dark"] .tab-header.active {
  color: var(--primary);
}
[data-theme="dark"] .spec-item {
  background: rgba(255,255,255,0.03);
}
[data-theme="dark"] .related-products {
  background: #0f0f1a;
}
[data-theme="dark"] .btn-secondary {
  background: #252540;
  color: #ccc;
  border-color: #303050;
}
[data-theme="dark"] input,
[data-theme="dark"] select,
[data-theme="dark"] textarea {
  background: #1a1a2e;
  border-color: #303050;
  color: #e0e0e0;
}
[data-theme="dark"] .auth-card,
[data-theme="dark"] .contact-form,
[data-theme="dark"] .blog-card {
  background: #1a1a2e;
}
[data-theme="dark"] .filter-sidebar {
  background: #1a1a2e;
  border-color: rgba(255,255,255,0.05);
}
[data-theme="dark"] .summary-card {
  background: #1a1a2e;
}
[data-theme="dark"] .order-card {
  background: #1a1a2e;
  border-color: rgba(255,255,255,0.05);
}
[data-theme="dark"] .delivery-opt {
  border-color: #303050 !important;
}
[data-theme="dark"] .size-btn {
  background: #1a1a2e !important;
  color: #ccc !important;
  border-color: #303050 !important;
}
[data-theme="dark"] .size-btn.active,
[data-theme="dark"] .size-btn[style*="background: var(--primary)"] {
  background: var(--primary) !important;
  color: white !important;
}
[data-theme="dark"] #priceBreakdown {
  background: #1a1a2e;
}
[data-theme="dark"] .quantity-selector button {
  background: #252540;
  color: #ccc;
  border-color: #303050;
}
[data-theme="dark"] .quantity-selector input {
  background: #1a1a2e;
  color: #e0e0e0;
  border-color: #303050;
}
[data-theme="dark"] .custom-order-cta {
  background: linear-gradient(135deg, #0a0a15 0%, #0f1520 50%, #0a1530 100%);
}

/* ===== THEME & LANGUAGE CONTROLS ===== */
.site-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 12px;
}
.theme-toggle {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 2px solid var(--gray-300);
  background: transparent;
  color: var(--dark);
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: all 0.3s ease;
  font-size: 0.9rem;
}
.theme-toggle:hover {
  border-color: var(--primary);
  color: var(--primary);
  transform: rotate(30deg);
}
.lang-dropdown {
  position: relative;
}
.lang-btn {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 2px solid var(--gray-300);
  background: transparent;
  color: var(--dark);
  cursor: pointer;
  font-weight: 600;
  font-size: 0.8rem;
  transition: all 0.3s ease;
}
.lang-btn:hover {
  border-color: var(--primary);
  color: var(--primary);
}
.lang-menu {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 4px;
  background: var(--white, white);
  border: 1px solid var(--gray-200);
  border-radius: var(--radius-sm);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  overflow: hidden;
  display: none;
  z-index: 1000;
  min-width: 120px;
}
.lang-menu.show {
  display: block;
}
.lang-option {
  display: block;
  width: 100%;
  padding: 10px 16px;
  border: none;
  background: transparent;
  color: var(--dark);
  text-align: left;
  cursor: pointer;
  font-size: 0.85rem;
  transition: background 0.2s;
}
.lang-option:hover {
  background: var(--gray-100);
}
.lang-option.active {
  color: var(--primary);
  font-weight: 600;
}
[data-theme="dark"] .lang-menu {
  background: #1a1a2e;
  border-color: #303050;
}
[data-theme="dark"] .lang-option:hover {
  background: #252540;
}
[data-theme="dark"] .theme-toggle,
[data-theme="dark"] .lang-btn {
  color: #ccc;
  border-color: #404060;
}

@media (max-width: 768px) {
  .site-controls {
    margin-left: 6px;
    gap: 4px;
  }
  .theme-toggle {
    width: 32px; height: 32px;
    font-size: 0.8rem;
  }
  .lang-btn {
    padding: 4px 8px;
    font-size: 0.75rem;
  }
}

/* ===== DARK MODE NEWSLETTER FIX ===== */
[data-theme="dark"] .newsletter {
  background: linear-gradient(135deg, #0a0a15 0%, #12122a 100%) !important;
}
[data-theme="dark"] .newsletter h2 {
  color: #f0f0f0 !important;
}
[data-theme="dark"] .newsletter p {
  color: #9999bb !important;
}
[data-theme="dark"] .newsletter-form input {
  background: rgba(255,255,255,0.08) !important;
  border-color: rgba(255,255,255,0.15) !important;
  color: #f0f0f0 !important;
}
[data-theme="dark"] .newsletter-form input::placeholder {
  color: #666688 !important;
}
[data-theme="dark"] .newsletter-form input:focus {
  border-color: var(--primary) !important;
  background: rgba(255,255,255,0.12) !important;
}

/* ===== COMPREHENSIVE MOBILE RESPONSIVENESS ===== */

/* --- NAV DARK MODE FIX --- */
[data-theme="dark"] .nav-links {
  background: #1a1a2e;
  border-top-color: #303050;
}

/* --- 1024px Tablet --- */
@media (max-width: 1024px) {
  .products-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .hero-content { gap: 2rem; }
}

/* --- 768px Mobile --- */
@media (max-width: 768px) {
  /* Global */
  html { font-size: 15px; }
  .page-header { padding: 6rem 0 2rem !important; }
  .page-header h1 { font-size: 1.8rem; }
  .section-title h2 { font-size: 1.6rem; }

  /* Nav controls */
  .site-controls { margin-left: 4px; gap: 4px; }
  .nav-actions { gap: 6px; }
  .icon-btn { width: 34px; height: 34px; font-size: 0.85rem; }
  .nav-logo { font-size: 1rem; }
  .logo-icon { width: 32px; height: 32px; font-size: 0.9rem; }

  /* Products grid */
  .products-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 1.2rem !important; }
  .filter-sidebar { width: 100%; position: static; margin-bottom: 1.5rem; }
  .products-layout { grid-template-columns: 1fr !important; }

  /* Product detail */
  .product-detail-grid { grid-template-columns: 1fr !important; gap: 2rem !important; }
  .product-price { font-size: 1.5rem; }
  .size-options { gap: 8px; }
  .size-btn { padding: 8px 16px !important; font-size: 0.85rem !important; }
  .delivery-opt { padding: 10px 12px !important; gap: 8px !important; }
  .delivery-opt div strong { font-size: 0.85rem; }
  .spec-grid { grid-template-columns: 1fr !important; }
  .action-buttons { flex-direction: column; }
  .action-buttons .btn { width: 100%; justify-content: center; }

  /* Cart */
  .cart-layout { grid-template-columns: 1fr !important; }
  .cart-item { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .cart-item .item-image { width: 100%; height: 120px; }

  /* Checkout */
  .checkout-grid { grid-template-columns: 1fr !important; }
  .payment-methods { flex-direction: column; }

  /* Dashboard */
  .dashboard-grid { grid-template-columns: 1fr !important; }
  .stat-cards, .admin-stats { grid-template-columns: repeat(2, 1fr) !important; }

  /* Orders */
  .order-items { flex-direction: column; }
  .order-footer { flex-direction: column; gap: 1rem; text-align: center; }

  /* Blog */
  .blog-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 1rem !important; }

  /* About */
  .about-grid { grid-template-columns: 1fr !important; }
  .stats-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .team-grid { grid-template-columns: repeat(2, 1fr) !important; }
  .values-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 1rem !important; }

  /* Contact */
  .contact-grid { grid-template-columns: 1fr !important; }

  /* Custom Order */
  .custom-order-grid { grid-template-columns: 1fr !important; }
  .custom-order-form { position: static !important; }
  .features-badges { grid-template-columns: repeat(2, 1fr) !important; }

  /* CTA banner */
  .cta-content h2 { font-size: 1.5rem !important; }
  .cta-features { gap: 12px !important; flex-direction: column; align-items: center; }

  /* Auth pages */
  .auth-card { margin: 1rem; padding: 2rem 1.5rem !important; }
  .auth-card h2 { font-size: 1.5rem; }

  /* Wishlist */
  .wishlist-grid { grid-template-columns: repeat(2, 1fr) !important; gap: 1rem !important; }

  /* Tables - horizontal scroll */
  .admin-table-wrap, .orders-table-wrap, table { overflow-x: auto; display: block; }
  table { min-width: 600px; }
}

/* --- 480px Small Mobile --- */
@media (max-width: 480px) {
  html { font-size: 14px; }
  .container { padding: 0 1rem; }
  .hero-text h1 { font-size: 2rem; }
  .stat-cards, .admin-stats { grid-template-columns: 1fr !important; }
  .team-grid { grid-template-columns: 1fr !important; }
  .stats-grid { grid-template-columns: 1fr !important; }
  .features-badges { grid-template-columns: 1fr !important; }
  .hero-buttons { flex-direction: column; gap: 10px; }
  .hero-buttons .btn { width: 100%; text-align: center; justify-content: center; }
  .nav-actions { gap: 4px; }
  .site-controls { gap: 2px; }
  .theme-toggle { width: 28px; height: 28px; font-size: 0.75rem; }
  .lang-btn { padding: 3px 6px; font-size: 0.7rem; }
  .tab-headers { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; gap: 0; }
  .tab-header { white-space: nowrap; font-size: 0.8rem; padding: 10px 14px; }
  .product-tabs { overflow: hidden; }
  .cta-btn { padding: 12px 24px !important; font-size: 0.95rem !important; }
  .newsletter-form { flex-direction: column; }
  .newsletter-form .btn { width: 100%; }
  .price-breakdown { font-size: 0.85rem; }
  .quantity-selector button { width: 36px; height: 36px; }
  .quantity-selector input { width: 50px; height: 36px; }
}

/* --- Touch-friendly elements --- */
@media (hover: none) and (pointer: coarse) {
  .btn, button { min-height: 44px; }
  .nav-links a { padding: 12px 0; }
  .size-btn { min-height: 44px !important; }
  .delivery-opt { min-height: 54px; }
  .tab-header { min-height: 44px; }
}

/* Dark mode mobile toggle bars */
[data-theme="dark"] .mobile-toggle span {
  background: #ccc;
}

/* ===== MOBILE CARD OVERHAUL ===== */

/* -- 768px: 2x2 card grids, tighter spacing -- */
@media (max-width: 768px) {
  /* Force 2x2 on all card grids */
  .grid-3, .grid-4 {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }
  .products-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  /* Product cards compact */
  .product-card {
    border-radius: 12px !important;
  }
  .product-card .card-image {
    height: 140px !important;
    min-height: 140px !important;
  }
  .product-card .card-body {
    padding: 0.7rem !important;
  }
  .product-card .card-category {
    font-size: 0.6rem !important;
    letter-spacing: 0.5px !important;
    margin-bottom: 0.2rem !important;
  }
  .product-card .card-title {
    font-size: 0.8rem !important;
    margin-bottom: 0.3rem !important;
    -webkit-line-clamp: 2 !important;
    line-height: 1.3 !important;
  }
  .product-card .card-rating {
    margin-bottom: 0.3rem !important;
  }
  .card-rating .stars {
    font-size: 0.7rem !important;
  }
  .card-rating .count {
    font-size: 0.65rem !important;
  }
  .card-footer .price {
    font-size: 0.95rem !important;
  }
  .card-footer .price .old-price {
    font-size: 0.65rem !important;
    margin-left: 3px !important;
  }
  .card-footer .add-cart-btn {
    width: 30px !important;
    height: 30px !important;
    font-size: 0.7rem !important;
  }
  .product-card .card-meta {
    font-size: 0.6rem !important;
    gap: 4px !important;
    margin-top: 4px !important;
  }
  .product-card .card-badge {
    font-size: 0.6rem !important;
    padding: 3px 8px !important;
  }
  .product-card .card-actions {
    gap: 4px !important;
    top: 6px !important;
    right: 6px !important;
  }
  .card-actions button {
    width: 28px !important;
    height: 28px !important;
    font-size: 0.7rem !important;
  }

  /* Category cards compact */
  .category-card {
    padding: 1rem 0.6rem !important;
    border-radius: 12px !important;
  }
  .category-icon {
    width: 48px !important;
    height: 48px !important;
    margin-bottom: 0.6rem !important;
    font-size: 1.2rem !important;
  }
  .category-card h4 {
    font-size: 0.8rem !important;
    margin-bottom: 0.2rem !important;
  }
  .category-card p {
    font-size: 0.65rem !important;
    line-height: 1.3 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
  }
  .category-card .item-count {
    font-size: 0.6rem !important;
    padding: 3px 8px !important;
    margin-top: 0.4rem !important;
  }

  /* Blog cards compact */
  .blog-card {
    border-radius: 12px !important;
  }
  .blog-card .blog-image,
  .blog-card .card-image {
    height: 120px !important;
  }
  .blog-card h3,
  .blog-card .blog-title {
    font-size: 0.85rem !important;
    -webkit-line-clamp: 2 !important;
  }
  .blog-card p {
    font-size: 0.7rem !important;
    -webkit-line-clamp: 2 !important;
  }

  /* Section spacing */
  .py-section {
    padding: 3rem 0 !important;
  }
  .section-title {
    margin-bottom: 1.5rem !important;
  }
  .section-title h2 {
    font-size: 1.4rem !important;
  }
  .section-title p {
    font-size: 0.85rem !important;
  }

  /* Steps/How it works */
  .step-card {
    padding: 1.2rem !important;
  }
  .step-card h3 {
    font-size: 0.95rem !important;
  }
  .step-card p {
    font-size: 0.8rem !important;
  }

  /* Testimonials compact */
  .testimonial-card {
    padding: 1.2rem !important;
  }

  /* Footer compact */
  .footer {
    padding: 2rem 0 1rem !important;
  }
  .footer h4 {
    font-size: 0.9rem !important;
  }
  .footer p, .footer a, .footer li {
    font-size: 0.8rem !important;
  }

  /* About page */
  .team-card {
    padding: 1rem !important;
  }
  .team-card h4 {
    font-size: 0.85rem !important;
  }
  .team-card p {
    font-size: 0.7rem !important;
  }

  /* CTA */
  .cta-content p {
    font-size: 0.9rem !important;
  }
  .cta-btn {
    padding: 12px 28px !important;
    font-size: 0.9rem !important;
  }
  .cta-features {
    flex-direction: row !important;
    flex-wrap: wrap !important;
    justify-content: center !important;
  }
  .cta-feature {
    font-size: 0.75rem !important;
  }
}

/* -- 480px: Extra compact -- */
@media (max-width: 480px) {
  .grid-3, .grid-4 {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
  .products-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 8px !important;
  }
  .product-card .card-image {
    height: 120px !important;
  }
  .product-card .card-body {
    padding: 0.5rem !important;
  }
  .product-card .card-title {
    font-size: 0.75rem !important;
  }
  .card-footer .price {
    font-size: 0.85rem !important;
  }
  .card-footer .price .old-price {
    display: none !important;
  }
  .product-card .card-meta {
    display: none !important;
  }
  .category-card {
    padding: 0.8rem 0.5rem !important;
  }
  .category-icon {
    width: 40px !important;
    height: 40px !important;
    font-size: 1rem !important;
    margin-bottom: 0.4rem !important;
  }
  .category-card h4 {
    font-size: 0.72rem !important;
  }
  .category-card p {
    display: none !important;
  }
  .category-card .item-count {
    font-size: 0.55rem !important;
    padding: 2px 6px !important;
  }

  /* Container less padding */
  .container {
    padding: 0 0.8rem !important;
  }
}

/* -- 360px: Minimum viable -- */
@media (max-width: 360px) {
  .nav-logo {
    font-size: 0.85rem !important;
  }
  .logo-icon {
    width: 28px !important;
    height: 28px !important;
  }
  .nav-actions .icon-btn {
    width: 28px !important;
    height: 28px !important;
  }
  .theme-toggle {
    width: 26px !important;
    height: 26px !important;
  }
  .lang-btn {
    padding: 2px 5px !important;
    font-size: 0.6rem !important;
  }
}
