* {
  box-sizing: border-box;
  font-family: 'Plus Jakarta Sans', sans-serif;
  -webkit-tap-highlight-color: transparent;
}

body {
  margin: 0;
  padding: 0;
  background: #ffffff;
  color: #0a0a0a;
}

.main-container {
  padding: 14px;
  padding-bottom: 100px; 
}

/* === UNIVERSAL NAVBAR (Replaces old .navbar & .header) === */
.navbar {
  position: sticky; 
  top: 0; 
  z-index: 50; 
  padding: 12px 16px;
  /* Glassmorphism */
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  background: rgba(255,255,255,0.85);
  border-bottom: 1px solid rgba(0,0,0,0.05);
  
  /* GRID LAYOUT: Ensures Logo is always perfectly centered */
  display: grid;
  grid-template-columns: 44px 1fr 44px; 
  align-items: center;
  justify-items: center;
  width: 100%;
}

/* Navbar Slots */
.nav-left { justify-self: start; display: flex; align-items: center; }
.nav-center { justify-self: center; display: flex; align-items: center; justify-content: center; }
.nav-right { justify-self: end; display: flex; align-items: center; }

/* Logo Styling */
.logo-link { display: block; line-height: 0; text-decoration: none; border: none; }
.logo-img { height: 24px; width: auto; display: block; }

/* Unified Navigation Buttons (Back / Cart) */
.nav-btn {
  width: 40px; 
  height: 40px;
  background: none; 
  border: none; 
  padding: 0;
  display: flex; 
  align-items: center; 
  justify-content: center;
  cursor: pointer; 
  border-radius: 50%;
  color: #111;
  transition: background 0.2s ease;
}
.nav-btn:active { background: rgba(0,0,0,0.05); transform: scale(0.96); }
.nav-btn svg { width: 24px; height: 24px; stroke-width: 2px; }

/* Cart Icon Specifics */
.cart-icon-btn { display: none; } /* Legacy class override */
.cart-badge-wrapper { position: relative; display: flex; align-items: center; justify-content: center; }
.cart-count {
  position: absolute; top: -6px; right: -6px;
  background: #000; color: #fff;
  font-size: 10px; font-weight: 700;
  height: 16px; min-width: 16px; padding: 0 4px;
  border-radius: 999px;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
}

/* === PAGE HEADERS (Legacy support, though Navbar is preferred) === */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 16px;
  background: #fff;
  border-bottom: 1px solid #f0f0f0;
}
.page-header h1 { font-size: 18px; margin: 0; font-weight: 800; }
.page-header button { background: none; border: none; font-size: 24px; cursor: pointer; padding: 0; }


