/* ============================================================
   public/css/style.css — Twink Mansion Merch Store
   Edit colours in :root to retheme the entire site.
   ============================================================ */

:root {
  --amber:        #E8A830;
  --amber-light:  #F5C355;
  --amber-dark:   #C48820;
  --navy:         #1E2D45;
  --navy-light:   #2A3F5F;
  --cream:        #FDF6E8;
  --cream-dark:   #F5EDD6;
  --steel:        #4A6080;
  --text:         #1A1A2E;
  --white:        #FFFFFF;
  --success:      #2E7D4F;
  --danger:       #C0392B;
  --border:       rgba(30,45,69,0.12);
}
.site-footer span {
  display: block;
  margin-top: 6px;
}
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'DM Sans', sans-serif;
  background: var(--cream);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.5;
}

/* ── Nav ─────────────────────────────────────────────────────── */
.site-nav {
  background: var(--amber);
  padding: 0 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  min-height: 70px;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 20px rgba(0,0,0,0.15);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.nav-logo {
  width: 44px;
  height: 44px;
  background: var(--navy);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Playfair Display', serif;
  font-size: 10px;
  color: var(--amber);
  font-weight: 700;
  text-align: center;
  line-height: 1.2;
  padding: 4px;
}

.nav-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--navy);
}

.nav-subtitle {
  font-size: 0.7rem;
  color: var(--navy);
  opacity: 0.92;
  letter-spacing: 0.05em;
}

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

.nav-link {
  color: var(--navy);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  opacity: 0.8;
}

.nav-link:hover {
  opacity: 1;
}

.cart-btn {
  background: var(--navy);
  color: var(--amber);
  border: none;
  padding: 8px 18px;
  border-radius: 50px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 8px;
  transition: all 0.2s;
}

.cart-btn:hover {
  background: var(--navy-light);
  transform: translateY(-1px);
}

.cart-count {
  background: var(--amber);
  color: var(--navy);
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

/* ── Hero ─────────────────────────────────────────────────────── */
.hero {
  background: var(--amber);
  padding: 4rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  min-height: 320px;
}

.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 70% 50%, rgba(255,255,255,0.15) 0%, transparent 70%);
}

.hero-tag {
  display: inline-block;
  background: var(--navy);
  color: var(--amber);
  padding: 4px 14px;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}

.hero h1 {
  font-family: 'Playfair Display', serif;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  font-weight: 900;
  color: var(--navy);
  line-height: 1.1;
  margin-bottom: 1rem;
  position: relative;
  min-height: 1.2em;
}

.hero p {
  font-size: 1.1rem;
  color: var(--navy);
  opacity: 0.9;
  max-width: 500px;
  margin: 0 auto 2rem;
  line-height: 1.6;
  position: relative;
}

/* ── Store ────────────────────────────────────────────────────── */
.store-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

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

.section-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.8rem;
  font-weight: 700;
  color: var(--navy);
}

.filter-tabs {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 6px 16px;
  border-radius: 50px;
  border: 2px solid var(--navy);
  background: transparent;
  color: var(--navy);
  font-family: 'DM Sans', sans-serif;
  font-weight: 500;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-tab.active,
.filter-tab:hover {
  background: var(--navy);
  color: var(--amber);
}

/* ── Product Grid ─────────────────────────────────────────────── */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
  min-height: 900px;
}

.product-card {
  background: var(--white);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  transition: all 0.3s;
  min-height: 460px;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 30px rgba(0,0,0,0.15);
}

.product-img {
  width: 100%;
  aspect-ratio: 1;
  background: var(--cream);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: hidden;
  font-size: 5rem;
}

.product-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--amber);
  color: var(--navy);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 50px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  z-index: 2;
}

.product-info {
  padding: 1.2rem;
}

.product-category {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--steel);
  margin-bottom: 4px;
}

.product-name {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 8px;
}

.product-desc {
  font-size: 0.8rem;
  color: var(--steel);
  margin-bottom: 0.4rem;
  line-height: 1.4;
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 1rem;
}

.product-price {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--amber-dark);
}

.add-to-cart {
  background: var(--navy);
  color: var(--amber);
  border: none;
  padding: 8px 16px;
  border-radius: 50px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.add-to-cart:hover {
  background: var(--amber);
  color: var(--navy);
}

.add-to-cart:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

/* ── Size Selector ───────────────────────────────────────────── */
.size-selector {
  margin: 0.6rem 0 0.4rem;
}

.size-label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--steel);
  margin-bottom: 4px;
}

.size-select {
  width: 100%;
  padding: 7px 10px;
  border: 2px solid var(--border);
  border-radius: 8px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.85rem;
  color: var(--text);
  background: var(--white);
  cursor: pointer;
  transition: border-color 0.2s;
}

.size-select:focus {
  outline: none;
  border-color: var(--amber);
}

