/* ============================================
   WISHBOX — Luxurious Indie Gift & Beauty
   Warm, elegant, brighter side
   ============================================ */
:root {
  --bg: #FDF8F4;
  --surface: #FFFFFF;
  --primary: #9C6B4E;
  --primary-dark: #7A5240;
  --accent: #C9A66B;
  --accent-soft: #E8D5B7;
  --text: #1A1A1A;
  --muted: #6B5E55;
  --soft: #F5E6D8;
  --border: #EDE4DB;
  --success: #5A7A5A;
  --danger: #A65D5D;
  --shadow: 0 4px 24px rgba(26, 26, 26, 0.06);
  --shadow-hover: 0 12px 40px rgba(26, 26, 26, 0.1);
  --radius: 12px;
  --radius-sm: 8px;
  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Outfit', system-ui, sans-serif;
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; }

/* Typography */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 500;
  letter-spacing: -0.02em;
}

.display {
  font-size: clamp(2.4rem, 5vw, 3.6rem);
  line-height: 1.15;
}

.subtitle {
  font-size: 1.05rem;
  color: var(--muted);
  max-width: 520px;
}

/* Layout */
.container {
  width: min(1180px, 92%);
  margin-inline: auto;
}

.section { padding: 4.5rem 0; }

.section-title {
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  margin-bottom: 0.5rem;
}

.section-header {
  text-align: center;
  margin-bottom: 2.8rem;
}

.section-header p {
  color: var(--muted);
  margin-top: 0.4rem;
}

/* Header */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(253, 248, 244, 0.94);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--border);
}

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

.logo-img {
  height: 36px;
  width: auto;
}

.nav {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav a {
  font-size: 0.95rem;
  font-weight: 450;
  color: var(--muted);
  transition: color 0.2s;
}

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

.header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.cart-btn {
  position: relative;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--text);
  transition: transform 0.2s;
}

.cart-btn:hover { transform: scale(1.08); }

.cart-count {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--primary);
  color: white;
  font-size: 0.7rem;
  font-weight: 600;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.6rem;
  border-radius: 999px;
  font-size: 0.95rem;
  font-weight: 500;
  border: none;
  cursor: pointer;
  transition: all 0.25s ease;
}

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

.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(156, 107, 78, 0.28);
}

.btn-outline {
  background: transparent;
  border: 1.5px solid var(--border);
  color: var(--text);
}

.btn-outline:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.btn-sm {
  padding: 0.5rem 1.1rem;
  font-size: 0.85rem;
}

.btn-full { width: 100%; }

/* Hero */
.hero {
  padding: 5rem 0 4rem;
  position: relative;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 3rem;
  align-items: center;
}

.hero-badge {
  display: inline-block;
  background: var(--soft);
  color: var(--primary);
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  margin-bottom: 1.2rem;
}

.hero h1 { margin-bottom: 1.1rem; }

.hero p {
  margin-bottom: 2rem;
  color: var(--muted);
  font-size: 1.1rem;
}

.hero-actions {
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
}

.hero-visual {
  position: relative;
  border-radius: 20px;
  overflow: hidden;
  aspect-ratio: 4/5;
  background: var(--soft);
  box-shadow: var(--shadow-hover);
}

.hero-visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-float {
  position: absolute;
  bottom: 1.5rem;
  left: 1.5rem;
  right: 1.5rem;
  background: rgba(255, 255, 255, 0.93);
  backdrop-filter: blur(8px);
  padding: 1rem 1.2rem;
  border-radius: var(--radius);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.hero-float strong {
  font-family: var(--font-display);
  font-size: 1.15rem;
}

/* Categories */
.categories {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

.cat-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.8rem 1.4rem;
  text-align: center;
  transition: all 0.3s ease;
  cursor: pointer;
}

.cat-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
  border-color: var(--accent-soft);
}

.cat-icon {
  width: 52px;
  height: 52px;
  margin: 0 auto 1rem;
  background: var(--soft);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}

