/* ============================================================
   Trunimal Tienda — shop-specific styles
   Direction A "Manada Shelf" with grafted purple+wave hero (C).
   Mobile-first. Uses brand tokens from MASTER.md.
   ============================================================ */

:root {
  --shop-purple: #492A7D;
  --shop-purple-dark: #3A1F65;
  --shop-purple-light: #B89AC8;
  --shop-lilac: #C4A8D8;
  --shop-red: #DC2626;
  --shop-red-dark: #B91C1C;
  --shop-ink: #492A7D;
  --shop-ink-soft: rgba(73, 42, 125, 0.7);
  --shop-ink-muted: rgba(73, 42, 125, 0.55);
  --shop-line: rgba(73, 42, 125, 0.12);
  --shop-card-shadow: 0 2px 8px rgba(73, 42, 125, 0.08), 0 1px 2px rgba(0,0,0,0.04);
  --shop-card-shadow-hover: 0 8px 28px rgba(73, 42, 125, 0.18), 0 2px 6px rgba(0,0,0,0.06);
}

/* Layout safety: leave room for the mobile sticky CTA on PDP */
.shop-main {
  padding-bottom: 96px; /* sticky bar height + breathing room */
}

@media (min-width: 1024px) {
  .shop-main { padding-bottom: 0; }
}

/* ============================================================
   Category chip row (PLP hero)
   ============================================================ */
.shop-chip-row {
  display: flex;
  flex-wrap: nowrap;
  gap: 0.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}

@media (min-width: 768px) {
  .shop-chip-row { flex-wrap: wrap; overflow-x: visible; }
}

.shop-chip {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  padding: 0.5rem 1rem;
  min-height: 44px;
  border-radius: 9999px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  background: transparent;
  color: #fff;
  font-weight: 600;
  font-size: 0.9rem;
  text-decoration: none;
  transition: background-color .2s ease, border-color .2s ease, color .2s ease;
  white-space: nowrap;
}

.shop-chip:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.7);
}

.shop-chip.is-active {
  background: var(--shop-red);
  border-color: var(--shop-red);
  color: #fff;
}

.shop-chip.is-active:hover {
  background: var(--shop-red-dark);
  border-color: var(--shop-red-dark);
}

/* ============================================================
   Empty / error state
   ============================================================ */
.shop-empty {
  text-align: center;
  padding: 3rem 1rem;
  max-width: 520px;
  margin: 0 auto;
}

/* ============================================================
   Product grid
   ============================================================ */
.shop-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

@media (min-width: 640px)  { .shop-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem; } }
@media (min-width: 768px)  { .shop-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.5rem; } }
@media (min-width: 1024px) { .shop-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1.75rem; } }

.shop-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: var(--shop-card-shadow);
  transition: transform .25s ease, box-shadow .25s ease;
  border: 1px solid var(--shop-line);
}

.shop-card:hover,
.shop-card:focus-within {
  transform: translateY(-2px);
  box-shadow: var(--shop-card-shadow-hover);
}

.shop-card-media {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  background: #f8f5fb;
}

.shop-card-media img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.shop-ribbon {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 2;
  padding: 0.25rem 0.625rem;
  border-radius: 9999px;
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  background: var(--shop-red);
  color: #fff;
}

.shop-ribbon.is-backorder {
  background: var(--shop-purple);
}

.shop-ribbon.is-soldout {
  background: rgba(73, 42, 125, 0.7);
}

.shop-card-body {
  padding: 0.875rem 1rem 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
  flex: 1;
}

.shop-card-title {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  line-height: 1.25;
  color: var(--shop-ink);
  margin: 0;
}

.shop-card-title a {
  color: inherit;
  text-decoration: none;
}

.shop-card-title a:hover { text-decoration: underline; }

.shop-card-sub {
  font-size: 0.85rem;
  color: var(--shop-ink-soft);
  margin: 0;
  line-height: 1.35;
}

