/* ===========================
   RESET & ROOT
   =========================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --primary:        #4f46e5;
  --primary-hover:  #4338ca;
  --primary-light:  #ede9fe;
  --success:        #16a34a;
  --success-light:  #dcfce7;
  --danger:         #dc2626;
  --danger-light:   #fee2e2;
  --warning:        #d97706;
  --warning-light:  #fef3c7;
  --gray-50:        #fafafa;
  --gray-100:       #f4f4f5;
  --gray-200:       #e4e4e7;
  --gray-300:       #d4d4d8;
  --gray-400:       #a1a1aa;
  --gray-600:       #52525b;
  --gray-700:       #3f3f46;
  --gray-800:       #27272a;
  --radius:         12px;
  --radius-sm:      8px;
  --shadow-sm:      0 1px 2px rgba(0,0,0,.05);
  --shadow:         0 1px 3px rgba(0,0,0,.1), 0 1px 2px rgba(0,0,0,.06);
  --shadow-md:      0 4px 6px -1px rgba(0,0,0,.1), 0 2px 4px -1px rgba(0,0,0,.06);
  --shadow-lg:      0 10px 15px -3px rgba(0,0,0,.1), 0 4px 6px -2px rgba(0,0,0,.05);
  
  /* Theme colors - Medium light grey foundation */
  --bg-primary:     #e0e0e3;    /* Medium light grey - main background */
  --bg-secondary:   #ececef;    /* Lighter grey - cards & elevated surfaces */
  --bg-tertiary:    #d4d4d8;    /* Medium grey - subtle backgrounds */
  --text-primary:   #27272a;    /* Dark grey - main text */
  --text-secondary: #52525b;    /* Medium grey - secondary text */
  --text-muted:     #a1a1aa;    /* Light grey - muted text */
  --border-color:   #c7c7cc;    /* Subtle grey border */
  --border-light:   #d4d4d8;    /* Very subtle border */
}

/* Dark Mode - Enhanced */
[data-theme="dark"] {
  /* Primary colors - Softer, more vibrant */
  --primary:        #818cf8;
  --primary-hover:  #6366f1;
  --primary-light:  #3730a3;
  
  /* Success/Danger/Warning - Better visibility */
  --success:        #34d399;
  --success-light:  #064e3b;
  --danger:         #f87171;
  --danger-light:   #7f1d1d;
  --warning:        #fbbf24;
  --warning-light:  #78350f;
  
  /* Gray scale - Warmer, softer */
  --gray-50:        #0f1419;
  --gray-100:       #1a1f2e;
  --gray-200:       #252d3d;
  --gray-300:       #37415a;
  --gray-400:       #5c6b8a;
  --gray-600:       #b8c5d9;
  --gray-700:       #dae3f0;
  --gray-800:       #f0f4f8;
  
  /* Theme colors - Enhanced contrast */
  --bg-primary:     #0f1419;
  --bg-secondary:   #1a1f2e;
  --bg-tertiary:    #252d3d;
  --text-primary:   #e8eef5;
  --text-secondary: #b8c5d9;
  --text-muted:     #7d8ca8;
  --border-color:   #2d3748;
  --border-light:   #1f2937;
  
  /* Enhanced shadows with subtle glow */
  --shadow-sm:      0 1px 2px rgba(0,0,0,.4);
  --shadow:         0 2px 4px rgba(0,0,0,.5), 0 1px 2px rgba(0,0,0,.3);
  --shadow-md:      0 4px 8px rgba(0,0,0,.5), 0 2px 4px rgba(0,0,0,.4);
  --shadow-lg:      0 10px 20px rgba(0,0,0,.6), 0 4px 8px rgba(0,0,0,.5);
  
  /* Glow effects for interactive elements */
  --glow-primary:   0 0 20px rgba(129, 140, 248, 0.15);
  --glow-success:   0 0 20px rgba(52, 211, 153, 0.15);
}