.cat-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.3rem;
}

.cat-card p {
  font-size: 0.88rem;
  color: var(--muted);
}

/* Products */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.6rem;
}

.product-card {
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-hover);
}

.product-img {
  aspect-ratio: 1;
  background: var(--soft);
  position: relative;
  overflow: hidden;
}

.product-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.4s ease;
}

.product-card:hover .product-img img {
  transform: scale(1.05);
}

.product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--primary);
  color: white;
  font-size: 0.72rem;
  font-weight: 500;
  padding: 0.25rem 0.6rem;
  border-radius: 999px;
}

.product-body {
  padding: 1.1rem 1.15rem 1.3rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-cat {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 0.25rem;
}

.product-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  margin-bottom: 0.35rem;
  line-height: 1.3;
}

.product-price {
  font-weight: 560;
  font-size: 1.05rem;
  color: var(--primary);
  margin-bottom: 0.9rem;
}

.product-actions { margin-top: auto; }

/* Cart Drawer */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 26, 0.35);
  z-index: 200;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
}

.cart-overlay.open {
  opacity: 1;
  visibility: visible;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(400px, 100%);
  height: 100%;
  background: var(--surface);
  z-index: 210;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  box-shadow: -8px 0 40px rgba(0,0,0,0.08);
}

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

.cart-header {
  padding: 1.4rem 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-header h3 { font-size: 1.35rem; }

.cart-close {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 1.4rem;
  color: var(--muted);
  padding: 4px;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 1.2rem 1.5rem;
}

.cart-item {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
}

.cart-item-img {
  width: 72px;
  height: 72px;
  border-radius: var(--radius-sm);
  object-fit: contain;
  background: var(--soft);
}

.cart-item-info { flex: 1; }

.cart-item-info h4 {
  font-size: 1rem;
  margin-bottom: 0.2rem;
}

.cart-item-info p {
  font-size: 0.9rem;
  color: var(--primary);
  font-weight: 500;
}

.cart-qty {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-top: 0.5rem;
}

.qty-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
}

.cart-footer {
  padding: 1.4rem 1.5rem;
  border-top: 1px solid var(--border);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  font-size: 1.15rem;
  margin-bottom: 1.1rem;
}

.cart-empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
}

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 26, 26, 0.4);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  padding: 1rem;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--surface);
  border-radius: 16px;
  width: min(480px, 100%);
  max-height: 90vh;
  overflow-y: auto;
  padding: 2rem;
  box-shadow: 0 20px 60px rgba(0,0,0,0.15);
  transform: translateY(20px);
  transition: transform 0.3s;
}

.modal-overlay.open .modal { transform: translateY(0); }

.modal h2 {
  font-size: 1.6rem;
  margin-bottom: 0.4rem;
}

.modal .subtitle { margin-bottom: 1.6rem; }

.form-group { margin-bottom: 1.1rem; }

.form-group label {
  display: block;
  font-size: 0.88rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
  color: var(--muted);
}

.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--bg);
  font-size: 0.95rem;
  transition: border-color 0.2s;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}

/* About / Contact */
.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}

.about-text p {
  color: var(--muted);
  margin-bottom: 1rem;
}

.contact-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}

/* Footer */
.footer {
  background: var(--text);
  color: #E8D5B7;
  padding: 3rem 0 2rem;
  margin-top: 3rem;
}

.footer-inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 2rem;
}

.footer .logo-img {
  height: 32px;
  filter: invert(1) brightness(0.95);
}

.footer p {
  font-size: 0.9rem;
  opacity: 0.75;
  margin-top: 0.5rem;
  max-width: 280px;
}

.footer-links {
  display: flex;
  gap: 2rem;
}

.footer-links a {
  font-size: 0.9rem;
  opacity: 0.8;
  transition: opacity 0.2s;
}

.footer-links a:hover { opacity: 1; }

