:root {
  --orange: #f18815;
  --orange-dark: #c86600;
  --orange-soft: #fff0de;
  --cream: #fffaf4;
  --paper: #ffffff;
  --ink: #2e241c;
  --muted: #766b61;
  --line: #eadfd4;
  --green: #287a4a;
  --green-soft: #eaf7ef;
  --red: #a33b2f;
  --red-soft: #fff0ed;
  --shadow: 0 18px 50px rgba(72, 43, 18, .10);
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
}

button,
input,
textarea,
select {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  color: inherit;
}

a {
  color: var(--orange-dark);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 12px;
  font-size: clamp(2rem, 4vw, 3.35rem);
  line-height: 1.03;
  letter-spacing: -.045em;
}

h2 {
  margin-bottom: 10px;
  font-size: 1.65rem;
  letter-spacing: -.025em;
}

.hidden {
  display: none !important;
}

.muted {
  color: var(--muted);
}

.eyebrow {
  margin-bottom: 10px;
  color: var(--orange-dark);
  font-size: .76rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
}

.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px 18px;
  background:
    radial-gradient(circle at 12% 15%, rgba(241, 136, 21, .16), transparent 30%),
    radial-gradient(circle at 88% 80%, rgba(241, 136, 21, .11), transparent 32%),
    var(--cream);
}

.login-card {
  width: min(100%, 480px);
  padding: clamp(28px, 5vw, 46px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(255, 255, 255, .94);
  box-shadow: var(--shadow);
  text-align: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  text-decoration: none;
  color: var(--ink);
}

.brand-centered {
  margin-bottom: 28px;
}

.brand-logo {
  display: block;
  width: auto;
  max-width: min(280px, 70vw);
  height: 82px;
  object-fit: contain;
}

.brand-header .brand-logo {
  max-width: 220px;
  height: 58px;
}

.brand-fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  line-height: 1;
  text-transform: uppercase;
}

.brand-fallback span {
  font-size: 1.35rem;
  font-weight: 900;
  letter-spacing: .09em;
}

.brand-fallback strong {
  margin-top: 4px;
  color: var(--orange);
  font-size: .8rem;
  letter-spacing: .11em;
}

.brand-fallback.compact {
  align-items: flex-start;
}

.brand-fallback.compact span {
  font-size: 1.08rem;
}

.brand-fallback.compact strong {
  font-size: .65rem;
}

.stack-form {
  display: grid;
  gap: 16px;
  margin-top: 28px;
  text-align: left;
}

label > span,
.field-label {
  display: block;
  margin-bottom: 7px;
  font-size: .84rem;
  font-weight: 750;
}

input,
textarea,
select {
  width: 100%;
  border: 1px solid #d8cabc;
  border-radius: 12px;
  outline: none;
  background: #fff;
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}

input,
select {
  min-height: 48px;
  padding: 0 13px;
}

textarea {
  padding: 12px 13px;
  resize: vertical;
}

input:focus,
textarea:focus,
select:focus {
  border-color: var(--orange);
  box-shadow: 0 0 0 3px rgba(241, 136, 21, .14);
}

.btn {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 800;
  transition: transform .15s ease, background .15s ease, border-color .15s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn:disabled {
  cursor: not-allowed;
  opacity: .55;
  transform: none;
}

.btn-primary {
  background: var(--orange);
  color: #24170b;
}

.btn-primary:hover {
  background: #ff971f;
}

.btn-secondary {
  border-color: var(--line);
  background: #fff;
}

.btn-danger {
  border-color: #efc5bf;
  background: var(--red-soft);
  color: var(--red);
}

.btn-large {
  min-height: 53px;
  border-radius: 14px;
}

.full-width {
  width: 100%;
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.button-row.centered {
  justify-content: center;
}

.form-error {
  min-height: 20px;
  margin: 0;
  color: var(--red);
  font-size: .88rem;
  font-weight: 650;
}

.login-help {
  margin-top: 28px;
  color: var(--muted);
  font-size: .88rem;
  line-height: 1.7;
}

.login-help span {
  padding: 0 4px;
}

.portal-shell {
  min-height: 100vh;
}

.site-header {
  position: sticky;
  z-index: 30;
  top: 0;
  display: flex;
  min-height: 82px;
  align-items: center;
  justify-content: space-between;
  gap: 26px;
  padding: 10px max(24px, calc((100vw - 1220px) / 2));
  border-bottom: 1px solid rgba(220, 204, 189, .8);
  background: rgba(255, 250, 244, .94);
  backdrop-filter: blur(16px);
}

.header-account {
  display: flex;
  align-items: center;
  gap: 28px;
  text-align: right;
}

.header-account > div {
  display: flex;
  flex-direction: column;
}

.header-account span {
  color: var(--muted);
  font-size: .72rem;
}

.header-account strong {
  max-width: 230px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: .9rem;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-button {
  min-height: 42px;
  padding: 0 13px;
  border: 0;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
  font-size: .86rem;
  font-weight: 750;
}

.nav-button:hover,
.nav-button.active {
  background: var(--orange-soft);
  color: var(--orange-dark);
}

.nav-logout {
  color: var(--muted);
}

.site-main {
  width: min(1220px, calc(100% - 36px));
  margin: 0 auto;
  padding: 64px 0 80px;
}

.hero,
.page-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 36px;
}

.hero p,
.page-heading p {
  max-width: 680px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.55;
}

.hero-customer {
  display: flex;
  min-width: 230px;
  flex-direction: column;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, .75);
}

.hero-customer span {
  color: var(--muted);
  font-size: .74rem;
}

.hero-customer strong {
  margin-top: 4px;
  font-size: .96rem;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

.product-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  box-shadow: 0 8px 24px rgba(65, 38, 13, .055);
}

.product-image {
  position: relative;
  display: grid;
  aspect-ratio: 4 / 3;
  place-items: center;
  overflow: hidden;
  background:
    radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .85), transparent 22%),
    linear-gradient(135deg, #fff1de, #f6c88d);
}

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