/* Dark mode specific enhancements */
[data-theme="dark"] .navbar {
  background: linear-gradient(135deg, #1a1f2e 0%, #252d3d 100%);
  border-bottom: 1px solid rgba(129, 140, 248, 0.1);
}

[data-theme="dark"] .product-card,
[data-theme="dark"] .order-card,
[data-theme="dark"] .admin-product-card {
  background: linear-gradient(135deg, #1a1f2e 0%, #1f2635 100%);
  border: 1px solid #2d3748;
  box-shadow: var(--shadow-md), var(--glow-primary);
}

[data-theme="dark"] .product-card:hover,
[data-theme="dark"] .admin-product-card:hover {
  border-color: #37415a;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), 0 0 30px rgba(129, 140, 248, 0.2);
}

[data-theme="dark"] .btn-primary {
  background: linear-gradient(135deg, #818cf8 0%, #6366f1 100%);
  border: none;
  box-shadow: 0 4px 12px rgba(129, 140, 248, 0.3);
}

[data-theme="dark"] .btn-primary:hover {
  background: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  box-shadow: 0 6px 16px rgba(129, 140, 248, 0.4);
  transform: translateY(-1px);
}

[data-theme="dark"] .btn-secondary {
  background: #252d3d;
  border: 1px solid #37415a;
  color: var(--text-primary);
}

[data-theme="dark"] .btn-secondary:hover {
  background: #2d3748;
  border-color: #4a5568;
}

[data-theme="dark"] input,
[data-theme="dark"] textarea,
[data-theme="dark"] select {
  background: #1a1f2e;
  border: 1px solid #2d3748;
  color: var(--text-primary);
}

[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] select:focus {
  background: #1f2635;
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.1);
}

[data-theme="dark"] .page-header {
  background: linear-gradient(135deg, #1a1f2e 0%, #252d3d 100%);
  border-bottom: 2px solid rgba(129, 140, 248, 0.2);
}

[data-theme="dark"] .empty-state {
  background: #1a1f2e;
  border: 2px dashed #37415a;
}

[data-theme="dark"] .badge {
  background: #252d3d;
  border: 1px solid #37415a;
  color: var(--text-secondary);
}

[data-theme="dark"] .badge-active {
  background: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
  color: #34d399;
  border-color: #065f46;
}

[data-theme="dark"] .badge-admin {
  background: linear-gradient(135deg, #3730a3 0%, #4338ca 100%);
  color: #c7d2fe;
  border-color: #4338ca;
}

[data-theme="dark"] .admin-tabs .tab-btn.active {
  background: linear-gradient(135deg, #252d3d 0%, #2d3748 100%);
  border-bottom-color: #818cf8;
  color: var(--text-primary);
  box-shadow: 0 -2px 8px rgba(129, 140, 248, 0.2);
}

[data-theme="dark"] .admin-tabs .tab-btn:hover:not(.active) {
  background: #1f2635;
  color: var(--text-primary);
}

[data-theme="dark"] .status-dropdown {
  background: #1a1f2e;
  border: 1px solid #37415a;
  color: var(--text-primary);
}

[data-theme="dark"] .status-in-progress {
  border-color: #fbbf24;
  background: rgba(251, 191, 36, 0.1);
}

[data-theme="dark"] .status-shipped {
  border-color: #60a5fa;
  background: rgba(96, 165, 250, 0.1);
}

[data-theme="dark"] .status-complete {
  border-color: #34d399;
  background: rgba(52, 211, 153, 0.1);
}

[data-theme="dark"] .order-table {
  background: #1a1f2e;
}

[data-theme="dark"] .order-table th {
  background: #252d3d;
  border-color: #2d3748;
  color: var(--text-secondary);
}

[data-theme="dark"] .order-table td {
  border-color: #2d3748;
}

[data-theme="dark"] .order-table tr:hover {
  background: #1f2635;
}

[data-theme="dark"] .cart-item {
  background: linear-gradient(135deg, #1a1f2e 0%, #1f2635 100%);
  border: 1px solid #2d3748;
}

[data-theme="dark"] .flash-message {
  background: #1a1f2e;
  border: 1px solid #2d3748;
}

[data-theme="dark"] .flash-message.flash-success {
  background: linear-gradient(135deg, #064e3b 0%, #065f46 100%);
  border-color: #34d399;
  color: #d1fae5;
}

[data-theme="dark"] .flash-message.flash-error {
  background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%);
  border-color: #f87171;
  color: #fecaca;
}

[data-theme="dark"] .img-placeholder {
  background: #252d3d;
  color: #5c6b8a;
}

[data-theme="dark"] .add-product-form,
[data-theme="dark"] .admin-edit-form {
  background: linear-gradient(135deg, #1a1f2e 0%, #1f2635 100%);
  border: 1px solid #2d3748;
  box-shadow: var(--shadow-lg), var(--glow-primary);
}

/* Scrollbar styling for dark mode */
[data-theme="dark"] ::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

[data-theme="dark"] ::-webkit-scrollbar-track {
  background: #1a1f2e;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb {
  background: #37415a;
  border-radius: 6px;
  border: 2px solid #1a1f2e;
}

[data-theme="dark"] ::-webkit-scrollbar-thumb:hover {
  background: #4a5568;
}

/* Selection color for dark mode */
[data-theme="dark"] ::selection {
  background: rgba(129, 140, 248, 0.3);
  color: var(--text-primary);
}

/* Link colors in dark mode */
[data-theme="dark"] a {
  color: #818cf8;
}

[data-theme="dark"] a:hover {
  color: #a5b4fc;
}

/* Enhanced theme toggle in dark mode */
[data-theme="dark"] .theme-toggle {
  background: linear-gradient(135deg, #252d3d 0%, #2d3748 100%);
  border: 1px solid #37415a;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

[data-theme="dark"] .theme-toggle:hover {
  background: linear-gradient(135deg, #2d3748 0%, #37415a 100%);
  border-color: #818cf8;
  color: #818cf8;
  box-shadow: 0 4px 12px rgba(129, 140, 248, 0.2);
}

[data-theme="dark"] .theme-toggle:hover .theme-toggle-icon {
  transform: rotate(180deg);
  filter: drop-shadow(0 0 8px rgba(129, 140, 248, 0.5));
}

/* Price displays in dark mode - make them pop */
[data-theme="dark"] .price {
  color: #a5b4fc;
  text-shadow: 0 0 20px rgba(129, 140, 248, 0.3);
}

[data-theme="dark"] .stock-warning {
  color: #fbbf24;
  background: rgba(251, 191, 36, 0.1);
  padding: .3rem .6rem;
  border-radius: 6px;
  border: 1px solid rgba(251, 191, 36, 0.2);
}

[data-theme="dark"] .footer {
  background: linear-gradient(180deg, transparent 0%, #0f1419 100%);
  border-top: 1px solid #2d3748;
}

/* Badge enhancements */
[data-theme="dark"] .badge-sold-out {
  background: linear-gradient(135deg, #7f1d1d 0%, #991b1b 100%);
  color: #fecaca;
  border: 1px solid #991b1b;
}

[data-theme="dark"] .badge-in-progress {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
  border-color: #f59e0b;
}

[data-theme="dark"] .badge-shipped {
  background: rgba(96, 165, 250, 0.15);
  color: #60a5fa;
  border-color: #3b82f6;
}

[data-theme="dark"] .badge-complete {
  background: rgba(52, 211, 153, 0.15);
  color: #34d399;
  border-color: #10b981;
}

/* Product images in dark mode */
[data-theme="dark"] .product-img-wrap,
[data-theme="dark"] .admin-product-img-wrap {
  background: #1a1f2e;
  border: 1px solid #2d3748;
}

[data-theme="dark"] .product-img-wrap:hover {
  border-color: #37415a;
}

/* Custom shirt designer in dark mode */
[data-theme="dark"] .shirt-preview-container {
  background: #1a1f2e;
  border: 2px solid #2d3748;
  box-shadow: var(--shadow-lg), var(--glow-primary);
}

[data-theme="dark"] .color-option {
  border: 2px solid #2d3748;
}

[data-theme="dark"] .color-option.selected {
  border-color: #818cf8;
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.2);
}

[data-theme="dark"] .alignment-grid button {
  background: #252d3d;
  border: 1px solid #37415a;
  color: var(--text-secondary);
}

[data-theme="dark"] .alignment-grid button:hover {
  background: #2d3748;
  border-color: #818cf8;
  color: #818cf8;
}

[data-theme="dark"] .alignment-grid button.selected {
  background: linear-gradient(135deg, #3730a3 0%, #4338ca 100%);
  border-color: #818cf8;
  color: #c7d2fe;
}

/* Checkout page in dark mode */
[data-theme="dark"] .checkout-summary {
  background: linear-gradient(135deg, #1a1f2e 0%, #1f2635 100%);
  border: 1px solid #2d3748;
  box-shadow: var(--shadow-lg), var(--glow-primary);
}

[data-theme="dark"] .order-total {
  color: #a5b4fc;
  text-shadow: 0 0 15px rgba(129, 140, 248, 0.3);
}

/* Account page order cards */
[data-theme="dark"] .user-order-card {
  background: linear-gradient(135deg, #1a1f2e 0%, #1f2635 100%);
  border: 1px solid #2d3748;
  box-shadow: var(--shadow-md), 0 0 15px rgba(129, 140, 248, 0.1);
}

[data-theme="dark"] .user-order-card:hover {
  border-color: #37415a;
  box-shadow: var(--shadow-lg), 0 0 25px rgba(129, 140, 248, 0.15);
}

/* Tab badges in dark mode */
[data-theme="dark"] .tab-badge {
  background: linear-gradient(135deg, #818cf8 0%, #6366f1 100%);
  color: #fff;
  box-shadow: 0 2px 6px rgba(129, 140, 248, 0.3);
}

/* Form focus states - extra glow */
[data-theme="dark"] input:focus,
[data-theme="dark"] textarea:focus,
[data-theme="dark"] select:focus {
  box-shadow: 0 0 0 3px rgba(129, 140, 248, 0.15), 0 0 15px rgba(129, 140, 248, 0.1);
}

/* Error/Success messages enhanced */
[data-theme="dark"] .text-success {
  color: #34d399;
  text-shadow: 0 0 10px rgba(52, 211, 153, 0.3);
}

[data-theme="dark"] .text-danger {
  color: #f87171;
  text-shadow: 0 0 10px rgba(248, 113, 113, 0.3);
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  transition: background-color .3s ease, color .3s ease;
}

/* ===========================
   TYPOGRAPHY
   =========================== */
h1, h2, h3, h4 { line-height: 1.3; font-weight: 700; }
a { color: var(--primary); }
.text-muted { color: var(--text-muted); font-size: .9rem; }
.text-success { color: var(--success); font-weight: 600; }
.text-danger { color: var(--danger); font-weight: 700; }

/* ===========================
   NAVBAR
   =========================== */
.navbar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-color);
  padding: .85rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: var(--shadow);
}
.nav-brand {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--primary);
  text-decoration: none;
  letter-spacing: -.5px;
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 1.4rem;
}
.nav-links a {
  text-decoration: none;
  color: var(--text-secondary);
  font-weight: 500;
  font-size: .92rem;
  transition: color .15s;
}
.nav-links a:hover { color: var(--primary); }
.nav-admin { color: var(--primary) !important; font-weight: 700 !important; }
.cart-link { position: relative; }
.cart-count {
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  padding: .1rem .45rem;
  font-size: .72rem;
  font-weight: 700;
  margin-left: .2rem;
  vertical-align: middle;
}

/* Theme Toggle */
.theme-toggle {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: 999px;
  padding: .4rem .7rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: .3rem;
  font-size: .85rem;
  color: var(--text-secondary);
  transition: all .2s;
  margin-left: .5rem;
}
.theme-toggle:hover {
  background: var(--bg-primary);
  border-color: var(--primary);
  color: var(--primary);
}
.theme-toggle-icon {
  font-size: 1rem;
  transition: transform .3s ease;
}
.theme-toggle:hover .theme-toggle-icon {
  transform: rotate(20deg);
}

/* ===========================
   CONTAINER
   =========================== */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
}

/* ===========================
   ALERTS
   =========================== */
.alert {
  padding: .9rem 1.2rem;
  border-radius: var(--radius-sm);
  margin-bottom: 1.5rem;
  font-weight: 500;
  font-size: .92rem;
  animation: slideDown .3s ease;
}
.alert-success { background: var(--success-light); color: #166534; border: 1px solid #bbf7d0; }
.alert-error   { background: var(--danger-light);  color: #991b1b; border: 1px solid #fecaca; }
@keyframes slideDown { from { opacity:0; transform: translateY(-8px); } to { opacity:1; transform: none; } }

/* ===========================
   BUTTONS
   =========================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  padding: .6rem 1.3rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: .9rem;
  cursor: pointer;
  border: none;
  text-decoration: none;
  transition: all .15s;
  white-space: nowrap;
  line-height: 1;
}
.btn-primary   { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-hover); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn-secondary { background: var(--gray-100); color: var(--gray-800); border: 1px solid var(--gray-300); }
.btn-secondary:hover { background: var(--gray-200); }
.btn-success   { background: var(--success); color: #fff; }
.btn-success:hover { background: #15803d; }
.btn-danger    { background: var(--danger); color: #fff; }
.btn-danger:hover { background: #b91c1c; }
.btn-warning   { background: var(--warning); color: #fff; }
.btn-warning:hover { background: #b45309; }
.btn-disabled  { background: var(--gray-200); color: var(--gray-400); cursor: not-allowed; }
.btn-block     { display: flex; width: 100%; margin-top: .7rem; }
.btn-lg        { padding: .85rem 1.8rem; font-size: 1rem; }
.btn-sm        { padding: .4rem .85rem; font-size: .82rem; }
.btn-remove    { background: none; border: none; color: var(--gray-400); font-size: 1rem; cursor: pointer; padding: .3rem .5rem; border-radius: 6px; transition: all .15s; }
.btn-remove:hover { background: var(--danger-light); color: var(--danger); }

/* ===========================
   PAGE HEADER
   =========================== */
.page-header { margin-bottom: 2rem; }
.page-header h1 { font-size: 2rem; font-weight: 800; }
.page-header p  { color: var(--gray-600); margin-top: .35rem; }

/* ===========================
   PRODUCTS GRID
   =========================== */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}
.product-card {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border-color);
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.product-img-wrap {
  position: relative;
  aspect-ratio: 1;
  background: var(--bg-tertiary);
  overflow: hidden;
}
.product-img-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.product-card:hover .product-img-wrap img { transform: scale(1.04); }
.img-placeholder {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--text-muted);
}
.badge-sold-out {
  position: absolute; top: .75rem; right: .75rem;
  background: var(--danger); color: #fff;
  font-size: .73rem; padding: .25rem .6rem;
  border-radius: 999px; font-weight: 700;
}
.product-info { padding: 1.25rem; flex: 1; display: flex; flex-direction: column; }
.product-info h3 { font-size: 1rem; font-weight: 700; margin-bottom: .3rem; color: var(--text-primary); }
.product-desc { color: var(--text-secondary); font-size: .87rem; flex: 1; margin-bottom: 1rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-footer { display: flex; align-items: center; justify-content: space-between; }
.price { font-size: 1.2rem; font-weight: 800; color: var(--primary); }
.stock-warning { font-size: .78rem; color: var(--warning); margin-top: .4rem; font-weight: 600; }
.empty-state { text-align: center; padding: 4rem 2rem; grid-column: 1/-1; color: var(--text-secondary); }
.empty-state .empty-icon { font-size: 3rem; margin-bottom: .8rem; }
.empty-state h3 { font-size: 1.2rem; margin-bottom: .4rem; color: var(--text-primary); }

/* ===========================
   CART
   =========================== */
.cart-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 2rem;
  align-items: start;
}
@media (max-width: 800px) { .cart-layout { grid-template-columns: 1fr; } }
.cart-items { display: flex; flex-direction: column; gap: 1rem; }
.cart-item {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 1rem 1.2rem;
  display: flex;
  align-items: center;
  gap: 1rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
}
.cart-item-img { width: 72px; height: 72px; flex-shrink: 0; }
.cart-item-img img { width: 100%; height: 100%; object-fit: cover; border-radius: var(--radius-sm); }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-info h3 { font-size: .95rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: var(--text-primary); }
.cart-item-info p  { font-size: .83rem; color: var(--text-secondary); margin-top: .1rem; }
.cart-item-total { font-weight: 700; min-width: 70px; text-align: right; color: var(--text-primary); }
.qty-control { display: flex; align-items: center; border: 1px solid var(--border-color); border-radius: var(--radius-sm); overflow: hidden; }
.qty-btn { background: var(--bg-tertiary); border: none; width: 30px; height: 34px; font-size: 1.1rem; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: background .15s; color: var(--text-primary); }
.qty-btn:hover { background: var(--border-color); }
.qty-input { width: 48px; border: none; text-align: center; font-size: .9rem; padding: .4rem 0; -moz-appearance: textfield; background: var(--bg-secondary); color: var(--text-primary); }
.qty-input::-webkit-inner-spin-button, .qty-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.cart-summary {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
  position: sticky;
  top: 80px;
  border: 1px solid var(--border-color);
}
.cart-summary h2 { font-size: 1.1rem; margin-bottom: 1.2rem; color: var(--text-primary); }
.summary-row {
  display: flex;
  justify-content: space-between;
  padding: .55rem 0;
  font-size: .93rem;
  color: var(--text-secondary);
  border-bottom: 1px solid var(--border-light);
}
.summary-row.total { font-size: 1.1rem; font-weight: 800; color: var(--text-primary); border: none; padding-top: .9rem; }
.summary-item { display: flex; justify-content: space-between; padding: .35rem 0; font-size: .88rem; color: var(--text-secondary); }
.summary-item-name { display: flex; gap: .5rem; align-items: center; }
.summary-qty { background: var(--bg-tertiary); color: var(--text-secondary); border-radius: 4px; padding: .1rem .4rem; font-size: .78rem; font-weight: 700; }

/* ===========================
   CHECKOUT
   =========================== */
.checkout-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 2.5rem;
  align-items: start;
}
@media (max-width: 880px) { .checkout-layout { grid-template-columns: 1fr; } }
.checkout-form-wrap { background: var(--bg-secondary); border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow); border: 1px solid var(--border-color); }
.checkout-form-wrap h2 { font-size: 1.15rem; margin-bottom: 1.2rem; padding-bottom: .7rem; border-bottom: 1px solid var(--border-light); color: var(--text-primary); }
.checkout-summary { background: var(--bg-secondary); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); position: sticky; top: 80px; border: 1px solid var(--border-color); }
.checkout-summary h2 { font-size: 1.1rem; margin-bottom: 1.2rem; color: var(--text-primary); }
.checkout-summary hr { border: none; border-top: 1px solid var(--border-color); margin: .8rem 0; }
.payment-notice {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem 1.2rem;
  margin-bottom: 1.5rem;
  display: flex;
  gap: .8rem;
  align-items: flex-start;
  font-size: .9rem;
}
.payment-notice span { font-size: 1.4rem; }
.payment-notice strong { display: block; margin-bottom: .2rem; color: var(--text-primary); }
.payment-notice p { color: var(--text-secondary); font-size: .85rem; margin: 0; }

/* ===========================
   FORMS
   =========================== */
.form-group { margin-bottom: 1.1rem; }
.form-group label { display: block; font-size: .85rem; font-weight: 600; margin-bottom: .4rem; color: var(--text-secondary); }
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: .65rem .95rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: .93rem;
  color: var(--text-primary);
  background: var(--bg-secondary);
  transition: border-color .15s, box-shadow .15s;
  font-family: inherit;
}
.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.12);
}
.form-group input[type="file"] { padding: .5rem; background: var(--bg-tertiary); }
.form-group textarea { resize: vertical; }
.form-group small { font-size: .78rem; color: var(--text-muted); margin-top: .3rem; display: block; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 1rem; }
.checkbox-group label { display: flex; align-items: center; gap: .5rem; cursor: pointer; font-weight: 500; }
.checkbox-group input[type="checkbox"] { width: auto; accent-color: var(--primary); }
.form-actions { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1rem; }

/* ===========================
   AUTH
   =========================== */
.auth-wrap { display: flex; justify-content: center; align-items: flex-start; padding: 3rem 1rem; min-height: 75vh; }
.auth-card {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 2.5rem;
  width: 100%;
  max-width: 440px;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
}
.auth-logo { font-size: 2.5rem; text-align: center; margin-bottom: 1rem; }
.auth-card h1 { font-size: 1.7rem; text-align: center; margin-bottom: .25rem; color: var(--text-primary); }
.auth-card > p { color: var(--text-secondary); text-align: center; margin-bottom: 2rem; font-size: .93rem; }
.auth-links { display: flex; justify-content: space-between; flex-wrap: wrap; gap: .5rem; margin-top: 1.3rem; }
.auth-links a { font-size: .87rem; text-decoration: none; }
.auth-links a:hover { text-decoration: underline; }

/* ===========================
   ACCOUNT
   =========================== */
.account-layout { display: grid; grid-template-columns: 300px 1fr; gap: 2rem; }
@media (max-width: 640px) { .account-layout { grid-template-columns: 1fr; } }
.account-card { background: var(--bg-secondary); border-radius: var(--radius); padding: 2rem; text-align: center; box-shadow: var(--shadow); border: 1px solid var(--border-color); }
.account-avatar {
  width: 76px; height: 76px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  color: #fff;
  font-size: 2rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 1rem;
  box-shadow: var(--shadow-md);
}
.account-card h2 { font-size: 1.3rem; margin-bottom: .2rem; color: var(--text-primary); }
.account-email { color: var(--text-secondary); font-size: .88rem; margin-bottom: 1rem; }
.account-panel { background: var(--bg-secondary); border-radius: var(--radius); padding: 2rem; box-shadow: var(--shadow); border: 1px solid var(--border-color); }
.account-panel h3 { font-size: 1rem; font-weight: 700; margin-bottom: 1.5rem; color: var(--text-secondary); text-transform: uppercase; letter-spacing: .05em; font-size: .8rem; }

/* Orders in Account Page */
.orders-section {
  margin-bottom: 2rem;
}
.orders-section:last-of-type {
  margin-bottom: 0;
}
.orders-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 1rem;
  padding-bottom: .7rem;
  border-bottom: 2px solid var(--border-color);
}
.user-order-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1rem;
  margin-bottom: .8rem;
  transition: all .15s;
}
.user-order-card:hover {
  box-shadow: var(--shadow-sm);
  border-color: var(--primary);
}
.user-order-card.past {
  opacity: .75;
}
.user-order-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: .8rem;
}
.user-order-header strong {
  font-size: .9rem;
  color: var(--text-primary);
}
.user-order-date {
  font-size: .75rem;
  color: var(--text-muted);
  margin-left: .5rem;
}
.user-order-items {
  background: var(--bg-secondary);
  border-radius: 6px;
  padding: .7rem;
  margin-bottom: .8rem;
}
.user-order-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  font-size: .85rem;
  color: var(--text-secondary);
}
.user-order-item-price {
  font-weight: 600;
  color: var(--text-primary);
  flex-shrink: 0;
}

/* Account Page Custom Shirt Details */
.account-custom-details {
  margin-top: .5rem;
  padding-top: .5rem;
  border-top: 1px solid var(--border-light);
}
.account-custom-details .custom-detail {
  font-size: .75rem;
  margin-bottom: .4rem;
  color: var(--text-secondary);
}
.account-custom-designs {
  display: flex;
  gap: .6rem;
  margin-top: .4rem;
  flex-wrap: wrap;
}
.account-design-preview {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  flex: 1;
  min-width: 80px;
  max-width: 100px;
}
.account-design-label {
  display: flex;
  flex-direction: column;
  gap: .2rem;
  font-size: .7rem;
}
.account-design-label strong {
  color: var(--text-primary);
  font-size: .72rem;
}
.account-alignment-badge {
  background: var(--success-light);
  color: var(--success);
  padding: .1rem .3rem;
  border-radius: 3px;
  font-size: .65rem;
  font-weight: 600;
  text-transform: capitalize;
  display: inline-block;
}
.account-design-img {
  width: 100%;
  max-width: 70px;
  height: 70px;
  object-fit: contain;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-secondary);
  padding: .2rem;
}

