:root {
  --bg-cream: #f8f2e8;
  --bg-accent: #ead9c0;
  --text-dark: #23180f;
  --text-muted: #6e5a48;
  --primary: #7a3516;
  --secondary: #d89a3d;
  --panel: #fffefb;
  --shadow: 0 16px 40px rgba(53, 31, 18, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Manrope", sans-serif;
  color: var(--text-dark);
  background: radial-gradient(circle at 10% 0%, #fff7e8 0%, var(--bg-cream) 45%, #efe3d3 100%);
  min-height: 100vh;
}

.checkout-body {
  background: linear-gradient(180deg, #efe5d8 0%, #f8f2e8 55%, #fff8eb 100%);
}

.checkout-header {
  color: #fff;
  background:
    linear-gradient(120deg, rgba(35, 24, 15, 0.95), rgba(80, 33, 14, 0.88)),
    url("https://images.unsplash.com/photo-1447933601403-0c6688de566e?auto=format&fit=crop&w=1600&q=80") center/cover no-repeat;
}

img {
  max-width: 100%;
}

.hero {
  color: #fff;
  background:
    linear-gradient(120deg, rgba(35, 24, 15, 0.92), rgba(80, 33, 14, 0.9)),
    url("https://images.unsplash.com/photo-1498804103079-a6351b050096?auto=format&fit=crop&w=1600&q=80") center/cover no-repeat;
  position: relative;
  overflow: hidden;
}

.hero::after {
  content: "";
  position: absolute;
  right: -120px;
  top: -120px;
  width: 320px;
  height: 320px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(216, 154, 61, 0.7), rgba(216, 154, 61, 0));
}

.brand,
.section-title {
  font-family: "Playfair Display", serif;
}

.brand {
  font-size: 1.7rem;
  letter-spacing: 0.03em;
}

.hero-card {
  border-radius: 1rem;
  background: rgba(255, 243, 224, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(4px);
}

.hero-highlights {
  margin: 0;
  display: grid;
  gap: 0.45rem;
}

.hero-highlights li {
  color: #fff6ea;
  font-size: 0.96rem;
}

.cart-btn {
  border-radius: 999px;
  padding: 0.6rem 1.1rem;
}

.btn-link {
  color: var(--primary);
  text-decoration: none;
}

.btn-link:hover {
  color: #5a220c;
}

.section-tag {
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.panel {
  border-radius: 1rem;
  background: var(--panel);
  box-shadow: var(--shadow);
  position: relative;
}

.product-card {
  border: 0;
  background: var(--panel);
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform 180ms ease, box-shadow 180ms ease;
  height: 100%;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 22px 44px rgba(53, 31, 18, 0.18);
}

.product-card img {
  height: 210px;
  object-fit: cover;
}

.product-actions {
  display: flex;
  gap: 0.45rem;
  align-items: center;
}

.rating-line {
  color: #8c3f1a;
  font-size: 0.88rem;
}

.rating-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.22rem;
  border-radius: 999px;
  padding: 0.2rem 0.6rem;
  background: #fff3cd;
  color: #8a4b08;
  font-size: 0.84rem;
  font-weight: 700;
}

.product-category {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.order-list {
  max-height: 420px;
  overflow: auto;
}

.order-item {
  padding: 0.8rem 0.9rem;
  border-radius: 0.8rem;
  border: 1px solid #e7dfd2;
  background: #fff;
}

.order-item .status-pill {
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.order-item .meta-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.35rem;
  font-size: 0.85rem;
}

.order-item .meta-line .label {
  color: var(--text-muted);
}

.status-pill.confirmed {
  background: #dbeafe;
  color: #1d4ed8;
}

.status-pill.processing {
  background: #e0f2fe;
  color: #075985;
}

.status-pill.pending {
  background: #fef3c7;
  color: #92400e;
}

.status-pill.completed {
  background: #dcfce7;
  color: #166534;
}

.status-pill.cancelled {
  background: #fee2e2;
  color: #991b1b;
}

.status-pill.paid {
  background: #dcfce7;
  color: #166534;
}

.status-pill.failed {
  background: #fee2e2;
  color: #991b1b;
}

.status-pill.unpaid {
  background: #f3f4f6;
  color: #374151;
}

.status-pill.refunded {
  background: #ede9fe;
  color: #5b21b6;
}

.order-detail-line {
  border: 1px solid #efe8dc;
  border-radius: 0.7rem;
  padding: 0.6rem 0.7rem;
  margin-bottom: 0.6rem;
}

.cart-panel {
  position: fixed;
  top: 0;
  right: -420px;
  width: min(95vw, 400px);
  height: 100vh;
  background: #fff;
  z-index: 1050;
  padding: 1rem;
  box-shadow: -20px 0 40px rgba(0, 0, 0, 0.2);
  transition: right 220ms ease;
}

.cart-panel h4 {
  font-family: "Playfair Display", serif;
}

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

.cart-items {
  max-height: calc(100vh - 180px);
  overflow: auto;
}

.cart-line {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.65rem 0.4rem;
  border-bottom: 1px solid #efe8dc;
}

.cart-line-main {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
}

.cart-thumb {
  width: 52px;
  height: 52px;
  border-radius: 0.45rem;
  object-fit: cover;
  flex-shrink: 0;
}

.cart-line-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.2rem;
}

.cart-line-meta span {
  background: #f5eee4;
  color: #6a513d;
  border-radius: 999px;
  padding: 0.1rem 0.45rem;
  font-size: 0.72rem;
}

.cart-controls {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.cart-controls .qty-label {
  min-width: 1.2rem;
  text-align: center;
}

#proceed-checkout.disabled {
  pointer-events: none;
  opacity: 0.55;
}

.checkout-cart-items {
  max-height: 420px;
  overflow: auto;
}

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

.backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms ease;
  z-index: 1040;
}

.backdrop.show {
  opacity: 1;
  pointer-events: auto;
}

.status-msg.success {
  color: #0a7a44;
}

.status-msg.error {
  color: #b42318;
}

.status-msg.info {
  color: #1f4f9f;
}

.status-msg.warning {
  color: #9f4c1f;
}

.auth-lock {
  position: absolute;
  inset: 0;
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.84);
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  color: #4b5563;
}

.auth-lock.d-none {
  display: none;
}

.form-label {
  margin-bottom: 0.35rem;
}

.payment-method-group {
  display: grid;
  gap: 0.65rem;
}

.payment-method-option {
  border: 1px solid #e7dfd2;
  border-radius: 0.75rem;
  padding: 0.65rem 0.75rem;
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  background: #fff;
  cursor: pointer;
}

.payment-method-option input {
  margin-top: 0.2rem;
}

.payment-method-option.active {
  border-color: #7a3516;
  box-shadow: 0 0 0 2px rgba(122, 53, 22, 0.14);
}

#checkout-submit.loading {
  pointer-events: none;
  opacity: 0.75;
}

