/* =========================================================
   CHECKOUT PAGE
   Standalone checkout styles
   ========================================================= */

/* =========================================================
   CHECKOUT PAGE WRAPPER
   ========================================================= */

.checkout-page {
  padding: 0 0 4rem;
}

.checkout-page > .customer-container {
  width: 100%;
}


/* =========================================================
   PAGE HEADER
   ========================================================= */

.checkout-page-header {
  padding: 3rem 0 2.5rem;
  border-bottom: 1px solid var(--customer-border, #e5e5e5);
}

.checkout-page-eyebrow {
  margin: 0 0 0.5rem;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--customer-accent, #b08d57);
}

.checkout-page-header h1 {
  margin: 0;
  font-size: clamp(2rem, 5vw, 3rem);
  line-height: 1.15;
  color: var(--customer-heading, #171717);
}

.checkout-page-header > p:last-child {
  max-width: 680px;
  margin: 0.9rem 0 0;
  color: var(--customer-muted, #6b6b6b);
  line-height: 1.7;
}


/* =========================================================
   CHECKOUT LAYOUT
   ========================================================= */

.checkout-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 380px);
  gap: 2rem;
  align-items: start;
  padding-top: 2rem;
}

.checkout-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.checkout-sidebar {
  min-width: 0;
}


/* =========================================================
   CHECKOUT SECTIONS / CARDS
   ========================================================= */

.checkout-section,
.checkout-card {
  background: var(--customer-background, #ffffff);
  border: 1px solid var(--customer-border, #e5e5e5);
  border-radius: var(--customer-radius, 12px);
  padding: 1.5rem;
}

.checkout-section-header,
.checkout-card-header {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
  margin-bottom: 1.5rem;
}

.checkout-section-header > div,
.checkout-card-header > div {
  min-width: 0;
}

.checkout-section-header h2,
.checkout-card-header h2 {
  margin: 0;
  font-size: 1.15rem;
  line-height: 1.35;
  color: var(--customer-heading, #171717);
}

.checkout-section-header p,
.checkout-card-header p {
  margin: 0.35rem 0 0;
  color: var(--customer-muted, #6b6b6b);
  font-size: 0.9rem;
  line-height: 1.5;
}

.checkout-section-eyebrow {
  margin: 0 0 0.25rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.07em;
  text-transform: uppercase;
  color: var(--customer-accent, #b08d57);
}

.checkout-step-number {
  flex: 0 0 34px;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--customer-accent, #b08d57);
  color: #ffffff;
  font-size: 0.85rem;
  font-weight: 700;
}


/* =========================================================
   FORM GRID
   ========================================================= */

.checkout-form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.15rem;
}

.checkout-form-full {
  grid-column: 1 / -1;
}


/* =========================================================
   FORM GROUPS
   ========================================================= */

.customer-form-group {
  min-width: 0;
}

.customer-form-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--customer-heading, #171717);
}

.customer-form-group label > span:first-of-type {
  color: #c62828;
}

.checkout-optional {
  margin-left: 0.3rem;
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--customer-muted, #777777);
}

.customer-form-group input,
.customer-form-group textarea,
.checkout-shipping-selector-button {
  width: 100%;
  font: inherit;
}

.customer-form-group input,
.customer-form-group textarea {
  display: block;
  padding: 0.82rem 0.9rem;
  border: 1px solid var(--customer-border, #dddddd);
  border-radius: var(--customer-radius-small, 8px);
  background: #ffffff;
  color: var(--customer-heading, #171717);
  font-size: 0.92rem;
  line-height: 1.5;
  outline: none;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.customer-form-group textarea {
  min-height: 110px;
  resize: vertical;
}

.customer-form-group input::placeholder,
.customer-form-group textarea::placeholder {
  color: #a0a0a0;
}

.customer-form-group input:focus,
.customer-form-group textarea:focus {
  border-color: var(--customer-accent, #b08d57);
  box-shadow: 0 0 0 3px rgba(176, 141, 87, 0.12);
}


/* =========================================================
   SHIPPING SELECTOR
   ========================================================= */

.checkout-shipping-selector {
  position: relative;
  width: 100%;
}

.checkout-shipping-selector-button {
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--customer-border, #dddddd);
  border-radius: var(--customer-radius-small, 8px);
  background: #ffffff;
  color: var(--customer-heading, #171717);
  cursor: pointer;
  text-align: left;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    background 0.2s ease;
}

.checkout-shipping-selector-button:hover:not(:disabled) {
  border-color: var(--customer-accent, #b08d57);
}

.checkout-shipping-selector-button[aria-expanded="true"] {
  border-color: var(--customer-accent, #b08d57);
  box-shadow: 0 0 0 3px rgba(176, 141, 87, 0.1);
}

.checkout-shipping-selector-button:disabled {
  background: #f7f7f7;
  color: #999999;
  cursor: not-allowed;
}

#shippingSelectorText {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 0.92rem;
  font-weight: 500;
}

.checkout-shipping-selector-arrow {
  flex: 0 0 auto;
  font-size: 0.7rem;
  color: var(--customer-muted, #777777);
  transition: transform 0.2s ease;
}


/* =========================================================
   SHIPPING DROPDOWN
   ========================================================= */

.checkout-shipping-dropdown {
  position: absolute;
  z-index: 20;
  top: calc(100% + 0.5rem);
  left: 0;
  right: 0;
  max-height: 360px;
  overflow-y: auto;
  padding: 0.4rem;
  border: 1px solid var(--customer-border, #dddddd);
  border-radius: var(--customer-radius-small, 8px);
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.1);
}

.checkout-shipping-dropdown[hidden] {
  display: none;
}

.checkout-shipping-methods {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}


/* =========================================================
   SHIPPING OPTIONS
   ========================================================= */

.checkout-shipping-option {
  width: 100%;
  display: block;
  padding: 0.9rem;
  border: 1px solid transparent;
  border-radius: var(--customer-radius-small, 8px);
  background: #ffffff;
  color: var(--customer-heading, #171717);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease;
}

.checkout-shipping-option:hover {
  background: #faf8f4;
  border-color: var(--customer-border, #e5e5e5);
}

.checkout-shipping-option[aria-selected="true"] {
  background: #faf8f4;
  border-color: var(--customer-accent, #b08d57);
}

.checkout-shipping-option-content {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
}

.checkout-shipping-option-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.checkout-shipping-option-top strong {
  min-width: 0;
  font-size: 0.9rem;
  line-height: 1.4;
}

.checkout-shipping-price {
  flex: 0 0 auto;
  font-size: 0.86rem;
  font-weight: 700;
  white-space: nowrap;
}

.checkout-shipping-description,
.checkout-shipping-area,
.checkout-shipping-note {
  font-size: 0.78rem;
  line-height: 1.45;
  color: var(--customer-muted, #6b6b6b);
}

.checkout-shipping-note {
  color: var(--customer-accent, #8b6d3f);
  font-weight: 500;
}


/* =========================================================
   SHIPPING LOADING
   ========================================================= */

.checkout-loading {
  padding: 1rem;
  text-align: center;
}

.checkout-loading p {
  margin: 0;
  color: var(--customer-muted, #777777);
  font-size: 0.85rem;
}


/* =========================================================
   PAYMENT METHOD
   ========================================================= */

.checkout-payment-method {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 1rem;
  border: 1px solid var(--customer-border, #e5e5e5);
  border-radius: var(--customer-radius-small, 8px);
  background: #fafafa;
}

.checkout-payment-icon {
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--customer-accent, #b08d57);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
}

.checkout-payment-method h3 {
  margin: 0;
  font-size: 0.95rem;
  color: var(--customer-heading, #171717);
}

.checkout-payment-method p {
  margin: 0.3rem 0 0;
  color: var(--customer-muted, #6b6b6b);
  font-size: 0.82rem;
  line-height: 1.55;
}


/* =========================================================
   ORDER SUMMARY
   ========================================================= */

.checkout-summary {
  position: sticky;
  top: 1.5rem;
  background: var(--customer-background, #ffffff);
  border: 1px solid var(--customer-border, #e5e5e5);
  border-radius: var(--customer-radius, 12px);
  padding: 1.5rem;
}

.checkout-summary-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--customer-border, #e5e5e5);
}

.checkout-summary-header h2 {
  margin: 0;
  font-size: 1.15rem;
  color: var(--customer-heading, #171717);
}

.checkout-summary-header a {
  flex: 0 0 auto;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--customer-accent, #8b6d3f);
  text-decoration: none;
}

.checkout-summary-header a:hover {
  text-decoration: underline;
}


/* =========================================================
   ORDER ITEMS
   ========================================================= */

.checkout-order-items {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.checkout-order-item {
  display: flex;
  align-items: flex-start;
  gap: 0.8rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--customer-border, #eeeeee);
}

.checkout-order-item:last-child {
  border-bottom: 0;
}

.checkout-order-item-image {
  flex: 0 0 64px;
  width: 64px;
  height: 64px;
  overflow: hidden;
  border-radius: var(--customer-radius-small, 8px);
  background: #f5f5f5;
}

.checkout-order-item-image img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.checkout-order-item-details {
  min-width: 0;
  flex: 1;
}

.checkout-order-item-details h3 {
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.4;
  color: var(--customer-heading, #171717);
}

.checkout-order-item-details p {
  margin: 0.25rem 0 0;
  color: var(--customer-muted, #777777);
  font-size: 0.77rem;
  line-height: 1.4;
}

.checkout-order-item-price {
  flex: 0 0 auto;
  font-size: 0.84rem;
  font-weight: 700;
  color: var(--customer-heading, #171717);
  white-space: nowrap;
}


/* =========================================================
   EMPTY CART
   ========================================================= */

.checkout-empty-cart {
  padding: 1.5rem 0;
  text-align: center;
}

.checkout-empty-cart p {
  margin: 0 0 1rem;
  color: var(--customer-muted, #777777);
}


/* =========================================================
   SUMMARY TOTALS
   ========================================================= */

.checkout-summary-totals {
  padding-top: 0.8rem;
}

.checkout-summary-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.45rem 0;
  color: var(--customer-muted, #666666);
  font-size: 0.88rem;
}

.checkout-summary-row strong {
  color: var(--customer-heading, #171717);
  font-weight: 600;
  white-space: nowrap;
}

.checkout-summary-divider {
  height: 1px;
  margin: 0.7rem 0;
  background: var(--customer-border, #e5e5e5);
}

.checkout-summary-row.checkout-summary-total {
  padding-top: 0.7rem;
  font-size: 1rem;
  color: var(--customer-heading, #171717);
}

.checkout-summary-row.checkout-summary-total strong {
  font-size: 1.15rem;
}


/* =========================================================
   CHECKOUT MESSAGES
   ========================================================= */

.checkout-message {
  padding: 0.8rem 0.9rem;
  border-radius: var(--customer-radius-small, 8px);
  font-size: 0.82rem;
  line-height: 1.5;
}

.checkout-message p {
  margin: 0;
}

.checkout-error-message {
  margin-top: 1rem;
  border: 1px solid #e5b8b8;
  background: #fff6f6;
  color: #a12626;
}


/* =========================================================
   PLACE ORDER BUTTON
   ========================================================= */

.checkout-submit-button {
  width: 100%;
  min-height: 50px;
  margin-top: 1rem;
  background: #09075e;
  color: #ffffff;
  border: 0;
  border-radius: var(--customer-radius-small, 8px);
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  transition:
    opacity 0.2s ease,
    transform 0.2s ease,
    background 0.2s ease;
}

.checkout-submit-button:hover:not(:disabled) {
  transform: translateY(-1px);
  .checkout-submit-button:hover {
  background: #ffffff;
  color: #09075e;
}
}

.checkout-submit-button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  transform: none;
}

.checkout-secure-note {
  margin: 0.8rem 0 0;
  text-align: center;
  color: var(--customer-muted, #777777);
  font-size: 0.72rem;
  line-height: 1.45;
}


/* =========================================================
   GENERIC CUSTOMER BUTTON FALLBACK
   ========================================================= */

.checkout-empty-cart .customer-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0.7rem 1rem;
  border-radius: var(--customer-radius-small, 8px);
  text-decoration: none;
}


/* =========================================================
   ACCESSIBILITY
   ========================================================= */

.checkout-shipping-selector-button:focus-visible,
.checkout-shipping-option:focus-visible,
.checkout-submit-button:focus-visible,
.customer-form-group input:focus-visible,
.customer-form-group textarea:focus-visible {
  outline: 3px solid rgba(176, 141, 87, 0.25);
  outline-offset: 2px;
}


/* =========================================================
   TABLET
   ========================================================= */

@media (max-width: 900px) {
  .checkout-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .checkout-sidebar {
    width: 100%;
  }

  .checkout-summary {
    position: static;
  }
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 640px) {
  .checkout-page {
    padding-bottom: 3rem;
  }

  .checkout-page-header {
    padding: 2rem 0 1.75rem;
  }

  .checkout-page-header h1 {
    font-size: 1.8rem;
  }

  .checkout-page-header > p:last-child {
    font-size: 0.88rem;
  }

  .checkout-layout {
    gap: 1rem;
    padding-top: 1rem;
  }

  .checkout-section,
  .checkout-card,
  .checkout-summary {
    padding: 1.1rem;
    border-radius: 10px;
  }

  .checkout-section-header,
  .checkout-card-header {
    margin-bottom: 1.15rem;
  }

  .checkout-form-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .checkout-form-full {
    grid-column: auto;
  }

  .checkout-step-number {
    flex-basis: 30px;
    width: 30px;
    height: 30px;
    font-size: 0.78rem;
  }

  .checkout-section-header h2,
  .checkout-card-header h2 {
    font-size: 1.05rem;
  }

  .checkout-shipping-dropdown {
    max-height: 320px;
  }

  .checkout-shipping-option {
    padding: 0.8rem;
  }

  .checkout-payment-method {
    gap: 0.75rem;
  }

  .checkout-payment-icon {
    flex-basis: 38px;
    width: 38px;
    height: 38px;
  }

  .checkout-order-item-image {
    flex-basis: 56px;
    width: 56px;
    height: 56px;
  }

  .checkout-order-item-details h3 {
    font-size: 0.82rem;
  }

  .checkout-order-item-price {
    font-size: 0.78rem;
  }
}


/* =========================================================
   SMALL MOBILE
   ========================================================= */

@media (max-width: 420px) {
  .checkout-page-header {
    padding-top: 1.5rem;
  }

  .checkout-page-header h1 {
    font-size: 1.6rem;
  }

  .checkout-section,
  .checkout-card,
  .checkout-summary {
    padding: 1rem;
  }

  .checkout-section-header,
  .checkout-card-header {
    gap: 0.7rem;
  }

  .checkout-shipping-selector-button {
    min-height: 52px;
  }

  .checkout-shipping-option-top {
    gap: 0.6rem;
  }

  .checkout-shipping-price {
    font-size: 0.78rem;
  }

  .checkout-summary-row.checkout-summary-total strong {
    font-size: 1.05rem;
  }
}


/* =========================================================
   REDUCED MOTION
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
  .checkout-shipping-selector-button,
  .checkout-shipping-selector-arrow,
  .checkout-shipping-option,
  .checkout-submit-button,
  .customer-form-group input,
  .customer-form-group textarea {
    transition: none;
  }
}

/* =========================================================
   CHECKOUT SUCCESS MESSAGE
   ========================================================= */

.checkout-success-message {
  margin-top: 16px;
  padding: 14px 16px;
  border: 1px solid #2e7d32;
  border-radius: 8px;
  background: #f1f8f2;
  color: #2e7d32;
  font-size: 14px;
  line-height: 1.5;
}