.item-divider {
  border: none;
  border-top: 1px solid var(--border-light);
  margin: .5rem 0;
}
.user-order-items-compact {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .85rem;
  color: var(--text-secondary);
  padding: .5rem 0;
}
.user-order-items-compact strong {
  color: var(--text-primary);
}
.user-order-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.user-order-status {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .8rem;
  color: var(--text-secondary);
}
.status-icon {
  font-size: 1rem;
}
.user-order-total {
  font-size: .95rem;
  color: var(--primary);
}

.quick-actions { display: grid; grid-template-columns: 1fr 1fr; gap: .8rem; }
.action-card {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 1.1rem;
  text-decoration: none;
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .4rem;
  font-weight: 600;
  font-size: .88rem;
  text-align: center;
  transition: all .15s;
}
.action-card:hover { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }
.action-icon { font-size: 1.5rem; }
.action-card-admin { background: var(--primary-light); border-color: var(--primary); color: var(--primary); }

/* ===========================
   BADGES
   =========================== */
.badge { display: inline-block; padding: .22rem .7rem; border-radius: 999px; font-size: .75rem; font-weight: 700; }
.badge-admin      { background: var(--primary-light); color: var(--primary); }
.badge-active     { background: var(--success-light); color: #166534; }
.badge-in-progress { background: var(--warning-light); color: var(--warning); }
.badge-shipped    { background: #dbeafe; color: #2563eb; }
.badge-inactive   { background: var(--gray-100); color: var(--gray-600); }
.badge-complete   { background: #dbeafe; color: #1e40af; }

/* ===========================
   ADMIN DASHBOARD
   =========================== */
.admin-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 2rem; }
.admin-header h1 { font-size: 2rem; color: var(--text-primary); }
.admin-header p  { color: var(--text-secondary); font-size: .9rem; }

.admin-tabs {
  display: flex;
  gap: 0;
  margin-bottom: 2rem;
  border-bottom: 2px solid var(--border-color);
  overflow-x: auto;
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
}
.admin-tabs::-webkit-scrollbar {
  display: none; /* Chrome/Safari/Opera */
}
.tab-btn {
  padding: .75rem 1.5rem;
  font-weight: 600;
  font-size: .9rem;
  text-decoration: none;
  color: var(--text-secondary);
  background: transparent;
  border: none;
  border-bottom: 3px solid transparent;
  margin-bottom: -2px;
  transition: all .15s;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.tab-btn:hover:not(.active) { color: var(--text-primary); background: var(--bg-tertiary); }
.tab-btn.active { color: var(--primary); border-bottom-color: var(--primary); background: transparent; }
.tab-badge {
  background: var(--primary);
  color: #fff;
  border-radius: 999px;
  padding: .1rem .45rem;
  font-size: .7rem;
  font-weight: 700;
  min-width: 18px;
  text-align: center;
}
.tab-btn.active .tab-badge { background: var(--primary); }

/* Orders */
.order-card {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.2rem;
  box-shadow: var(--shadow);
  border-left: 4px solid var(--primary);
  border: 1px solid var(--border-color);
  border-left: 4px solid var(--primary);
}
.order-card.completed { border-left-color: var(--border-color); opacity: .85; }
.order-card-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: .9rem; }
.order-id-group { display: flex; align-items: center; gap: .8rem; }
.order-id-group strong { color: var(--text-primary); }
.order-date { font-size: .82rem; color: var(--text-muted); }

/* Order Status Dropdown */
.order-status-form {
  margin: 0;
}
.status-dropdown {
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  border-radius: 8px;
  padding: .5rem .9rem;
  font-size: .85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%234b5563' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .6rem center;
  padding-right: 2rem;
}
.status-dropdown:hover {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.1);
}
.status-dropdown:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79,70,229,.15);
}

