/*
 * Single product: add-to-cart form (variation select, quantity, button), description tabs,
 * additional-information table and related products. Styles Woo's default markup (no overrides).
 */

/* ---------- Add to cart form ---------- */
.product .summary form.cart {
  display: grid;
  gap: var(--space-4);
  margin: 0;
}

/* Simple products: quantity + button on one row. */
.product .summary form.cart:not(.variations_form),
.woocommerce-variation-add-to-cart {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: var(--space-3);
}

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

table.variations tbody,
table.variations tr {
  display: grid;
  gap: var(--space-2);
}

table.variations th,
table.variations td {
  padding: 0;
  text-align: left;
}

table.variations th label {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
}

table.variations td.value {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: var(--space-2) var(--space-4);
}

table.variations select {
  appearance: none;
  min-width: min(100%, 14rem);
  min-height: var(--control-height-lg);
  padding: 0 3rem 0 var(--space-5);
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-pill);
  background: var(--color-surface)
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%237a6252' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E")
    right 1.1rem center / 1.1rem no-repeat;
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: border-color var(--transition-fast);
}

table.variations select:hover {
  border-color: var(--color-primary);
}

.reset_variations {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

.single_variation_wrap {
  display: grid;
  gap: var(--space-4);
}

.woocommerce-variation-price .price .amount {
  color: var(--color-price);
  font-size: var(--font-size-xl);
  font-weight: var(--font-weight-semibold);
}

.woocommerce-variation-description p,
.woocommerce-variation-availability p {
  color: var(--color-text-muted);
  font-size: var(--font-size-sm);
}

.stock.in-stock {
  color: var(--color-success-text);
}

.stock.out-of-stock {
  color: var(--color-error-text);
}

.single-product .summary .quantity .qty {
  width: 5.5rem;
  min-height: var(--control-height-lg);
  border-radius: var(--radius-pill);
  font-weight: var(--font-weight-semibold);
}

.single-product .single_add_to_cart_button {
  flex: 1 1 12rem;
}

.single-product .single_add_to_cart_button.disabled {
  opacity: 0.45;
}

/* ---------- Tabs (Woo single-product.js toggles .active) ---------- */
.woocommerce-tabs {
  margin-top: var(--space-8);
}

.woocommerce-tabs ul.tabs {
  display: flex;
  gap: var(--space-6);
  margin: 0 0 var(--space-6);
  padding: 0;
  overflow-x: auto;
  overflow-y: hidden; /* The active tab overlaps the border by 1px: without this a vertical scrollbar appears. */
  border-bottom: 1px solid var(--color-border);
  list-style: none;
  scrollbar-width: none; /* Swipeable strip, like the category chips. */
}

.woocommerce-tabs ul.tabs::-webkit-scrollbar {
  display: none;
}

.woocommerce-tabs ul.tabs a {
  display: inline-flex;
  align-items: center;
  min-height: var(--control-height-lg);
  margin-bottom: -1px;
  border-bottom: 2px solid transparent;
  color: var(--color-text-muted);
  font-family: var(--font-heading);
  font-size: var(--font-size-lg);
  text-decoration: none;
  white-space: nowrap;
}

.woocommerce-tabs ul.tabs a:hover,
.woocommerce-tabs ul.tabs li.active a {
  color: var(--color-text);
  border-bottom-color: var(--color-primary);
}

.woocommerce-Tabs-panel {
  max-width: 68ch;
}

.woocommerce-Tabs-panel > * + * {
  margin-top: var(--space-4);
}

.woocommerce-Tabs-panel ul,
.woocommerce-Tabs-panel ol {
  padding-left: 1.25rem;
}

.woocommerce-product-attributes {
  width: 100%;
  max-width: 36rem;
  border-collapse: collapse;
}

.woocommerce-product-attributes th,
.woocommerce-product-attributes td {
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
  vertical-align: top;
}

.woocommerce-product-attributes th {
  width: 40%;
  font-weight: var(--font-weight-semibold);
}

/* ---------- Related / upsells ---------- */
.related.products,
.upsells.products {
  margin-top: var(--space-9);
}

.related.products > h2,
.upsells.products > h2 {
  margin-bottom: var(--space-6);
  font-size: var(--font-size-2xl);
}
