:root {
  --primary-gold: #e9b540;
  --secondary-gold: #f7d2c4;
  --warm-gold: #a67c52;
  --accent-gold: #d6c39f;
  --light-cream: #F5F5DC;
  --pure-white: #ffffff;
  --bg: #0f1115;
  --panel: #201417;
  --card: #efe0c9;
  --accent: #c63a22;
  --muted: #a78e79;
  --text: #f6f3ee;
  --header-h: clamp(60px, 8vw, 80px);
  --bg-gradient: linear-gradient(to right, #021120 0%, #641807 100%);
  --gold: #e9b540;
  --container-padding: clamp(20px, 4vw, 50px);
  --surface: rgba(255, 255, 255, 0.08);
  --stroke: rgba(233, 181, 64, 0.2);
  --shadow: 0 20px 60px rgba(0, 0, 0, 0.4);
  --shadow-sm: 0 8px 25px rgba(0, 0, 0, 0.3);
  --shadow-xs: 0 4px 15px rgba(0, 0, 0, 0.2);
  --radius: 16px;
  --radius-lg: 24px;
  --transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);

  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-display: 'Playfair Display', Georgia, serif;
}

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

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

body {
  min-height: 100vh;
  margin: 0;
  color: var(--text);
  background: var(--bg-gradient);
  font-family: system-ui, Segoe UI, Roboto, Arial;
  padding-top: var(--header-h);
  line-height: 1.6;
}

/* Dot removed (toggle)*/
.menu-toggle {
  display: none;
}

/* header*/
.navbar--brand {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: clamp(16px, 3vw, 24px) var(--container-padding);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  color: var(--gold);
  background: transparent;
  backdrop-filter: blur(24px);
  border-bottom: 1px solid rgba(233, 181, 64, 0.15);
  transition: var(--transition);
  box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.navbar--brand:hover {
  border-bottom-color: rgba(233, 181, 64, 0.35);
}

.logo-container {
  display: flex;
  align-items: center;
  gap: 16px;
  transition: var(--transition);
}

.logo {
  width: clamp(38px, 5vw, 48px);
  height: clamp(38px, 5vw, 48px);
  border-radius: 50%;
  border: 2px solid var(--gold);
  transition: var(--transition);
  box-shadow: 0 6px 20px rgba(233, 181, 64, 0.25);
  margin-right: 16px;
}

.logo-container h1 {
  font-size: clamp(24px, 3.5vw, 32px);
  font-weight: 700;
  background: linear-gradient(135deg, #e9b540 0%, #f7d2c4 50%, #e9b540 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  letter-spacing: 2px;
  text-shadow: 0 2px 10px rgba(233, 181, 64, 0.3);
}

.brand-link {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
}

.spacer {
  flex: 1 1 auto;
}

/* Profile avatar */
#profileTrigger {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: none;
  color: var(--primary-gold);
  text-decoration: none;
  transition: var(--transition);
}

#profileTrigger:hover {
  transform: scale(1.05);
}

.user-icon {
  font-size: 26px;
}

/* Page layout */
.container {
  max-width: 1300px;
  margin: auto;
  padding: 40px 28px;
  padding-top: calc(var(--header-h) + 32px);
}

/* Back button row*/
.utility-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  margin-bottom: 16px;
}

.nav-back {
  appearance: none;
  border: 1px solid rgba(233, 181, 64, 0.15);
  background: var(--surface);
  color: #f6e3c8;
  padding: 12px 18px;
  border-radius: 50px;
  cursor: pointer;
  font-weight: 600;
  letter-spacing: 0.3px;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  backdrop-filter: blur(10px);
  box-shadow: var(--shadow-xs);
  font-size: 14px;
}

.nav-back i {
  font-size: 12px;
  opacity: 0.9;
}

.nav-back::before {
  font-weight: 700;
  opacity: .95;
}

.nav-back:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(233, 181, 64, 0.3);
  transform: translateX(-1px);
  box-shadow: var(--shadow-sm);
}

.nav-back:active {
  transform: translateX(-1px) scale(0.98);
}

