/* ================================================
   Namira's Crafting - Fantasy Theme Styles
   ================================================ */

/* CSS Custom Properties (overridable by admin) */
:root {
  --primary: #7c3aed;
  --primary-light: #a78bfa;
  --primary-dark: #5b21b6;
  --accent: #f472b6;
  --accent-light: #fbcfe8;
  --bg-start: #0f0a1a;
  --bg-mid: #1a1033;
  --bg-end: #0d0b1a;
  --surface: rgba(255, 255, 255, 0.05);
  --surface-hover: rgba(255, 255, 255, 0.1);
  --text: #f0e6ff;
  --text-muted: #a89cc4;
  --text-dark: #1a1033;
  --glass: rgba(124, 58, 237, 0.08);
  --glass-border: rgba(124, 58, 237, 0.2);
  --glow: 0 0 20px rgba(124, 58, 237, 0.3);
  --glow-accent: 0 0 20px rgba(244, 114, 182, 0.3);
  --radius: 16px;
  --radius-sm: 8px;
  --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  --font: 'Segoe UI', system-ui, -apple-system, sans-serif;

  /* Overlay backdrops — controlled from admin Design panel */
  --header-overlay: rgba(15, 10, 26, 0.80);
  --hero-overlay: rgba(10, 5, 20, 0.55);
  --featured-overlay: rgba(10, 5, 20, 0.55);
  --shop-overlay: rgba(10, 5, 20, 0.55);
  --items-overlay: rgba(10, 5, 20, 0.55);
  --showcase-overlay: rgba(10, 5, 20, 0.55);
}

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

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font);
  background: linear-gradient(135deg, var(--bg-start), var(--bg-mid), var(--bg-end));
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

/* Background magic particles */
body::before {
  content: '';
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-image:
    radial-gradient(2px 2px at 20% 30%, rgba(167, 139, 250, 0.4), transparent),
    radial-gradient(2px 2px at 40% 70%, rgba(244, 114, 182, 0.3), transparent),
    radial-gradient(1px 1px at 60% 20%, rgba(255, 255, 255, 0.3), transparent),
    radial-gradient(2px 2px at 80% 50%, rgba(167, 139, 250, 0.3), transparent),
    radial-gradient(1px 1px at 10% 80%, rgba(244, 114, 182, 0.4), transparent),
    radial-gradient(1px 1px at 90% 10%, rgba(255, 255, 255, 0.2), transparent),
    radial-gradient(2px 2px at 50% 90%, rgba(167, 139, 250, 0.3), transparent);
  animation: floatParticles 20s linear infinite;
  pointer-events: none;
  z-index: 0;
}

@keyframes floatParticles {
  0% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-20px) rotate(1deg); }
  100% { transform: translateY(0) rotate(0deg); }
}

/* ============ TYPOGRAPHY ============ */
h1, h2, h3, h4, h5, h6 {
  line-height: 1.2;
  font-weight: 700;
}

a {
  color: var(--primary-light);
  text-decoration: none;
  transition: color var(--transition);
}

a:hover {
  color: var(--accent);
}

/* ============ LAYOUT ============ */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
  position: relative;
  z-index: 1;
}

/* ============ HEADER ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  padding: 14px 0;
}

.header-backdrop {
  backdrop-filter: blur(20px);
  background: var(--header-overlay);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-logo {
  font-size: 1.5rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  white-space: nowrap;
}

.site-logo .sparkle {
  -webkit-text-fill-color: initial;
  animation: sparkle 2s ease-in-out infinite;
}

@keyframes sparkle {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.5; }
}

.nav-links {
  display: flex;
  gap: 8px;
  list-style: none;
}

.nav-links a {
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 500;
  transition: all var(--transition);
  font-size: 0.9rem;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  background: var(--surface);
}

/* ============ HERO ============ */
.hero {
  text-align: center;
  padding: 80px 20px 60px;
  position: relative;
  z-index: 1;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.15;
  z-index: -1;
  border-radius: 0 0 50% 50% / 0 0 10% 10%;
}