/* === HERO & CARDS === */
.hero { position: relative; height: 52vh; overflow: hidden; }
.hero img { width: 100%; height: 100%; object-fit: cover; }
.hero-overlay { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(255,255,255,0.05), rgba(255,255,255,0.45), rgba(255,255,255,0.9)); }
.hero-text { position: absolute; bottom: 18px; left: 16px; }
.hero-text h1 { font-size: 26px; line-height: 1.15; margin-bottom: 6px; }
.hero-text p { font-size: 14px; color: #333; }

.entry-grid { display: grid; gap: 22px; padding: 24px 16px; }
.entry-card { background: #f9f9f9; border-radius: 24px; padding: 16px; transition: transform 260ms cubic-bezier(0.22, 1, 0.36, 1); }
.entry-card.interactive:active { transform: translateY(-2px); }
.card-image { position: relative; aspect-ratio: 4 / 5; overflow: hidden; border-radius: 16px; margin-bottom: 14px; }
.card-image img { width: 100%; height: 100%; object-fit: cover; transition: transform 300ms cubic-bezier(0.22, 1, 0.36, 1); }
.entry-card.interactive:active .card-image img { transform: scale(1.02); }
.combo-badge { position: absolute; bottom: 12px; right: 12px; background: rgba(255,255,255,0.9); color: #15803d; padding: 4px 8px; border-radius: 999px; font-size: 11px; }

.entry-card h2 { margin: 0 0 4px; }
.entry-card p { margin: 0 0 10px; color: #666; }
.price-hint { display: block; font-size: 12px; color: #777; margin-bottom: 12px; }

/* === BUTTONS === */
.primary-btn { 
  border: none; background: #000; color: #fff; 
  padding: 12px 18px; border-radius: 999px; 
  font-size: 14px; font-weight: 700; cursor: pointer; 
}
.secondary-btn { 
  background: transparent; color: #000; border: 1px solid #000; 
  padding: 12px 18px; border-radius: 999px; 
  font-size: 14px; font-weight: 700; cursor: pointer; 
}

/* === GLOBAL INPUT STYLES (New: Unified for Cart & Checkout) === */
.premium-input {
  width: 100%; padding: 14px 16px;
  background: #fafafa; border: 1px solid #e5e5e5;
  border-radius: 12px; font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 16px; color: #111; outline: none;
  transition: all 0.2s ease; appearance: none;
}
.premium-input:focus { background: #fff; border-color: #000; box-shadow: 0 0 0 1px #000; }
.premium-input[readonly] { background-color: #f3f4f6; color: #888; border-color: #e5e5e5; pointer-events: none; }
.premium-input.input-error { border-color: #dc2626 !important; background-color: #fef2f2 !important; animation: shake 0.3s ease; }

/* === RESUME BAR === */
.resume-bar {
  position: fixed; bottom: 24px; left: 16px; right: 16px;
  background: #111; color: #fff;
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-radius: 16px;
  box-shadow: 0 14px 30px rgba(0,0,0,0.25);
  z-index: 90;
  transform: translateY(150%);
  transition: transform 0.5s cubic-bezier(0.19, 1, 0.22, 1);
  cursor: pointer; border: 1px solid rgba(255,255,255,0.15);
}
.resume-bar.show { transform: translateY(0); }
.resume-info { display: flex; flex-direction: column; text-align: left; }
.resume-title { font-size: 15px; font-weight: 700; margin-bottom: 2px; color: #fff; }
.resume-sub { font-size: 12px; color: #aaa; }
.resume-btn { background: #fff; color: #000; padding: 8px 16px; border-radius: 999px; font-size: 13px; font-weight: 700; white-space: nowrap; }

/* === BUILDER PAGE SPECIFIC === */
body.frozen-state .metal-toggle,
body.frozen-state .tray-surface,
body.frozen-state .reset-row,
body.frozen-state .helper,
body.frozen-state #cta {
  display: none !important;
}

.post-actions-container {
  position: fixed; bottom: 20px; left: 14px; right: 14px;
  display: none; gap: 12px; z-index: 99;
}
body.frozen-state .post-actions-container { display: flex; }
.action-btn { flex: 1; padding: 16px; border-radius: 999px; font-size: 16px; font-weight: 600; cursor: pointer; border: none; text-align: center; }
.btn-build-more { background: #e5e5e5; color: #000; }
.btn-view-cart { background: #000; color: #fff; }

.helper { font-size: 13px; color: #777; margin-top: 10px; text-align: center; width: 100%; display: block; }

.cta {
  position: fixed; bottom: 20px; left: 14px; right: 14px; padding: 16px; border-radius: 999px; background: #000; color: #fff; border: none; font-size: 16px; font-weight: 700; cursor: pointer;
  opacity: 0; transform: translateY(12px); transition: all 0.25s ease;
  pointer-events: none;
}
.cta.show { opacity: 1; transform: translateY(0); pointer-events: auto; }

/* === COMBO VISUALIZATION === */
.combo-stack { display: flex; flex-direction: column; gap: 20px; align-items: center; margin-top: 10px; }
.canvas.bracelet-preview { position: relative; width: 100%; max-width: 300px; aspect-ratio: 1 / 1; }
.bracelet-base-img { position: absolute; width: 72%; height: 72%; left: 50%; top: 50%; transform: translate(-50%, -50%); pointer-events: none; }
.bracelet-charm { position: absolute; width: 40px; transform-origin: top center; }

/* === CART PAGE LAYOUT === */
.cart-page { min-height: 80vh; display: flex; flex-direction: column; background: #fff; }
.cart-list { display: flex; flex-direction: column; gap: 20px; margin-bottom: 40px; }
.item-row-content { display: flex; align-items: center; gap: 14px; width: 100%; }

.cart-item-card {
  background: #fff; border-radius: 16px; padding: 12px; position: relative; overflow: hidden;
  border: 1px solid #f0f0f0; box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}

.combo-card-group {
  display: flex; flex-direction: column; background: #fff; border: 1px solid #e5e5e5;
  border-radius: 16px; overflow: hidden; box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}
.combo-group-header { padding: 14px 16px; background: #fcfcfc; border-bottom: 1px solid #f0f0f0; }
.combo-header-info { display: flex; flex-direction: column; }
.combo-header-title { font-size: 15px; font-weight: 700; color: #111; letter-spacing: -0.01em; }
.combo-header-price { font-size: 13px; color: #15803d; font-weight: 600; margin-top: 2px; }
.combo-sub-item { padding: 12px 16px; background: #fff; border-bottom: 1px solid #f5f5f5; }
.combo-sub-item:last-child { border-bottom: none; }

.item-thumb {
  position: relative; width: 72px; height: 72px; background: #f9f9f9;
  border-radius: 14px; overflow: hidden; flex-shrink: 0; border: 1px solid rgba(0,0,0,0.04);
}

/* Mini Builder Engine */
.mini-canvas-scaler { position: absolute; width: 300px; height: 300px; top: 0; left: 0; transform-origin: 0 0; transform: scale(0.24); pointer-events: none; }
.mini-base { position: absolute; width: 72%; height: 72%; left: 50%; top: 50%; transform: translate(-50%, -50%); object-fit: contain; }
.mini-charm { position: absolute; width: 46px; transform-origin: top center; }
.mini-hook { position: absolute; top: 12px; width: 45%; }
.mini-hook.left { left: 50%; transform: translateX(-100%); }
.mini-hook.right { left: 50%; }

.charm-badge {
  position: absolute; bottom: 0; right: 0; background: #000; color: #fff;
  font-size: 10px; font-weight: 600; padding: 3px 8px; border-radius: 8px 0 0 0; z-index: 2;
}

.item-details { flex: 1; }
.item-title { font-weight: 700; font-size: 15px; margin-bottom: 4px; color: #111; }
.item-price { font-size: 14px; color: #666; font-weight: 500; }
.sub-item-name { font-size: 14px; font-weight: 600; color: #333; }
.sub-item-meta { font-size: 12px; color: #888; text-transform: capitalize; }

.item-actions { display: flex; gap: 8px; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid #eee; background: #fff;
  cursor: pointer; display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: #444; transition: all 0.2s;
}
.icon-btn:active { transform: scale(0.95); background: #f5f5f5; }
.delete-btn { color: #dc2626; border-color: #fee2e2; background: #fffaf0; }

/* === SUMMARY & COUPONS === */
/* Update these styles for the Bill Summary */
.math-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 14px;
  color: #444;
}

.discount-row {
  color: #15803d; /* Green color for savings */
  font-weight: 500;
}

.discount-row span:last-child {
  font-weight: 700; /* Bold the negative amount */
}

.divider {
  height: 1px;
  background: #eee;
  margin: 12px 0;
}

.total-row {
  font-size: 18px;
  font-weight: 800;
  color: #000;
  margin-top: 4px;
}
.coupon-section-container { margin-bottom: 24px; }
.featured-coupon-card {
  background: #fff; border: 1px solid #e0e0e0; border-radius: 12px; padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 2px 8px rgba(0,0,0,0.02); margin-bottom: 8px;
}
.featured-icon {
  width: 40px; height: 40px; background: #e8f5e9; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; margin-right: 12px; flex-shrink: 0;
}
.featured-icon svg { width: 20px; height: 20px; color: #15803d; }
.featured-content { flex: 1; margin-right: 10px; }
.featured-code { font-weight: 700; font-size: 14px; color: #111; display: block; }
.featured-desc { font-size: 12px; color: #666; margin-top: 2px; }
.featured-apply-btn { background: none; border: none; color: #15803d; font-weight: 700; font-size: 14px; cursor: pointer; padding: 4px 8px; }

.view-more-coupons { font-size: 13px; color: #15803d; font-weight: 600; display: flex; align-items: center; gap: 4px; cursor: pointer; padding-left: 4px; }

/* Coupon Drawer */
.coupon-drawer-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 100;
  display: none; opacity: 0; transition: opacity 0.3s;
}
.coupon-drawer-overlay.active { display: block; opacity: 1; }
.coupon-drawer {
  position: fixed; bottom: 0; left: 0; right: 0; background: #fdfdfd;
  border-radius: 20px 20px 0 0; z-index: 101; transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1);
  max-height: 85vh; display: flex; flex-direction: column;
}
.coupon-drawer.active { transform: translateY(0); }
.drawer-header { padding: 16px; border-bottom: 1px solid #eee; display: flex; align-items: center; justify-content: space-between; }
.drawer-header h3 { margin: 0; font-size: 16px; font-weight: 700; }
.close-drawer-btn { background: none; border: none; font-size: 20px; color: #666; cursor: pointer; }
.coupon-input-container { padding: 16px; border-bottom: 1px solid #f0f0f0; }
.coupon-input-wrapper { display: flex; border: 1px solid #ddd; border-radius: 8px; overflow: hidden; }
.coupon-input-wrapper input { flex: 1; border: none; padding: 12px; outline: none; font-size: 14px; }
.coupon-input-wrapper button { background: #fff; border: none; border-left: 1px solid #ddd; color: #aaa; padding: 0 16px; font-weight: 600; cursor: default; }
.drawer-content { overflow-y: auto; padding: 16px; background: #f4f6f8; padding-bottom: 40px; }

/* Swiss Coupon Card */
.swiss-coupon-card {
  display: flex; background: #fff; border-radius: 12px; overflow: hidden;
  box-shadow: 0 2px 5px rgba(0,0,0,0.03); margin-bottom: 16px; border: 1px solid #eaeaea;
}
.coupon-strip {
  width: 36px; background: linear-gradient(180deg, #f0f0f0 0%, #e6e6e6 100%);
  display: flex; align-items: center; justify-content: center; border-right: 1px dashed #ccc;
}
.strip-text {
  writing-mode: vertical-rl; transform: rotate(180deg);
  font-size: 11px; font-weight: 700; color: #888; letter-spacing: 1px; text-transform: uppercase;
}
.coupon-main { flex: 1; padding: 14px; }
.coupon-top-row { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 6px; }
.c-code { font-size: 15px; font-weight: 800; color: #111; letter-spacing: -0.3px; }
.c-apply-btn { font-size: 13px; font-weight: 700; color: #15803d; background: none; border: none; cursor: pointer; padding: 4px 0; }
.c-apply-btn:disabled { color: #ccc; cursor: not-allowed; }
.c-benefit { font-size: 13px; color: #16a34a; margin-bottom: 4px; font-weight: 600; }
.c-desc { font-size: 12px; color: #666; line-height: 1.4; margin-bottom: 8px; }
.c-progress-bar { height: 4px; width: 100%; background: #eee; border-radius: 2px; overflow: hidden; margin-top: 8px; }
.c-progress-fill { height: 100%; background: #fbbf24; width: 0%; transition: width 0.3s; }
.c-progress-text { font-size: 11px; color: #7D5C29; margin-top: 4px; font-weight: 600; }

.coupon-applied-view {
  display: none; background: #f0fdf4; border: 1px solid #dcfce7; padding: 12px; border-radius: 12px;
  color: #15803d; font-size: 14px; font-weight: 600; justify-content: space-between; align-items: center; margin-bottom: 20px;
}
.remove-coupon-btn { background: none; border: none; font-size: 18px; color: #15803d; cursor: pointer; }

/* Update the existing button style to transition smoothly */
.coupon-input-wrapper button {
  background: #fff;
  border: none;
  border-left: 1px solid #ddd;
  color: #ccc; /* Default 'disabled' look */
  padding: 0 16px;
  font-weight: 600;
  cursor: default;
  transition: all 0.2s ease;
}

/* Add this NEW class for when text is entered */
.coupon-input-wrapper button.ready {
  color: #15803d; /* Brand Green */
  cursor: pointer;
  background-color: #f0fdf4; /* Slight green tint */
  font-weight: 700;
}

/* === CHECKOUT ELEMENTS === */
.checkout-pill {
  position: fixed; bottom: 24px; left: 16px; right: 16px;
  background: #000; color: #fff; border: none; padding: 18px;
  border-radius: 999px; font-size: 16px; font-weight: 700;
  box-shadow: 0 10px 30px rgba(0,0,0,0.25); z-index: 80; cursor: pointer;
}

.empty-state { display: flex; flex-direction: column; align-items: center; justify-content: center; margin-top: 80px; text-align: center; }
.empty-img { width: 140px; margin-bottom: 24px; opacity: 0.8; }
.empty-state h3 { margin: 0 0 8px; font-size: 18px; }
.empty-state p { margin: 0 0 24px; color: #666; font-size: 14px; }

/* Upsell Modal */
.upsell-modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6); z-index: 200;
  display: none; align-items: center; justify-content: center;
  backdrop-filter: blur(4px); animation: fadeIn 0.2s ease;
}
.upsell-modal-card {
  background: #fff; width: 85%; max-width: 320px; padding: 24px; border-radius: 20px;
  text-align: center; box-shadow: 0 20px 40px rgba(0,0,0,0.2);
  transform: scale(0.95); animation: popIn 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275) forwards;
}
.secondary-link { display: block; color: #777; font-size: 13px; text-decoration: underline; cursor: pointer; margin-top: 8px; font-weight: 600; }

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { to { transform: scale(1); } }
@keyframes shake { 0%, 100% { transform: translateX(0); } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }

/* Delete Modal Styles */
.delete-modal-overlay {
  position: fixed;
  top: 0; left: 0; width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.5);
  display: none; /* Hidden by default */
  justify-content: center;
  align-items: center;
  z-index: 2000;
  backdrop-filter: blur(2px);
}

.delete-modal-card {
  background: #fff;
  padding: 24px;
  border-radius: 16px;
  width: 90%;
  max-width: 320px;
  text-align: center;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  animation: fadeIn 0.2s ease-out;
}

.delete-modal-card h3 {
  margin: 0 0 8px 0;
  font-size: 18px;
  font-weight: 700;
  color: #111;
}

.delete-modal-card p {
  margin: 0 0 20px 0;
  font-size: 14px;
  color: #666;
  line-height: 1.4;
}

.delete-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
}

.delete-actions button {
  flex: 1;
  padding: 10px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
}

.cancel-btn {
  background: #f1f1f1;
  color: #333;
}

.confirm-btn {
  background: #ef4444; /* Red for danger */
  color: white;
}