.footer-bottom {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid rgba(232, 213, 183, 0.15);
  text-align: center;
  font-size: 0.82rem;
  opacity: 0.6;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 1.5rem;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: var(--text);
  color: white;
  padding: 0.85rem 1.5rem;
  border-radius: 999px;
  font-size: 0.9rem;
  z-index: 500;
  opacity: 0;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  pointer-events: none;
}

.toast.show {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
}

/* Admin */
.admin-body { background: #F7F3EF; }

.admin-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: 100vh;
}

.admin-sidebar {
  background: var(--text);
  color: #E8D5B7;
  padding: 2rem 1.4rem;
}

.admin-sidebar .logo-img {
  height: 28px;
  filter: invert(1);
  margin-bottom: 2.5rem;
  display: block;
}

.admin-nav a {
  display: block;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  margin-bottom: 0.3rem;
  color: rgba(232, 213, 183, 0.7);
  font-size: 0.95rem;
  transition: all 0.2s;
}

.admin-nav a:hover,
.admin-nav a.active {
  background: rgba(255,255,255,0.08);
  color: white;
}

.admin-main { padding: 2rem 2.5rem; }

.admin-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;
}

.admin-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.6rem;
  margin-bottom: 1.5rem;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 0.85rem 0.7rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.92rem;
}

.admin-table th {
  color: var(--muted);
  font-weight: 500;
  font-size: 0.82rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.admin-table img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  border-radius: 6px;
}

.login-box {
  max-width: 400px;
  margin: 10vh auto;
  background: var(--surface);
  padding: 2.5rem;
  border-radius: 16px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.login-box h1 {
  font-size: 1.8rem;
  margin-bottom: 0.4rem;
  text-align: center;
}

.login-box p {
  text-align: center;
  color: var(--muted);
  margin-bottom: 1.8rem;
}

.loading-screen {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 60vh;
  color: var(--muted);
  font-size: 1.1rem;
}

/* Responsive */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-visual { max-width: 420px; margin: 0 auto; }
  .categories { grid-template-columns: 1fr; }
  .about-grid { grid-template-columns: 1fr; }
  .admin-layout { grid-template-columns: 1fr; }
  .admin-sidebar { display: none; }
}

@media (max-width: 700px) {
  .nav { display: none; }
  .menu-toggle { display: block; }
  .form-row { grid-template-columns: 1fr; }
  .header-inner { height: 64px; }
  .logo-img { height: 30px; }
}

.mobile-nav {
  display: none;
  position: fixed;
  top: 64px;
  left: 0;
  right: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 1rem;
  z-index: 90;
  flex-direction: column;
  gap: 0.8rem;
}

.mobile-nav.open { display: flex; }

.mobile-nav a {
  padding: 0.6rem 1rem;
  border-radius: var(--radius-sm);
  font-weight: 500;
}

.mobile-nav a:hover { background: var(--soft); }

/* ========== New styles for v2 ========== */
.multi-img-badge {
  position: absolute;
  bottom: 10px;
  right: 10px;
  background: rgba(0,0,0,0.6);
  color: white;
  font-size: 0.7rem;
  padding: 0.2rem 0.5rem;
  border-radius: 999px;
}

/* Box Builder Modal */
.box-size-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
  margin-top: 1.5rem;
}

.box-size-card {
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 1.8rem 1.2rem;
  text-align: center;
  cursor: pointer;
  transition: all 0.25s;
  background: var(--bg);
}