.hero h1 {
  font-size: clamp(2.5rem, 6vw, 4rem);
  background: linear-gradient(135deg, var(--primary-light), var(--accent), #fbbf24);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 16px;
  animation: shimmer 3s ease-in-out infinite;
  background-size: 200% 200%;
}

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

.hero p {
  font-size: 1.2rem;
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
}

/* Hero text backdrop rectangle */
.hero-text-backdrop {
  display: block;
  background: var(--hero-overlay);
  border-radius: var(--radius);
  padding: 32px 48px;
  max-width: 100%;
  width: 100%;
  backdrop-filter: blur(6px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  text-align: center;
}

/* Section content backdrop rectangles */
.section-featured-backdrop,
.section-shop-backdrop,
.section-showcase-backdrop {
  border-radius: var(--radius);
  padding: 32px;
  backdrop-filter: blur(6px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.25);
}

.section-featured-backdrop {
  background: var(--featured-overlay);
}

.section-shop-backdrop {
  background: var(--shop-overlay);
}

.section-showcase-backdrop {
  background: var(--showcase-overlay);
}

/* ============ SECTION ============ */
.section {
  padding: 60px 0;
  position: relative;
  z-index: 1;
}

.section-title {
  text-align: center;
  font-size: 2rem;
  margin-bottom: 40px;
  position: relative;
}

.section-title::after {
  content: '';
  display: block;
  width: 60px;
  height: 3px;
  background: linear-gradient(90deg, var(--primary), var(--accent));
  margin: 12px auto 0;
  border-radius: 2px;
}

/* ============ PRODUCT GRID ============ */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

/* ============ PRODUCT CARD ============ */
.product-card {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: all var(--transition);
  backdrop-filter: blur(10px);
  animation: fadeInUp 0.6s ease-out both;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--glow);
  border-color: var(--primary-light);
}

.product-card-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: linear-gradient(135deg, var(--glass), rgba(244, 114, 182, 0.05));
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--primary-light);
  overflow: hidden;
}

.product-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-card-body {
  padding: 20px;
}

.product-card-body h3 {
  font-size: 1.1rem;
  margin-bottom: 8px;
  color: var(--text);
}

.product-card-body p {
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-price {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--accent);
  margin-bottom: 12px;
}

.showcase-badge {
  display: inline-block;
  padding: 4px 12px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  color: white;
  margin-bottom: 12px;
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border: none;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
  font-family: var(--font);
  text-decoration: none;
}

.btn-primary {
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  box-shadow: var(--glow);
}

.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(124, 58, 237, 0.5);
}

.btn-accent {
  background: linear-gradient(135deg, var(--accent), #ec4899);
  color: white;
  box-shadow: var(--glow-accent);
}

.btn-accent:hover {
  transform: translateY(-2px);
  box-shadow: 0 0 30px rgba(244, 114, 182, 0.5);
}

.btn-ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--glass-border);
}

.btn-ghost:hover {
  background: var(--surface);
  border-color: var(--primary-light);
}

.btn-sm {
  padding: 8px 16px;
  font-size: 0.85rem;
}

.btn-full {
  width: 100%;
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none !important;
}

/* ============ FORMS ============ */
.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.form-input {
  width: 100%;
  padding: 12px 16px;
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 1rem;
  font-family: var(--font);
  transition: all var(--transition);
}

.form-input:focus {
  outline: none;
  border-color: var(--primary-light);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.2);
}

.form-input::placeholder {
  color: var(--text-muted);
  opacity: 0.6;
}

textarea.form-input {
  resize: vertical;
  min-height: 80px;
}