/* Status-specific colors */
.status-in-progress {
  color: var(--warning);
  border-color: var(--warning);
  background-color: var(--warning-light);
}
.status-shipped {
  color: #2563eb;
  border-color: #2563eb;
  background-color: #dbeafe;
}
.status-complete {
  color: var(--success);
  border-color: var(--success);
  background-color: var(--success-light);
}

.order-customer { font-size: .87rem; color: var(--text-secondary); margin-bottom: 1rem; line-height: 1.8; }
.order-table { width: 100%; border-collapse: collapse; font-size: .87rem; margin-bottom: .8rem; }
.order-table th, .order-table td { text-align: left; padding: .5rem .7rem; border-bottom: 1px solid var(--border-light); }
.order-table th { font-weight: 600; color: var(--text-secondary); background: var(--bg-tertiary); font-size: .8rem; text-transform: uppercase; letter-spacing: .04em; }
.order-table td { color: var(--text-primary); }
.order-card-footer { display: flex; justify-content: space-between; align-items: center; padding-top: .9rem; border-top: 1px solid var(--border-light); }
.order-total { font-size: 1.1rem; color: var(--text-primary); }

/* Past Order Items */
.past-order-items {
  border-top: 1px solid var(--border-light);
  padding-top: .9rem;
  margin-top: .9rem;
}
.past-order-item {
  padding: .5rem 0;
  border-bottom: 1px solid var(--border-light);
  color: var(--text-primary);
}
.past-order-item:last-child { border-bottom: none; }

