/*
 * ecommerce.css — TCB Elementor Theme
 * Shop, product detail, bag dialog, cart, checkout, empty & confirmation pages.
 * WooCommerce wrapper overrides scoped to .woocommerce.
 * Scoped to avoid conflicts with Elementor.
 */

/* ══════════════════════════════════════════════════════════════════════════
   PAGE SHELL
   ══════════════════════════════════════════════════════════════════════════ */

.page-shell {
  padding: 48px 4.5% 80px;
  max-width: var(--content-width);
  margin-inline: auto;
}

/* ─── Page Heading ───────────────────────────────────────────────────────── */
.page-heading {
  margin-bottom: 38px;
}

.page-heading h1 {
  font-size: clamp(28px, 3.5vw, 52px);
  letter-spacing: -2px;
  margin: 10px 0 0;
}

/* These are also in base.css for reuse, repeated here for page context */
.page-eyebrow {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.9px;
  color: var(--muted);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.page-description {
  font-size: 13px;
  line-height: 1.85;
  color: var(--muted);
  max-width: 520px;
  margin-top: 12px;
}

/* ─── Page Back Link ─────────────────────────────────────────────────────── */
.page-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-bottom: 20px;
  font-size: 14px;
  font-weight: 600;
  color: var(--green, #344536);
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ══════════════════════════════════════════════════════════════════════════
   SHOP PAGE
   ══════════════════════════════════════════════════════════════════════════ */

.shop-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

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

/* ══════════════════════════════════════════════════════════════════════════
   PRODUCT DETAIL PAGE
   ══════════════════════════════════════════════════════════════════════════ */

.product-page {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: clamp(24px, 5vw, 76px);
  align-items: start;
}

/* ─── Product Gallery ────────────────────────────────────────────────────── */
.product-gallery,
.detail-gallery {
  min-width: 0;
  position: relative;
}

.product-gallery > img,
.product-gallery > picture img,
.product-gallery .product-main-image,
#detail-image {
  display: block;
  width: 100%;
  max-height: 780px;
  aspect-ratio: 3 / 3.8;
  object-fit: cover;
  object-position: center top;
  background: #eeede8;
}

/* ─── Thumbnails ─────────────────────────────────────────────────────────── */
.product-thumbnails,
.thumbnails {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.product-thumbnails button,
.thumbnails button {
  width: 68px;
  min-width: 44px;
  min-height: 68px;
  padding: 2px;
  border: 1px solid var(--line, #dddfd6);
  background: #fff;
  cursor: pointer;
  border-radius: 0;
  transition: border-color 0.15s ease;
}

.product-thumbnails button:is(.selected, .active, [aria-pressed="true"]),
.thumbnails button:is(.selected, .active, [aria-pressed="true"]) {
  border-color: var(--green, #344536);
}

.product-thumbnails img,
.thumbnails img {
  display: block;
  width: 100%;
  height: 62px;
  object-fit: cover;
  object-position: center top;
}

/* ─── Product Summary ────────────────────────────────────────────────────── */
.product-summary,
.detail-copy {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.product-summary h1,
.detail-copy h1,
.product-summary .page-title {
  font-size: clamp(30px, 3vw, 48px);
  line-height: 1.2;
  letter-spacing: -.05em;
  margin: 12px 0 18px;
}

.product-summary p,
.detail-copy p,
.product-summary .product-description {
  margin-block: 16px;
  color: var(--muted, #71766d);
  font-size: 15px;
  line-height: 1.8;
}

.detail-price {
  display: flex;
  align-items: center;
  gap: 13px;
  font-size: 24px;
  font-weight: 600;
  color: #262d26;
  margin: 10px 0 16px;
  flex-wrap: wrap;
}

.detail-price del,
.detail-price del .woocommerce-Price-amount {
  font-size: 15px;
  color: #93958b;
  font-weight: 400;
  text-decoration: line-through;
}

.detail-price .sale-price,
.detail-price ins,
.detail-price .regular-price,
.detail-price .woocommerce-Price-amount {
  font-size: 24px;
  font-weight: 600;
  color: #262d26;
}

.detail-price ins {
  text-decoration: none;
}

/* ─── Product Option (swatches / selectors) ──────────────────────────────── */
.size-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
  margin-top: 24px;
  margin-bottom: 12px;
}

.size-heading span {
  color: #7a8071;
  font-weight: 400;
}

.size-options {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 8px;
}

.size-options button {
  min-width: 44px;
  height: 42px;
  padding: 0 14px;
  border: 1px solid #bfc6b8;
  background: #fff;
  color: #262d26;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0;
  transition: all 0.15s ease;
}

.size-options button:hover:not(:disabled) {
  border-color: var(--green, #344536);
}

.size-options button:is(.selected, [aria-pressed="true"]) {
  background: var(--green, #344536);
  color: #fff;
  border-color: var(--green, #344536);
}

.size-options button:disabled {
  text-decoration: line-through;
  opacity: 0.35;
  cursor: not-allowed;
  border-color: #dddfd6;
}

.size-error {
  color: #9e432e;
  min-height: 16px;
  margin: 6px 0 14px;
  font-size: 12px;
}

/* ─── Quantity ───────────────────────────────────────────────────────────── */
.quantity-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  margin: 20px 0 9px;
  color: #262d26;
}

#product-quantity {
  display: block;
  width: 84px;
  height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--line, #dddfd6);
  border-radius: 0;
  background: #fff;
  font-size: 15px;
  color: #262d26;
  margin-bottom: 18px;
  box-sizing: border-box;
}

#product-quantity:focus {
  outline: 2px solid var(--green, #344536);
  outline-offset: -1px;
}

/* ─── Add to Bag Button ──────────────────────────────────────────────────── */
#add-to-bag.button,
#add-to-bag {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 52px;
  padding: 14px 20px;
  background: var(--green, #344536);
  border: 1px solid var(--green, #344536);
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .03em;
  text-decoration: none;
  cursor: pointer;
  border-radius: 0;
  box-sizing: border-box;
  transition: background 0.2s ease, border-color 0.2s ease;
}

#add-to-bag:hover:not(:disabled) {
  background: #233025;
  border-color: #233025;
}

#add-to-bag:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#add-to-bag span {
  font-size: 18px;
  font-weight: 300;
  line-height: 1;
}

/* ─── Save Product (wishlist on detail page) ─────────────────────────────── */
.save-product.save-button {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin: 16px 0 20px;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  color: var(--green, #344536);
}

.save-product.save-button:hover {
  opacity: 0.8;
}

.save-product.save-button svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  fill: none;
  transition: fill 0.2s ease, stroke 0.2s ease;
}

.save-product.save-button:is(.is-saved, [aria-pressed="true"]) svg {
  fill: #9e432e;
  stroke: #9e432e;
}

/* ─── Full Description / Accordion ──────────────────────────────────────── */
details.product-details-accordion {
  border-top: 1px solid var(--line, #dddfd6);
  border-bottom: 1px solid var(--line, #dddfd6);
  margin: 14px 0 24px;
  font-size: 12px;
}

details.product-details-accordion summary {
  cursor: pointer;
  padding: 16px 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: #262d26;
  list-style: none;
  user-select: none;
}

details.product-details-accordion summary::-webkit-details-marker {
  display: none;
}

details.product-details-accordion summary::after {
  content: '+';
  font-size: 20px;
  font-weight: 300;
  line-height: 1;
  color: var(--muted, #71766d);
}

details.product-details-accordion[open] summary::after {
  content: '−';
}

details.product-details-accordion .full-description {
  white-space: pre-line;
  max-height: 280px;
  overflow-y: auto;
  font-size: 12px;
  line-height: 1.85;
  color: #6b7261;
  padding-bottom: 20px;
  border-top: none;
  margin-top: 0;
}

/* ══════════════════════════════════════════════════════════════════════════
   MINI BAG DIALOG
   ══════════════════════════════════════════════════════════════════════════ */

.bag-dialog {
  position: fixed;
  inset: 0 0 0 auto;
  width: min(420px, 100vw);
  margin: 0;
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}

.bag-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px;
  border-bottom: 1px solid var(--line);
  flex-shrink: 0;
}

.bag-heading h2 {
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
}

.bag-list {
  flex: 1;
  overflow-y: auto;
  padding: 0 24px;
}

.bag-item {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 16px;
  padding: 20px 0;
  border-bottom: 1px solid var(--line);
}

.bag-item img {
  width: 88px;
  height: 110px;
  object-fit: cover;
}

.bag-item-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.bag-item-details h3 {
  font-size: 13px;
  font-weight: 500;
}

.bag-item-details small {
  font-size: 10px;
  color: var(--muted);
}

.bag-item-details .price {
  font-size: 12px;
  margin-top: auto;
}

.bag-item-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 8px;
}

.bag-item-actions button {
  font-size: 10px;
  color: var(--muted);
  padding: 0;
  border-bottom: 1px solid var(--line);
}

.bag-summary {
  padding: 20px 24px 28px;
  border-top: 1px solid var(--line);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.bag-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}

.bag-summary-row.total {
  font-size: 14px;
  font-weight: 600;
  border-top: 1px solid var(--line);
  padding-top: 12px;
  margin-top: 4px;
}

.bag-summary .button {
  width: 100%;
  justify-content: space-between;
  margin-top: 4px;
}

/* ══════════════════════════════════════════════════════════════════════════
   CART PAGE
   ══════════════════════════════════════════════════════════════════════════ */

.cart-page {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 40px 5%;
  align-items: start;
}

.cart-list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
}

.cart-line {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  gap: 20px;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
  align-items: start;
}

.cart-line img {
  width: 100px;
  height: 126px;
  object-fit: cover;
}

.cart-line-details {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.cart-line-details h3 {
  font-size: 13px;
  font-weight: 500;
}

.cart-line-details small {
  font-size: 10px;
  color: var(--muted);
}

.cart-line-price {
  font-size: 13px;
  text-align: right;
  white-space: nowrap;
}

.cart-line-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 12px;
}

.cart-line-actions button {
  font-size: 10px;
  color: var(--muted);
  padding: 0;
  border-bottom: 1px solid var(--line);
}

/* ══════════════════════════════════════════════════════════════════════════
   ORDER SUMMARY
   ══════════════════════════════════════════════════════════════════════════ */

.order-summary {
  background: var(--bg-order-summary);
  padding: 28px 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  position: sticky;
  top: 110px;
}

.order-summary h2 {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
  margin-bottom: 6px;
}

.order-summary-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
}

.order-summary-row.total {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  border-top: 1px solid var(--line);
  padding-top: 14px;
  margin-top: 6px;
}

.order-summary .button {
  width: 100%;
  justify-content: space-between;
  margin-top: 6px;
}

/* ─── Promo Code ─────────────────────────────────────────────────────────── */
.promo-row {
  display: flex;
  gap: 8px;
}

.promo-row input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  padding: 11px 13px;
  font-size: 12px;
  background: white;
}

.promo-row button {
  font-size: 11px;
  padding: 11px 16px;
  border: 1px solid var(--line);
}

/* ══════════════════════════════════════════════════════════════════════════
   CHECKOUT PAGE
   ══════════════════════════════════════════════════════════════════════════ */

.checkout-page {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 40px 5%;
  align-items: start;
}

.checkout-form {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.checkout-section-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  border-bottom: 1px solid var(--line);
  padding-bottom: 10px;
  margin-bottom: 16px;
}

/* ─── Checkout Fields Grid ───────────────────────────────────────────────── */
.checkout-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
}

.checkout-fields .full-width {
  grid-column: 1 / -1;
}

/* ─── Form Field ─────────────────────────────────────────────────────────── */
.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-field label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.5px;
  color: var(--muted);
}

.form-field input,
.form-field select {
  border: 1px solid var(--line);
  padding: 13px 14px;
  font-size: 13px;
  background: white;
  width: 100%;
  border-radius: 1px;
}

.form-field input:focus,
.form-field select:focus {
  outline: 2px solid #72834b;
  outline-offset: 2px;
  border-color: transparent;
}

/* ─── Notice (inline form notices) ──────────────────────────────────────── */
.notice {
  padding: 14px 18px;
  font-size: 12px;
  line-height: 1.6;
  border-radius: 2px;
  margin-bottom: 18px;
}

.notice.info {
  background: #eef1e8;
  border-left: 3px solid var(--green);
  color: #3e4b35;
}

.notice.success {
  background: #eaf0e5;
  border-left: 3px solid #5b7246;
  color: #3a4f30;
}

.notice.error {
  background: #f9eded;
  border-left: 3px solid #b94040;
  color: #7a2a2a;
}

/* ══════════════════════════════════════════════════════════════════════════
   EMPTY PAGE
   ══════════════════════════════════════════════════════════════════════════ */

.empty-page {
  text-align: center;
  padding: 80px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  max-width: 440px;
  margin-inline: auto;
}

.empty-page svg {
  width: 56px;
  height: 56px;
  color: var(--muted);
}

.empty-page h2 {
  font-size: 26px;
  letter-spacing: -1px;
}

.empty-page p {
  font-size: 13px;
  line-height: 1.8;
  color: var(--muted);
}

.empty-page .button {
  margin-top: 8px;
}

/* ══════════════════════════════════════════════════════════════════════════
   ORDER CONFIRMATION PAGE
   ══════════════════════════════════════════════════════════════════════════ */

.confirmation-page {
  max-width: 660px;
  margin-inline: auto;
  text-align: center;
  padding: 60px 24px 80px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.confirmation-page .check-icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #e9f0e4;
  display: grid;
  place-items: center;
}

.confirmation-page .check-icon svg {
  width: 26px;
  height: 26px;
  stroke: var(--green);
}

.confirmation-page h1 {
  font-size: clamp(26px, 3vw, 38px);
  letter-spacing: -2px;
  margin: 0;
}

.confirmation-page p {
  font-size: 13px;
  line-height: 1.8;
  color: var(--muted);
  max-width: 380px;
}

.order-detail-table {
  width: 100%;
  text-align: left;
  background: var(--bg-order-summary);
  padding: 24px 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 8px;
}

.order-detail-row {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
}

.order-detail-row dt {
  color: var(--muted);
}

.order-detail-row dd {
  font-weight: 500;
  margin: 0;
}

/* ══════════════════════════════════════════════════════════════════════════
   WOOCOMMERCE WRAPPER OVERRIDES
   ══════════════════════════════════════════════════════════════════════════ */

/* Reset WC breadcrumb to minimal style */
.woocommerce .woocommerce-breadcrumb {
  font-size: 10px;
  color: var(--muted);
  margin-bottom: 20px;
  padding: 0;
  background: none;
}

.woocommerce .woocommerce-breadcrumb a {
  color: var(--muted);
}

.woocommerce .woocommerce-breadcrumb a:hover {
  color: var(--text);
  opacity: 1;
}

/* Strip WC default page padding / margins that conflict with .page-shell */
.woocommerce .woocommerce-page,
.woocommerce-page .woocommerce {
  padding: 0;
  margin: 0;
}

/* WC notices already styled via components.css — ensure list resets */
.woocommerce .woocommerce-error,
.woocommerce .woocommerce-message,
.woocommerce .woocommerce-info {
  padding: 14px 18px;
  font-size: 12px;
  line-height: 1.6;
  border-radius: 2px;
  margin-bottom: 18px;
  list-style: none;
}

.woocommerce .woocommerce-info {
  background: #eef1e8;
  border-top-color: var(--green);
}

.woocommerce .woocommerce-message {
  background: #eaf0e5;
  border-top-color: #5b7246;
}

.woocommerce .woocommerce-error {
  background: #f9eded;
  border-top-color: #b94040;
}

/* WC shop loop uses .products ul — normalize to our grid */
.woocommerce ul.products {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 36px 23px;
  list-style: none;
  margin: 0;
  padding: 0;
}

/* Neutralize WC button defaults to inherit our .button styles */
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button {
  background: none;
  border-radius: 0;
  padding: 0;
  font-size: inherit;
  font-weight: inherit;
  color: inherit;
  letter-spacing: inherit;
}

/* ─── Single Product Overrides & Cleanup ──────────────────────────────────── */
.single-product .woocommerce-breadcrumb,
.single-product .woocommerce-tabs,
.single-product .product_meta,
.single-product .related.products,
.single-product .upsells.products,
.single-product .woocommerce-product-gallery {
  display: none !important;
}

.single-product .tcb-content-area,
.single-product .page-shell {
  width: min(91%, var(--content-width, 1440px));
  margin-inline: auto;
}

@media (max-width: 760px) {
  .product-page {
    grid-template-columns: minmax(0, 1fr);
    gap: 26px;
  }
  .product-gallery > img,
  .product-gallery > picture img,
  .product-gallery .product-main-image,
  #detail-image {
    max-height: 640px;
  }
}

@media (max-width: 360px) {
  .product-thumbnails button,
  .thumbnails button {
    width: 56px;
    min-height: 56px;
  }
  .product-thumbnails img,
  .thumbnails img {
    height: 50px;
  }
}

