/* ==========================================================================
   Merch store (Printful) — /merch/{country}
   Loaded only by the StoreMerch views (@section HeaderAddons), after the theme.
   Plain CSS on the modern.scss tokens (--sr-*) so the compiled merch.css
   matches this file one-to-one.
   ========================================================================== */

/* ---- Product images ------------------------------------------------------
   Printful mockups are square with a white background. The base theme gives
   .thumb a 120px banner box, background-position-y: -55px and repeat, which
   tiled the mockup across the card; show the whole image once instead. */
.thumb.thumb-product,
.thumb-strip,
.product-main .thumbnail,
.thumbnails .preview {
  background-color: #fff !important;
  background-repeat: no-repeat !important;
  background-position: center center !important;
  background-size: contain !important;
  aspect-ratio: 1 / 1;
  height: auto !important;
}

.content.product .content-thumbnail {
  flex: 0 0 200px;
  max-width: 200px;
  line-height: 0;
}

.content.product .content-thumbnail a {
  display: block;
  width: 100% !important;
}

.thumb.thumb-product {
  width: 100% !important;
  border-radius: var(--sr-radius-sm) !important;
}

/* ---- Product card (listing) ---------------------------------------------- */
/* modern.scss forces .content to display: block !important */
.content.product:not(.product-info) {
  display: flex !important;
  gap: 20px;
  align-items: flex-start;
}

.content.product .content-details {
  flex: 1 1 auto;
  min-width: 0;
  padding: 0;
  width: auto;
}

.content.product .content-details h1 {
  margin-top: 0;
}

.product .order-data {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 6px;
  text-align: end;
  flex: 0 0 auto;
}

.product .order-data .qty {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 6px;
}

.product .order-data input {
  width: 3.5rem;
  text-align: center;
}

.order-data .remove {
  flex-grow: 1;
}

/* ---- Size / variant buttons ---------------------------------------------- */
.product .variants {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 10px 0;
}

.product .variants .variant-btn {
  min-width: 44px;
  padding: 6px 10px;
  margin: 0;
  font: inherit;
  font-size: 0.85em;
  line-height: 1.2;
  color: var(--sr-text);
  background: var(--sr-surface-raised);
  border: 1px solid var(--sr-border-strong);
  border-radius: var(--sr-radius-sm);
  cursor: pointer;
  transition: background-color var(--sr-transition), border-color var(--sr-transition), color var(--sr-transition);
}

.product .variants .variant-btn:hover:not(:disabled) {
  border-color: var(--sr-primary);
  color: #fff;
}

.product .variants .variant-btn.selected {
  background: var(--sr-primary);
  border-color: var(--sr-primary);
  color: #fff;
  font-weight: bold;
}

.product .variants .variant-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  text-decoration: line-through;
}

.product .variants-data {
  display: none;
}

/* ---- Price / stock / feedback -------------------------------------------- */
.merch-price {
  font-size: 1.25em;
  font-weight: bold;
  color: var(--sr-text);
}

.merch-currency {
  font-size: 0.75em;
  color: var(--sr-text-muted);
}

