/**
 * cart-edit-sizes.css — styling for a configured cart line on the WooCommerce
 * (classic shortcode) cart page: the front/back design previews, collar line,
 * and the editable size grid rendered by WC3D_Cart_Display::render_design_summary().
 *
 * Everything is scoped under .wc3d-cart-design-summary so it cannot bleed into
 * the surrounding theme, and key properties are specific enough to win against
 * WooCommerce/Storefront input defaults (e.g. the theme coloring number inputs).
 */

/* Full-width row the summary is relocated into (cart-edit-sizes.js) so it
   spans every cart column instead of the narrow product-name cell. */
.wc3d-cart-summary-row > .wc3d-cart-summary-cell {
  padding: 0 0 18px;
  border-top: 0;
  background: transparent;
}

.wc3d-cart-design-summary {
  box-sizing: border-box;
  width: 100%;
  margin-top: 12px;
  padding: 16px 18px;
  border: 1px solid #e7e9ee;
  border-radius: 12px;
  background: #fbfcfe;
}
.wc3d-cart-design-summary *,
.wc3d-cart-design-summary *::before,
.wc3d-cart-design-summary *::after { box-sizing: border-box; }

/* ── Two-column body: preview rail (left) + size grid (right) ───────────── */
.wc3d-cart-design-summary .wc3d-summary-body {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 16px 20px;
}
.wc3d-cart-design-summary .wc3d-summary-aside {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* ── Front / back previews — stacked in the narrow left rail ────────────── */
.wc3d-cart-design-summary .wc3d-cart-previews {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
}
.wc3d-cart-design-summary .wc3d-cart-preview {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  color: inherit;
  text-decoration: none;
  cursor: zoom-in;
}
.wc3d-cart-design-summary a.wc3d-cart-preview:hover,
.wc3d-cart-design-summary a.wc3d-cart-preview:focus {
  text-decoration: none;
  outline: none;
}
.wc3d-cart-design-summary .wc3d-cart-preview img {
  width: 92px;
  height: 92px;
  object-fit: contain;
  padding: 6px;
  background: #fff;
  border: 1px solid #e7e9ee;
  border-radius: 10px;
  transition: border-color .12s ease, box-shadow .12s ease, transform .12s ease;
}
.wc3d-cart-design-summary a.wc3d-cart-preview:hover img,
.wc3d-cart-design-summary a.wc3d-cart-preview:focus img {
  border-color: #2f6df6;
  box-shadow: 0 6px 18px rgba(47, 109, 246, .18);
  transform: translateY(-1px);
}
.wc3d-cart-design-summary .wc3d-cart-preview small {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #9aa1ab;
}

/* ── Collar line ───────────────────────────────────────────────────────── */
.wc3d-cart-design-summary .wc3d-collar {
  margin: 0;
  font-size: 12.5px;
  color: #5b6270;
}
.wc3d-cart-design-summary .wc3d-collar strong { color: #333; }

/* ── Size editor — the right-hand region beside the preview rail ────────── */
.wc3d-cart-design-summary .wc3d-size-editor {
  flex: 1 1 340px;
  min-width: 0;
}

.wc3d-cart-design-summary .wc3d-size-editor-label {
  margin: 0 0 12px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #3a3f47;
}

/* Lay the Men / Women / Youth groups side-by-side (all three across on a wide
   line) to fill the width; they reflow to 2-up then stack on narrow carts. */
.wc3d-cart-design-summary .wc3d-size-groups {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(148px, 1fr));
  gap: 16px 14px;
}

.wc3d-cart-design-summary .wc3d-size-group-title {
  margin: 0 0 9px;
  padding-bottom: 6px;
  border-bottom: 1px solid #ebedf1;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .09em;
  text-transform: uppercase;
  color: #98a0ac;
}

.wc3d-cart-design-summary .wc3d-size-cells {
  display: grid;
  grid-template-columns: repeat(auto-fill, 44px);
  gap: 8px;
}

.wc3d-cart-design-summary .wc3d-size-cell {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin: 0;
  cursor: text;
}
.wc3d-cart-design-summary .wc3d-size-cell > span {
  min-height: 12px;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1.1;
  text-align: center;
  color: #98a0ac;
}

.wc3d-cart-design-summary .wc3d-size-input {
  width: 44px;
  height: 34px;
  margin: 0;
  padding: 2px;
  text-align: center;
  font-size: 14px;
  font-weight: 700;
  line-height: 1;
  color: #c2c8d0;                 /* zero / empty state — de-emphasised */
  background: #fff;
  border: 1px solid #dfe3e9;
  border-radius: 8px;
  box-shadow: none;
  -moz-appearance: textfield;
  appearance: textfield;
  transition: border-color .12s ease, box-shadow .12s ease, color .12s ease, background .12s ease;
}
.wc3d-cart-design-summary .wc3d-size-input::-webkit-outer-spin-button,
.wc3d-cart-design-summary .wc3d-size-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}
.wc3d-cart-design-summary .wc3d-size-input:focus {
  outline: none;
  color: #1f2937;
  border-color: #2f6df6;
  box-shadow: 0 0 0 3px rgba(47, 109, 246, .15);
}