.shop-card-price {
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--shop-ink);
  margin: 0.25rem 0 0;
}

.shop-card-iva {
  display: inline-block;
  margin-left: 0.25rem;
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--shop-ink-muted);
}

.shop-card-cta {
  margin-top: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  min-height: 44px;
  padding: 0.55rem 1rem;
  border: 2px solid var(--shop-red);
  border-radius: 9999px;
  background: transparent;
  color: var(--shop-red);
  font-weight: 700;
  font-size: 0.9rem;
  cursor: pointer;
  transition: background-color .2s ease, color .2s ease;
  text-decoration: none;
  width: 100%;
}

.shop-card-cta:hover,
.shop-card-cta:focus {
  background: var(--shop-red);
  color: #fff;
  outline: none;
}

.shop-card-cta.is-disabled {
  border-color: var(--shop-line);
  color: var(--shop-ink-muted);
  cursor: not-allowed;
}

.shop-arrow {
  display: inline-block;
  font-weight: 700;
}

/* ============================================================
   Pagination
   ============================================================ */
.shop-pagination {
  margin-top: 2.5rem;
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.shop-page {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0 0.75rem;
  border-radius: 0.5rem;
  border: 1px solid var(--shop-line);
  color: var(--shop-ink);
  font-weight: 600;
  text-decoration: none;
}

.shop-page.is-active {
  background: var(--shop-purple);
  border-color: var(--shop-purple);
  color: #fff;
}

.shop-page:hover:not(.is-active) {
  background: rgba(73, 42, 125, 0.05);
}

/* ============================================================
   PDP layout
   ============================================================ */
.shop-pdp { align-items: flex-start; }

.shop-gallery-main {
  position: relative;
  aspect-ratio: 1 / 1;
  background: #f8f5fb;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: var(--shop-card-shadow);
}

.shop-gallery-main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.shop-gallery-thumbs {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.75rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.shop-gallery-thumb {
  flex: 0 0 auto;
  width: 72px;
  height: 72px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 0.5rem;
  background: transparent;
  cursor: pointer;
  overflow: hidden;
}

.shop-gallery-thumb.is-active {
  border-color: var(--shop-red);
}

.shop-gallery-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.shop-videos { margin-top: 1.25rem; }

.shop-video-link {
  display: inline-flex;
  align-items: center;
  color: var(--shop-purple);
  font-weight: 600;
  text-decoration: none;
}

.shop-video-link:hover { text-decoration: underline; }

/* PDP info column */
.shop-pdp-price {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 1.75rem;
  color: var(--shop-ink);
  margin: 0;
}

.shop-pdp-currency {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--shop-ink-soft);
  margin-left: 0.25rem;
}

.shop-pdp-iva {
  margin: 0.25rem 0 1.25rem;
  color: var(--shop-ink-soft);
  font-size: 0.875rem;
}

/* ============================================================
   Variant pills (radiogroup)
   ============================================================ */
.shop-variants {
  border: none;
  padding: 0;
  margin: 0 0 1.25rem;
}

.shop-variants-legend {
  font-weight: 700;
  color: var(--shop-ink);
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
}

.shop-variant-pill {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-width: 72px;
  min-height: 56px;
  padding: 0.5rem 0.85rem;
  margin: 0 0.5rem 0.5rem 0;
  border: 2px solid var(--shop-line);
  border-radius: 0.625rem;
  background: #fff;
  color: var(--shop-ink);
  cursor: pointer;
  transition: border-color .15s ease, background-color .15s ease, color .15s ease;
  text-align: center;
}

.shop-variant-pill input { position: absolute; opacity: 0; pointer-events: none; }

.shop-variant-pill:has(input:checked) {
  border-color: var(--shop-red);
  background: var(--shop-red);
  color: #fff;
}

.shop-variant-pill:has(input:focus-visible) {
  outline: 3px solid rgba(220, 38, 38, 0.35);
  outline-offset: 2px;
}

.shop-variant-pill.is-disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.shop-variant-pill.is-backorder {
  border-style: dashed;
}

.shop-variant-label strong { display: block; font-size: 0.95rem; font-weight: 700; }
.shop-variant-label small  { display: block; font-size: 0.7rem;  margin-top: 0.15rem; opacity: 0.85; }
.shop-variant-flag         { margin-top: 0.2rem; }
.shop-variant-flag.is-soldout { color: inherit; }

/* ============================================================
   Quantity stepper
   ============================================================ */
.shop-qty-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.shop-qty-label {
  font-weight: 700;
  color: var(--shop-ink);
}

.shop-qty-stepper {
  display: inline-flex;
  align-items: stretch;
  border: 2px solid var(--shop-line);
  border-radius: 0.625rem;
  overflow: hidden;
  background: #fff;
}

.shop-qty-stepper button {
  width: 44px;
  min-height: 44px;
  border: 0;
  background: transparent;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--shop-ink);
  cursor: pointer;
}

