:root {
  --bg: #eef2f9;
  --surface: #ffffff;
  --text: #1a2332;
  --text-muted: #5c6b80;
  --border: #dbe3f0;
  --primary: #145be6;
  --primary-dark: #0d47c4;
  --header-start: #0a4fd2;
  --header-end: #3a7bfd;
  --shadow: 0 4px 16px rgba(15, 45, 95, 0.08);
  --radius: 14px;
  --radius-sm: 10px;
  --space-section: clamp(1.5rem, 4vw, 2.25rem);
  --font: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

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

.container {
  width: min(1100px, 92vw);
  margin: 0 auto;
}

/* ----- Header ----- */
.site-header {
  background: linear-gradient(135deg, var(--header-start), var(--header-end));
  color: #fff;
  padding: clamp(1rem, 3vw, 1.35rem) 0;
  box-shadow: 0 2px 12px rgba(10, 79, 210, 0.25);
}

.site-header__inner {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.site-header h1 {
  margin: 0;
  font-size: clamp(1.35rem, 3.5vw, 1.75rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.site-header p {
  margin: 0;
  font-size: 0.9rem;
  opacity: 0.92;
  max-width: 36rem;
}

/* ----- Main layout ----- */
.main-content {
  padding: var(--space-section) 0 3rem;
  display: flex;
  flex-direction: column;
  gap: var(--space-section);
}

/* ----- Sections & panels ----- */
.section-heading {
  margin: 0 0 1rem;
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
}

.panel {
  background: var(--surface);
  border-radius: var(--radius);
  padding: clamp(1.25rem, 3vw, 1.75rem);
  box-shadow: var(--shadow);
  border: 1px solid rgba(219, 227, 240, 0.9);
}

.panel__title {
  margin: 0 0 1.25rem;
  font-size: 1.125rem;
  font-weight: 700;
  text-align: center;
}

.register-panel .panel__title {
  padding-bottom: 0.75rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.25rem;
}

/* Centered stacked form inside register panel */
.form--stacked {
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
  max-width: 400px;
  margin: 0 auto;
  width: 100%;
}

.cart-panel .cart-col .form--stacked {
  max-width: none;
  margin: 0;
}

.register-panel #register-result,
.register-panel #current-account {
  text-align: center;
  margin-top: 0.75rem;
  margin-bottom: 0;
  font-size: 0.9rem;
}

.register-panel #current-account {
  color: var(--text-muted);
}

/* ----- Product grid ----- */
.products-section .section-heading {
  text-align: center;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.25rem;
  align-items: stretch;
}

.product-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  background: var(--surface);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(219, 227, 240, 0.85);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 28px rgba(15, 45, 95, 0.12);
}

.product-card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  background: linear-gradient(145deg, #e8eef9 0%, #dfe8f8 100%);
}

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

.product-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 1rem 1.1rem 1.15rem;
  gap: 0.5rem;
}

.product-card__title {
  margin: 0;
  font-size: 0.98rem;
  font-weight: 600;
  line-height: 1.4;
  min-height: 2.8em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card__price {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--primary);
}

.product-card__price .currency {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  margin-left: 0.2rem;
}

.product-card__body .btn {
  margin-top: auto;
  width: 100%;
}

/* ----- Cart panel ----- */
.cart-panel .panel__title {
  text-align: left;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
  margin-bottom: 1.25rem;
}

.cart-layout {
  display: grid;
  gap: 1.5rem;
}

@media (min-width: 880px) {
  .cart-layout {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.cart-items-box {
  min-height: 3rem;
}

.cart-empty {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 0.75rem;
  padding: 0.65rem 0;
  border-bottom: 1px solid #eef1f6;
  font-size: 0.95rem;
}

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

.total {
  margin: 1rem 0 0;
  padding-top: 1rem;
  border-top: 1px solid var(--border);
  font-weight: 700;
  font-size: 1.05rem;
}

.cart-panel h3 {
  margin: 0 0 0.75rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-muted);
}

/* ----- Forms & buttons ----- */
input,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 0.7rem 0.85rem;
  font-size: 0.95rem;
  font-family: inherit;
  background: #fafbfd;
  color: var(--text);
  transition: border-color 0.15s ease, background 0.15s ease;
}