/* Sizes with a quantity stand out (class toggled by cart-edit-sizes.js). */
.wc3d-cart-design-summary .wc3d-size-cell--filled .wc3d-size-input {
  color: #15233b;
  background: #f2f6ff;
  border-color: #2f6df6;
}
.wc3d-cart-design-summary .wc3d-size-cell--filled > span { color: #2f6df6; }

/* ── Total bar ─────────────────────────────────────────────────────────── */
.wc3d-cart-design-summary .wc3d-size-editor-total {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 16px 0 0;
  padding-top: 12px;
  border-top: 1px solid #ebedf1;
  font-size: 13px;
  color: #3a3f47;
}
.wc3d-cart-design-summary .wc3d-size-total-label {
  font-weight: 600;
  color: #6b7280;
}
.wc3d-cart-design-summary .wc3d-size-total {
  font-size: 16px;
  font-weight: 800;
  color: #15233b;
}
.wc3d-cart-design-summary .wc3d-size-total-unit { color: #6b7280; }
.wc3d-cart-design-summary .wc3d-size-editor-status {
  margin-left: auto;
  font-size: 11px;
  font-weight: 600;
  color: #16a34a;
}

.wc3d-cart-design-summary .wc3d-size-editor--saving { opacity: .7; }
.wc3d-cart-design-summary .wc3d-size-editor--saving .wc3d-size-input { pointer-events: none; }

/* ── Reconfigure action ────────────────────────────────────────────────── */
.wc3d-cart-design-summary .wc3d-reconfigure-row { margin: 16px 0 0; }
.wc3d-cart-design-summary .wc3d-reconfigure-design.button {
  font-size: 12px;
  padding: 8px 18px;
}

/* ── Read-only summary (used where the grid is not editable) ───────────── */
.wc3d-cart-design-summary .wc3d-size-summary {
  margin: 0;
  font-size: 12.5px;
  color: #5b6270;
}

/* ── Preview lightbox ──────────────────────────────────────────────────── */
/* Mounted on <body> (outside the scoped summary), so these rules are
   top-level. The wc3d-zoom- prefix keeps them clear of theme styles. */
.wc3d-zoom-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4vmin;
  background: rgba(15, 20, 30, .82);
  opacity: 0;
  transition: opacity .15s ease;
  cursor: zoom-out;
}
.wc3d-zoom-overlay.is-open { opacity: 1; }
.wc3d-zoom-figure {
  margin: 0;
  max-width: 94vw;
  max-height: 94vh;
  text-align: center;
}
.wc3d-zoom-figure img {
  max-width: 100%;
  max-height: 86vh;
  object-fit: contain;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, .55);
}
.wc3d-zoom-figure figcaption {
  margin-top: 14px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: #fff;
  opacity: .85;
}
.wc3d-zoom-close {
  position: fixed;
  top: 18px;
  right: 22px;
  width: 40px;
  height: 40px;
  font-size: 26px;
  line-height: 38px;
  text-align: center;
  color: #fff;
  background: rgba(255, 255, 255, .12);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}
.wc3d-zoom-close:hover { background: rgba(255, 255, 255, .24); }