.product-placeholder {
  display: grid;
  width: 92px;
  height: 92px;
  place-items: center;
  border: 3px dashed rgba(150, 84, 12, .32);
  border-radius: 50%;
  color: rgba(112, 60, 9, .55);
  font-size: 2.2rem;
  font-weight: 900;
}

.product-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  padding: 20px;
}

.product-body h2 {
  margin-bottom: 7px;
  font-size: 1.25rem;
}

.product-description {
  min-height: 44px;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: .9rem;
  line-height: 1.5;
}

.product-package {
  min-height: 20px;
  margin-bottom: 8px;
  color: var(--orange-dark);
  font-size: .78rem;
  font-weight: 750;
}

.product-price {
  margin-top: auto;
  font-size: 1.27rem;
  font-weight: 900;
  letter-spacing: -.025em;
}

.product-price small {
  color: var(--muted);
  font-size: .75rem;
  font-weight: 650;
}

.product-actions {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-top: 18px;
}

.quantity-control {
  display: grid;
  min-height: 46px;
  grid-template-columns: 44px minmax(42px, 1fr) 44px;
  align-items: center;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--cream);
}

.quantity-control button {
  align-self: stretch;
  border: 0;
  background: transparent;
  cursor: pointer;
  color: var(--orange-dark);
  font-size: 1.3rem;
  font-weight: 850;
}

.quantity-control button:hover {
  background: var(--orange-soft);
}

.quantity-control strong {
  text-align: center;
  font-size: .95rem;
}

.shipping-banner {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-top: 30px;
  padding: 19px 22px;
  border: 1px solid #f1c894;
  border-radius: 16px;
  background: var(--orange-soft);
}

.shipping-banner div:last-child {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.shipping-banner span {
  color: #6f4b28;
  font-size: .88rem;
}

.shipping-icon {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  border-radius: 50%;
  background: var(--orange);
  font-size: 1.3rem;
  font-weight: 900;
}

.cart-bar {
  position: fixed;
  z-index: 40;
  right: max(22px, calc((100vw - 1220px) / 2));
  bottom: 22px;
  display: grid;
  min-width: 300px;
  min-height: 58px;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  border: 0;
  border-radius: 16px;
  background: var(--ink);
  box-shadow: 0 16px 36px rgba(30, 19, 10, .25);
  color: #fff;
  cursor: pointer;
  text-align: left;
}

.cart-count {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  background: var(--orange);
  color: var(--ink);
  font-size: .82rem;
  font-weight: 900;
}

.cart-bar strong {
  font-size: .88rem;
}

.site-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px 60px;
  padding: 42px max(24px, calc((100vw - 1220px) / 2)) 110px;
  border-top: 1px solid var(--line);
  background: #33271f;
  color: #fff;
}

.site-footer p {
  margin: 7px 0 0;
  color: #d6c8bc;
  font-size: .86rem;
  line-height: 1.55;
}

.site-footer a {
  color: #ffc27c;
}

.net-notice {
  grid-column: 1 / -1;
  padding-top: 18px;
  border-top: 1px solid rgba(255, 255, 255, .13);
}

.mobile-nav {
  display: none;
}

.notice {
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  font-size: .88rem;
  line-height: 1.5;
}

.notice-error {
  margin-bottom: 22px;
  border-color: #efc5bf;
  background: var(--red-soft);
  color: var(--red);
}