select.form-input {
  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='%23a89cc4' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

/* ============ MODAL ============ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.modal {
  background: var(--bg-mid);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 32px;
  max-width: 500px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  transform: translateY(20px) scale(0.95);
  transition: transform var(--transition);
}

.modal-overlay.active .modal {
  transform: translateY(0) scale(1);
}

.modal h2 {
  margin-bottom: 20px;
  font-size: 1.3rem;
}

.modal-close {
  float: right;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.modal-close:hover {
  color: var(--text);
}

/* ============ ORDER CONFIRMATION ============ */
.confirmation-card {
  max-width: 600px;
  margin: 40px auto;
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 40px;
  backdrop-filter: blur(10px);
  text-align: center;
}

.order-number {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--accent);
  background: var(--glass);
  display: inline-block;
  padding: 8px 24px;
  border-radius: var(--radius-sm);
  margin: 16px 0;
  letter-spacing: 1px;
}

.swish-info {
  background: rgba(251, 191, 36, 0.1);
  border: 1px solid rgba(251, 191, 36, 0.3);
  border-radius: var(--radius-sm);
  padding: 20px;
  margin: 24px 0;
  text-align: left;
}

.swish-info h3 {
  color: #fbbf24;
  margin-bottom: 12px;
}

.swish-info p {
  margin-bottom: 8px;
}

.swish-info strong {
  color: var(--text);
}

/* ============ ORDER TABLE ============ */
.order-items-table {
  width: 100%;
  border-collapse: collapse;
  margin: 20px 0;
  text-align: left;
}

.order-items-table th {
  background: var(--glass);
  padding: 10px 12px;
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.order-items-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--glass-border);
}

.order-items-table .total-row td {
  font-weight: 700;
  border-bottom: none;
  padding-top: 16px;
  color: var(--accent);
}

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

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.fade-in {
  animation: fadeIn 0.5s ease-out;
}

.stagger-1 { animation-delay: 0.1s; }
.stagger-2 { animation-delay: 0.2s; }
.stagger-3 { animation-delay: 0.3s; }
.stagger-4 { animation-delay: 0.4s; }

/* ============ TOAST / NOTIFICATIONS ============ */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  border-radius: var(--radius-sm);
  color: white;
  font-weight: 500;
  font-size: 0.9rem;
  animation: slideInRight 0.3s ease-out;
  max-width: 350px;
  backdrop-filter: blur(10px);
}

.toast-success {
  background: rgba(34, 197, 94, 0.9);
}

.toast-error {
  background: rgba(239, 68, 68, 0.9);
}

.toast-info {
  background: rgba(124, 58, 237, 0.9);
}

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

/* ============ FOOTER ============ */
.site-footer {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
  font-size: 0.85rem;
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--glass-border);
  margin-top: 60px;
}

/* ============ ADMIN PANEL ============ */
.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
  gap: 0;
}

.admin-sidebar {
  background: rgba(15, 10, 26, 0.95);
  border-right: 1px solid var(--glass-border);
  padding: 24px 16px;
  position: sticky;
  top: 0;
  height: 100vh;
  overflow-y: auto;
}

.admin-sidebar h2 {
  font-size: 1.1rem;
  margin-bottom: 24px;
  background: linear-gradient(135deg, var(--primary-light), var(--accent));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.admin-nav {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.admin-nav li a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-weight: 500;
  transition: all var(--transition);
  font-size: 0.9rem;
}

.admin-nav li a:hover,
.admin-nav li a.active {
  color: var(--text);
  background: var(--surface);
}

.admin-nav li a.active {
  border-left: 3px solid var(--primary);
}

.admin-content {
  padding: 32px;
  max-width: 1100px;
}

.admin-content h1 {
  font-size: 1.8rem;
  margin-bottom: 24px;
}

/* Admin table */
.admin-table {
  width: 100%;
  border-collapse: collapse;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--glass-border);
}

.admin-table th {
  background: var(--glass);
  padding: 12px 16px;
  text-align: left;
  font-weight: 600;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--text-muted);
}

.admin-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--glass-border);
  font-size: 0.9rem;
}

.admin-table tr:last-child td {
  border-bottom: none;
}

.admin-table tr:hover td {
  background: var(--surface-hover);
}

/* Status badges */
.status-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: capitalize;
}

.status-pending {
  background: rgba(251, 191, 36, 0.15);
  color: #fbbf24;
}

