/* Cart, checkout, product add-to-cart */

.product-info {
  min-width: 0;
}

.product-add-form {
  width: 100%;
  min-width: 0;
}

.product-option {
  min-width: 0;
  max-width: 100%;
}

.product-option-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-bottom: 10px;
}

.product-option-head {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  gap: 8px 16px;
  margin-bottom: 10px;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.product-option-head .product-option-label {
  display: inline-block;
  margin-bottom: 0;
  flex: 0 0 auto;
}

.product-option-head .product-size-help {
  margin-left: auto;
  flex: 0 0 auto;
  justify-content: flex-end;
}

.product-option-head--size {
  width: 100%;
  max-width: 100%;
}

.product-option--size {
  width: 100%;
  max-width: 100%;
}

.product-size-help {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  font-size: 13px;
  font-weight: 400;
  color: var(--color-text-muted, #666);
  text-transform: none;
  letter-spacing: normal;
  line-height: 1.4;
  text-align: right;
}

.product-size-help__text {
  white-space: nowrap;
}

.product-size-help__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  border: 1px solid currentColor;
  border-radius: 50%;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
  flex-shrink: 0;
}

.product-size-help__link {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  white-space: nowrap;
}

.product-size-help__link:hover {
  color: var(--color-primary, #111);
}

.option-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.option-btn input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.option-btn:has(input:checked),
.option-btn.active {
  border-color: var(--color-primary);
  background: var(--color-primary);
  color: white;
}

.product-add-form .product-actions {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 8px;
}

.product-add-form .product-actions .btn {
  flex: 1 1 0;
  min-width: 140px;
  justify-content: center;
}

.cart-items {
  min-width: 0;
}

.cart-item-remove-form {
  margin-top: 12px;
}

.cart-item-unit-price {
  font-size: 14px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

.cart-item-qty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 120px;
}

.cart-qty-control {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--color-border);
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
}

.cart-qty-control.is-updating {
  opacity: 0.6;
  pointer-events: none;
}

.cart-qty-btn {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--color-text);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
  -webkit-tap-highlight-color: transparent;
}

.cart-qty-btn:hover:not(:disabled) {
  background: rgba(26, 26, 26, 0.04);
}

.cart-qty-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.cart-qty-input {
  width: 40px;
  height: 40px;
  border: 0;
  border-left: 1px solid var(--color-border);
  border-right: 1px solid var(--color-border);
  background: transparent;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--color-text);
  padding: 0;
  -moz-appearance: textfield;
}

.cart-qty-input::-webkit-outer-spin-button,
.cart-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

@media (max-width: 768px) {
  .cart-item-qty {
    grid-column: 2;
    justify-content: flex-start;
    min-width: 0;
    margin-top: 8px;
  }

  .cart-item-price {
    margin-top: 8px;
  }
}

.btn-sm {
  padding: 8px 16px;
  font-size: 12px;
}

.btn-block {
  width: 100%;
  justify-content: center;
  margin-top: 20px;
}

.checkout-empty-note {
  font-size: 14px;
  color: var(--color-text-muted);
  margin-bottom: 16px;
}

.checkout-order-items {
  margin-bottom: 8px;
}

.payment-method {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.payment-method input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.payment-method:has(input:checked),
.payment-method.active {
  border-color: var(--color-primary);
  background: rgba(var(--color-primary-rgb), 0.05);
}

.checkout-card-fields {
  margin-top: 16px;
}

/* Order success */
.order-success-page {
  padding: 48px var(--page-gutter) 80px;
}

.order-success-hero {
  text-align: center;
  max-width: 560px;
  margin: 0 auto 48px;
}

.order-success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: rgba(var(--color-primary-rgb), 0.08);
  color: var(--color-primary);
  margin-bottom: 24px;
}

.order-success-hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(32px, 5vw, 44px);
  color: var(--color-primary);
  margin-bottom: 16px;
}

.order-success-lead {
  font-size: 16px;
  line-height: 1.7;
  color: var(--color-text-muted);
  margin-bottom: 12px;
}

.order-success-meta {
  font-size: 14px;
  color: var(--color-text-muted);
}

.order-number {
  font-weight: 600;
  color: var(--color-text);
  font-variant-numeric: tabular-nums;
}

