/* store.css - shares brand tokens with portal.css (membership portal) */

:root {
  --lg-red: #c0281c;
  --lg-red-dark: #8f1e15;
  --lg-ink: #2b2b2b;
  --lg-cream: #faf7f2;
  --lg-tile-bg: #e9e1d3;
  --lg-border: #ddd4c8;
}

html {
  font-size: 14px;
}

body {
  font-family: 'Source Serif 4', Georgia, serif;
  color: var(--lg-ink);
  background: var(--lg-cream);
  margin: 0;
}

h1, h2, h3, .lg-brand {
  font-family: 'Playfair Display', Georgia, serif;
}

h3 {
  font-size: 1.05rem;
}

h4 {
  font-size: 0.9rem;
  margin: 0.75rem 0 0.35rem;
}

header.lg-header {
  padding: 1rem 1.5rem 0.5rem;
  text-align: center;
}

header.lg-header h1 {
  margin: 0.4rem 0 0;
  font-size: 1.3rem;
  color: var(--lg-ink);
}

.lg-logo {
  height: 36px;
  width: auto;
  display: block;
  margin: 0 auto;
}

.lg-container {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 0.75rem;
}

.product-card {
  position: relative;
  border: 1px solid var(--lg-border);
  background: var(--lg-tile-bg);
  padding: 0.5rem;
  border-radius: 6px;
}

.product-card img {
  width: 100%;
  height: 90px;
  object-fit: contain;
  background: var(--lg-tile-bg);
  /* Printful's mockup photos have an opaque white studio background
     baked into the image itself, not transparency - CSS background alone
     can only ever show through the letterboxed edges, never through the
     photo's own pixels. Multiply blend makes white areas of the image
     take on whatever's behind them (multiplying white by any color
     yields that color), while the garment/logo pixels stay visible -
     effectively faking transparency without touching the image files. */
  mix-blend-mode: multiply;
}

.product-card h3 {
  font-size: 0.7rem;
  margin: 0.4rem 0 0.15rem;
  line-height: 1.2;
}

.product-card .price {
  font-size: 0.8rem;
  margin: 0.15rem 0;
}

.product-card select {
  width: 100%;
  font-size: 0.75rem;
  padding: 0.2rem;
  margin-bottom: 0.35rem;
  border: 1px solid var(--lg-border);
  border-radius: 4px;
  font-family: inherit;
}

.product-card button {
  width: 100%;
  padding: 0.35rem 0.5rem;
  font-size: 0.8rem;
}

.product-card-clickable {
  cursor: pointer;
}

.product-card-clickable:hover {
  border-color: var(--lg-red);
}

.product-modal {
  border: none;
  border-radius: 8px;
  padding: 1.5rem;
  max-width: 480px;
  width: 90vw;
  max-height: 85vh;
  overflow-y: auto;
}

.product-modal::backdrop {
  background: rgba(0, 0, 0, 0.5);
}

.product-modal h3 {
  margin: 0 0 1rem;
  padding-right: 2rem;
}

.modal-close {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: auto;
  background: transparent;
  color: var(--lg-ink);
  font-size: 1.3rem;
  line-height: 1;
  padding: 0.25rem 0.5rem;
}

.modal-close:hover {
  background: var(--lg-cream);
}

.modal-color-group {
  border-top: 1px solid var(--lg-border);
  padding: 0.75rem 0;
}

.modal-color-group:first-of-type {
  border-top: none;
}

.modal-color-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 0.5rem;
}

.modal-color-header img {
  width: 42px;
  height: 42px;
  object-fit: contain;
  background: var(--lg-tile-bg);
  border-radius: 4px;
  mix-blend-mode: multiply;
}

.modal-color-header span {
  font-weight: bold;
  font-size: 0.9rem;
}

.modal-size-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.modal-size-row form {
  margin: 0;
}

.size-tab {
  width: auto;
  background: #fff;
  color: var(--lg-ink);
  border: 1px solid var(--lg-border);
  padding: 0.35rem 0.7rem;
  font-size: 0.8rem;
}

.size-tab:hover:not(:disabled) {
  background: var(--lg-red);
  color: #fff;
  border-color: var(--lg-red);
}

.size-tab:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  text-decoration: line-through;
}

.price {
  font-weight: bold;
  color: var(--lg-red-dark);
}

.description-editor {
  border-bottom: 1px solid var(--lg-border);
  padding: 1rem 0;
}

.description-editor textarea {
  width: 100%;
  font-family: inherit;
  font-size: 0.85rem;
  padding: 0.5rem;
  border: 1px solid var(--lg-border);
  border-radius: 4px;
  box-sizing: border-box;
  margin-bottom: 0.5rem;
}

.description-preview {
  background: var(--lg-tile-bg);
  border-radius: 4px;
  padding: 0.5rem 0.75rem;
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
  min-height: 1.5rem;
}

