/* Shared storefront design layer. Kept in S-K Custom so the theme and checkout logic remain untouched. */
:root {
  --sk-store-ink: #293831;
  --sk-store-muted: #65736b;
  --sk-store-green: #506653;
  --sk-store-green-soft: #edf3ee;
  --sk-store-gold: #d9a334;
  --sk-store-gold-soft: #fbf5e8;
  --sk-store-line: #d7e0d9;
  --sk-store-shadow: 0 10px 28px rgba(36, 53, 44, .07);
}

body {
  color: var(--sk-store-ink);
  overflow-x: clip;
}

body :where(#main-container, #main, .site-main, .entry-content, .woocommerce, .woocommerce-page) {
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
}

body :where(.entry-content, .woocommerce) :where(img, video, iframe, table) {
  max-width: 100%;
}

body :where(.entry-content, .woocommerce, .site-main) :where(h1, h2, h3, h4) {
  color: var(--sk-store-ink);
  text-wrap: pretty;
  overflow-wrap: break-word;
}

body :where(.entry-content, .woocommerce, .site-main) :where(p, li) {
  color: var(--sk-store-muted);
  line-height: 1.65;
}

/* Consistent storefront width and comfortable gutters on standard pages. */
body:not(.home):not(.front-page) #main-container > .ct-container,
body:not(.home):not(.front-page) #main-container .site-main > .ct-container,
body:not(.home):not(.front-page) .site-main > .ct-container {
  width: min(100% - 48px, 1440px);
  max-width: 1440px;
  margin-inline: auto;
}

/* Category and search intros: readable copy width instead of narrow columns or stretched text. */
body.woocommerce.archive .term-description,
body.woocommerce.archive .woocommerce-products-header__description,
body.search .archive-description {
  max-width: 1100px;
  margin: 18px auto 30px;
  padding: clamp(20px, 3vw, 34px);
  background: #f5f7f4;
  border: 1px solid var(--sk-store-line);
  border-radius: 14px;
  color: var(--sk-store-muted);
  column-count: initial;
  columns: initial;
}

body.woocommerce.archive .term-description > :first-child,
body.woocommerce.archive .woocommerce-products-header__description > :first-child {
  margin-top: 0;
}

body.woocommerce.archive .term-description > :last-child,
body.woocommerce.archive .woocommerce-products-header__description > :last-child {
  margin-bottom: 0;
}

/* Product listing cards, including category, shop, search, and related products. */
body.woocommerce ul.products,
body.woocommerce-page ul.products {
  display: grid !important;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 20px !important;
  margin-inline: 0 !important;
}

body.woocommerce ul.products::before,
body.woocommerce ul.products::after {
  display: none !important;
}

body.woocommerce ul.products li.product,
body.woocommerce-page ul.products li.product {
  display: flex;
  flex-direction: column;
  float: none !important;
  width: auto !important;
  min-width: 0;
  margin: 0 !important;
  padding: 14px;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--sk-store-line);
  border-radius: 12px;
  box-shadow: 0 3px 12px rgba(36, 53, 44, .035);
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
}

body.woocommerce ul.products li.product:hover,
body.woocommerce-page ul.products li.product:hover {
  transform: translateY(-2px);
  border-color: #b9c9bd;
  box-shadow: var(--sk-store-shadow);
}

body.woocommerce ul.products li.product a img,
body.woocommerce-page ul.products li.product a img {
  width: 100%;
  aspect-ratio: 1.12 / 1;
  object-fit: cover;
  border-radius: 8px;
  background: #f3f5f2;
}

body.woocommerce ul.products li.product .woocommerce-loop-product__title,
body.woocommerce-page ul.products li.product .woocommerce-loop-product__title {
  padding: 8px 0 4px;
  color: var(--sk-store-ink);
  font-size: clamp(15px, 1.05vw, 18px);
  font-weight: 700;
  line-height: 1.35;
}

