/* =============================================================
   LODGE MILANO & CO — WOOCOMMERCE STYLES
============================================================= */

/* ---- Shop Wrapper ---- */
.lmc-shop-wrapper { padding: 3rem 0 5rem; }

/* ---- WooCommerce Notices ---- */
.woocommerce-message,
.woocommerce-info,
.woocommerce-error {
  padding: 1rem 1.5rem;
  border-left: 3px solid var(--black);
  background: var(--off-white);
  font-size: 0.875rem;
  list-style: none;
  margin-bottom: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.woocommerce-error { border-color: #c0392b; }
.woocommerce-info { border-color: var(--gold); }
.woocommerce-message a.button,
.woocommerce-info a.button {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1.25rem;
  background: var(--black);
  color: var(--white);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  transition: background 0.2s ease;
}
.woocommerce-message a.button:hover { background: var(--dark-gray); }

/* ---- Products Grid ---- */
ul.products {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem 1.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
/* Kill WC woocommerce-layout.css clearfix pseudos: in a grid container they
   are placed as items and consume the first/last cells, pushing real cards
   out of column 1. We don't need them — grid handles layout. */
body.woocommerce ul.products::before,
body.woocommerce ul.products::after,
body.woocommerce-page ul.products::before,
body.woocommerce-page ul.products::after {
  content: none !important;
  display: none !important;
}
ul.products li.product {
  position: relative;
}
/* Reset WC woocommerce-layout.css defaults (width: 22.05%; float: left)
   that, inside our CSS Grid container, collapse cells to ~22% of the
   track (~56px) and break the related-products row on single product.
   Must out-specify WC's `.woocommerce ul.products li.product` (0,3,2). */
body.woocommerce ul.products li.product,
body.woocommerce-page ul.products li.product {
  float: none;
  width: auto;
  max-width: 100%;
  margin: 0;
}
/* Image — keep BG's native 1:1 asset, contain over off-white background.
   The 3:4 + cover combo cropped accessories like straps off-axis and
   was the main reason cards "didn't look right" in related-products. */
ul.products li.product a img {
  aspect-ratio: 1/1;
  object-fit: contain;
  background: var(--off-white);
  width: 100%;
  transition: transform 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
ul.products li.product:hover a img { transform: scale(1.03); }
ul.products li.product .woocommerce-loop-product__title {
  font-family: var(--font-serif);
  font-size: 1.0625rem;
  font-weight: 400;
  line-height: 1.3;
  color: var(--text);
  margin: 1rem 0 0.375rem;
  padding: 0;
  /* Keep titles to a single line so the vertical rhythm between cards
     stays clean. The full name remains accessible via the link's
     aria-label and the image alt. */
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}
ul.products li.product .price {
  font-size: 0.875rem;
  color: var(--text);
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}
ul.products li.product .price del {
  color: var(--text-muted);
  font-size: 0.75rem;
  margin-right: 0;
}
ul.products li.product .price ins {
  text-decoration: none;
  color: var(--text);
  font-weight: 500;
}

/* CTA — hidden by default on devices that can hover with a fine pointer;
   reveals beneath the price on card hover. On touch devices the whole
   card is the tap target, so we hide the button entirely there. */
ul.products li.product .button {
  display: block;
  width: 100%;
  padding: 0.75rem;
  margin-top: 0.875rem;
  background: var(--black);
  color: var(--white);
  border: none;
  font-family: var(--font-sans);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  text-align: center;
  cursor: pointer;
  transition: background 0.2s ease;
}
ul.products li.product .button:hover { background: var(--dark-gray); }
@media (hover: hover) and (pointer: fine) {
  ul.products li.product .button {
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.25s ease, transform 0.25s ease, background 0.2s ease;
    pointer-events: none;
  }
  ul.products li.product:hover .button,
  ul.products li.product:focus-within .button {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
  }
}
@media (hover: none) {
  ul.products li.product .button { display: none; }
}

/* Sale badge — flat tag, no pill. Black on neutral overlay reads as
   editorial; gold pills read as e-commerce template. */
ul.products li.product .onsale,
.woocommerce-badge--onsale {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  background: transparent;
  color: var(--black);
  font-family: var(--font-sans);
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0;
  border-radius: 0;
  min-height: auto;
  line-height: 1;
  z-index: 2;
}

/* ---- Single Product ---- */
.single-product div.product {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5rem;
  align-items: start;
  padding: 3rem 0 5rem;
}

/* Override WooCommerce default float/width — children must fill grid cell.
   WC's `.woocommerce` class lives on <body>, not on a wrapper, so the
   selector must use `body.woocommerce` (single-element scope), not
   `body .woocommerce` (which expects a descendant). */
body.woocommerce.single-product div.product > div.images,
body.woocommerce.single-product div.product > .woocommerce-product-gallery,
body.woocommerce.single-product div.product > div.summary,
body.woocommerce.single-product div.product > .summary.entry-summary,
body.woocommerce.single-product div.product > .woocommerce-tabs,
body.woocommerce.single-product div.product > .related,
body.woocommerce.single-product div.product > .upsells {
  float: none !important;
  width: 100% !important;
  max-width: 100% !important;
  margin-bottom: 0;
  clear: none;
}

/* WC (and some plugins) ship `position: sticky` on the product summary so
   it pins as the gallery scrolls. In a CSS Grid that has a tall related
   section in row 3, the summary stays stuck and visually overlaps the
   related cards. Force static positioning. */
body.woocommerce.single-product div.product > div.summary,
body.woocommerce.single-product div.product > .summary.entry-summary {
  position: static !important;
}

/* Tabs and related products span the full row, not just one grid column */
body.woocommerce.single-product div.product > .woocommerce-tabs,
body.woocommerce.single-product div.product > .related,
body.woocommerce.single-product div.product > .upsells {
  grid-column: 1 / -1;
  margin-top: 3rem;
}

/* The .onsale badge is a direct child of .product. In a CSS Grid it
   would consume the first cell and push gallery/summary out of place.
   Take it out of the grid flow and float it over the gallery. */
body.woocommerce.single-product div.product > .onsale {
  position: absolute;
  z-index: 6;
  margin: 1rem 0 0 1rem;
  padding: 0.35rem 0.75rem;
  background: var(--black);
  color: var(--white);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  line-height: 1;
}
body.woocommerce.single-product div.product { position: relative; }

/* Gallery — let WC's FlexSlider handle the carousel; we just style.
   Wrapper is set by JS to width = N * slide_width and clipped by
   .flex-viewport. We must NOT apply display:grid to the wrapper or
   we break the carousel. */
.woocommerce-product-gallery {
  position: relative;
  width: 100%;
  max-width: 100%;
}
.woocommerce-product-gallery .flex-viewport {
  width: 100%;
  margin: 0;
  background: var(--off-white);
  aspect-ratio: 1/1;
  overflow: hidden;
}
.woocommerce-product-gallery__image {
  width: 100%;
}
.woocommerce-product-gallery__image > a,
.woocommerce-product-gallery__image > a > img,
.woocommerce-product-gallery__image > img,
.flex-viewport .wp-post-image {
  display: block;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover;
  margin: 0;
}

/* Thumbnails: horizontal row below the main slide */
.flex-control-thumbs {
  display: flex !important;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
}
.flex-control-thumbs li {
  flex: 0 0 calc((100% - 1.5rem) / 4);
  margin: 0;
}
.flex-control-thumbs li img {
  display: block;
  width: 100%;
  aspect-ratio: 1/1;
  object-fit: cover;
  cursor: pointer;
  opacity: 0.5;
  transition: opacity 0.2s ease;
  border: 1px solid transparent;
}
.flex-control-thumbs li img.flex-active,
.flex-control-thumbs li img:hover {
  opacity: 1;
  border-color: var(--black);
}

/* Magnifier trigger top-right */
.woocommerce-product-gallery__trigger {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  z-index: 5;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  text-decoration: none;
  font-size: 1rem;
}

/* Product summary */
.summary.entry-summary {}
.woocommerce-product-details__short-description + * {}

.product_title {
  font-family: var(--font-serif);
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  font-weight: 300;
  line-height: 1.2;
  margin-bottom: 0.5rem;
  color: var(--text);
}
.product__brand {
  font-size: 0.625rem;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 0.25rem;
}
.woocommerce-product-rating {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1.25rem;
}
.star-rating {
  font-size: 0.875rem;
  color: var(--gold);
  letter-spacing: 0.1em;
}
.price {
  font-family: var(--font-serif);
  font-size: 1.625rem;
  font-weight: 300;
  color: var(--text);
  margin-bottom: 1.5rem;
  display: block;
}
.price del {
  font-size: 1.25rem;
  color: var(--mid-gray);
  margin-right: 0.5rem;
}
.price ins { text-decoration: none; color: var(--gold); }

/* Variations */
.variations {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.25rem;
}
.variations td, .variations th {
  padding: 0.5rem 0;
  vertical-align: middle;
}
.variations .label label {
  font-size: 0.625rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.variations select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  font-family: var(--font-sans);
  font-size: 0.875rem;
  background: var(--white);
  outline: none;
  cursor: pointer;
  -webkit-appearance: none;
}
.woocommerce-variation-price .price { font-size: 1.375rem; }

/* Add to cart */
form.cart {
  display: flex;
  gap: 1rem;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 1.5rem;
}
.quantity input[type="number"] {
  width: 64px;
  height: 52px;
  text-align: center;
  border: 1px solid var(--border);
  font-family: var(--font-sans);
  font-size: 1rem;
  background: var(--white);
  outline: none;
  -webkit-appearance: none;
}
.single_add_to_cart_button {
  flex: 1;
  padding: 1rem 2rem;
  background: var(--black);
  color: var(--white);
  border: none;
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease;
  min-width: 200px;
}
.single_add_to_cart_button:hover { background: var(--dark-gray); }
.single_add_to_cart_button.loading::after {
  content: '';
  display: inline-block;
  width: 12px;
  height: 12px;
  border: 1.5px solid var(--white);
  border-top-color: transparent;
  border-radius: 50%;
  animation: spin 0.6s linear infinite;
  margin-left: 0.5rem;
  vertical-align: middle;
}

/* Product meta */
.product_meta {
  padding-top: 1.5rem;
  border-top: 1px solid var(--border);
  margin-top: 1.5rem;
}
.product_meta > span {
  display: block;
  font-size: 0.75rem;
  color: var(--text-muted);
  margin-bottom: 0.3rem;
}
.product_meta > span a { color: var(--text); }
.product_meta > span a:hover { color: var(--gold); }

/* Tabs */
.woocommerce-tabs {
  margin-top: 5rem;
  padding-top: 3rem;
  border-top: 1px solid var(--border);
}
.wc-tabs {
  display: flex;
  gap: 0;
  list-style: none;
  border-bottom: 1px solid var(--border);
  margin-bottom: 2.5rem;
}
.wc-tabs li a {
  display: block;
  padding: 0.875rem 2rem 0.875rem 0;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.wc-tabs li.active a,
.wc-tabs li a:hover {
  color: var(--text);
  border-bottom-color: var(--black);
}
.woocommerce-Tabs-panel { font-size: 0.9375rem; line-height: 1.75; color: var(--dark-gray); }
.woocommerce-Tabs-panel h2 { font-size: 1.375rem; margin-bottom: 1rem; }
.woocommerce-Tabs-panel table {
  width: 100%;
  border-collapse: collapse;
}
.woocommerce-Tabs-panel table th,
.woocommerce-Tabs-panel table td {
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}
.woocommerce-Tabs-panel table th {
  font-weight: 500;
  text-align: left;
  color: var(--text-muted);
  width: 35%;
}

/* Related products — editorial cross-sell, not a re-skinned shop row.
   Headline is metainformation: keep serif for the product itself. */
.related.products,
.upsells.products {
  margin-top: 5rem;
  padding-top: 4rem;
  border-top: 1px solid var(--border);
}
.related.products > h2,
.upsells.products > h2 {
  font-family: var(--font-sans);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text);
  margin: 0 0 2.5rem;
  padding: 0;
  border: 0;
}
.related.products ul.products,
.upsells.products ul.products {
  gap: 2.5rem 1.5rem;
}

/* ---- Cart ---- */
.woocommerce-cart .woocommerce {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 4rem;
  align-items: start;
  padding: 3rem 0 5rem;
}
.woocommerce-cart-form table.cart {
  width: 100%;
  border-collapse: collapse;
}
.woocommerce-cart-form table.cart td {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}
.woocommerce-cart-form .cart_item .product-thumbnail img {
  width: 80px;
  height: 100px;
  object-fit: cover;
}
.woocommerce-cart-form .cart_item .product-name a {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--text);
}
.woocommerce-cart-form .cart_item .product-name a:hover { color: var(--gold); }
.woocommerce-cart-form .cart_item .product-price,
.woocommerce-cart-form .cart_item .product-subtotal {
  font-size: 0.9375rem;
}
.woocommerce-cart-form .cart_item a.remove {
  font-size: 1.25rem;
  color: var(--mid-gray);
  line-height: 1;
  transition: color 0.2s ease;
}
.woocommerce-cart-form .cart_item a.remove:hover { color: var(--black); }

.cart-collaterals { }
.cart_totals {
  background: var(--off-white);
  padding: 2rem;
}
.cart_totals h2 {
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}
.cart_totals table {
  width: 100%;
  border-collapse: collapse;
  margin-bottom: 1.5rem;
}
.cart_totals table th,
.cart_totals table td {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}
.cart_totals table th { color: var(--text-muted); font-weight: 400; }
.cart_totals .order-total th,
.cart_totals .order-total td { font-weight: 600; border-bottom: none; }
.cart_totals .wc-proceed-to-checkout a {
  display: block;
  width: 100%;
  padding: 1rem;
  background: var(--black);
  color: var(--white);
  text-align: center;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  transition: background 0.2s ease;
}
.cart_totals .wc-proceed-to-checkout a:hover { background: var(--dark-gray); }

/* ---- Checkout ---- */
.woocommerce-checkout .woocommerce {
  padding: 3rem 0 5rem;
}
#customer_details {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
}
.woocommerce-checkout #payment {
  background: var(--off-white);
  padding: 2rem;
  margin-top: 2rem;
}
.woocommerce-checkout #payment ul.payment_methods {
  list-style: none;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
}
.woocommerce-checkout #payment ul.payment_methods li label {
  font-size: 0.875rem;
  cursor: pointer;
}
.woocommerce-checkout #payment .place-order .button {
  width: 100%;
  padding: 1.125rem;
  background: var(--black);
  color: var(--white);
  border: none;
  font-family: var(--font-sans);
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s ease;
}
.woocommerce-checkout #payment .place-order .button:hover { background: var(--dark-gray); }