.status-paid {
  background: rgba(34, 197, 94, 0.15);
  color: #22c55e;
}

.status-completed {
  background: rgba(124, 58, 237, 0.15);
  color: var(--primary-light);
}

/* Admin card grid */
.admin-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.admin-stat-card {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 20px;
  text-align: center;
}

.admin-stat-card .stat-value {
  font-size: 2rem;
  font-weight: 800;
  color: var(--primary-light);
}

.admin-stat-card .stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-top: 4px;
}

/* Admin toolbar */
.admin-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

/* Color picker input */
.color-picker-group {
  display: flex;
  align-items: center;
  gap: 12px;
}

.color-picker-group input[type="color"] {
  width: 48px;
  height: 48px;
  border: 2px solid var(--glass-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  background: none;
  padding: 2px;
}

/* Opacity range slider */
.opacity-slider {
  width: 100%;
  accent-color: var(--primary);
  cursor: pointer;
  height: 6px;
}

/* Switch toggle */
.toggle-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  gap: 10px;
}

.form-group label.toggle-switch {
  display: inline-flex;
  align-items: center;
  margin-bottom: 0;
}

.toggle-switch input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
  pointer-events: none;
}

.toggle-slider {
  width: 48px;
  height: 26px;
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: 13px;
  position: relative;
  transition: all var(--transition);
}

.toggle-slider::before {
  content: '';
  position: absolute;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--text-muted);
  top: 2px;
  left: 2px;
  transition: all var(--transition);
}

.toggle-switch input:checked + .toggle-slider {
  background: var(--primary);
  border-color: var(--primary);
}

.toggle-switch input:checked + .toggle-slider::before {
  transform: translateX(22px);
  background: white;
}

.toggle-label {
  display: inline-block;
  line-height: 1.2;
  user-select: none;
}

/* Login form */
.login-container {
  max-width: 400px;
  margin: 100px auto;
  padding: 0 20px;
}

.login-card {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 40px;
  backdrop-filter: blur(10px);
  text-align: center;
}

.login-card h1 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}

.login-card p {
  color: var(--text-muted);
  margin-bottom: 24px;
  font-size: 0.9rem;
}

/* ============ LOADING SPINNER ============ */
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--glass-border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 40px auto;
}

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

/* Loading skeleton */
.skeleton {
  background: linear-gradient(90deg, var(--surface) 25%, var(--surface-hover) 50%, var(--surface) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: var(--radius-sm);
}

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

/* ============ EMPTY STATE ============ */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state .icon {
  font-size: 3rem;
  margin-bottom: 16px;
}

/* ============ HAMBURGER MENU ============ */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 10;
}

.hamburger span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* ============ CART TOGGLE BUTTON ============ */
.cart-toggle {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  padding: 8px 14px;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all var(--transition);
  flex-shrink: 0;
}

.cart-toggle:hover {
  background: var(--surface-hover);
  border-color: var(--primary-light);
}

.cart-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  background: var(--accent);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font);
}

.cart-pulse {
  animation: cartPulse 0.6s ease;
}

@keyframes cartPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

/* ============ CART PANEL (slide-out) ============ */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.cart-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.cart-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(420px, 88vw);
  height: 100vh;
  background: var(--bg-mid);
  border-left: 1px solid var(--glass-border);
  z-index: 1101;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.cart-panel.open {
  transform: translateX(0);
}

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

.cart-panel-header h2 {
  font-size: 1.2rem;
  margin: 0;
}

.cart-items-list {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
}

.cart-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.cart-empty-icon {
  font-size: 3rem;
  margin-bottom: 12px;
}

.cart-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--glass-border);
  align-items: center;
}

.cart-item:last-child {
  border-bottom: none;
}

.cart-item-img {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--glass);
}

.cart-item-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cart-item-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
}

.cart-item-info {
  flex: 1;
  min-width: 0;
}

.cart-item-name {
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cart-item-price {
  color: var(--accent);
  font-weight: 600;
  font-size: 0.85rem;
}

.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 4px;
}