.nav-back:focus-visible {
  outline: 2px solid rgba(233, 181, 64, 0.6);
  outline-offset: 3px;
}

@media (max-width: 480px) {
  .nav-back {
    padding: 8px 12px;
  }
}

/* Title row with Customer ID aligned right */
.title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 20px;
}

.page-title {
  font-size: clamp(28px, 4vw, 36px);
  color: #f7d2c4;
  letter-spacing: 0.5px;
  font-weight: 650;
  margin: 0;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

@media (max-width: 640px) {
  .title-row {
    flex-direction: column;
    gap: 16px;
    align-items: stretch;
  }

  .title-row .page-title {
    margin-right: auto;
  }
}

/* Customer ID chip */
.customer-chip {
  display: flex;
  flex-direction: column;
  gap: 4px;
  background: linear-gradient(135deg, var(--surface) 0%, rgba(255, 255, 255, 0.04) 100%);
  border: 1px solid rgba(233, 181, 64, 0.25);
  color: #f6e3c8;
  padding: 16px 20px;
  border-radius: 18px;
  box-shadow: var(--shadow-xs), inset 0 1px 0 rgba(255, 255, 255, 0.08);
  min-width: 240px;
  backdrop-filter: blur(10px);
}

.customer-chip .cid-top {
  font-size: 12px;
  color: #d9c2ac;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.customer-chip .cid-val {
  font-weight: 700;
  letter-spacing: 1px;
  color: #f7d2c4;
  font-size: 16px;
}

/* Grid */
.cart-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 32px;
  align-items: start;
}

@media (max-width: 900px) {
  .cart-grid {
    grid-template-columns: 1fr;
    gap: 28px;
  }
}

/* Panels */
.cart-panel {
  background: linear-gradient(145deg,
      rgba(255, 255, 255, 0.08),
      rgba(255, 255, 255, 0.03));
  border: 1px solid var(--stroke);
  border-radius: var(--radius-lg);
  padding: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  position: relative;
}

.cart-panel::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.1), transparent);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #f0d8c4;
  padding: 0 0 20px;
  border-bottom: 1px solid rgba(233, 181, 64, 0.15);
  margin-bottom: 20px;
}

.panel-head h3 {
  font-size: 20px;
  font-weight: 600;
  margin: 0;
}

.link {
  background: none;
  border: 0;
  color: #f5b1a0;
  cursor: pointer;
  font-weight: 500;
  font-size: 14px;
  padding: 8px 16px;
  border-radius: 20px;
  transition: var(--transition);
}

.link.danger:hover {
  color: #ff8e72;
  background: rgba(255, 142, 114, 0.1);
}

/* Cart list */
.cart-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cart-item {
  display: grid;
  grid-template-columns: 80px 1fr auto auto auto;
  gap: 16px;
  align-items: center;
  padding: 20px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(233, 181, 64, 0.1);
  border-radius: var(--radius);
  transition: var(--transition);
  box-shadow: var(--shadow-xs);
}

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

.cart-item:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(233, 181, 64, 0.2);
  transform: translateY(-1px);
}