.size-options {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 4px;
  border-radius: 8px;
  transition: all 0.2s;
}

.size-options.size-required {
  background: rgba(192,57,43,0.08);
  outline: 2px solid var(--danger);
}

.size-btn {
  padding: 4px 10px;
  border: 2px solid var(--border);
  border-radius: 6px;
  background: transparent;
  color: var(--navy);
  font-family: 'DM Sans', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  min-width: 36px;
  text-align: center;
}

.size-btn:hover {
  border-color: var(--navy);
  background: var(--cream-dark);
}

.size-btn.selected {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--amber);
}

/* ── Cart ─────────────────────────────────────────────────────── */
.cart-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
}

.cart-overlay.open {
  display: block;
}

.cart-panel {
  position: fixed;
  top: 0;
  right: -480px;
  width: 480px;
  max-width: 100vw;
  height: 100vh;
  background: var(--white);
  z-index: 201;
  transition: right 0.3s ease;
  display: flex;
  flex-direction: column;
  box-shadow: -10px 0 40px rgba(0,0,0,0.2);
}

.cart-panel.open {
  right: 0;
}

.cart-header {
  background: var(--amber);
  padding: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cart-header h2 {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  color: var(--navy);
}

.close-btn {
  background: var(--navy);
  color: var(--amber);
  border: none;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

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

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

.cart-item-img {
  width: 60px;
  height: 60px;
  background: var(--cream);
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  flex-shrink: 0;
  overflow: hidden;
}

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

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

.cart-item-name {
  font-weight: 600;
  color: var(--navy);
  font-size: 0.95rem;
}

.cart-item-price {
  color: var(--amber-dark);
  font-weight: 700;
  font-size: 0.9rem;
}

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

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

.qty-btn:hover {
  border-color: var(--navy);
  background: var(--navy);
  color: var(--white);
}

.qty-num {
  font-weight: 600;
  font-size: 0.9rem;
  min-width: 20px;
  text-align: center;
}

.remove-item {
  color: var(--danger);
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.8rem;
  margin-left: auto;
  align-self: flex-start;
}

.cart-item-size {
  display: inline-block;
  background: var(--amber);
  color: var(--navy);
  border-radius: 4px;
  padding: 1px 6px;
  font-size: 0.7rem;
  font-weight: 700;
  margin-left: 4px;
  vertical-align: middle;
}

.cart-footer {
  padding: 1.5rem;
  border-top: 2px solid var(--border);
  background: var(--cream);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.cart-total .label {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--navy);
}

.cart-total .amount {
  font-family: 'Playfair Display', serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--navy);
}

.checkout-btn {
  width: 100%;
  background: var(--navy);
  color: var(--amber);
  border: none;
  padding: 16px;
  border-radius: 12px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.checkout-btn:hover {
  background: var(--amber);
  color: var(--navy);
}

.stripe-note {
  text-align: center;
  font-size: 0.75rem;
  color: var(--steel);
  margin-top: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

/* ── Checkout ─────────────────────────────────────────────────── */
.checkout-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 3rem 2rem;
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 2rem;
  align-items: start;
}

.checkout-section-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.6rem;
  color: var(--navy);
  margin-bottom: 1.5rem;
}

.form-card {
  background: var(--white);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  margin-bottom: 1.5rem;
}

.form-card h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.1rem;
  color: var(--navy);
  margin-bottom: 1.2rem;
  padding-bottom: 0.8rem;
  border-bottom: 2px solid var(--border);
}

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

.form-group label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--navy);
  margin-bottom: 5px;
}

.form-group input,
.form-group select,
.form-group textarea {
  width: 100%;
  padding: 10px 14px;
  border: 2px solid var(--border);
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  color: var(--text);
  background: var(--white);
  transition: border-color 0.2s;
}

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

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

/* ── Stripe Elements ──────────────────────────────────────────── */
.stripe-elements-wrapper {
  background: var(--navy);
  border-radius: 14px;
  padding: 1.5rem;
  margin: 0.5rem 0 1rem;
}

.stripe-elements-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.2rem;
}

.stripe-elements-header span {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.7);
  font-weight: 500;
  display: flex;
  align-items: center;
  gap: 6px;
}

.stripe-cards-icons {
  display: flex;
  gap: 6px;
}

.card-icon {
  background: rgba(255,255,255,0.15);
  border-radius: 4px;
  padding: 3px 7px;
  font-size: 0.7rem;
  color: rgba(255,255,255,0.8);
  font-weight: 700;
}

.stripe-field-label {
  font-size: 0.75rem;
  color: rgba(255,255,255,0.5);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 6px;
}

.stripe-element-field {
  background: rgba(255,255,255,0.1);
  border: 1.5px solid rgba(255,255,255,0.15);
  border-radius: 8px;
  padding: 12px 14px;
  margin-bottom: 12px;
  min-height: 44px;
  transition: border-color 0.2s;
}