.qty-btn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--glass-border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}

.qty-btn:hover {
  background: var(--surface-hover);
  border-color: var(--primary-light);
}

.cart-item-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px;
  opacity: 0.6;
  transition: all var(--transition);
  flex-shrink: 0;
}

.cart-item-remove:hover {
  color: #ef4444;
  opacity: 1;
}

.cart-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--glass-border);
  flex-shrink: 0;
}

.cart-summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
  font-size: 0.9rem;
}

.cart-total-label strong {
  color: var(--accent);
  font-size: 1.1rem;
}

.checkout-total {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent);
  text-align: center;
  padding: 12px;
  background: var(--glass);
  border-radius: var(--radius-sm);
}

#cartCheckoutView {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px 24px;
}

/* ============ LIGHTBOX ============ */
.lightbox-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.92);
  z-index: 1500;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.lightbox-overlay.active {
  opacity: 1;
  pointer-events: all;
}

.lightbox-overlay img {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: var(--radius-sm);
  animation: fadeInUp 0.3s ease-out;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 24px;
  background: none;
  border: none;
  color: white;
  font-size: 2.5rem;
  cursor: pointer;
  z-index: 10;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.lightbox-close:hover {
  opacity: 1;
}

.lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: white;
  font-size: 2.5rem;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
  transition: all 0.2s;
  backdrop-filter: blur(4px);
}

.lightbox-arrow:hover {
  background: rgba(255, 255, 255, 0.2);
}

.lightbox-prev { left: 16px; }
.lightbox-next { right: 16px; }

.lightbox-caption {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  color: white;
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
  max-width: 80vw;
}

/* Product card image zoom icon */
.product-card-image {
  position: relative;
}

.image-zoom-icon {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.5);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.product-card-image.has-image:hover .image-zoom-icon {
  opacity: 1;
}

/* ============ PRODUCT TAGS ============ */
.product-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-bottom: 10px;
}

.product-tag {
  display: inline-block;
  padding: 2px 8px;
  background: var(--glass);
  border: 1px solid var(--glass-border);
  border-radius: 12px;
  font-size: 0.7rem;
  color: var(--text-muted);
  text-transform: lowercase;
}

/* ============ FILTER SIDEBAR ============ */
.main-wrapper {
  display: flex;
  position: relative;
  z-index: 1;
}

.main-content {
  flex: 1;
  min-width: 0;
}

/* Make each content section span the full viewport width so its inner
   .container centres the same way the header and hero panels do,
   regardless of how wide the filter sidebar is. The sidebar renders on
   top via its z-index:2. */
.main-content .section {
  width: 100vw;
  margin-left: calc(100% - 100vw);
}

.filter-sidebar {
  width: 240px;
  flex-shrink: 0;
  position: sticky;
  top: 80px;
  height: fit-content;
  max-height: calc(100vh - 100px);
  overflow-y: auto;
  padding: 20px 0 20px 20px;
  z-index: 2;
}

.filter-sidebar-inner {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 20px;
  backdrop-filter: blur(10px);
}

.filter-title {
  font-size: 1rem;
  margin-bottom: 16px;
}

.filter-section {
  margin-bottom: 16px;
}

.filter-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-search {
  padding: 8px 12px;
  font-size: 0.9rem;
}

.filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-tag-btn {
  padding: 4px 12px;
  border: 1px solid var(--glass-border);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text-muted);
  font-size: 0.78rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: var(--font);
  text-transform: lowercase;
}

.filter-tag-btn:hover {
  border-color: var(--primary-light);
  color: var(--text);
}

.filter-tag-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

.filter-toggle-btn {
  display: none;
  margin: 16px 20px 0;
  padding: 8px 16px;
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.9rem;
  cursor: pointer;
  font-family: var(--font);
}