.payment-result-panel {
  max-width: 760px;
  margin: 0 auto;
}

.payment-result-grid {
  display: grid;
  grid-template-columns: 180px 1fr;
  gap: 0.55rem 0.9rem;
}

@media (max-width: 640px) {
  .payment-result-grid {
    grid-template-columns: 1fr;
  }
}

.modal-content {
  border: 0;
  border-radius: 1rem;
}

.modal-header {
  border-bottom: 1px solid #efe8dc;
}

.modal-title {
  font-family: "Playfair Display", serif;
}

.fade-in {
  opacity: 0;
  transform: translateY(12px);
  animation: reveal 380ms ease forwards;
}

.product-status {
  font-size: 0.76rem;
  padding: 0.16rem 0.45rem;
  border-radius: 999px;
  font-weight: 700;
}

.product-status.available {
  background: #dcfce7;
  color: #166534;
}

.product-status.out {
  background: #fee2e2;
  color: #991b1b;
}

.loading-state {
  text-align: center;
  padding: 1.2rem 0.5rem;
  color: var(--text-muted);
}

.detail-option-group {
  border: 1px solid #eadfce;
  border-radius: 0.7rem;
  padding: 0.65rem;
  margin-bottom: 0.6rem;
}

.detail-option-title {
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.45rem;
}

.option-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.option-choice {
  position: relative;
}

.option-choice input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.option-choice label {
  margin: 0;
  border: 1px solid #d8c5ad;
  border-radius: 999px;
  padding: 0.3rem 0.65rem;
  font-size: 0.82rem;
  cursor: pointer;
  background: #fff;
  transition: all 140ms ease;
}

.option-choice input:checked + label {
  border-color: #7a3516;
  background: #7a3516;
  color: #fff;
}

.option-choice-price {
  opacity: 0.85;
  margin-left: 0.2rem;
}

.option-hint {
  margin-top: 0.45rem;
  color: #6b4b37;
  font-size: 0.77rem;
}

.detail-price-breakdown {
  margin-top: 0.35rem;
  font-size: 0.82rem;
  color: #6b4b37;
}

.products-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.products-pagination .page-info {
  color: var(--text-muted);
  font-size: 0.86rem;
}

.products-pagination .btn {
  min-width: 2.2rem;
}

.btn:disabled,
.btn.disabled {
  cursor: not-allowed;
}

@keyframes reveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 992px) {
  .hero {
    background-position: 60% center;
  }

  .product-card img {
    height: 180px;
  }

  .cart-panel {
    width: 100%;
  }
}