input:hover,
select:hover {
  border-color: #c5d0e3;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--primary);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(20, 91, 230, 0.15);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  padding: 0.7rem 1rem;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}

.btn:hover {
  background: var(--primary-dark);
}

.btn:active {
  transform: scale(0.98);
}

.note {
  margin-top: 0.75rem;
  font-size: 0.9rem;
  color: var(--primary);
}

/* ----- Checkout page ----- */
.checkout-box {
  margin: var(--space-section) auto;
  max-width: 480px;
  background: var(--surface);
  padding: clamp(1.5rem, 4vw, 2rem);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid rgba(219, 227, 240, 0.9);
}

.checkout-box h1 {
  margin: 0 0 1rem;
  font-size: 1.35rem;
}

.checkout-box label {
  display: block;
  margin: 1rem 0 0.4rem;
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--text-muted);
}

.checkout-box select {
  margin-bottom: 0.5rem;
}

.checkout-box .btn {
  width: 100%;
  margin-top: 1rem;
}

.checkout-box a {
  display: inline-block;
  margin-top: 1.25rem;
  color: var(--primary);
  text-decoration: none;
  font-weight: 500;
}

.checkout-box a:hover {
  text-decoration: underline;
}

/* ========== Extended layout: nav, hero, footer ========== */

.site-header__row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 1.25rem;
}

.site-header__brand-wrap h1 {
  margin: 0;
  font-size: clamp(1.2rem, 3.2vw, 1.65rem);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.site-header__brand-wrap p {
  margin: 0.15rem 0 0;
  font-size: 0.85rem;
  opacity: 0.92;
}

.header-auth {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  flex-shrink: 0;
}

.auth-sep {
  opacity: 0.7;
  font-size: 0.85rem;
  margin: 0 0.1rem;
}

.btn-auth-text,
.btn-auth-strong {
  background: transparent;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.95);
  padding: 0.35rem 0.45rem;
  border-radius: 8px;
}

.btn-auth-text:hover {
  background: rgba(255, 255, 255, 0.12);
}

.btn-auth-strong {
  background: rgba(255, 255, 255, 0.2);
}

.btn-auth-strong:hover {
  background: rgba(255, 255, 255, 0.35);
}

.user-chip {
  font-size: 0.82rem;
  font-weight: 600;
  margin-right: 0.35rem;
  opacity: 0.95;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: middle;
}

@media (max-width: 720px) {
  .site-header__row .site-nav {
    order: 3;
    width: 100%;
    justify-content: flex-start;
  }
  .header-actions {
    order: 2;
    margin-left: auto;
  }
}

.site-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem 0.85rem;
  align-items: center;
}

.site-nav a {
  color: rgba(255, 255, 255, 0.94);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.35rem 0.65rem;
  border-radius: 8px;
  transition: background 0.15s ease;
}

.site-nav a:hover {
  background: rgba(255, 255, 255, 0.12);
}

.site-nav a.is-active {
  background: rgba(255, 255, 255, 0.22);
}

.hero {
  padding: clamp(1.25rem, 4vw, 2.25rem) 0;
  margin-bottom: 0;
}

.hero__inner {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 800px) {
  .hero__inner {
    grid-template-columns: 1fr minmax(220px, 280px);
    align-items: start;
  }
}

.hero__text h2 {
  margin: 0 0 0.65rem;
  font-size: clamp(1.2rem, 3vw, 1.65rem);
  color: var(--text);
}

.hero__text p {
  margin: 0 0 1rem;
  color: var(--text-muted);
  max-width: 36rem;
  font-size: 0.95rem;
}

.hero__cta {
  text-decoration: none;
  display: inline-flex;
}

.hero__card h3 {
  margin: 0 0 0.75rem;
  font-size: 1rem;
}