.filter-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.filter-overlay.open {
  opacity: 1;
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
  .hamburger {
    display: flex;
    order: -1;
  }

  #mainNav {
    display: none;
    width: 100%;
    order: 10;
  }

  .site-header.nav-open #mainNav {
    display: block;
  }

  .site-header.nav-open .nav-links {
    flex-direction: column;
    padding-top: 8px;
  }

  .header-inner {
    flex-wrap: wrap;
  }

  .nav-links {
    flex-wrap: wrap;
  }

  .cart-toggle {
    margin-left: auto;
  }

  /* Reset full-bleed sections — sidebar is off-canvas on mobile so
     main-content is already full viewport width */
  .main-content .section {
    width: 100%;
    margin-left: 0;
  }

  /* Filter sidebar becomes off-canvas on mobile */
  .filter-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    width: min(280px, 80vw);
    max-height: 100vh;
    z-index: 100;
    padding: 20px;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    background: var(--bg-mid);
    border-right: 1px solid var(--glass-border);
  }

  .filter-sidebar.open {
    transform: translateX(0);
  }

  .filter-overlay {
    display: block;
    pointer-events: none;
  }

  .filter-overlay.open {
    pointer-events: all;
  }

  .filter-toggle-btn {
    display: inline-flex;
  }

  .admin-layout {
    grid-template-columns: 1fr;
  }

  .admin-sidebar {
    position: relative;
    height: auto;
    border-right: none;
    border-bottom: 1px solid var(--glass-border);
  }

  .admin-nav {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .admin-content {
    padding: 20px;
  }

  .hero {
    padding: 60px 20px 40px;
  }

  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  }

  .admin-table {
    display: block;
    overflow-x: auto;
  }

  .modal {
    padding: 24px;
    margin: 10px;
  }

  .lightbox-arrow {
    width: 40px;
    height: 40px;
    font-size: 1.8rem;
  }

  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
}

@media (max-width: 480px) {
  .product-grid {
    grid-template-columns: 1fr;
  }

  .hero h1 {
    font-size: 2rem;
  }
}

/* ============ IMAGE PLACEHOLDER ============ */
.img-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(124, 58, 237, 0.1), rgba(244, 114, 182, 0.05));
  font-size: 3rem;
}

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar {
  width: 8px;
}

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

::-webkit-scrollbar-thumb {
  background: var(--glass-border);
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary-light);
}

/* ============ FOCUS STYLES ============ */
:focus-visible {
  outline: 2px solid var(--primary-light);
  outline-offset: 2px;
}

/* ============ UTILITY ============ */
.text-center { text-align: center; }
.text-muted { color: var(--text-muted); }
.mt-1 { margin-top: 8px; }
.mt-2 { margin-top: 16px; }
.mt-3 { margin-top: 24px; }
.mb-1 { margin-bottom: 8px; }
.mb-2 { margin-bottom: 16px; }
.mb-3 { margin-bottom: 24px; }
.flex { display: flex; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-1 { gap: 8px; }
.gap-2 { gap: 16px; }
.hidden { display: none !important; }

/* ============ TAG INPUT (Admin) ============ */
.tag-input-container {
  position: relative;
}

.tag-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--primary);
  color: white;
  border-radius: 14px;
  font-size: 0.8rem;
  font-weight: 500;
}

.tag-pill-remove {
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.7);
  font-size: 1rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.tag-pill-remove:hover {
  color: white;
}

.tag-text-input {
  padding: 8px 12px !important;
  font-size: 0.9rem !important;
}

.tag-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: var(--bg-mid);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  max-height: 150px;
  overflow-y: auto;
  z-index: 10;
  display: none;
}

.tag-suggestions.open {
  display: block;
}

.tag-suggestion-item {
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.85rem;
  color: var(--text-muted);
  transition: background 0.15s;
}

.tag-suggestion-item:hover {
  background: var(--surface);
  color: var(--text);
}

/* ============ CROP MODAL ============ */
.crop-aspect-buttons {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.crop-ratio-btn.active {
  background: var(--primary);
  color: white;
  border-color: var(--primary);
}

/* ============ IMAGE POSITION SLIDERS ============ */
.position-sliders {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.position-slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.position-slider-row .opacity-slider {
  flex: 1;
}