.shop-qty-stepper button:hover {
  background: rgba(73, 42, 125, 0.08);
}

.shop-qty-stepper input {
  width: 56px;
  border: 0;
  text-align: center;
  font-weight: 700;
  color: var(--shop-ink);
  background: transparent;
  outline: none;
  -moz-appearance: textfield;
}

.shop-qty-stepper input::-webkit-outer-spin-button,
.shop-qty-stepper input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.shop-pdp-cta {
  width: 100%;
  margin-top: 0.5rem;
  font-size: 1rem;
  padding: 0.95rem 1.5rem;
}

.shop-pdp-cta[disabled] {
  opacity: 0.6;
  cursor: not-allowed;
}

.shop-pdp-perks {
  list-style: none;
  padding: 0;
  margin: 1.25rem 0 0;
  color: var(--shop-ink-soft);
  font-size: 0.9rem;
}

.shop-pdp-perks li { padding: 0.25rem 0; }

/* ============================================================
   Accordion (description, specs)
   ============================================================ */
.shop-acc {
  border-top: 1px solid var(--shop-line);
  padding: 0.5rem 0;
}

.shop-acc:last-child { border-bottom: 1px solid var(--shop-line); }

.shop-acc-summary {
  list-style: none;
  cursor: pointer;
  padding: 0.875rem 0;
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--shop-ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 48px;
}

.shop-acc-summary::-webkit-details-marker { display: none; }

.shop-acc-summary::after {
  content: '▾';
  color: var(--shop-red);
  transition: transform .2s ease;
  font-size: 1rem;
}

.shop-acc[open] > .shop-acc-summary::after { transform: rotate(180deg); }

.shop-acc-body {
  padding: 0.25rem 0 1rem;
  color: var(--shop-ink);
  line-height: 1.6;
}

.shop-prose p { margin: 0 0 0.75rem; }
.shop-prose a { color: var(--shop-purple); text-decoration: underline; }

.shop-dim-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.25rem;
}

@media (min-width: 640px) {
  .shop-dim-list { grid-template-columns: 1fr 1fr; }
}

/* ============================================================
   Sticky bottom CTA on PDP (mobile only — hidden on lg)
   ============================================================ */
.shop-pdp-sticky {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: #fff;
  border-top: 1px solid var(--shop-line);
  padding: 0.75rem 1rem calc(0.75rem + env(safe-area-inset-bottom));
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem;
  align-items: center;
  z-index: 30; /* below cart drawer (z-50) and its backdrop (z-40) per shipper-cart contract */
  box-shadow: 0 -2px 12px rgba(73, 42, 125, 0.12);
}

@media (min-width: 1024px) {
  .shop-pdp-sticky { display: none; }
}