/* Admin Products */
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 1.5rem; }
.section-header h2 { font-size: 1.3rem; color: var(--text-primary); }

/* Admin Custom Shirt Details in Orders */
.admin-custom-details {
  background: var(--bg-tertiary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: .9rem;
  margin-top: .6rem;
}
.custom-specs {
  display: flex;
  gap: .5rem;
  margin-bottom: .7rem;
  flex-wrap: wrap;
}
.custom-spec-badge {
  background: var(--primary-light);
  color: var(--primary);
  padding: .2rem .6rem;
  border-radius: 999px;
  font-size: .78rem;
  font-weight: 700;
}
.custom-design-row {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: .8rem;
  margin-bottom: .6rem;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem;
  align-items: center;
}
.custom-design-row:last-child { margin-bottom: 0; }
.design-label {
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.design-label strong {
  font-size: .88rem;
  color: var(--text-primary);
}
.alignment-label {
  display: inline-block;
  background: var(--success-light);
  color: var(--success);
  padding: .15rem .5rem;
  border-radius: 4px;
  font-size: .75rem;
  font-weight: 600;
  text-transform: capitalize;
}
.design-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
}
.design-preview img {
  width: 100px;
  height: 100px;
  object-fit: contain;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  padding: .3rem;
}

.add-product-form {
  background: var(--bg-secondary);
  border: 2px dashed var(--primary);
  border-radius: var(--radius);
  padding: 1.8rem;
  margin-bottom: 2rem;
  box-shadow: var(--shadow);
}
.add-product-form h3 { font-size: 1rem; margin-bottom: 1.2rem; color: var(--primary); }
.admin-products-list { display: flex; flex-direction: column; gap: 1.2rem; }
.admin-product-card {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 1.3rem;
  box-shadow: var(--shadow);
  display: grid;
  grid-template-columns: 90px 1fr auto;
  grid-template-rows: auto auto;
  gap: 1rem;
  align-items: start;
  transition: box-shadow .15s;
  border: 1px solid var(--border-color);
}
.admin-product-card:hover { box-shadow: var(--shadow-md); }
.admin-product-img-wrap { grid-row: 1; }
.admin-product-img { width: 90px; height: 90px; object-fit: cover; border-radius: var(--radius-sm); border: 1px solid var(--border-color); }
.admin-product-info { grid-row: 1; }
.admin-product-title-row { display: flex; align-items: center; gap: .7rem; margin-bottom: .3rem; flex-wrap: wrap; }
.admin-product-title-row h3 { font-size: 1rem; font-weight: 700; color: var(--text-primary); }
.admin-product-desc { font-size: .85rem; color: var(--text-secondary); margin-bottom: .5rem; }
.product-meta { display: flex; align-items: center; gap: .6rem; font-size: .85rem; color: var(--text-secondary); flex-wrap: wrap; }
.meta-divider { color: var(--text-muted); }
.admin-product-actions { display: flex; flex-direction: column; gap: .5rem; grid-row: 1; }
.edit-product-form {
  grid-column: 1 / -1;
  grid-row: 2;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  padding: 1.4rem;
  border: 1px solid var(--border-color);
}
.edit-product-form h4 { font-size: .95rem; margin-bottom: 1rem; color: var(--text-primary); }
.current-images { display: flex; align-items: center; gap: .5rem; margin-top: .5rem; flex-wrap: wrap; font-size: .82rem; color: var(--text-muted); }
.current-img-thumb { width: 45px; height: 45px; object-fit: cover; border-radius: 5px; border: 1px solid var(--border-color); }

/* ===========================
   CUSTOM SHIRT DESIGNER
   =========================== */
.custom-shirt-layout {
  display: grid;
  grid-template-columns: 1fr 420px;
  gap: 2rem;
  align-items: start;
}
@media (max-width: 1024px) { .custom-shirt-layout { grid-template-columns: 1fr; } }

.designer-panel {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
  border: 1px solid var(--border-color);
}

.design-section {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border-light);
}
.design-section:last-child { border-bottom: none; }
.design-section h3 { font-size: 1.1rem; margin-bottom: 1.2rem; color: var(--text-primary); }