.order-success-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 48px;
  align-items: start;
  margin-bottom: 40px;
}

.order-success-details {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 0;
}

.order-success-card {
  background: white;
  border-radius: var(--radius-lg);
  padding: 28px;
  box-shadow: var(--shadow);
}

.order-success-card h2 {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 20px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}

.order-success-items {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.order-success-item {
  display: grid;
  grid-template-columns: 72px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--color-border);
}

.order-success-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.order-success-item:first-child {
  padding-top: 0;
}

.order-success-item-image {
  aspect-ratio: 1;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--color-bg);
}

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

.order-success-item-info h3 {
  font-family: var(--font-serif);
  font-size: 18px;
  margin-bottom: 4px;
}

.order-success-item-info p {
  font-size: 14px;
  color: var(--color-text-muted);
}

.order-success-item-price {
  font-size: 15px;
  font-weight: 500;
}

.order-success-address {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-style: normal;
  font-size: 15px;
  line-height: 1.7;
  color: var(--color-text-muted);
}

.order-success-steps {
  font-size: 14px;
  line-height: 1.8;
  color: var(--color-text-muted);
  padding-left: 18px;
  list-style: disc;
}

.order-success-steps a {
  color: var(--color-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.order-success-summary {
  position: sticky;
  top: calc(var(--header-height) + 24px);
}

.order-success-payment {
  display: flex;
  justify-content: space-between;
  font-size: 14px;
  margin-top: 16px;
  padding-top: 16px;
  border-top: 1px solid var(--color-border);
  color: var(--color-text-muted);
}

.order-success-payment-value {
  font-weight: 500;
  color: var(--color-text);
}

.order-success-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

@media (max-width: 900px) {
  .order-success-layout {
    grid-template-columns: 1fr;
  }

  .order-success-summary {
    position: static;
  }
}

@media (max-width: 600px) {
  .order-success-page {
    padding: 32px var(--page-gutter) 100px;
  }

  .order-success-item {
    grid-template-columns: 64px 1fr;
    gap: 12px;
  }

  .order-success-item-price {
    grid-column: 2;
  }

  .order-success-actions {
    flex-direction: column;
  }

  .order-success-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .product-add-form .product-actions .btn {
    flex: 1 1 calc(50% - 6px);
    width: auto;
    min-width: 0;
  }
}

/* Product detail gallery — mobile thumb strip */
@media (max-width: 768px) {
  .product-detail .product-gallery {
    width: 100% !important;
    max-width: 100% !important;
  }

  .product-gallery-thumbs-wrap {
    --gallery-thumb-gap: 6px;
    --gallery-thumb-per-row: 6;
    --gallery-thumb-min: 56px;
    --gallery-nav-slot: 38px;
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: 100%;
    overflow: hidden;
  }

  .product-gallery-thumbs-wrap.has-overflow .product-gallery-thumbs {
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-behavior: smooth;
    scrollbar-width: none;
  }

  .product-gallery-thumbs-wrap.has-overflow .product-gallery-thumbs::-webkit-scrollbar {
    display: none;
  }

  .product-gallery-nav {
    flex: 0 0 32px;
    width: 32px;
    height: 32px;
    padding: 0;
    border-color: rgba(26, 26, 26, 0.12);
  }

  .product-gallery-nav:not([hidden]) {
    display: inline-flex;
  }

  .product-gallery-thumbs-wrap.has-overflow .product-gallery-nav[hidden] {
    display: inline-flex !important;
  }

  .product-gallery-thumbs-wrap.has-overflow .product-gallery-nav.is-disabled {
    visibility: hidden;
    pointer-events: none;
  }

  .product-gallery-nav[hidden] {
    display: none !important;
  }

  .product-option-head--size {
    flex-wrap: wrap;
    gap: 6px 8px;
  }

  .product-option-head--size .product-size-help {
    flex: 1 1 100%;
    width: 100%;
    max-width: 100%;
    min-width: 0;
    margin-left: 0 !important;
    margin-right: 0 !important;
    justify-content: flex-start;
    flex-wrap: wrap;
    row-gap: 4px;
  }

  .product-size-help__text,
  .product-size-help__link {
    white-space: normal;
  }
}