.notice-success {
  border-color: #bce2c9;
  background: var(--green-soft);
  color: var(--green);
}

.order-list {
  display: grid;
  gap: 15px;
}

.order-card {
  border: 1px solid var(--line);
  border-radius: 17px;
  background: #fff;
  box-shadow: 0 7px 20px rgba(65, 38, 13, .045);
}

.order-card summary {
  display: grid;
  min-height: 88px;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 24px;
  padding: 18px 20px;
  cursor: pointer;
  list-style: none;
}

.order-card summary::-webkit-details-marker {
  display: none;
}

.order-card summary::after {
  content: "+";
  color: var(--orange-dark);
  font-size: 1.5rem;
  font-weight: 500;
}

.order-card[open] summary::after {
  content: "–";
}

.order-card h2 {
  margin: 0 0 4px;
  font-size: 1.05rem;
}

.order-meta {
  color: var(--muted);
  font-size: .8rem;
}

.order-total {
  text-align: right;
}

.order-total strong {
  display: block;
}

.status-pill {
  display: inline-flex;
  margin-top: 4px;
  padding: 3px 8px;
  border-radius: 999px;
  background: #eef3ff;
  color: #3c568b;
  font-size: .7rem;
  font-weight: 800;
}

.status-pill.completed {
  background: var(--green-soft);
  color: var(--green);
}

.order-details {
  padding: 0 20px 20px;
  border-top: 1px solid var(--line);
}

.order-line-row {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid #f0e8e0;
  font-size: .88rem;
}

.order-actions {
  display: flex;
  justify-content: flex-end;
  padding-top: 16px;
}

.empty-state {
  padding: 44px 24px;
  border: 1px dashed #d9c9ba;
  border-radius: 18px;
  color: var(--muted);
  text-align: center;
}

.success-card {
  width: min(100%, 700px);
  margin: 30px auto;
  padding: clamp(28px, 6vw, 58px);
  border: 1px solid var(--line);
  border-radius: 26px;
  background: #fff;
  box-shadow: var(--shadow);
  text-align: center;
}

.success-mark {
  display: grid;
  width: 72px;
  height: 72px;
  margin: 0 auto 22px;
  place-items: center;
  border-radius: 50%;
  background: var(--green-soft);
  color: var(--green);
  font-size: 2rem;
  font-weight: 900;
}

.success-card > p {
  color: var(--muted);
  line-height: 1.6;
}

.success-details {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 26px 0 16px;
}

.success-details > div {
  padding: 14px 10px;
  border-radius: 12px;
  background: var(--cream);
}

.success-details span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: .72rem;
}

.success-details strong {
  font-size: .9rem;
}

.success-card .button-row {
  margin-top: 24px;
}

dialog {
  color: var(--ink);
}

dialog::backdrop {
  background: rgba(32, 23, 15, .56);
  backdrop-filter: blur(4px);
}

.sheet-dialog {
  width: min(100% - 24px, 600px);
  max-height: calc(100vh - 28px);
  margin: auto;
  padding: 28px;
  overflow: auto;
  border: 0;
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.dialog-close-row {
  display: flex;
  justify-content: flex-end;
}

.icon-close {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: var(--cream);
  cursor: pointer;
  font-size: 1.35rem;
}

.dialog-heading {
  margin: -22px 46px 20px 0;
}

.cart-lines {
  display: grid;
}

.cart-line {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 130px auto;
  align-items: center;
  gap: 14px;
  padding: 15px 0;
  border-bottom: 1px solid var(--line);
}

.cart-line h3 {
  margin: 0 0 4px;
  font-size: .98rem;
}

.cart-line p {
  margin: 0;
  color: var(--muted);
  font-size: .76rem;
}

.cart-line-total {
  min-width: 84px;
  text-align: right;
  font-size: .85rem;
  font-weight: 800;
}

.cart-remove {
  margin-top: 6px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--red);
  cursor: pointer;
  font-size: .74rem;
}

.shipping-progress {
  margin: 18px 0;
  padding: 13px 15px;
  border-radius: 12px;
  background: var(--orange-soft);
  color: #6e451d;
  font-size: .86rem;
  font-weight: 700;
  text-align: center;
}

.shipping-progress.reached {
  background: var(--green-soft);
  color: var(--green);
}

.note-field {
  display: block;
  margin-top: 20px;
}

.note-field small {
  color: var(--muted);
  font-weight: 500;
}

.address-box {
  margin: 18px 0;
  padding: 15px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--cream);
}

.address-box span {
  display: block;
  margin-bottom: 4px;
  color: var(--muted);
  font-size: .75rem;
}

.address-box strong {
  white-space: pre-line;
  font-size: .87rem;
  line-height: 1.45;
}

.address-box p {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: .73rem;
}