body.woocommerce ul.products li.product .price,
body.woocommerce-page ul.products li.product .price {
  margin-top: auto;
  padding: 6px 0 10px;
  color: var(--sk-store-ink);
  font-size: 17px;
  font-weight: 750;
}

body.woocommerce ul.products li.product .button,
body.woocommerce-page ul.products li.product .button {
  width: 100%;
  margin-top: auto;
  text-align: center;
}

body.woocommerce span.onsale,
body.woocommerce-page span.onsale {
  min-height: auto;
  min-width: 0;
  padding: 7px 11px;
  color: #3c321d;
  background: #f0c45d;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.2;
}

/* Cohesive buttons and form controls without changing their behavior. */
body :where(.entry-content, .woocommerce) :where(button, .button, input[type="submit"], .wp-element-button) {
  border-radius: 8px;
  font-weight: 700;
  transition: filter .16s ease, transform .16s ease;
}

body :where(.entry-content, .woocommerce) :where(button, .button, input[type="submit"], .wp-element-button):hover {
  filter: brightness(.97);
}

body :where(.woocommerce, .woocommerce-page) :where(input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="password"], select, textarea) {
  max-width: 100%;
  min-height: 46px;
  padding: 10px 13px;
  color: var(--sk-store-ink);
  background-color: #fff;
  border: 1px solid #cbd6ce;
  border-radius: 8px;
  box-shadow: none;
}

body :where(.woocommerce, .woocommerce-page) :where(input, select, textarea):focus {
  outline: 2px solid rgba(217, 163, 52, .28);
  outline-offset: 1px;
  border-color: var(--sk-store-gold);
}

/* Product detail: clear image / information split and a calm purchase panel. */
body.single-product .product.type-product {
  min-width: 0;
}

body.single-product .product .woocommerce-product-gallery,
body.single-product .product .summary {
  min-width: 0;
}

body.single-product .product .woocommerce-product-gallery img {
  border-radius: 12px;
}

body.single-product .product .summary {
  padding: clamp(18px, 2.5vw, 32px);
  background: #fff;
  border: 1px solid var(--sk-store-line);
  border-top: 3px solid var(--sk-store-gold);
  border-radius: 12px;
  box-shadow: var(--sk-store-shadow);
}

body.single-product .product .summary .price {
  color: var(--sk-store-ink);
  font-size: clamp(22px, 2vw, 30px);
  font-weight: 800;
}

body.single-product .product .summary .cart {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* Cart and checkout: readable, centered, and visually grouped. */
body.woocommerce-cart #main-container,
body.woocommerce-checkout #main-container,
body.woocommerce-account #main-container {
  background: #f7f8f5;
}

body.woocommerce-cart .woocommerce,
body.woocommerce-checkout .woocommerce,
body.woocommerce-account .woocommerce {
  width: min(100% - 48px, 1260px);
  margin: 34px auto 60px;
}

body.woocommerce-cart .cart-collaterals,
body.woocommerce-checkout #order_review,
body.woocommerce-checkout #customer_details,
body.woocommerce-account .woocommerce-MyAccount-content,
body.woocommerce-account .woocommerce-MyAccount-navigation {
  padding: clamp(18px, 2vw, 28px);
  background: #fff;
  border: 1px solid var(--sk-store-line);
  border-radius: 12px;
  box-shadow: 0 4px 16px rgba(36, 53, 44, .045);
}

body.woocommerce-checkout #order_review_heading {
  margin-top: 0;
  padding: 18px 22px 0;
  background: #fff;
  border: 1px solid var(--sk-store-line);
  border-bottom: 0;
  border-radius: 12px 12px 0 0;
}

body.woocommerce-checkout #order_review {
  border-radius: 0 0 12px 12px;
}

body.woocommerce :where(.shop_table, .woocommerce-checkout-review-order-table) {
  overflow: hidden;
  border-color: var(--sk-store-line);
  border-radius: 8px;
}