.shop-pdp-sticky-inner {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.shop-pdp-sticky-name {
  font-weight: 700;
  color: var(--shop-ink);
  font-size: 0.9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shop-pdp-sticky-price {
  color: var(--shop-ink-soft);
  font-size: 0.85rem;
}

.shop-pdp-sticky-iva { font-size: 0.7rem; }

.shop-pdp-sticky-cta {
  min-height: 48px;
  padding: 0.65rem 1.1rem;
  font-size: 0.95rem;
  border-radius: 9999px;
}

.shop-pdp-sticky-cta.is-disabled,
.shop-pdp-sticky-cta[disabled] {
  opacity: 0.55;
  cursor: not-allowed;
  pointer-events: none;
}

/* ============================================================
   Reduced motion
   ============================================================ */
@media (prefers-reduced-motion: reduce) {
  .shop-card,
  .shop-card-cta,
  .shop-acc-summary::after,
  .shop-chip {
    transition: none !important;
  }
}

/* Cart button slot inside the header nav.
   No display rule — let Tailwind utility classes (lg:hidden, lg:flex) win.
   Color defaults to white for the solid-purple shop header; overridden on white pages. */
.shop-nav-cart-slot {
  align-items: center;
  color: #ffffff;
  min-width: 0;
}
#main-header.bg-white .shop-nav-cart-slot {
  color: #492A7D;
}

/* ============================================================
   Checkout Vue island styles (Phase 6).
   ============================================================ */
.checkout-page {
  background: linear-gradient(180deg, #faf8fd 0%, #fff 240px);
  min-height: 70vh;
  padding: 96px 0 64px;
}
.checkout-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 1rem;
}
.checkout-header { margin-bottom: 24px; }
.checkout-title {
  font-family: 'Campora', 'Poppins', sans-serif;
  color: #492A7D;
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 800;
  line-height: 1.05;
  margin: 0 0 6px 0;
}
.checkout-login-link { color: #6b7280; font-size: 0.9rem; }
.checkout-login-link a { color: #DC2626; font-weight: 600; }
.checkout-empty {
  background: #fff;
  border: 1px solid #ede7f6;
  border-radius: 16px;
  padding: 32px;
  text-align: center;
  color: #4b5563;
}
.checkout-grid-2 {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  align-items: start;
}
@media (min-width: 900px) {
  .checkout-grid-2 { grid-template-columns: minmax(0, 1.5fr) minmax(280px, 1fr); }
}
.checkout-form-col { display: flex; flex-direction: column; gap: 20px; }
.checkout-section {
  background: #fff;
  border: 1px solid #ede7f6;
  border-radius: 16px;
  padding: 20px 22px;
  box-shadow: 0 2px 12px rgba(73, 42, 125, 0.04);
}
.checkout-section-title {
  font-family: 'Poppins', sans-serif;
  color: #492A7D;
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 14px 0;
  letter-spacing: 0.01em;
}
.checkout-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
@media (min-width: 600px) { .checkout-grid { grid-template-columns: repeat(2, 1fr); } }
.checkout-grid > .checkout-field-full { grid-column: 1 / -1; }
.checkout-field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.checkout-field label {
  font-family: 'Poppins', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b5fa1;
}
.checkout-field input,
.checkout-field select,
.checkout-field textarea {
  width: 100%;
  background: #fff;
  border: 1px solid #d6cfe8;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  color: #1f2937;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.checkout-field input:focus,
.checkout-field select:focus,
.checkout-field textarea:focus {
  outline: none;
  border-color: #492A7D;
  box-shadow: 0 0 0 3px rgba(73, 42, 125, 0.12);
}
.checkout-field textarea { min-height: 72px; resize: vertical; }
.checkout-toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.95rem;
  color: #1f2937;
  cursor: pointer;
  user-select: none;
}
.checkout-toggle input[type="checkbox"] { width: 18px; height: 18px; accent-color: #492A7D; }
.checkout-payment-hint { color: #6b7280; font-size: 0.9rem; margin: 0 0 12px 0; }
.checkout-error {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 0.9rem;
  margin: 6px 0;
}
.checkout-pay-btn {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: 'Poppins', sans-serif;
  font-size: 1.05rem;
  font-weight: 700;
  padding: 14px 22px;
  border-radius: 9999px;
  background: #DC2626;
  color: #fff;
  border: none;
  cursor: pointer;
  transition: background-color 150ms ease, transform 100ms ease;
  margin-top: 6px;
}
.checkout-pay-btn:hover:not(:disabled) { background: #B91C1C; }
.checkout-pay-btn:disabled { opacity: 0.55; cursor: not-allowed; }
.checkout-pay-btn .shop-arrow { color: #fff; }
.checkout-summary {
  background: #fff;
  border: 1px solid #ede7f6;
  border-radius: 16px;
  padding: 22px;
  box-shadow: 0 2px 12px rgba(73, 42, 125, 0.04);
  position: sticky;
  top: 96px;
}
.checkout-summary > h3,
.checkout-summary > h2 {
  font-family: 'Poppins', sans-serif;
  color: #492A7D;
  font-size: 1.05rem;
  font-weight: 700;
  margin: 0 0 14px 0;
}
.checkout-summary-items { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; padding-bottom: 14px; border-bottom: 1px solid #ede7f6; list-style: none; padding-left: 0; margin-top: 0; }
.checkout-summary-item { display: flex; flex-direction: column; gap: 2px; font-size: 0.92rem; }
.checkout-summary-item-name { color: #1f2937; font-weight: 600; }
.checkout-summary-item-meta { color: #6b7280; font-size: 0.85rem; display: flex; justify-content: space-between; gap: 8px; }
.checkout-summary-item-line-total { color: #1f2937; font-weight: 600; white-space: nowrap; }
.checkout-summary-totals { display: flex; flex-direction: column; gap: 6px; font-size: 0.92rem; color: #4b5563; margin: 0; }
.checkout-summary-totals > div { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.checkout-summary-totals dt { margin: 0; font-weight: 500; }
.checkout-summary-totals dd { margin: 0; font-variant-numeric: tabular-nums; }
.checkout-summary-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid #ede7f6;
  font-family: 'Poppins', sans-serif;
  font-size: 1.05rem;
  font-weight: 800;
  color: #492A7D;
}
.checkout-summary-total dt,
.checkout-summary-total dd { margin: 0; }

/* Coupon block (lives inside .checkout-summary via slot) */
.coupon-input {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin: 4px 0 14px 0;
  padding-bottom: 14px;
  border-bottom: 1px solid #ede7f6;
}
.coupon-input-label {
  font-family: 'Poppins', sans-serif;
  font-size: 0.78rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #6b5fa1;
}
.coupon-input-row {
  display: flex;
  gap: 8px;
  align-items: stretch;
}
.coupon-input-row input {
  flex: 1 1 auto;
  min-width: 0;
  background: #fff;
  border: 1px solid #d6cfe8;
  border-radius: 10px;
  padding: 10px 12px;
  font: inherit;
  color: #1f2937;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.coupon-input-row input:focus {
  outline: none;
  border-color: #492A7D;
  box-shadow: 0 0 0 3px rgba(73, 42, 125, 0.12);
}
.coupon-input-row input:disabled {
  background: #f5f3fb;
  color: #6b7280;
  cursor: not-allowed;
}
.coupon-input-row .btn {
  flex: 0 0 auto;
  padding: 10px 16px;
  border-radius: 10px;
  font-family: 'Poppins', sans-serif;
  font-size: 0.9rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  background: #fff;
  color: #492A7D;
  border: 1px solid #492A7D;
  transition: background-color 150ms ease, color 150ms ease;
}
.coupon-input-row .btn:hover:not(:disabled) {
  background: #492A7D;
  color: #fff;
}
.coupon-input-row .btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
.coupon-error {
  margin: 0;
  font-size: 0.85rem;
  color: #b91c1c;
}
.coupon-applied {
  margin: 0;
  font-size: 0.9rem;
  color: #047857;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 8px;
  padding: 6px 10px;
}
.coupon-applied strong { color: #065f46; }