.cart-totals {
  display: grid;
  gap: 8px;
  margin: 20px 0;
}

.total-row {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  font-size: .9rem;
}

.total-row.grand {
  margin-top: 5px;
  padding-top: 11px;
  border-top: 2px solid var(--orange);
  font-size: 1.05rem;
  font-weight: 900;
}

.confirm-dialog {
  width: min(100% - 32px, 430px);
  padding: 0;
  border: 0;
  border-radius: 22px;
}

.confirm-content {
  padding: 34px;
  text-align: center;
}

.confirm-content p {
  color: var(--muted);
  line-height: 1.55;
}

.confirm-content .button-row {
  justify-content: center;
  margin-top: 24px;
}

.confirm-icon {
  display: grid;
  width: 56px;
  height: 56px;
  margin: 0 auto 17px;
  place-items: center;
  border-radius: 50%;
  background: var(--orange-soft);
  color: var(--orange-dark);
  font-size: 1.5rem;
  font-weight: 900;
}

.toast {
  position: fixed;
  z-index: 100;
  right: 22px;
  bottom: 94px;
  max-width: min(390px, calc(100vw - 44px));
  padding: 13px 16px;
  border-radius: 12px;
  background: var(--ink);
  box-shadow: var(--shadow);
  color: #fff;
  font-size: .86rem;
  font-weight: 700;
}

.toast.toast-error {
  background: var(--red);
}

@media (max-width: 940px) {
  .product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .desktop-nav {
    display: none;
  }

  .header-account > div {
    display: none;
  }

  .mobile-nav {
    position: fixed;
    z-index: 50;
    right: 0;
    bottom: 0;
    left: 0;
    display: grid;
    height: 68px;
    grid-template-columns: repeat(3, 1fr);
    border-top: 1px solid var(--line);
    background: rgba(255, 255, 255, .97);
    backdrop-filter: blur(14px);
  }

  .mobile-nav button {
    border: 0;
    background: transparent;
    color: var(--muted);
    font-size: .76rem;
    font-weight: 750;
  }

  .mobile-nav button.active {
    color: var(--orange-dark);
  }

  .site-footer {
    padding-bottom: 150px;
  }

  .cart-bar {
    right: 14px;
    bottom: 80px;
  }
}

@media (max-width: 660px) {
  h1 {
    font-size: 2.15rem;
  }

  .site-header {
    min-height: 70px;
    padding: 8px 17px;
  }

  .brand-header .brand-logo {
    max-width: 180px;
    height: 50px;
  }

  .site-main {
    width: min(100% - 28px, 1220px);
    padding: 38px 0 60px;
  }

  .hero,
  .page-heading {
    display: block;
    margin-bottom: 26px;
  }

  .hero-customer {
    min-width: 0;
    margin-top: 20px;
  }

  .page-heading .btn {
    margin-top: 17px;
  }

  .product-grid {
    grid-template-columns: 1fr;
  }

  .product-card {
    flex-direction: row;
    align-items: stretch;
  }

  .product-image {
    width: 32%;
    min-width: 112px;
    aspect-ratio: auto;
  }

  .product-placeholder {
    width: 66px;
    height: 66px;
    font-size: 1.6rem;
  }

  .product-body {
    min-width: 0;
    padding: 16px;
  }

  .product-body h2 {
    font-size: 1.08rem;
  }

  .product-description {
    min-height: 0;
    margin-bottom: 11px;
    font-size: .82rem;
  }

  .product-actions {
    grid-template-columns: 1fr;
  }

  .shipping-banner {
    align-items: flex-start;
  }

  .cart-bar {
    left: 14px;
    min-width: 0;
  }

  .site-footer {
    grid-template-columns: 1fr;
    gap: 24px;
    padding-right: 18px;
    padding-left: 18px;
  }

  .sheet-dialog {
    width: 100%;
    max-height: 92vh;
    margin: auto 0 0;
    padding: 22px 18px;
    border-radius: 22px 22px 0 0;
  }

  .cart-line {
    grid-template-columns: 1fr;
    gap: 9px;
  }

  .cart-line .quantity-control {
    width: 140px;
  }

  .cart-line-total {
    position: absolute;
    right: 18px;
    margin-top: 48px;
  }

  .order-card summary {
    grid-template-columns: 1fr auto;
    gap: 12px;
  }

  .order-total {
    grid-column: 1;
    text-align: left;
  }

  .order-card summary::after {
    grid-column: 2;
    grid-row: 1 / 3;
  }

  .order-line-row {
    grid-template-columns: 1fr auto;
  }

  .order-line-row span:last-child {
    grid-column: 1 / -1;
    color: var(--muted);
  }

  .success-details {
    grid-template-columns: 1fr;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