body.woocommerce :where(.shop_table th, .shop_table td) {
  padding: 12px;
}

body.woocommerce .woocommerce-message,
body.woocommerce .woocommerce-info {
  border-top-color: var(--sk-store-green);
  border-radius: 8px;
  background: var(--sk-store-green-soft);
}

body.woocommerce .woocommerce-error {
  border-radius: 8px;
}

/* Keep long product names and checkout controls inside their columns. */
body.woocommerce :where(.product-name, .product-name a, .woocommerce-checkout-review-order-table td, .woocommerce-checkout-review-order-table th) {
  overflow-wrap: anywhere;
}

@media (max-width: 1100px) {
  body.woocommerce ul.products,
  body.woocommerce-page ul.products {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  body:not(.home):not(.front-page) #main-container > .ct-container,
  body:not(.home):not(.front-page) #main-container .site-main > .ct-container,
  body:not(.home):not(.front-page) .site-main > .ct-container {
    width: calc(100% - 32px);
  }

  body.woocommerce.archive .term-description,
  body.woocommerce.archive .woocommerce-products-header__description,
  body.search .archive-description {
    margin: 14px 0 22px;
    padding: 18px;
    border-radius: 10px;
  }

  body.woocommerce ul.products,
  body.woocommerce-page ul.products {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px !important;
  }

  body.woocommerce ul.products li.product,
  body.woocommerce-page ul.products li.product {
    padding: 9px;
    border-radius: 10px;
  }

  body.woocommerce ul.products li.product .woocommerce-loop-product__title,
  body.woocommerce-page ul.products li.product .woocommerce-loop-product__title {
    font-size: 14px;
  }

  body.woocommerce ul.products li.product .price,
  body.woocommerce-page ul.products li.product .price {
    font-size: 15px;
  }

  body.woocommerce-cart .woocommerce,
  body.woocommerce-checkout .woocommerce,
  body.woocommerce-account .woocommerce {
    width: calc(100% - 28px);
    margin: 20px auto 38px;
  }

  body.woocommerce-cart .cart-collaterals,
  body.woocommerce-checkout #order_review,
  body.woocommerce-checkout #customer_details,
  body.woocommerce-account .woocommerce-MyAccount-content,
  body.woocommerce-account .woocommerce-MyAccount-navigation {
    padding: 16px;
  }

  body.single-product .product .summary {
    padding: 18px;
  }
}

@media (max-width: 480px) {
  body.woocommerce ul.products,
  body.woocommerce-page ul.products {
    grid-template-columns: minmax(0, 1fr);
  }

  body.woocommerce ul.products li.product,
  body.woocommerce-page ul.products li.product {
    display: grid;
    grid-template-columns: minmax(88px, 34%) minmax(0, 1fr);
    column-gap: 12px;
    align-items: start;
  }

  body.woocommerce ul.products li.product > a:first-of-type,
  body.woocommerce-page ul.products li.product > a:first-of-type {
    grid-row: span 3;
    min-width: 0;
  }

  body.woocommerce ul.products li.product a img,
  body.woocommerce-page ul.products li.product a img {
    aspect-ratio: 1 / 1;
    margin: 0;
  }

  body.woocommerce ul.products li.product .woocommerce-loop-product__title,
  body.woocommerce-page ul.products li.product .woocommerce-loop-product__title,
  body.woocommerce ul.products li.product .price,
  body.woocommerce-page ul.products li.product .price,
  body.woocommerce ul.products li.product .button,
  body.woocommerce-page ul.products li.product .button {
    grid-column: 2;
  }

  body.woocommerce :where(.shop_table, .woocommerce-checkout-review-order-table) {
    font-size: 13px;
  }

  body.woocommerce :where(.shop_table th, .shop_table td) {
    padding: 8px 6px;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.woocommerce ul.products li.product,
  body :where(.entry-content, .woocommerce) :where(button, .button, input[type="submit"], .wp-element-button) {
    transition: none;
  }
}