.description-preview p:first-child { margin-top: 0; }
.description-preview p:last-child { margin-bottom: 0; }

.size-guide-status {
  font-size: 0.75rem;
  color: var(--lg-ink);
  margin: 0 0.5rem;
}

.size-guide-link {
  width: 100%;
  margin-top: 0.3rem;
  background: transparent;
  color: var(--lg-red-dark);
  border: 1px solid var(--lg-border);
  font-size: 0.75rem;
  padding: 0.3rem 0.5rem;
}

.size-guide-link:hover {
  border-color: var(--lg-red);
}

.zoom-preview {
  position: fixed;
  display: none;
  pointer-events: none;
  z-index: 2000;
  max-width: 280px;
  background: var(--lg-tile-bg);
  border: 1px solid var(--lg-border);
  border-radius: 6px;
  padding: 6px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  /* Isolation matters here specifically because this element floats
     fixed above arbitrary page content: without it, the multiply blend
     on the img inside would composite against whatever happens to be
     rendered underneath the cursor on the page, not just this box's own
     background. Isolate gives it a fresh stacking context so the blend
     only ever applies within this box. */
  isolation: isolate;
}

.zoom-preview img {
  display: block;
  width: 100%;
  max-height: 280px;
  object-fit: contain;
  mix-blend-mode: multiply;
}

.zoom-preview-description {
  display: none;
  background: #fff;
  border-radius: 4px;
  padding: 0.5rem;
  margin-top: 4px;
  font-size: 0.75rem;
  line-height: 1.4;
  text-align: left;
  color: var(--lg-ink);
}

.zoom-preview-description p:first-child { margin-top: 0; }
.zoom-preview-description p:last-child { margin-bottom: 0; }

button, .btn {
  font-family: 'Source Serif 4', Georgia, serif;
  background: var(--lg-red);
  color: #fff;
  border: none;
  padding: 0.6rem 1.2rem;
  border-radius: 4px;
  cursor: pointer;
  font-size: 1rem;
}

button:hover, .btn:hover {
  background: var(--lg-red-dark);
}

table.cart-table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.5rem 0;
}

table.cart-table th, table.cart-table td {
  border-bottom: 1px solid var(--lg-border);
  padding: 0.5rem;
  text-align: left;
  font-size: 0.9rem;
}

.total-line {
  font-size: 1.05rem;
  text-align: right;
  margin: 1rem 0;
}

form.checkout-form input:not([type="radio"]):not([type="checkbox"]),
form.checkout-form select {
  display: block;
  width: 100%;
  margin-bottom: 0.75rem;
  padding: 0.45rem;
  border: 1px solid var(--lg-border);
  border-radius: 4px;
  font-family: inherit;
  font-size: 0.85rem;
  box-sizing: border-box;
}

form.checkout-form label {
  font-size: 0.85rem;
}

.shipping-option {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--lg-border);
  cursor: pointer;
  font-size: 0.85rem;
}

.shipping-option input {
  margin-top: 0.2rem;
}

.shipping-option-text {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.shipping-option-price {
  font-weight: bold;
  color: var(--lg-red-dark);
}

.order-summary {
  border-top: 1px solid var(--lg-border);
  padding-top: 0.75rem;
  margin: 1rem 0;
}

.order-summary p {
  display: flex;
  justify-content: space-between;
  margin: 0.25rem 0;
  font-size: 0.9rem;
}

.order-summary-total {
  font-weight: bold;
  font-size: 1.05rem !important;
  border-top: 1px solid var(--lg-border);
  padding-top: 0.5rem;
  margin-top: 0.5rem !important;
}

.policy-notice {
  font-size: 0.8rem;
  font-style: italic;
  color: var(--lg-ink);
  text-align: center;
  margin: 0.75rem 0;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
}

.admin-table th, .admin-table td {
  border: 1px solid var(--lg-border);
  padding: 0.5rem;
  font-size: 0.9rem;
}

.status-draft { color: var(--lg-red-dark); font-weight: bold; }
.status-confirmed { color: #2e7d32; font-weight: bold; }
.status-cancelled { color: #777; text-decoration: line-through; }

/* Bigger tiles on phones specifically - iPhones (portrait or landscape)
   stay well under 600px CSS width, while even the smallest iPad starts
   around 744px, so this breakpoint targets phones without affecting
   tablets. On a phone, 110px tiles are cramped; ~160px gives 2 comfortable
   columns instead of 3 tiny ones. Placed at the end of the file
   deliberately: with equal CSS specificity, source order decides ties,
   so this must come after the base .product-card rules it overrides. */
@media (max-width: 600px) {
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
  }

  .product-card img {
    height: 130px;
  }

  .product-card h3 {
    font-size: 0.85rem;
  }

  .product-card .price {
    font-size: 0.95rem;
  }

  .product-card select,
  .product-card button {
    font-size: 0.9rem;
  }
}
