.checkout-page {
  background: #ececec;
}

.checkout-page::before {
  display: none;
}

.checkout-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: #fff;
  border-bottom: 1px solid #e3dedd;
}

.utility-row {
  min-height: 30px;
  padding: 0.25rem 1rem;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 0.75rem;
  background: #fafafa;
  border-bottom: 1px solid #f0eceb;
}

.utility-copy {
  margin: 0;
  font-size: 0.74rem;
  color: #222;
}

.utility-actions {
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.lang-flag {
  border: 1px solid #ddd;
  border-radius: 999px;
  width: 27px;
  height: 27px;
  padding: 0;
  overflow: hidden;
  cursor: pointer;
  background: #fff;
}

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

.lang-flag.active {
  border-color: var(--accent-strong);
  box-shadow: 0 0 0 2px rgba(223, 90, 61, 0.2);
}

.menu-row {
  width: min(1320px, 100% - 1rem);
  margin: 0 auto;
  min-height: 72px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 1.1rem;
  align-items: center;
}

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

.brand-logo-large {
  width: 108px;
  height: auto;
  object-fit: contain;
}

.mobile-menu-toggle {
  display: none;
  align-items: center;
  gap: 0.55rem;
  border: 1px solid #e6d4cf;
  background: #fff;
  color: #181818;
  border-radius: 999px;
  height: 40px;
  padding: 0 0.75rem;
  cursor: pointer;
  font-family: 'DMSans-Bold', sans-serif;
  font-size: 0.84rem;
  line-height: 1;
}

.mobile-menu-toggle:hover {
  border-color: #d9b8af;
  background: #fff7f5;
}

.mobile-menu-icon {
  width: 17px;
  display: inline-grid;
  gap: 3px;
}

.mobile-menu-icon span {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 999px;
  background: #232323;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.checkout-header.mobile-menu-open .mobile-menu-icon span:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}

.checkout-header.mobile-menu-open .mobile-menu-icon span:nth-child(2) {
  opacity: 0;
}

.checkout-header.mobile-menu-open .mobile-menu-icon span:nth-child(3) {
  transform: translateY(-5px) rotate(-45deg);
}

.checkout-menu {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.08rem;
}

.menu-item-link {
  min-height: 52px;
  padding: 0.66rem 0.8rem;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  color: #111;
  text-decoration: none;
  font-family: 'DMSans-Bold', sans-serif;
  font-size: 0.86rem;
  line-height: 1.1;
  white-space: nowrap;
}

.menu-item-link:hover {
  border-bottom-color: var(--accent-strong);
  color: var(--accent-deep);
  background: #fff7f5;
}

.menu-cart {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  height: 52px;
  padding: 0 0.18rem;
  border: none;
  border-bottom: 2px solid transparent;
  background: transparent;
  text-decoration: none;
  color: #111;
  font-family: 'DMSans-Bold', sans-serif;
  font-size: 0.92rem;
  line-height: 1;
  white-space: nowrap;
}

.menu-cart-icon {
  display: none;
  width: 18px;
  height: 18px;
}

.menu-cart-icon svg {
  width: 100%;
  height: 100%;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.checkout-main {
  width: min(860px, 100% - 1rem);
  margin: 1rem auto 2rem;
}

.checkout-shell {
  border-radius: 4px;
  border: 1px solid #ddd;
  box-shadow: none;
  padding: 1rem;
}

.checkout-title {
  font-family: 'DMSans-Bold', sans-serif;
  font-size: 1.35rem;
  margin: 0;
}

.checkout-stepper {
  margin-top: 0.5rem;
  display: inline-flex;
  border: 1px solid #e1d4d1;
  border-radius: 6px;
  overflow: hidden;
}

.step-tab {
  border: none;
  background: #fff;
  color: #333;
  font-family: 'DMSans-Bold', sans-serif;
  font-size: 0.83rem;
  padding: 0.5rem 0.8rem;
  cursor: pointer;
}

.step-tab + .step-tab {
  border-left: 1px solid #eadfdd;
}

.step-tab.active {
  background: #f9e8e5;
  color: #5b211c;
}

.checkout-stage {
  margin-top: 0.85rem;
  border: 1px solid #ece6e4;
  border-radius: 5px;
  padding: 0.75rem;
  display: grid;
  gap: 0.65rem;
}

.section-title {
  margin: 0;
  font-family: 'DMSans-Bold', sans-serif;
  font-size: 1.05rem;
}

.stage-subtitle {
  margin: -0.25rem 0 0;
  color: #4a4a4a;
  font-size: 0.86rem;
}

.cart-table {
  width: 100%;
  border-collapse: collapse;
}

.cart-table th,
.cart-table td {
  border: 1px solid #ece6e4;
  padding: 0.48rem 0.35rem;
  vertical-align: top;
  text-align: left;
  font-size: 0.84rem;
}

.cart-table th {
  font-size: 0.76rem;
  color: #555;
  background: #faf9f9;
}

.cart-table input[type='number'] {
  max-width: 74px;
  min-height: 28px;
  border-radius: 2px;
  border: 1px solid #d5cccc;
}

.total-box {
  border-top: 1px solid #e8e1df;
  padding-top: 0.55rem;
  display: grid;
  gap: 0.2rem;
  font-size: 0.86rem;
}

.actions-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.button,
.button-ghost,
.button-danger {
  min-height: 34px;
  border-radius: 4px;
  font-size: 0.78rem;
  padding: 0.35rem 0.7rem;
  box-shadow: none;
}

.button {
  background: #f9cfc5;
}

.button:hover {
  background: #f3bdb0;
  color: #1f1f1f;
  transform: none;
}

.button-ghost {
  border-color: #e7d9d5;
}

.button-danger {
  border-color: #e7d9d5;
  color: #3a2f2c;
}

.form-grid {
  display: grid;
  gap: 0.56rem;
}

#stage-summary {
  border: none;
  padding: 0;
  background: transparent;
}

.legacy-summary-container {
  max-width: 800px;
  border: 1px solid #ddd;
  border-radius: 8px;
  padding: 1rem;
  background: #fff;
}

.legacy-summary-section {
  margin-top: 1rem;
}

.legacy-summary-heading {
  margin: 0 0 0.5rem;
  font-size: 1.02rem;
}

.legacy-summary-section p {
  margin: 0.1rem 0;
  font-size: 0.86rem;
}

.legacy-total {
  margin-top: 0.8rem;
  font-size: 1rem;
  font-family: 'DMSans-Bold', sans-serif;
}

.summary-accept {
  margin-top: 1rem;
  font-size: 0.83rem;
}

.summary-accept label {
  display: inline-flex;
  align-items: flex-start;
  gap: 0.45rem;
}

.summary-error-copy {
  margin: 0.45rem 0 0;
  color: #b4362a;
  font-size: 0.82rem;
}

.summary-pdf-link {
  color: #1d5fbf;
  text-decoration: underline;
  display: inline-block;
  margin-top: 0.9rem;
  font-size: 0.85rem;
}

.summary-pdf-help {
  margin: 0.35rem 0 0;
  color: #5d5d5d;
  font-size: 0.78rem;
}

#stage-form label {
  color: #1f1f1f;
  font-size: 0.8rem;
}

#stage-form input,
#stage-form select,
#stage-form textarea {
  min-height: 34px;
  border-radius: 2px;
  border: 1px solid #ef9187;
  font-size: 0.86rem;
}