.box-size-card:hover {
  border-color: var(--primary);
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.box-size-icon {
  font-size: 2.2rem;
  margin-bottom: 0.6rem;
}

.box-size-card h3 {
  font-size: 1.25rem;
  margin-bottom: 0.3rem;
}

.box-price {
  margin-top: 0.6rem;
  font-weight: 600;
  color: var(--primary);
}

.box-items-grid {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  max-height: 320px;
  overflow-y: auto;
  margin: 1rem 0;
}

.box-item-card {
  display: flex;
  align-items: center;
  gap: 0.9rem;
  padding: 0.7rem 0.9rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all 0.2s;
  background: var(--bg);
}

.box-item-card:hover {
  border-color: var(--accent);
}

.box-item-card.selected {
  border-color: var(--primary);
  background: var(--soft);
}

.box-item-card img {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: 8px;
}

.box-item-card strong {
  font-size: 0.95rem;
  display: block;
}

.box-item-card p {
  font-size: 0.85rem;
  color: var(--primary);
  margin: 0;
}

.box-item-card .check {
  margin-left: auto;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 0.9rem;
}

.box-item-card.selected .check {
  background: var(--primary);
  color: white;
}

.box-summary {
  border-top: 1px solid var(--border);
  padding-top: 1rem;
}

.box-summary > div {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.4rem;
  font-size: 0.95rem;
}

.box-summary .grand {
  font-weight: 600;
  font-size: 1.15rem;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border);
}

@media (max-width: 600px) {
  .box-size-grid {
    grid-template-columns: 1fr;
  }
}

/* ========== Layout v3 — Compact Hero + Sidebar ========== */

.hero-compact {
  padding: 2.5rem 0 2rem;
}

.hero-compact .hero-grid {
  gap: 2rem;
  align-items: center;
}

.hero-compact .display {
  font-size: clamp(2rem, 4vw, 2.8rem);
}

.hero-compact .subtitle {
  font-size: 1rem;
  margin-bottom: 1.4rem;
}

/* Carousel */
.carousel {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  border-radius: 16px;
}

.carousel-track {
  display: flex;
  height: 100%;
  transition: transform 0.6s ease;
}

.carousel-slide {
  min-width: 100%;
  height: 100%;
}

.carousel-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.carousel-dots {
  position: absolute;
  bottom: 14px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 5;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.5);
  cursor: pointer;
  padding: 0;
  transition: background 0.2s;
}

.dot.active {
  background: white;
}

/* Shop Layout with Sidebar */
.shop-layout {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 2rem;
  align-items: start;
}

.shop-main {
  min-width: 0;
}

.filter-row {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.4rem;
  flex-wrap: wrap;
}

/* Sidebar */
.shop-sidebar {
  position: sticky;
  top: 90px;
}

.sidebar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.3rem;
  margin-bottom: 1.2rem;
}

.sidebar-card h3 {
  font-size: 1.15rem;
  margin-bottom: 0.25rem;
}

.sidebar-sub {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.sidebar-link {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  width: 100%;
  padding: 0.7rem 0.6rem;
  border: none;
  background: transparent;
  border-radius: var(--radius-sm);
  cursor: pointer;
  text-align: left;
  transition: background 0.2s;
  margin-bottom: 0.25rem;
}

.sidebar-link:hover {
  background: var(--soft);
}

.sidebar-icon {
  width: 36px;
  height: 36px;
  background: var(--soft);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  flex-shrink: 0;
}

.sidebar-link strong {
  display: block;
  font-size: 0.92rem;
}

.sidebar-link small {
  font-size: 0.78rem;
  color: var(--muted);
}

.sidebar-cta {
  background: linear-gradient(145deg, #FDF8F4, #F5E6D8);
  border-color: var(--accent-soft);
}

.sidebar-cta p {
  font-size: 0.88rem;
  color: var(--muted);
  margin: 0.5rem 0 1rem;
}

/* Products grid tweak for sidebar layout */
.shop-main .products-grid {
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1.2rem;
}

@media (max-width: 960px) {
  .shop-layout {
    grid-template-columns: 1fr;
  }
  .shop-sidebar {
    position: static;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }
  .sidebar-cta {
    grid-column: 1 / -1;
  }
}

@media (max-width: 600px) {
  .shop-sidebar {
    grid-template-columns: 1fr;
  }
  .hero-compact {
    padding: 1.8rem 0 1.5rem;
  }
}