.trust-list {
  margin: 0;
  padding-left: 1.25rem;
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.section-head {
  text-align: center;
  margin-bottom: 1.25rem;
}

.section-head .section-heading {
  margin-bottom: 0.35rem;
}

.section-sub {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.product-badge {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  z-index: 1;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  background: rgba(20, 91, 230, 0.92);
  color: #fff;
  padding: 0.25rem 0.5rem;
  border-radius: 6px;
}

.product-card__media {
  position: relative;
}

.product-sku {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-family: ui-monospace, monospace;
}

.product-card__desc {
  margin: 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.45;
  min-height: 2.55em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
}

.stock-label {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.qty-add-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
  margin-top: 0.35rem;
}

.qty-label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.qty-input {
  width: 4rem;
  padding: 0.4rem;
  text-align: center;
}

.btn--sm {
  padding: 0.45rem 0.65rem;
  font-size: 0.875rem;
}

.btn--secondary {
  background: #334155;
}

.btn--secondary:hover {
  background: #1e293b;
}

.btn--ghost {
  background: transparent;
  border: 1px solid rgba(219, 227, 240, 0.95);
  color: var(--text);
}

.btn--ghost:hover {
  background: #eef2f9;
  color: var(--text);
}

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

.cart-count {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
}

.ship-line,
.cart-note {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 400 !important;
}

.grand-total {
  font-size: 1.15rem;
}

.checkout-actions {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.cart-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.85rem 0;
  border-bottom: 1px solid #eef1f6;
}

.cart-row__name {
  font-weight: 600;
  font-size: 0.93rem;
}

.cart-row__unit {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
}

.cart-row__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: #fafbfd;
}

.stepper-btn {
  width: 2rem;
  height: 2rem;
  border: none;
  background: #eef2f9;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

.stepper-btn:hover {
  background: #dfe8f8;
}

.stepper-input {
  width: 2.75rem;
  border: none;
  text-align: center;
  font-size: 0.9rem;
  background: transparent;
}

.cart-row__line {
  font-weight: 600;
  min-width: 6.5rem;
  text-align: right;
}

.btn-remove {
  border: none;
  background: transparent;
  color: #94a3b8;
  cursor: pointer;
  font-size: 1rem;
  padding: 0.2rem;
  line-height: 1;
}

.btn-remove:hover {
  color: #ef4444;
}

.orders-preview-title {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  text-align: left !important;
  border-bottom: 1px solid var(--border);
  padding-bottom: 0.75rem;
}

.link-arrow {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--primary);
  text-decoration: none;
}

.link-arrow:hover {
  text-decoration: underline;
}

.inline-link {
  color: var(--primary);
  font-weight: 600;
}

.orders-preview-empty {
  color: var(--text-muted);
  font-size: 0.93rem;
  margin: 0;
}

.mini-order-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mini-order {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 0.5rem 1rem;
  align-items: center;
  padding: 0.55rem 0;
  border-bottom: 1px solid #eef1f6;
  font-size: 0.9rem;
}

.mini-order a {
  color: var(--primary);
  text-decoration: none;
  font-family: ui-monospace, monospace;
  font-size: 0.85rem;
}

.mini-order-sum {
  font-weight: 600;
  text-align: right;
}

.status-pill {
  font-size: 0.72rem;
  font-weight: 600;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
  background: #e8eef9;
}

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

.status-pill--paid {
  background: #d1fae5;
  color: #065f46;
}

.status-pill--cho_thanh-toan {
  background: #fee2e2;
}

.site-footer {
  margin-top: 2rem;
  padding: 2rem 0 1rem;
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.site-footer--compact {
  margin-top: 0;
}

.footer__grid {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 640px) {
  .footer__grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.footer-nav {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.footer-nav a {
  color: var(--primary);
  text-decoration: none;
  font-size: 0.9rem;
}

.footer__muted {
  font-size: 0.87rem;
  color: var(--text-muted);
  margin: 0.35rem 0 0;
}

.footer__copy {
  margin: 1.5rem auto 0;
  padding-top: 1rem;
  border-top: 1px solid #eef1f6;
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
}

/* ---------- Orders page ---------- */

.page-narrow {
  max-width: 920px;
}

.page-lead {
  color: var(--text-muted);
  font-size: 0.92rem;
  margin: 0 0 1rem;
}

.lookup-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  align-items: center;
}

.lookup-form input {
  flex: 1 1 240px;
  max-width: 360px;
}

.orders-page-title {
  text-align: left !important;
}

.subpanel-title {
  margin: 0 0 0.85rem;
  font-size: 1rem;
  font-weight: 700;
}

.order-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.order-table th,
.order-table td {
  padding: 0.65rem 0.45rem;
  text-align: left;
  border-bottom: 1px solid #eef1f6;
}

.order-table thead th {
  color: var(--text-muted);
  font-weight: 600;
}

.cell-actions {
  text-align: right;
  white-space: nowrap;
}

.order-expand-row td {
  padding-top: 0;
  border-bottom: 1px solid #eef1f6;
  background: #f8fafc;
  vertical-align: top;
}

.order-line-items-details {
  margin: 0.15rem 0 0.85rem;
}

.order-line-items-summary {
  cursor: pointer;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--primary);
}

.order-line-items-summary:hover {
  text-decoration: underline;
}

.order-line-items-mini {
  width: 100%;
  margin-top: 0.65rem;
  border-collapse: collapse;
  font-size: 0.82rem;
}

.order-line-items-mini th,
.order-line-items-mini td {
  padding: 0.42rem 0.5rem;
  text-align: left;
  border-bottom: 1px solid #e9edf5;
}

.order-line-items-mini thead th {
  color: var(--text-muted);
  font-weight: 600;
}

.status-badge {
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.22rem 0.5rem;
  border-radius: 6px;
  background: #e8eef9;
}

.status-badge--gen {
  background: #eef2ff;
  color: #3730a3;
}

.order-json-hint {
  margin-top: 1rem;
  font-size: 0.85rem;
}

.hint-pre {
  background: #f8fafc;
  padding: 0.75rem;
  border-radius: var(--radius-sm);
  overflow: auto;
  font-size: 0.76rem;
  max-height: 200px;
}

.btn--linkish {
  background: transparent;
  color: var(--primary);
  padding: 0.35rem 0.65rem !important;
  border: 1px solid rgba(20, 91, 230, 0.35);
  text-decoration: none;
  border-radius: var(--radius-sm);
  font-size: 0.8rem !important;
  display: inline-block;
}

/* ---------- Checkout page ---------- */

.checkout-page {
  padding: var(--space-section) 0 2rem;
}

.checkout-layout {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 900px) {
  .checkout-layout {
    grid-template-columns: 1.2fr 0.95fr;
    align-items: start;
  }
}

.checkout-steps {
  margin: 0 0 1rem;
  padding-left: 1.25rem;
  font-size: 0.87rem;
  color: var(--text-muted);
  line-height: 1.6;
}

.order-detail-shell .muted {
  color: var(--text-muted);
  margin: 0;
}

.order-meta-block {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 0.75rem 1rem;
  margin-bottom: 1rem;
  font-size: 0.88rem;
}

.order-detail-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  margin-bottom: 0.75rem;
}

.order-detail-table th,
.order-detail-table td {
  padding: 0.5rem;
  border: 1px solid #eef1f6;
  text-align: left;
}

.order-detail-table thead {
  background: #f8fafc;
}

.order-detail-table tfoot td {
  font-weight: 700;
}

.order-status-chip {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.65rem;
}

.status-line {
  font-weight: 600;
  margin: 0 0 1rem;
  font-size: 0.93rem;
}

.checkout-links {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-top: 1rem;
}

.checkout-links a {
  color: var(--primary);
  font-size: 0.9rem;
}

/* ---------- About ---------- */

.about-page .panel + .panel {
  margin-top: 0;
}

.about-lead {
  font-size: 1rem;
  line-height: 1.65;
}

.about-text {
  color: var(--text-muted);
  line-height: 1.65;
}

.about-facts {
  margin: 1rem 0 0;
  display: grid;
  gap: 0.85rem;
}

.about-facts > div {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 0.5rem;
  font-size: 0.92rem;
  border-bottom: 1px solid #eef1f6;
  padding-bottom: 0.65rem;
}

.about-facts dt {
  font-weight: 600;
  margin: 0;
  color: var(--text-muted);
}

.about-facts dd {
  margin: 0;
}

.check-list {
  color: var(--text-muted);
  line-height: 1.65;
}

.three-cols {
  display: grid;
  gap: 1rem;
}

@media (min-width: 700px) {
  .three-cols {
    grid-template-columns: repeat(3, 1fr);
  }
}

.pill-card {
  background: #f8fafc;
  border-radius: var(--radius-sm);
  padding: 1rem;
  border: 1px solid #eef1f6;
}

.pill-card h3 {
  margin: 0 0 0.4rem;
  font-size: 0.98rem;
}

.pill-card p {
  margin: 0;
  font-size: 0.87rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.muted-panel {
  background: #f8fafc;
}

.fine-print {
  margin: 0;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ---------- Auth & product modals ---------- */

body.modal-open {
  overflow: hidden;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: rgba(15, 30, 60, 0.45);
  backdrop-filter: blur(2px);
}

.modal-dialog {
  position: fixed;
  z-index: 2001;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(420px, 94vw);
  max-height: 90vh;
  overflow-y: auto;
}

.modal-dialog--wide {
  width: min(720px, 96vw);
}

.modal-panel {
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.22);
  padding: 1.25rem 1.35rem 1.35rem;
  border: 1px solid var(--border);
}

.modal-panel--scroll {
  max-height: min(85vh, 640px);
  overflow-y: auto;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.modal-head--tight {
  margin-bottom: 0.65rem;
}

.modal-head h2 {
  margin: 0;
  font-size: 1.15rem;
}

.modal-close {
  border: none;
  background: transparent;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0.15rem;
  border-radius: 6px;
}

.modal-close:hover {
  background: #f1f5f9;
  color: var(--text);
}

.modal-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
}

.modal-form input {
  width: 100%;
}

.modal-msg {
  margin: 0;
  font-size: 0.88rem;
  min-height: 1.25em;
}

.modal-switch {
  margin: 0.85rem 0 0;
  font-size: 0.87rem;
  color: var(--text-muted);
  text-align: center;
}

.inline-link-btn {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  text-decoration: underline;
  padding: 0;
}

.account-snippet-panel {
  padding: 0.85rem 1rem !important;
}

.account-snippet {
  margin: 0;
  font-size: 0.9rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.inline-link-btn-inline {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-family: inherit;
  font-weight: 600;
  padding: 0;
}

.checkout-login-hint {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
  color: var(--text-muted);
}

.qty-detail-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
  margin-top: 0.85rem;
}

.product-card__actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.35rem;
}

.btn--outline {
  background: transparent;
  color: var(--primary);
  border: 1px solid rgba(20, 91, 230, 0.45);
}

.btn--outline:hover {
  background: rgba(20, 91, 230, 0.08);
}

.product-card__title.clickable-title {
  cursor: pointer;
  color: var(--primary-dark);
}

.product-card__title.clickable-title:hover {
  text-decoration: underline;
}

.product-modal-heading {
  font-size: 1.05rem !important;
  padding-right: 0.25rem;
}

.product-detail-layout {
  display: grid;
  gap: 1rem;
}

@media (min-width: 560px) {
  .product-detail-layout {
    grid-template-columns: 1fr 1fr;
    align-items: start;
  }
}

.product-detail-img-wrap {
  border-radius: var(--radius-sm);
  overflow: hidden;
  aspect-ratio: 4/3;
  background: #e8eef9;
}

.product-detail-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-detail-meta dl {
  margin: 0;
  display: grid;
  gap: 0.4rem;
  font-size: 0.88rem;
}

.product-detail-meta dt {
  margin: 0;
  font-weight: 600;
  color: var(--text-muted);
}

.product-detail-meta dd {
  margin: 0;
}

.product-detail-text {
  grid-column: 1 / -1;
  margin: 0;
  font-size: 0.93rem;
  line-height: 1.65;
  color: var(--text);
  white-space: pre-wrap;
}

.product-detail-body .qty-label-detail {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
}

.product-detail-body .qty-input-detail {
  width: 4rem;
  padding: 0.35rem;
}

/* ----- Header cart + cart drawer ----- */
.site-header__home-link {
  color: inherit;
  text-decoration: none;
}

.site-header__home-link:hover {
  opacity: 0.92;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
}

.lang-switch {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.lang-btn {
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  border-radius: 999px;
  padding: 0.2rem 0.45rem;
  cursor: pointer;
}

.lang-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

.lang-btn.is-active {
  background: rgba(255, 255, 255, 0.35);
  color: #fff;
}

.header-cart-btn {
  position: relative;
  background: rgba(255, 255, 255, 0.15);
  border: none;
  border-radius: var(--radius-sm);
  padding: 0.35rem 0.55rem;
  cursor: pointer;
  color: #fff;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  line-height: 1;
}

.header-cart-btn:hover {
  background: rgba(255, 255, 255, 0.22);
}

.header-cart-badge {
  font-size: 0.72rem;
  font-weight: 700;
  min-width: 1.25rem;
  text-align: center;
  background: #ef4444;
  color: #fff;
  border-radius: 999px;
  padding: 0.12rem 0.38rem;
  line-height: 1.2;
}

.header-cart-badge--hidden {
  visibility: hidden;
}

.cart-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 2100;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  height: 100%;
  width: min(400px, 100vw);
  z-index: 2101;
  background: var(--surface);
  box-shadow: -8px 0 24px rgba(15, 45, 95, 0.14);
  display: flex;
  flex-direction: column;
}

.cart-drawer__inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  max-height: 100vh;
}