.section-header-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.2rem;
}

/* Toggle Switch */
.toggle-switch {
  position: relative;
  display: inline-block;
  width: 50px;
  height: 26px;
}
.toggle-switch input { opacity: 0; width: 0; height: 0; }
.toggle-slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: var(--border-color);
  transition: .3s;
  border-radius: 26px;
}
.toggle-slider:before {
  position: absolute;
  content: "";
  height: 20px; width: 20px;
  left: 3px; bottom: 3px;
  background-color: white;
  transition: .3s;
  border-radius: 50%;
}
.toggle-switch input:checked + .toggle-slider { background-color: var(--primary); }
.toggle-switch input:checked + .toggle-slider:before { transform: translateX(24px); }

.design-controls { animation: slideDown .3s ease; }

/* Upload Area */
.upload-area {
  background: var(--bg-tertiary);
  border: 2px dashed var(--border-color);
  border-radius: var(--radius);
  padding: 2rem;
  text-align: center;
  margin-bottom: 1.2rem;
  transition: all .2s;
  min-height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.upload-area:hover { border-color: var(--primary); background: var(--primary-light); }
.upload-placeholder { cursor: pointer; }
.upload-icon { font-size: 2.5rem; margin-bottom: .5rem; }
.upload-placeholder p { font-weight: 600; margin-bottom: .2rem; color: var(--text-primary); }
.upload-placeholder small { color: var(--text-muted); }
.required-badge {
  background: var(--danger);
  color: #fff;
  padding: .15rem .4rem;
  border-radius: 4px;
  font-size: .7rem;
  font-weight: 700;
  margin-left: .3rem;
}

.upload-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .8rem;
}
.upload-preview img {
  max-width: 140px;
  max-height: 140px;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow);
}
.btn-remove-upload {
  background: var(--danger);
  color: #fff;
  border: none;
  padding: .4rem .9rem;
  border-radius: var(--radius-sm);
  font-size: .82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .15s;
}
.btn-remove-upload:hover { background: #b91c1c; }

/* Alignment Grid */
.alignment-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: .6rem;
}
.align-btn {
  background: var(--bg-tertiary);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: .8rem .5rem;
  cursor: pointer;
  transition: all .15s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .3rem;
  font-size: .78rem;
  color: var(--text-secondary);
}
.align-btn:hover { background: var(--border-color); border-color: var(--text-muted); }
.align-btn.active {
  background: var(--primary-light);
  border-color: var(--primary);
  color: var(--primary);
  font-weight: 700;
}
.align-icon { font-size: 1.3rem; }
.align-label { white-space: nowrap; }

/* Price Section */
.price-section {
  padding-top: 1.5rem !important;
  border-top: 2px solid var(--border-color) !important;
}
.price-display {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.2rem;
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  margin-bottom: 1rem;
  font-size: 1.1rem;
  color: var(--text-primary);
}
.custom-price {
  font-size: 1.6rem;
  color: var(--primary);
  font-weight: 800;
}

/* Preview Panel */
.preview-panel {
  position: sticky;
  top: 80px;
}
.preview-sticky {
  background: var(--bg-secondary);
  border-radius: var(--radius);
  padding: 1.8rem;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--border-color);
}
.preview-sticky h3 {
  font-size: 1.1rem;
  margin-bottom: 1rem;
  text-align: center;
  color: var(--text-primary);
}

.view-toggle {
  display: flex;
  gap: .5rem;
  margin-bottom: 1.5rem;
  background: var(--bg-tertiary);
  padding: .3rem;
  border-radius: var(--radius-sm);
}
.view-btn {
  flex: 1;
  background: transparent;
  border: none;
  padding: .6rem;
  border-radius: 6px;
  font-weight: 600;
  font-size: .88rem;
  cursor: pointer;
  transition: all .15s;
  color: var(--text-secondary);
}
.view-btn.active {
  background: var(--bg-secondary);
  color: var(--primary);
  box-shadow: var(--shadow-sm);
}