.in-stock { color: #6ee07a; }
.out-of-stock { color: #ff6e6e; }

.merch-feedback {
  color: #6ee07a;
  font-size: 0.85em;
  margin-top: 4px;
}

.merch-error {
  color: #ff6e6e;
  font-size: 0.85em;
  margin-top: 4px;
}

/* ---- Product detail page -------------------------------------------------- */
.product-info {
  flex-direction: column;
}

.product-overview {
  display: flex;
  flex-direction: row;
  gap: 16px;
  align-items: flex-start;
}

.thumbnails {
  flex: 0 0 90px;
  max-width: 90px !important;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.thumb-strip {
  cursor: pointer;
  border: 2px solid transparent;
  border-radius: var(--sr-radius-sm);
  transition: border-color var(--sr-transition);
}

.thumb-strip:hover {
  border-color: var(--sr-primary);
}

.product-overview .product-main {
  flex: 1 1 auto;
  min-width: 0;
}

.product-main .thumbnail {
  max-width: 480px;
  margin: 0;
  border-radius: var(--sr-radius);
}

.product-main-image {
  cursor: zoom-in;
  position: relative;
}

/* ---- Zoom overlay --------------------------------------------------------- */
/* Overlays live directly under .max-width-all, whose global rule caps every
   descendant at 960px; lift that so the backdrop covers the full viewport. */
.zoom-overlay,
.zoom-overlay-bg,
.sizing-modal,
.sizing-modal-bg {
  max-width: none !important;
}

.zoom-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.zoom-overlay-bg {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
}

.zoom-container {
  position: relative;
  z-index: 1001;
  max-width: 90vw;
  max-height: 90vh;
}

.zoom-container img {
  display: block;
  max-width: 80vw;
  max-height: 80vh;
  object-fit: contain;
  background: #fff;
}

.zoom-close {
  position: absolute;
  top: -2rem;
  right: 0;
  background: none;
  border: none;
  color: #fff;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
}

.zoom-icon {
  position: absolute;
  bottom: 8px;
  right: 8px;
  color: rgba(0, 0, 0, 0.45);
  pointer-events: none;
}

/* ---- Sizing modal --------------------------------------------------------- */
.sizing-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.sizing-modal-bg {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
}

.sizing-modal-content {
  position: relative;
  z-index: 1001;
  background: var(--sr-surface-raised);
  border: 1px solid var(--sr-border-strong);
  border-radius: var(--sr-radius);
  box-shadow: var(--sr-shadow);
  padding: 1.5rem 2rem;
  max-width: min(90vw, 960px) !important;
  background-color: rgb(32, 24, 20);
  color: var(--sr-text);
  font-family: Montserrat, "Segoe UI", system-ui, sans-serif;
  max-height: 85vh;
  overflow-y: auto;
}

.sizing-close {
  position: absolute;
  top: 0.5rem;
  right: 0.75rem;
  background: none;
  border: none;
  font-size: 1.5rem;
  color: inherit;
  cursor: pointer;
}

.sizing-tabs {
  display: flex;
  gap: 0.5rem;
  border-bottom: 1px solid var(--sr-border);
  margin: 1rem 0;
}

.sizing-tab {
  background: none;
  border: none;
  border-bottom: 2px solid transparent;
  color: var(--sr-text-muted);
  padding: 0.5rem 0.75rem;
  cursor: pointer;
  font: inherit;
}

.sizing-tab.active {
  color: var(--sr-text);
  border-bottom-color: currentColor;
}

/* Wide size charts scroll inside their panel instead of widening the modal */
.sizing-modal-content {
  overflow-x: hidden;
}

.sizing-panel {
  overflow-x: auto;
}

.sizing-howto {
  display: flex;
  gap: 1.5rem;
  align-items: flex-start;
  margin: 1rem 0;
}

.sizing-howto img {
  width: 220px;
  max-width: 40%;
  background: #fff;
  border-radius: var(--sr-radius);
}

@media (max-width: 600px) {
  .sizing-howto {
    flex-direction: column;
  }

  .sizing-howto img {
    max-width: 100%;
  }
}

.sizing-table {
  width: 100%;
  border-collapse: collapse;
  margin-top: 1rem;
  font-size: 0.9em;
}

.sizing-table th,
.sizing-table td {
  border: 1px solid var(--sr-border);
  padding: 6px 10px;
  text-align: left;
}

.sizing-table th {
  background: var(--sr-surface);
}

/* ---- Country / cart submenu ---------------------------------------------- */
.store.submenu {
  display: flex;
  justify-content: flex-end;
}

.store.submenu > div {
  padding: 12px 16px;
}

.store.submenu .dropdown-content {
  right: 0;
}

.store .dropdown-content .item {
  min-width: 210px;
}

.store .sbtn {
  margin: 5px;
}

/* ---- Cart ----------------------------------------------------------------- */
.store.cart {
  display: flex;
  flex-direction: row;
}

.cart-panel {
  display: flex;
}

.cart-panel .content-details * {
  font-size: 1em !important;
}

.cart-panel .content.product .content-thumbnail {
  flex-basis: 120px;
  max-width: 120px;
}

.cart-total {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  width: 100%;
}

.cart-line {
  display: flex;
  justify-content: space-between;
}

.shipping {
  display: flex;
  flex-direction: column;
}

.shipping input {
  width: auto;
}

/* Shipping rate choices: radio | name + delivery estimate | price */
.shipping-option {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.5rem 0.6rem;
  margin-bottom: 0.4rem;
  border: 1px solid var(--sr-border);
  border-radius: var(--sr-radius);
  cursor: pointer;
}

.shipping-option:has(input:checked) {
  border-color: var(--sr-border-strong);
  background: var(--sr-surface);
}

/* Undo the site-wide text input styling (size, padding, border, background) */
.shipping .shipping-option input[type="radio"] {
  appearance: auto;
  flex: 0 0 auto;
  width: 1rem !important;
  height: 1rem !important;
  min-width: 0;
  margin: 0.2rem 0 0;
  padding: 0;
  border: none;
  background: none;
  box-shadow: none;
}

.shipping-option-text {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-width: 0;
}

.shipping-option-eta {
  font-size: 0.85em;
  color: var(--sr-text-muted);
}

.shipping-option-price {
  flex: 0 0 auto;
  white-space: nowrap;
  font-weight: 600;
}

.store.address {
  display: flex;
  width: 200%;
}

.store .address-lines {
  display: flex;
  flex-direction: column;
  padding: 0 10px;
  width: 50%;
}

/* Wrapped fields (State / Province) stack like the plain label + input pairs */
.store .address-lines .address-field {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.store .address-lines select {
  width: 100%;
}

/* ---- Order status --------------------------------------------------------- */
.order-status-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 1rem 0;
}

.order-status-card {
  background: var(--sr-surface-raised);
  border: 1px solid var(--sr-border);
  border-radius: var(--sr-radius-sm);
  padding: 0.75rem 1.25rem;
  min-width: 160px;
}

.order-status-card h4 {
  margin: 0 0 0.25rem;
  font-size: 0.8em;
  opacity: 0.7;
  text-transform: uppercase;
}

.order-status-card p {
  margin: 0;
  font-weight: bold;
}

.order-status-notice {
  border-left: 3px solid var(--sr-primary);
  padding: 0.75rem 1rem;
  margin: 1rem 0;
  font-size: 0.9em;
  opacity: 0.85;
}

.status-badge {
  text-transform: capitalize;
}

/* ---- Small screens -------------------------------------------------------- */
@media only screen and (max-width: 767px) {
  .content.product:not(.product-info) {
    flex-direction: column;
    align-items: stretch;
  }

  .content.product .content-thumbnail,
  .cart-panel .content.product .content-thumbnail {
    flex-basis: auto;
    max-width: 260px;
    width: 100%;
    margin: 0 auto;
  }

  .product .order-data {
    align-items: stretch;
    text-align: start;
  }

  .product-overview {
    flex-direction: column-reverse;
  }

  .thumbnails {
    flex-direction: row;
    flex-basis: auto;
    max-width: 100% !important;
    overflow-x: auto;
  }

  .thumbnails .thumb-strip {
    flex: 0 0 64px;
  }

  .product-main .thumbnail {
    max-width: 100%;
  }

  .cart-panel {
    flex-direction: column-reverse;
  }

  .store.cart {
    flex-direction: column;
  }

  .cart-total {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .cart-total div {
    padding: 0 5px;
  }

  .store.address {
    flex-wrap: wrap;
    width: 100%;
  }

  .store .address-lines {
    width: 100%;
  }

  .store input {
    width: 100%;
  }
}