.item-img {
  width: 80px;
  height: 80px;
  border-radius: 14px;
  background: linear-gradient(135deg, #e8d9c3, #f0e6d2);
  display: grid;
  place-items: center;
  overflow: hidden;
  box-shadow: var(--shadow-xs);
  border: 1px solid rgba(233, 181, 64, 0.15);
}

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

.item-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.item-name {
  color: #f6e9d9;
  font-weight: 600;
  font-size: 16px;
  line-height: 1.4;
}

.item-meta {
  color: #d8c2af;
  font-size: 13px;
  opacity: 0.8;
}

.item-price {
  color: #f6e9d9;
  font-weight: 700;
  font-size: 16px;
  min-width: 100px;
  text-align: right;
}

.stepper {
  display: flex;
  align-items: center;
  gap: 12px;
  justify-content: flex-end;
  min-width: 120px;
  background: rgba(255, 255, 255, 0.05);
  padding: 8px 12px;
  border-radius: 25px;
  border: 1px solid rgba(233, 181, 64, 0.1);
}

.stepper button {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #ecd6bf;
  border: 1px solid #c9ad90;
  color: #5e3d2e;
  cursor: pointer;
  transition: var(--transition);
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
}

.stepper button:hover {
  background: #f2dcc5;
  transform: scale(1.05);
  box-shadow: var(--shadow-xs);
}

.stepper .qty {
  font-weight: 600;
  color: #f6e9d9;
  min-width: 20px;
  text-align: center;
}

.remove-btn {
  background: transparent;
  border: 0;
  color: #f2b9a9;
  cursor: pointer;
  min-width: 80px;
  text-align: right;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 20px;
  transition: var(--transition);
  font-size: 14px;
}

.remove-btn:hover {
  color: #ff8e72;
  background: rgba(255, 142, 114, 0.1);
}

/* Empty */
.empty {
  text-align: center;
  padding: 60px 24px;
}

.empty-title {
  font-size: 24px;
  margin-bottom: 12px;
  color: #f6e9d9;
  font-weight: 600;
}

.empty-sub {
  color: #d8c2af;
  margin-bottom: 32px;
  font-size: 16px;
}

.browse-btn {
  display: inline-block;
  text-decoration: none;
  background: linear-gradient(135deg, #c63a22, #d14428);
  color: #fff;
  padding: 16px 32px;
  border-radius: 50px;
  border: 0;
  cursor: pointer;
  box-shadow: var(--shadow-sm);
  font-weight: 600;
  font-size: 16px;
  transition: var(--transition);
}

.browse-btn:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.hidden {
  display: none;
}

/* Summary */
.summary-panel {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: calc(var(--header-h) + 20px);
}

.free-ship {
  background: linear-gradient(135deg, rgba(233, 181, 64, 0.1), rgba(233, 181, 64, 0.05));
  color: #f6e9d9;
  border: 1px solid rgba(233, 181, 64, 0.3);
  border-radius: 16px;
  padding: 16px 20px;
  font-size: 14px;
  text-align: center;
  font-weight: 500;
  box-shadow: var(--shadow-xs);
}

.summary-card {
  background: radial-gradient(800px 500px at 70% 20%,
      #5a2219 0%,
      #2a1515 55%,
      #15161b 100%);
  border: 1px solid #5a3a2f;
  border-radius: var(--radius-lg);
  color: #f6e9d9;
  padding: 28px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
  position: relative;
}

.summary-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.15), transparent);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.summary-card h3 {
  margin: 0 0 20px;
  color: #f7d9a9;
  font-size: 20px;
  font-weight: 600;
}

.summary-card .row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 14px 0;
  font-size: 15px;
}

.summary-card .grand {
  font-size: 20px;
  font-weight: 700;
  padding-top: 8px;
}

.summary-card hr {
  border: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, #704235, transparent);
  margin: 16px 0;
}

.summary-card .primary {
  width: 100%;
  margin-top: 20px;
  font-weight: 600;
  padding: 16px 24px;
  border: 0;
  border-radius: 50px;
  cursor: pointer;
  background: #c63a22;
  color: #fff;
  font-size: 16px;
  transition: var(--transition);
  box-shadow: var(--shadow-sm);
}

.summary-card .primary:hover {
  box-shadow: var(--shadow);
}

.summary-card .primary:active {
  transform: translateY(0);
}

/* Footer */
.footer-bottom {
  margin-top: 60px;
  text-align: center;
  padding: 24px 0;
  border-top: 1px solid rgba(233, 181, 64, 0.2);
}

.footer-bottom-content{
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 14px;
}

@media (max-width: 768px) {
  .cart-item {
    grid-template-columns: 64px 1fr;
    gap: 12px;
    padding: 16px;
  }

  .item-img {
    width: 64px;
    height: 64px;
  }

  .item-price,
  .stepper,
  .remove-btn {
    grid-column: 2;
    justify-self: end;
  }

  .stepper {
    min-width: 100px;
    margin: 8px 0;
  }
}

@media (max-width: 640px) {
  .container {
    padding: 32px 20px;
  }
  
  .customer-chip {
    min-width: auto;
    width: 100%;
  }
  
  .summary-panel {
    position: static;
  }
}