.stripe-element-field.StripeElement--focus {
  border-color: var(--amber);
}

.stripe-element-field.StripeElement--invalid {
  border-color: var(--danger);
}

.stripe-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.stripe-secure-note {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.75rem;
  color: rgba(255,255,255,0.45);
  margin-top: 4px;
}

.stripe-error {
  color: var(--danger);
  font-size: 0.85rem;
  margin-top: 0.5rem;
  display: none;
  background: rgba(192,57,43,0.1);
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid rgba(192,57,43,0.3);
}

/* ── Order Summary ────────────────────────────────────────────── */
.order-summary {
  background: var(--white);
  border-radius: 16px;
  padding: 1.5rem;
  box-shadow: 0 2px 12px rgba(0,0,0,0.08);
  position: sticky;
  top: 90px;
}

.order-summary h3 {
  font-family: 'Playfair Display', serif;
  font-size: 1.2rem;
  color: var(--navy);
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 2px solid var(--border);
}

.summary-item {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 0.9rem;
  gap: 1rem;
}

.summary-item-name {
  color: var(--text);
  flex: 1;
}

.summary-item-price {
  font-weight: 600;
  color: var(--navy);
  white-space: nowrap;
}

.summary-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 10px 0;
}

.summary-total {
  display: flex;
  justify-content: space-between;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--navy);
}

.pay-btn {
  width: 100%;
  background: var(--amber);
  color: var(--navy);
  border: none;
  padding: 16px;
  border-radius: 12px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
  margin-top: 1.5rem;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.pay-btn:hover {
  background: var(--navy);
  color: var(--amber);
}

.pay-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ── Success ──────────────────────────────────────────────────── */
.success-page {
  text-align: center;
  padding: 5rem 2rem;
  max-width: 600px;
  margin: 0 auto;
}

.success-icon {
  width: 100px;
  height: 100px;
  background: var(--success);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  margin: 0 auto 2rem;
}

.success-page h2 {
  font-family: 'Playfair Display', serif;
  font-size: 2.5rem;
  color: var(--navy);
  margin-bottom: 1rem;
}

.success-page p {
  color: var(--steel);
  font-size: 1.05rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

/* ── Misc ─────────────────────────────────────────────────────── */
.btn-primary {
  background: var(--navy);
  color: var(--amber);
  border: none;
  padding: 10px 20px;
  border-radius: 10px;
  font-family: 'DM Sans', sans-serif;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary:hover {
  background: var(--amber);
  color: var(--navy);
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--navy);
  font-weight: 600;
  cursor: pointer;
  background: none;
  border: none;
  font-family: 'DM Sans', sans-serif;
  font-size: 0.95rem;
  padding: 0;
  margin-bottom: 2rem;
  text-decoration: none;
}

.back-link:hover {
  color: var(--amber-dark);
}

.toast {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  background: var(--navy);
  color: var(--white);
  padding: 12px 20px;
  border-radius: 10px;
  font-size: 0.9rem;
  font-weight: 500;
  z-index: 9999;
  transform: translateY(100px);
  opacity: 0;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 320px;
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.empty-state {
  text-align: center;
  padding: 3rem;
  color: var(--steel);
}

.empty-state .icon {
  font-size: 3rem;
  display: block;
  margin-bottom: 1rem;
}

.loading {
  text-align: center;
  padding: 3rem;
  color: var(--steel);
  min-height: 200px;
}

.page {
  display: none;
}

.page.active {
  display: block;
}

.site-footer {
  background: var(--navy);
  color: rgba(255,255,255,0.7);
  text-align: center;
  padding: 1.5rem;
  font-size: 0.85rem;
  margin-top: 4rem;
}

.site-footer a {
  color: var(--amber);
  text-decoration: none;
  font-weight: 600;
}

/* ── Size checkboxes (admin) ─────────────────────────────────── */
.size-checkboxes {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.size-checkbox-label {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--cream);
  border: 2px solid var(--border);
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.15s;
  color: var(--navy);
}

.size-checkbox-label:hover {
  border-color: var(--amber);
}

.size-checkbox-label input[type="checkbox"] {
  accent-color: var(--navy);
  width: 14px;
  height: 14px;
}

.size-checkbox-label.checked {
  background: var(--navy);
  color: var(--amber);
  border-color: var(--navy);
}

@media (max-width: 768px) {
  .checkout-page {
    grid-template-columns: 1fr;
  }

  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    min-height: 600px;
  }

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

  .stripe-row {
    grid-template-columns: 1fr;
  }

  .site-nav {
    padding: 0 1rem;
  }

  .cart-panel {
    width: 100vw;
  }

  .hero {
    min-height: 280px;
  }

  .product-card {
    min-height: 420px;
  }
}