/* ---- Account ---- */
.woocommerce-MyAccount-navigation {
  width: 240px;
  flex-shrink: 0;
}
.woocommerce-MyAccount-navigation ul {
  list-style: none;
  border: 1px solid var(--border);
}
.woocommerce-MyAccount-navigation ul li a {
  display: block;
  padding: 0.875rem 1.25rem;
  font-size: 0.8125rem;
  color: var(--text);
  border-bottom: 1px solid var(--border);
  transition: all 0.2s ease;
}
.woocommerce-MyAccount-navigation ul li:last-child a { border-bottom: none; }
.woocommerce-MyAccount-navigation ul li.is-active a,
.woocommerce-MyAccount-navigation ul li a:hover {
  background: var(--black);
  color: var(--white);
  padding-left: 1.75rem;
}
.woocommerce-account .woocommerce {
  display: flex;
  gap: 4rem;
  align-items: flex-start;
  padding: 3rem 0 5rem;
}
.woocommerce-MyAccount-content { flex: 1; }

/* Responsive WooCommerce */
@media (max-width: 1280px) {
  ul.products { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 1024px) {
  /* 2-up at tablet, not 3 — 3 cards at 768–1024 collapses to ~240px each
     and reproduces the "cramped" feel the related grid was designed
     against. Better to ship two well-spaced cards. */
  ul.products { grid-template-columns: repeat(2, 1fr); gap: 2rem 1.5rem; }
  .single-product div.product { grid-template-columns: 1fr; gap: 2rem; }
  .woocommerce-product-gallery { position: relative; top: 0; }
  .woocommerce-cart .woocommerce { grid-template-columns: 1fr; }
  #customer_details { grid-template-columns: 1fr; }
  .woocommerce-account .woocommerce { flex-direction: column; }
  .woocommerce-MyAccount-navigation { width: 100%; }
}
@media (max-width: 768px) {
  ul.products { grid-template-columns: repeat(2, 1fr); gap: 2rem 1rem; }
  .related.products ul.products,
  .upsells.products ul.products { gap: 2rem 1rem; }
  .woocommerce-product-gallery__wrapper { grid-template-columns: 1fr; }
  .flex-control-thumbs { grid-column: auto; flex-direction: row; overflow-x: auto; }
  .woocommerce-cart-form table thead { display: none; }
  .woocommerce-cart-form table tr,
  .woocommerce-cart-form table td { display: block; }
}