.cart-drawer__head {
  flex-shrink: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.1rem;
  border-bottom: 1px solid var(--border);
}

.cart-drawer__title {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
}

.cart-drawer__close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  color: var(--text-muted);
  padding: 0.15rem 0.35rem;
  border-radius: 8px;
}

.cart-drawer__close:hover {
  background: rgba(15, 45, 95, 0.06);
}

.cart-drawer__body {
  flex: 1;
  overflow: auto;
  padding: 0.75rem 1rem;
}

.cart-drawer__summary {
  flex-shrink: 0;
  padding: 0.75rem 1rem 0;
  border-top: 1px solid var(--border);
  background: rgba(238, 242, 249, 0.55);
}

.cart-drawer__sum-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 0.9rem;
  margin-bottom: 0.35rem;
}

.cart-drawer__sum-line--muted {
  color: var(--text-muted);
  font-size: 0.85rem;
}

.cart-drawer__sum-total {
  margin-top: 0.35rem;
  padding-top: 0.5rem;
  border-top: 1px dashed var(--border);
  font-size: 1rem;
}

.cart-drawer__foot {
  flex-shrink: 0;
  padding: 1rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cart-drawer__empty {
  margin: 0;
  color: var(--text-muted);
  font-size: 0.92rem;
}

.cart-drawer__empty a {
  color: var(--primary);
}

.cart-drawer__row {
  padding: 0.65rem 0;
  border-bottom: 1px solid rgba(219, 227, 240, 0.85);
}

.cart-drawer__row:last-child {
  border-bottom: none;
}

.cart-drawer__row-main {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.cart-drawer__name {
  font-weight: 600;
  font-size: 0.93rem;
}

.cart-drawer__meta {
  font-size: 0.82rem;
  color: var(--text-muted);
}

.cart-drawer__row-bot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.35rem;
}

.cart-drawer__rm {
  background: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  font-size: 1rem;
  padding: 0.2rem 0.45rem;
  border-radius: 6px;
}

.cart-drawer__rm:hover {
  background: rgba(239, 68, 68, 0.12);
  color: #b91c1c;
}

.btn--block {
  width: 100%;
  justify-content: center;
}

body.cart-drawer-open {
  overflow: hidden;
}

.cart-teaser-panel {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}

.cart-teaser-panel__text {
  margin: 0;
  flex: 1 1 14rem;
}

/* Page accent under header (body[data-page]) */
body[data-page="home"] .site-header {
  border-bottom: 3px solid rgba(255, 255, 255, 0.35);
}

body[data-page="cart"] .site-header {
  border-bottom: 3px solid #38bdf8;
}

body[data-page="news"] .site-header {
  border-bottom: 3px solid #a78bfa;
}

body[data-page="about"] .site-header {
  border-bottom: 3px solid #34d399;
}

body[data-page="orders"] .site-header {
  border-bottom: 3px solid #fbbf24;
}

body[data-page="checkout"] .site-header,
body[data-page="payment"] .site-header {
  border-bottom: 3px solid #fb923c;
}