.shirt-preview {
  position: relative;
  background: linear-gradient(135deg, var(--bg-tertiary), var(--bg-secondary));
  border-radius: var(--radius);
  padding: 2rem;
  margin-bottom: 1.2rem;
  min-height: 450px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.shirt-view {
  display: none;
  width: 100%;
  max-width: 300px;
  margin: 0 auto;
}
.shirt-view.active { display: block; animation: fadeIn .3s ease; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.shirt-svg { width: 100%; height: auto; filter: drop-shadow(0 4px 8px rgba(0,0,0,.1)); }

.preview-info {
  background: var(--bg-tertiary);
  border-radius: var(--radius-sm);
  padding: 1rem;
}
.info-row {
  display: flex;
  justify-content: space-between;
  padding: .4rem 0;
  font-size: .9rem;
}
.info-row span { color: var(--text-secondary); }
.info-row strong { color: var(--text-primary); }

/* Cart - Custom Shirt Display */
.cart-custom-details {
  background: var(--bg-tertiary);
  border-radius: 6px;
  padding: .6rem .8rem;
  margin-top: .4rem;
  font-size: .8rem;
  color: var(--text-secondary);
}
.cart-custom-details .custom-detail {
  display: flex;
  align-items: center;
  gap: .4rem;
  margin-bottom: .5rem;
}
.cart-custom-details .custom-detail:last-child { margin-bottom: 0; }

.cart-custom-designs {
  display: flex;
  gap: .8rem;
  margin-top: .6rem;
  flex-wrap: wrap;
}
.cart-design-preview {
  display: flex;
  flex-direction: column;
  gap: .4rem;
  flex: 1;
  min-width: 100px;
}
.cart-design-label {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .75rem;
}
.cart-design-label strong {
  color: var(--text-primary);
  font-size: .78rem;
}
.cart-alignment-badge {
  background: var(--success-light);
  color: var(--success);
  padding: .1rem .4rem;
  border-radius: 4px;
  font-size: .7rem;
  font-weight: 600;
  text-transform: capitalize;
}
.cart-design-img {
  width: 100%;
  max-width: 80px;
  height: 80px;
  object-fit: contain;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  background: var(--bg-secondary);
  padding: .3rem;
}

/* ===========================
   404
   =========================== */
.not-found {
  text-align: center;
  padding: 6rem 2rem;
}
.not-found-code {
  font-size: 7rem;
  font-weight: 900;
  color: var(--text-muted);
  line-height: 1;
  margin-bottom: .5rem;
}
.not-found h2 { font-size: 1.8rem; margin-bottom: .5rem; color: var(--text-primary); }
.not-found p  { color: var(--text-secondary); margin-bottom: 2rem; }

/* ===========================
   FOOTER
   =========================== */
.footer {
  text-align: center;
  padding: 2rem;
  color: var(--text-muted);
  font-size: .85rem;
  border-top: 1px solid var(--border-color);
  margin-top: 4rem;
  background: var(--bg-secondary);
}

/* ===========================
   LIGHT MODE ENHANCEMENTS
   =========================== */

/* Cards with elevated appearance on grey background */
[data-theme="light"] .product-card,
[data-theme="light"] .order-card,
[data-theme="light"] .admin-product-card,
[data-theme="light"] .cart-item,
[data-theme="light"] .user-order-card {
  background: var(--bg-secondary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Enhanced hover effects on grey */
[data-theme="light"] .product-card:hover,
[data-theme="light"] .admin-product-card:hover {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
  transform: translateY(-1px);
}

/* Inputs with subtle depth on grey */
[data-theme="light"] input,
[data-theme="light"] textarea,
[data-theme="light"] select {
  background: var(--bg-secondary);
  border-color: var(--border-color);
}

[data-theme="light"] input:focus,
[data-theme="light"] textarea:focus,
[data-theme="light"] select:focus {
  background: #f4f4f5;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.1);
}

/* Navbar elevated on grey background */
[data-theme="light"] .navbar {
  background: var(--bg-secondary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

/* Page headers with subtle contrast */
[data-theme="light"] .page-header {
  background: var(--bg-secondary);
  border-bottom: 2px solid var(--border-color);
}

/* Tables with better definition */
[data-theme="light"] .order-table {
  background: var(--bg-secondary);
}

[data-theme="light"] .order-table th {
  background: var(--bg-tertiary);
  border-color: var(--border-color);
}

[data-theme="light"] .order-table tr:hover {
  background: var(--bg-primary);
}

/* Admin tabs */
[data-theme="light"] .admin-tabs {
  background: var(--bg-tertiary);
  border-bottom-color: var(--border-color);
}

[data-theme="light"] .admin-tabs .tab-btn.active {
  background: var(--bg-secondary);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

[data-theme="light"] .admin-tabs .tab-btn:hover:not(.active) {
  background: rgba(236, 236, 239, 0.5);
}

/* Forms elevated on grey */
[data-theme="light"] .add-product-form,
[data-theme="light"] .admin-edit-form {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Flash messages with better contrast */
[data-theme="light"] .flash-message {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
}

/* Empty states */
[data-theme="light"] .empty-state {
  background: var(--bg-secondary);
  border: 2px dashed var(--border-color);
}

/* Checkout summary */
[data-theme="light"] .checkout-summary {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Custom shirt designer */
[data-theme="light"] .shirt-preview-container {
  background: var(--bg-secondary);
  border: 2px solid var(--border-color);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Footer on grey */
[data-theme="light"] .footer {
  background: var(--bg-tertiary);
  border-top: 1px solid var(--border-color);
}

/* Buttons stand out on grey */
[data-theme="light"] .btn-primary {
  box-shadow: 0 2px 8px rgba(79, 70, 229, 0.25);
}

[data-theme="light"] .btn-primary:hover {
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.35);
}

[data-theme="light"] .btn-secondary {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
}

[data-theme="light"] .btn-secondary:hover {
  background: var(--bg-tertiary);
}

/* Price displays pop on grey */
[data-theme="light"] .price {
  color: var(--primary);
  font-weight: 800;
}

/* Image placeholders on grey */
[data-theme="light"] .img-placeholder {
  background: var(--bg-tertiary);
  color: var(--text-muted);
}

/* Better badge contrast on grey */
[data-theme="light"] .badge {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
}

[data-theme="light"] .badge-active {
  background: var(--success-light);
  color: var(--success);
  border-color: var(--success);
}

/* ===========================
   RESPONSIVE / MOBILE
   =========================== */

/* Mobile menu toggle button */
.mobile-menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: .5rem;
  z-index: 1001;
}

.hamburger {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all .3s ease;
}

.mobile-menu-toggle.active .hamburger:nth-child(1) {
  transform: rotate(45deg) translate(6px, 6px);
}

.mobile-menu-toggle.active .hamburger:nth-child(2) {
  opacity: 0;
}

.mobile-menu-toggle.active .hamburger:nth-child(3) {
  transform: rotate(-45deg) translate(6px, -6px);
}

/* Custom shirt nav link styling */
.nav-custom {
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-weight: 700;
}

/* Tablet styles (768px and below) */
@media (max-width: 768px) {
  /* Container */
  .container {
    padding: 1.5rem 1rem;
  }

  /* Typography */
  h1 { font-size: 1.75rem; }
  h2 { font-size: 1.5rem; }
  h3 { font-size: 1.25rem; }

  /* Navbar - stays horizontal on tablet */
  .navbar {
    padding: .85rem 1rem;
  }

  .nav-links {
    gap: .8rem;
    font-size: .85rem;
  }

  /* Products grid - 2 columns on tablet */
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  /* Admin product card - smaller images */
  .admin-product-card {
    grid-template-columns: 80px 1fr;
    gap: 1rem;
  }

  /* Tables - allow horizontal scroll */
  .order-table {
    display: block;
    overflow-x: auto;
    white-space: nowrap;
  }

  /* Forms - single column */
  .form-row {
    grid-template-columns: 1fr;
  }

  /* Custom shirt designer - stack vertically */
  .custom-shirt-layout {
    grid-template-columns: 1fr;
  }

  .shirt-preview-container {
    order: -1; /* Preview on top */
  }
}

/* Mobile styles (640px and below) */
@media (max-width: 640px) {
  /* Mobile menu toggle */
  .mobile-menu-toggle {
    display: flex;
  }

  /* Mobile navigation */
  .nav-links {
    position: fixed;
    top: 60px;
    left: 0;
    right: 0;
    background: var(--bg-secondary);
    flex-direction: column;
    padding: 1rem;
    gap: 0;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    transform: translateX(-100%);
    transition: transform .3s ease;
    z-index: 1000;
    max-height: calc(100vh - 60px);
    overflow-y: auto;
  }

  .nav-links.active {
    transform: translateX(0);
  }

  .nav-links a,
  .nav-links .theme-toggle {
    padding: .85rem 1rem;
    border-bottom: 1px solid var(--border-light);
    width: 100%;
    text-align: left;
    display: block;
  }

  .nav-links a:last-of-type {
    border-bottom: none;
  }

  .theme-toggle {
    justify-content: flex-start;
    border-radius: 0;
    margin: 0;
  }

  .cart-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  /* Container */
  .container {
    padding: 1rem;
  }

  /* Typography */
  h1 { font-size: 1.5rem; }
  h2 { font-size: 1.25rem; }
  h3 { font-size: 1.1rem; }

  /* Page header */
  .page-header {
    padding: 1.5rem 1rem;
  }

  .page-header h1 {
    font-size: 1.5rem;
  }

  .page-header p {
    font-size: .9rem;
  }

  /* Products grid - 1 column on mobile */
  .products-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  /* Product cards */
  .product-card {
    max-width: 100%;
  }

  /* Buttons - full width and touch-friendly */
  .btn {
    padding: .85rem 1.25rem;
    font-size: .95rem;
    min-height: 44px; /* Touch target */
  }

  .btn-block {
    width: 100%;
  }

  /* Forms */
  .form-group input,
  .form-group textarea,
  .form-group select {
    font-size: 16px; /* Prevent zoom on iOS */
    min-height: 44px; /* Touch target */
  }

  .form-row {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .form-actions {
    flex-direction: column;
    gap: .75rem;
  }

  .form-actions .btn {
    width: 100%;
  }

  /* Cart */
  .cart-item {
    grid-template-columns: 80px 1fr;
    gap: .75rem;
  }

  .cart-item-details h3 {
    font-size: 1rem;
  }

  .cart-controls {
    flex-wrap: wrap;
    gap: .5rem;
  }

  .qty-controls {
    width: 100%;
    order: 1;
  }

  .cart-custom-designs {
    grid-template-columns: 1fr;
  }

  /* Checkout */
  .checkout-layout {
    grid-template-columns: 1fr;
  }

  .checkout-summary {
    position: static;
    margin-top: 2rem;
  }

  /* Admin dashboard */
  .admin-header {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
  }

  .admin-tabs {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .tab-btn {
    white-space: nowrap;
    padding: .75rem 1rem;
    font-size: .85rem;
  }

  .admin-product-card {
    grid-template-columns: 70px 1fr;
    gap: .75rem;
  }

  .admin-product-img {
    width: 70px;
    height: 70px;
  }

  .admin-product-actions {
    flex-direction: column;
    grid-column: 1 / -1;
    gap: .5rem;
  }

  .admin-product-actions .btn {
    width: 100%;
  }

  /* Add/Edit product form */
  .add-product-form,
  .admin-edit-form {
    padding: 1rem;
  }

  /* Order cards */
  .order-card {
    padding: 1rem;
  }

  .order-card-header {
    flex-direction: column;
    gap: .75rem;
    align-items: flex-start;
  }

  .order-status-form {
    width: 100%;
  }

  .status-dropdown {
    width: 100%;
  }

  .order-table {
    font-size: .85rem;
  }

  .order-table th,
  .order-table td {
    padding: .5rem;
  }

  /* Custom shirt designer */
  .shirt-controls {
    grid-template-columns: 1fr;
  }

  .control-group {
    width: 100%;
  }

  .color-options {
    gap: .5rem;
  }

  .color-option {
    width: 45px;
    height: 45px;
  }

  .alignment-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: .4rem;
  }

  .align-btn {
    padding: .6rem .3rem;
    font-size: .7rem;
    min-height: 44px;
  }

  .align-icon {
    font-size: 1.1rem;
  }

  .shirt-preview-container {
    height: 300px;
  }

  .design-upload-section {
    padding: 1rem;
  }

  /* Account page */
  .user-order-card {
    padding: 1rem;
  }

  .user-order-header {
    flex-direction: column;
    gap: .5rem;
    align-items: flex-start;
  }

  /* Flash messages */
  .flash-message {
    font-size: .9rem;
    padding: .85rem 1rem;
  }

  /* Empty states */
  .empty-state {
    padding: 2rem 1rem;
  }

  .empty-icon {
    font-size: 3rem;
  }

  /* Footer */
  .footer {
    padding: 1.5rem 1rem;
    font-size: .8rem;
  }

  /* Modal/overlay fix for mobile */
  body.menu-open {
    overflow: hidden;
  }
}

/* Extra small mobile (480px and below) */
@media (max-width: 480px) {
  /* Even smaller typography */
  h1 { font-size: 1.35rem; }
  h2 { font-size: 1.15rem; }

  /* Tighter spacing */
  .container {
    padding: .75rem;
  }

  .page-header {
    padding: 1.25rem .75rem;
  }

  /* Smaller cards */
  .product-card,
  .order-card,
  .cart-item {
    padding: .85rem;
  }

  /* Compact order table */
  .order-table {
    font-size: .8rem;
  }

  .order-table th,
  .order-table td {
    padding: .4rem;
  }

  /* Admin tabs scrollable */
  .tab-btn {
    font-size: .8rem;
    padding: .65rem .85rem;
  }

  /* Smaller badges */
  .badge {
    font-size: .7rem;
    padding: .3rem .5rem;
  }

  /* Cart quantity controls */
  .qty-btn {
    width: 36px;
    height: 36px;
    font-size: 1.1rem;
  }

  .qty-display {
    min-width: 40px;
    font-size: .9rem;
  }
}

/* Landscape mobile orientation */
@media (max-width: 900px) and (orientation: landscape) {
  .nav-links {
    max-height: calc(100vh - 50px);
  }

  .shirt-preview-container {
    height: 250px;
  }
}

/* Print styles */
@media print {
  .navbar,
  .admin-tabs,
  .form-actions,
  .btn,
  .theme-toggle,
  .mobile-menu-toggle {
    display: none !important;
  }

  .container {
    max-width: 100%;
    padding: 0;
  }

  .order-card,
  .product-card {
    break-inside: avoid;
  }
}