#stage-form textarea {
  min-height: 90px;
}

#stage-form input:focus,
#stage-form select:focus,
#stage-form textarea:focus {
  border-color: #df5a3d;
  outline: 1px solid #f1b4aa;
}

.hidden {
  display: none !important;
}

@media (max-width: 1100px) {
  .menu-row {
    grid-template-columns: auto 1fr auto;
    gap: 0.45rem;
    align-items: center;
    padding: 0.3rem 0;
  }

  .checkout-menu {
    grid-column: 1 / -1;
    order: 3;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding: 0.2rem 0 0.15rem;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .checkout-menu::-webkit-scrollbar {
    display: none;
  }

  .menu-item-link {
    min-height: 38px;
    border: 1px solid #ead7d2;
    border-radius: 999px;
    border-bottom-width: 1px;
    padding: 0.42rem 0.72rem;
    flex: 0 0 auto;
  }
}

@media (max-width: 760px) {
  .utility-copy {
    display: none;
  }

  .menu-row {
    grid-template-columns: 1fr auto auto;
    gap: 0.4rem;
    min-height: 60px;
  }

  .brand-link {
    grid-column: 1;
  }

  .menu-cart {
    grid-column: 2;
    justify-self: end;
    height: 40px;
    min-width: 40px;
    padding: 0 0.58rem;
    border: 1px solid #e6d4cf;
    border-radius: 999px;
    background: #fff;
    border-bottom-width: 1px;
    position: relative;
    gap: 0;
    font-size: 0;
  }

  .menu-cart #checkout-link-text {
    display: none;
  }

  .menu-cart-icon {
    display: block;
  }

  .menu-cart .badge {
    position: absolute;
    top: -7px;
    right: -6px;
    min-width: 1.25rem;
    height: 1.25rem;
    font-size: 0.72rem;
  }

  .mobile-menu-toggle {
    display: inline-flex;
    grid-column: 3;
    justify-self: end;
  }

  .checkout-menu {
    display: none;
    grid-column: 1 / -1;
    order: 3;
    flex-direction: column;
    gap: 0;
    border-top: 1px solid #efe3df;
    padding-top: 0.3rem;
  }

  .checkout-header.mobile-menu-open .checkout-menu {
    display: flex;
  }

  .menu-item-link {
    font-size: 0.86rem;
    min-height: 40px;
    padding: 0.44rem 0.2rem;
    border-radius: 0;
    border: none;
    border-bottom: 1px solid #f2e4df;
    width: 100%;
  }

  .checkout-main {
    width: min(860px, 100% - 0.5rem);
    margin-top: 0.5rem;
  }

  .checkout-shell {
    padding: 0.72rem;
    border-radius: 8px;
  }

  .checkout-title {
    font-size: 1.2rem;
  }

  .checkout-stepper {
    width: 100%;
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .step-tab {
    min-height: 40px;
    padding: 0.45rem 0.3rem;
    font-size: 0.75rem;
  }

  .checkout-stage {
    padding: 0.68rem;
  }

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

  .actions-row .button,
  .actions-row .button-ghost,
  .actions-row .button-danger {
    width: 100%;
    min-height: 38px;
  }

  .cart-table thead {
    display: none;
  }

  .cart-table tbody {
    display: grid;
    gap: 0.62rem;
  }

  .cart-table tr {
    display: grid;
    border: 1px solid #ece6e4;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
  }

  .cart-table td {
    border: none;
    border-top: 1px solid #f0eceb;
    padding: 0.52rem 0.55rem;
    display: grid;
    grid-template-columns: minmax(95px, 40%) 1fr;
    gap: 0.52rem;
    align-items: center;
  }

  .cart-table td:first-child {
    border-top: none;
  }

  .cart-table td::before {
    content: attr(data-label);
    color: #626262;
    font-family: 'DMSans-Bold', sans-serif;
    font-size: 0.72rem;
    line-height: 1.25;
  }

  .cart-table td[colspan]::before {
    content: '';
  }

  .cart-table input[type='number'] {
    max-width: 96px;
  }

  .cart-table td .button-danger {
    width: auto;
    min-width: 44px;
    min-height: 30px;
    padding: 0.24rem 0.5rem;
  }

  .legacy-summary-section p {
    font-size: 0.82rem;
  }

  .legacy-summary-container {
    padding: 0.7rem;
  }
}

@media (max-width: 430px) {
  .mobile-menu-toggle {
    width: 40px;
    padding: 0;
    justify-content: center;
  }

  .mobile-menu-text {
    display: none;
  }
}
