:root {
  --bg: #f4ece8;
  --surface: #fffdfc;
  --surface-soft: #fdf2f6;
  --ink: #2f1712;
  --muted: #6a4338;
  --line: #dec4b9;
  --brown: #4f2f24;
  --brown-light: #b98f7f;
  --brown-100: #f1e3dc;
  --brown-200: #dfc6ba;
  --brown-500: #855343;
  --brown-700: #4f2f24;
  --rose-100: #f8e1ea;
  --rose-200: #f3c9da;
  --rose-300: #e89bb8;
  --rose-500: #b33268;
  --rose-700: #7f2148;
  --accent: #b33268;
  --accent-strong: #7f2148;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow-card:
    0 2px 6px rgba(47, 21, 13, 0.05),
    0 12px 28px rgba(76, 43, 31, 0.09);
  --shadow-soft:
    0 1px 2px rgba(47, 21, 13, 0.03),
    0 8px 18px rgba(76, 43, 31, 0.08);
  --shadow-checkout:
    0 3px 10px rgba(47, 21, 13, 0.06),
    0 16px 34px rgba(76, 43, 31, 0.1);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  color: var(--ink);
  font-family: "Instrument Sans", "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 8% 8%, #fbe9f1 0%, transparent 30%),
    radial-gradient(circle at 92% 12%, #ead8cf 0%, transparent 34%),
    linear-gradient(180deg, #f7f0ec 0%, #f0e5df 52%, #ecddd6 100%);
}

body {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: clamp(14px, 2.5vw, 28px);
  padding: clamp(12px, 2.2vw, 28px);
}

.topbar {
  grid-column: 1 / -1;
  display: block;
  margin-bottom: 6px;
  border: 1px solid rgba(79, 47, 36, 0.22);
  border-radius: 18px;
  padding: clamp(12px, 2vw, 18px);
  background:
    radial-gradient(circle at 14% -40%, rgba(255, 255, 255, 0.88) 0%, transparent 52%),
    linear-gradient(140deg, rgba(248, 238, 233, 0.94), rgba(245, 228, 219, 0.95));
  box-shadow: var(--shadow-soft);
}

.topbar-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: end;
}

.brand-block {
  max-width: 660px;
}

.brand-logo-btn {
  border: 0;
  background: transparent;
  padding: 0;
  margin: 0;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
}

.brand-logo-btn:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--brown-700) 70%, var(--rose-500) 30%);
  outline-offset: 4px;
  border-radius: 10px;
}

.brand-logo {
  width: clamp(44px, 7vw, 64px);
  height: clamp(44px, 7vw, 64px);
  object-fit: contain;
  display: block;
  margin: 0 0 8px;
}

.eyebrow {
  margin: 0;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: color-mix(in srgb, var(--brown) 88%, #ffffff 12%);
  font-weight: 600;
  opacity: 0.9;
}

.topbar h1 {
  margin: 8px 0 0;
  font-family: "Newsreader", Georgia, serif;
  font-size: clamp(2rem, 5vw, 3.2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1;
  color: color-mix(in srgb, var(--brown) 90%, var(--rose-500) 10%);
}

.topbar p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: clamp(0.95rem, 2vw, 1.08rem);
  line-height: 1.55;
  max-width: 65ch;
}

.topbar-highlights {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  align-self: start;
}

.highlight-pill {
  border: 1px solid rgba(79, 47, 36, 0.28);
  border-radius: 999px;
  padding: 7px 11px;
  font-size: 0.76rem;
  font-weight: 700;
  color: color-mix(in srgb, var(--brown) 82%, var(--rose-700) 18%);
  background: linear-gradient(180deg, rgba(255, 250, 247, 0.92), rgba(247, 236, 230, 0.9));
  letter-spacing: 0.02em;
}

.admin-link {
  text-decoration: none;
  border: 1px solid rgba(122, 18, 55, 0.35);
  color: var(--accent-strong);
  background: rgba(255, 243, 248, 0.72);
  border-radius: 999px;
  padding: 8px 14px;
  font-size: 0.85rem;
  font-weight: 700;
}

.admin-link:hover {
  background: #fff;
}

main {
  min-width: 0;
}

.section-head {
  margin: 0 0 16px;
  padding: 4px 2px 14px;
  border-bottom: 1px solid rgba(79, 47, 36, 0.16);
}

.section-head h2 {
  margin: 0;
  color: color-mix(in srgb, var(--brown) 92%, var(--rose-700) 8%);
  font-family: "Newsreader", Georgia, serif;
  font-size: clamp(1.25rem, 3vw, 1.7rem);
}

.section-head p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.45;
}

.gallery {
  align-self: start;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 14px;
}

.gallery .card {
  animation: cardIn 0.45s ease both;
}

.gallery .card:nth-child(2) { animation-delay: 0.04s; }
.gallery .card:nth-child(3) { animation-delay: 0.08s; }
.gallery .card:nth-child(4) { animation-delay: 0.12s; }
.gallery .card:nth-child(5) { animation-delay: 0.16s; }
.gallery .card:nth-child(6) { animation-delay: 0.2s; }

.gallery-empty {
  grid-column: 1 / -1;
  border: 1px solid rgba(79, 47, 36, 0.18);
  border-radius: 16px;
  background:
    radial-gradient(circle at 10% -40%, rgba(255, 255, 255, 0.9) 0%, transparent 55%),
    linear-gradient(145deg, #fbf1ec, #f7e5dd);
  padding: 18px;
  box-shadow: var(--shadow-soft);
}

.gallery-empty h3 {
  margin: 0;
  color: var(--accent-strong);
  font-family: "Newsreader", Georgia, serif;
  font-size: 1.4rem;
}

.gallery-empty p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.5;
}

.data-status {
  margin: 0 0 10px;
  color: var(--brown);
  font-weight: 500;
}

.card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background:
    radial-gradient(circle at 50% -60%, rgba(255, 255, 255, 0.95) 0%, transparent 70%),
    var(--surface);
  box-shadow: var(--shadow-soft), inset 0 1px 0 rgba(255, 244, 248, 0.9);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
  content-visibility: auto;
  contain-intrinsic-size: 280px;
}

.card-clickable {
  cursor: pointer;
}

.selected-chip {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  border-radius: 999px;
  font-size: 0.74rem;
  padding: 4px 8px;
  color: #fff;
  background: linear-gradient(135deg, var(--rose-700), var(--accent));
  border: 1px solid rgba(255, 255, 255, 0.4);
}

.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card), inset 0 1px 0 rgba(255, 220, 220, 0.6);
  border-color: color-mix(in srgb, var(--brown-500) 64%, #ffffff 36%);
}

.card.is-selected {
  border-color: var(--accent);
  box-shadow: 0 0 0 2px rgba(196, 32, 80, 0.3), var(--shadow-card);
}

.select-btn {
  position: absolute;
  top: 11px;
  right: 11px;
  z-index: 2;
  width: 30px;
  height: 30px;
  border-radius: 999px;
  border: 1px solid #d1d1d1;
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(3px);
  cursor: pointer;
  transition: all 0.18s ease;
}

.card.is-selected .select-btn {
  background: var(--accent);
  border-color: var(--accent);
}

.card.is-selected .select-btn::after {
  content: "✓";
  color: #fff;
  font-size: 14px;
  line-height: 1;
}

.image-wrap {
  aspect-ratio: 4 / 3;
  position: relative;
  overflow: hidden;
  background: linear-gradient(120deg, #f6dce7 0%, #edbed2 100%);
  background-size: 200% 100%;
  animation: none;
}

.image-wrap.img-loaded {
  background: none;
  animation: none;
}

.image-wrap img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 0.38s ease, transform 0.38s ease;
}

.image-wrap img.img-ready {
  opacity: 1;
  transform: scale(1);
}

.card:hover .image-wrap img.img-ready {
  transform: scale(1.03);
}

.card-body {
  padding: 14px;
  display: grid;
  gap: 10px;
}

.card h3 {
  margin: 0;
  font-size: 1.02rem;
  font-weight: 650;
}

.media-count {
  width: fit-content;
  border: 1px solid rgba(79, 47, 36, 0.22);
  color: var(--brown);
  border-radius: 999px;
  font-size: 0.75rem;
  padding: 3px 8px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(247, 235, 228, 0.76));
}

.view-btn {
  border: 1px solid rgba(122, 18, 55, 0.22);
  background: rgba(255, 255, 255, 0.7);
  color: var(--accent-strong);
  border-radius: 9px;
  padding: 8px 10px;
  font-size: 0.84rem;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.view-btn:hover {
  background: rgba(255, 255, 255, 0.92);
}

.price {
  font-weight: 700;
  color: color-mix(in srgb, var(--brown-700) 84%, var(--rose-700) 16%);
}

.checkout {
  position: sticky;
  top: 24px;
  align-self: start;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    radial-gradient(circle at 90% -30%, rgba(255, 255, 255, 0.92) 0%, transparent 54%),
    linear-gradient(180deg, #fff9f6, #fbf0ea);
  padding: 18px;
  box-shadow: var(--shadow-checkout);
  max-height: calc(100vh - 50px);
  overflow-y: auto;
  scroll-margin-top: 90px;
}

.checkout h2 {
  margin: 0 0 12px;
  font-family: "Newsreader", Georgia, serif;
  font-size: 1.52rem;
  letter-spacing: -0.01em;
}

.checkout label {
  display: block;
  font-size: 0.84rem;
  color: var(--muted);
  margin: 12px 0 6px;
}

.checkout input,
.checkout textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 11px 12px;
  font: inherit;
  background: linear-gradient(180deg, #fffdfc, #fdf4ef);
}

.checkout input:focus,
.checkout textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(212, 67, 110, 0.14);
}

.summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  color: color-mix(in srgb, var(--ink) 86%, var(--brown) 14%);
}

.selected-list {
  margin: 0;
  padding: 0;
  list-style: none;
  color: #34140c;
  font-size: 0.9rem;
  min-height: 24px;
}

.whatsapp-btn {
  width: 100%;
  margin-top: 14px;
  border: 0;
  border-radius: 12px;
  padding: 13px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--rose-500) 72%, var(--brown-500) 28%), var(--brown-700));
  color: #fff;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.16s ease, filter 0.16s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.whatsapp-btn:hover:not(:disabled) {
  transform: translateY(-1px);
  filter: brightness(1.02);
}

.whatsapp-btn:disabled {
  background: color-mix(in srgb, var(--brown-light) 86%, #ffffff 14%);
  cursor: not-allowed;
}

.whatsapp-btn.is-loading {
  cursor: wait;
  opacity: 0.95;
}

.spinner {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  border: 2px solid rgba(255, 255, 255, 0.45);
  border-top-color: #ffffff;
  animation: spin 0.8s linear infinite;
}

.select-btn:focus-visible,
.qty-btn:focus-visible,
.whatsapp-btn:focus-visible {
  outline: 3px solid rgba(255, 196, 220, 0.7);
  outline-offset: 2px;
}

.checkout input:focus-visible,
.checkout textarea:focus-visible {
  outline: 3px solid rgba(143, 18, 58, 0.45);
  outline-offset: 1px;
}

@media (max-width: 1024px) {
  body {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 14px;
  }

  .checkout {
    position: static;
    max-height: none;
  }
}

@media (max-width: 560px) {
  body {
    gap: 12px;
    padding: 8px 8px calc(76px + var(--safe-bottom));
  }

  main {
    display: grid;
    gap: 10px;
  }

  .topbar {
    position: static;
    border: 1px solid rgba(79, 47, 36, 0.2);
    border-radius: 12px;
    padding: 10px;
    margin-bottom: 6px;
    background:
      radial-gradient(circle at 12% -20%, rgba(255, 255, 255, 0.8) 0%, transparent 44%),
      linear-gradient(145deg, rgba(249, 239, 233, 0.92), rgba(244, 227, 218, 0.96));
    backdrop-filter: blur(8px);
  }

  .topbar-layout {
    grid-template-columns: 1fr;
    gap: 8px;
  }

  .topbar-highlights {
    justify-content: flex-start;
  }

  .brand-logo {
    width: 42px;
    height: 42px;
    margin: 0 0 6px;
  }

  .highlight-pill {
    font-size: 0.68rem;
    padding: 5px 8px;
  }

  .topbar h1 {
    margin: 4px 0 2px 0;
    font-size: clamp(1.6rem, 8vw, 2rem);
    line-height: 1.05;
  }

  .topbar p {
    font-size: 0.8rem;
    line-height: 1.3;
    margin: 4px 0 0 0;
  }
    font-size: 0.88rem;
    line-height: 1.4;
  }

  .data-status {
    margin: 0;
    font-size: 0.85rem;
  }

  .card-body {
    padding: 10px;
    gap: 8px;
  }

  .card h3 {
    font-size: 0.98rem;
    line-height: 1.3;
  }

  .price {
    font-size: 1rem;
  }

  .checkout {
    margin-top: 2px;
    border-radius: 18px;
    padding: 14px;
    background:
      radial-gradient(circle at 88% -30%, rgba(255, 255, 255, 0.9) 0%, transparent 48%),
      linear-gradient(180deg, #fff8f4, #f8ece5);
  }

  .selected-list {
    max-height: 30vh;
    overflow-y: auto;
    overscroll-behavior: contain;
  }

  .checkout h2 {
    margin-bottom: 8px;
    font-size: 1.4rem;
  }

  .checkout label {
    margin: 8px 0 5px;
  }

  .checkout input,
  .checkout textarea {
    padding: 10px;
    font-size: 16px;
  }

  .clear-cart-btn,
  .variant-block select {
    min-height: 42px;
    font-size: 16px;
  }

  .qty-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
  }

  .site-footer {
    margin-top: 2px;
    padding: 8px 0 2px;
  }

  .product-modal__content {
    margin: 0;
    width: 100vw;
    max-height: 100vh;
    min-height: 100vh;
    border-radius: 0;
    border: 0;
    padding: 12px;
    padding-bottom: calc(18px + var(--safe-bottom));
  }

  .product-modal__grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .product-gallery__main {
    aspect-ratio: 4 / 5;
    border: 1px solid rgba(122, 18, 55, 0.15);
    background: #fff;
  }

  .product-gallery__main img {
    object-fit: contain;
    background: #fff;
  }

  .product-gallery__thumbs {
    display: flex;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    padding-bottom: 4px;
    gap: 8px;
    scrollbar-width: thin;
    grid-template-columns: none;
  }

  .thumb-btn {
    flex: 0 0 74px;
    width: 74px;
    height: 74px;
  }

  .product-gallery__hint {
    font-size: 0.8rem;
    line-height: 1.35;
  }

  .gallery-fullscreen-btn {
    width: 100%;
    min-height: 40px;
  }

  .image-lightbox__content {
    padding: 14px;
  }

  .image-lightbox__stage {
    max-height: calc(100vh - 172px);
  }

  .image-lightbox__img {
    max-height: calc(100vh - 28px);
    border-radius: 10px;
  }

  .image-lightbox__close {
    top: calc(8px + var(--safe-bottom));
    right: 8px;
  }

  .image-lightbox__controls {
    width: 100%;
    justify-content: center;
    border-radius: 12px;
  }

  .image-lightbox__control-btn {
    min-width: 40px;
    height: 40px;
    font-size: 1rem;
  }

  .image-lightbox__hint {
    font-size: 0.78rem;
    line-height: 1.3;
  }

  .product-info h3 {
    font-size: 1.55rem;
  }

  .product-actions .whatsapp-btn {
    position: sticky;
    bottom: 0;
    z-index: 5;
    box-shadow: 0 -8px 18px rgba(47, 21, 13, 0.12);
  }

  .toast {
    bottom: calc(80px + var(--safe-bottom));
    max-width: calc(100vw - 16px);
    white-space: normal;
    text-align: center;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gallery .card,
  .image-wrap img,
  .whatsapp-btn,
  .card {
    animation: none !important;
    transition: none !important;
  }
}

@media (max-width: 390px) {
  .gallery {
    grid-template-columns: 1fr;
  }
}

/* Mobile Fullscreen Product Modal */
.product-modal.is-mobile {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
}

.product-modal.is-mobile ~ .topbar,
.product-modal.is-mobile ~ main,
.product-modal.is-mobile ~ aside,
.product-modal.is-mobile ~ .mobile-cart-bar {
  display: none;
}

.product-modal.is-mobile .product-modal__backdrop {
  display: none;
}

.product-modal.is-mobile .product-modal__content {
  position: absolute;
  inset: 0;
  margin: 0;
  width: 100vw;
  height: 100vh;
  max-height: 100vh;
  min-height: 100vh;
  border-radius: 0;
  border: 0;
  padding: 0;
  overflow: auto;
  background: linear-gradient(180deg, #fff4f6, #fdf8f5);
  animation: slideUpFromBottom 0.28s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}

@keyframes slideUpFromBottom {
  from {
    opacity: 0;
    transform: translateY(100%);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.product-modal.is-mobile .product-modal__close {
  position: fixed;
  top: 8px;
  right: 8px;
  z-index: 100;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(79, 47, 36, 0.2);
  color: var(--ink);
  font-size: 1.8rem;
  cursor: pointer;
  backdrop-filter: blur(6px);
  box-shadow: 0 4px 12px rgba(47, 21, 13, 0.18);
  padding: 0;
}

.product-modal.is-mobile .product-modal__grid {
  display: flex;
  flex-direction: column;
  padding: 14px;
  padding-top: 62px;
  gap: 18px;
}

.product-modal.is-mobile .product-gallery {
  width: 100%;
  margin: 0;
  padding: 0;
}

.product-modal.is-mobile .product-gallery__main {
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  overflow: hidden;
  background: linear-gradient(145deg, #f5aabf, #e88aa5);
  border: 1px solid rgba(122, 18, 55, 0.1);
  margin-bottom: 8px;
}

.product-modal.is-mobile .product-gallery__main[role="button"] {
  cursor: zoom-in;
}

.product-modal.is-mobile .product-gallery__main.is-loaded {
  background: none;
}

.product-modal.is-mobile .product-gallery__main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.product-modal.is-mobile .product-gallery__thumbs {
  display: flex;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  gap: 7px;
  padding: 0 0 8px 0;
  scrollbar-width: thin;
  margin: 0;
}

.product-modal.is-mobile .thumb-btn {
  flex: 0 0 66px;
  width: 66px;
  height: 66px;
  border-radius: 8px;
  border: 2px solid transparent;
}

.product-modal.is-mobile .thumb-btn.is-active {
  border-color: rgba(79, 47, 36, 0.4);
}

.product-modal.is-mobile .product-gallery__hint {
  font-size: 0.72rem;
  line-height: 1.3;
  color: var(--muted);
  margin-top: 6px;
  text-align: center;
}

.product-modal.is-mobile .gallery-fullscreen-btn {
  width: 100%;
  min-height: 36px;
  font-size: 0.82rem;
  border-radius: 8px;
  border: 1px solid rgba(79, 47, 36, 0.25);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.7), rgba(255, 248, 246, 0.8));
  color: var(--ink);
  cursor: pointer;
  transition: all 0.2s;
  font-weight: 600;
}

.product-modal.is-mobile .gallery-fullscreen-btn:active {
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(255, 255, 255, 0.8));
}

.product-modal.is-mobile .product-info {
  padding: 0;
}

.product-modal.is-mobile .product-info h3 {
  font-size: 1.65rem;
  font-weight: 700;
  margin: 0 0 8px 0;
  line-height: 1.3;
  color: color-mix(in srgb, var(--brown-700) 92%, var(--rose-500) 8%);
  word-wrap: break-word;
  overflow-wrap: break-word;
}

.product-modal.is-mobile .product-price {
  font-size: 1.45rem;
  font-weight: 700;
  color: color-mix(in srgb, var(--brown-700) 85%, var(--rose-700) 15%);
  margin: 4px 0 12px 0;
}

.product-modal.is-mobile .product-rating {
  font-size: 0.92rem;
  color: var(--muted);
  margin: 2px 0 12px 0;
  font-weight: 500;
}

.product-modal.is-mobile .stock-pill {
  font-size: 0.85rem;
  margin: 6px 0 14px 0;
  display: inline-block;
  padding: 7px 14px;
  border-radius: 22px;
  font-weight: 600;
}

.product-modal.is-mobile .product-description {
  font-size: 1.02rem;
  line-height: 1.7;
  color: var(--ink);
  margin: 14px 0;
}

.product-modal.is-mobile .variant-block {
  margin: 12px 0;
}

.product-modal.is-mobile .variant-block label {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--ink);
}

.product-modal.is-mobile .variant-block select {
  width: 100%;
  padding: 10px 10px;
  border-radius: 8px;
  border: 1px solid rgba(79, 47, 36, 0.25);
  background: #fff;
  font-size: 0.9rem;
  color: var(--ink);
  cursor: pointer;
}

.product-modal.is-mobile .product-actions {
  margin: 16px 0 0 0;
  padding-bottom: calc(60px + 16px + var(--safe-bottom));
}

.product-modal.is-mobile .product-actions .whatsapp-btn {
  position: fixed;
  bottom: calc(8px + var(--safe-bottom));
  left: 8px;
  right: 8px;
  z-index: 99;
  width: calc(100% - 16px);
  min-height: 52px;
  border-radius: 12px;
  font-size: 0.97rem;
  font-weight: 700;
  box-shadow: 0 4px 16px rgba(47, 21, 13, 0.22);
  transition: all 0.2s ease;
}

.product-modal.is-mobile .product-actions .whatsapp-btn:disabled {
  opacity: 0.6;
}

.product-modal.is-mobile .product-actions .whatsapp-btn:active:not(:disabled) {
  transform: scale(0.96);
}

.product-modal.is-mobile .product-reviews {
  margin: 24px 0 0 0;
  padding: 24px 0 0 0;
  border-top: 1px solid rgba(79, 47, 36, 0.15);
}

.product-modal.is-mobile .product-reviews h4 {
  font-size: 0.97rem;
  font-weight: 700;
  margin-bottom: 14px;
  color: var(--ink);
}

.product-modal.is-mobile .reviews-list {
  list-style: none;
  padding: 0;
  margin: 0 0 16px 0;
}

.product-modal.is-mobile .review-item {
  margin-bottom: 10px;
  font-size: 0.85rem;
  line-height: 1.4;
}

.product-modal.is-mobile .review-item strong {
  display: block;
  margin-bottom: 2px;
}

.product-modal.is-mobile .review-item span {
  font-size: 0.8rem;
  color: var(--muted);
}

.product-modal.is-mobile .review-empty {
  font-size: 0.85rem;
  color: var(--muted);
  font-style: italic;
}

.product-modal.is-mobile .review-form {
  display: grid;
  gap: 10px;
  padding: 12px 0;
}

.product-modal.is-mobile .review-form label {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
}

.product-modal.is-mobile .review-form input,
.product-modal.is-mobile .review-form select,
.product-modal.is-mobile .review-form textarea {
  padding: 10px;
  border-radius: 8px;
  border: 1px solid rgba(79, 47, 36, 0.2);
  background: #fff;
  font-size: 0.9rem;
  color: var(--ink);
  font-family: inherit;
}

.product-modal.is-mobile .review-form textarea {
  resize: vertical;
  min-height: 70px;
}

.product-modal.is-mobile .review-submit {
  padding: 10px;
  background: linear-gradient(135deg, rgba(242, 113, 162, 0.8), rgba(128, 30, 60, 0.85));
  color: #fff;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}

.product-modal.is-mobile .review-submit:active {
  transform: scale(0.98);
}

.product-modal.is-mobile .review-submit:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* Cart item with quantity controls */
.cart-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 7px 0;
  border-bottom: 1px solid var(--line);
  gap: 8px;
}

.cart-item:last-child { border-bottom: none; }

.cart-item-name {
  flex: 1;
  font-size: 0.87rem;
  line-height: 1.4;
  display: grid;
  gap: 3px;
}

.cart-item-variant {
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 600;
}

.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}

.qty-btn {
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--ink);
  font-size: 15px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.14s;
}

.qty-btn:hover { background: var(--line); }

.qty-value {
  min-width: 20px;
  text-align: center;
  font-size: 0.87rem;
  font-weight: 600;
}

.cart-item-price {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--accent-strong);
  min-width: 54px;
  text-align: right;
}

.checkout-row-actions {
  margin-top: 10px;
}

.clear-cart-btn {
  width: 100%;
  border: 1px solid rgba(79, 47, 36, 0.3);
  border-radius: 10px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.78), rgba(244, 231, 224, 0.84));
  color: color-mix(in srgb, var(--brown-700) 82%, var(--rose-700) 18%);
  font-weight: 700;
  padding: 10px 12px;
  cursor: pointer;
}

.clear-cart-btn:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Skeleton loading */
.card.skeleton { animation: none; }

.skeleton .image-wrap {
  background: linear-gradient(90deg, #ea83a7 25%, #ffc0d5 50%, #ea83a7 75%);
  background-size: 200% 100%;
  animation: pulse 1.4s ease infinite;
}

.skeleton-line {
  border-radius: 4px;
  background: linear-gradient(90deg, #ea83a7 25%, #ffc0d5 50%, #ea83a7 75%);
  background-size: 200% 100%;
  animation: pulse 1.4s ease infinite;
}

@keyframes pulse {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

@keyframes spin {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

/* Card entrance animation */
@keyframes cardIn {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* Toast notification */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #fff;
  padding: 9px 18px;
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 500;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.22s ease, transform 0.22s ease;
  z-index: 999;
  white-space: nowrap;
}

.toast.toast-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Footer */
.site-footer {
  grid-column: 1 / -1;
  text-align: center;
  font-size: 0.8rem;
  color: #6d3f31;
  padding: 12px 0 6px;
  border-top: 1px solid rgba(120, 66, 51, 0.22);
}

.site-footer p { margin: 0; }

.mobile-cart-bar {
  display: none;
}

@media (max-width: 560px) {
  .mobile-cart-bar {
    position: fixed;
    left: 8px;
    right: 8px;
    bottom: calc(8px + var(--safe-bottom));
    border: 0;
    border-radius: 14px;
    padding: 10px 12px;
    background: rgba(76, 43, 31, 0.92);
    color: #fff;
    z-index: 60;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    text-align: left;
    box-shadow: 0 10px 20px rgba(47, 21, 13, 0.28);
    backdrop-filter: blur(8px);
  }

  .mobile-cart-bar.has-items {
    background: linear-gradient(135deg, #8e173f, #b61f58);
  }

  .mobile-cart-bar__label {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.86;
    font-weight: 700;
  }

  .mobile-cart-bar__value {
    font-size: 0.9rem;
    font-weight: 700;
  }
}

.product-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
}

.product-modal.is-open {
  display: block;
}

.product-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(25, 10, 8, 0.5);
  animation: fadeIn 0.2s ease both;
}

.product-modal__content {
  position: relative;
  margin: 4vh auto;
  width: min(1000px, calc(100vw - 28px));
  max-height: 92vh;
  overflow: auto;
  background:
    radial-gradient(circle at 86% -34%, rgba(255, 255, 255, 0.9) 0%, transparent 52%),
    linear-gradient(180deg, #fff4f6, #f8e9e1);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow-checkout);
  padding: 18px;
  animation: modalIn 0.24s ease both;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes modalIn {
  from { opacity: 0; transform: translateY(10px) scale(0.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

.product-modal__close {
  position: sticky;
  top: 0;
  margin-left: auto;
  display: block;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--ink);
  width: 34px;
  height: 34px;
  border-radius: 999px;
  cursor: pointer;
}

.product-modal__grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 18px;
}

.product-gallery__main {
  border-radius: 14px;
  overflow: hidden;
  background: linear-gradient(145deg, #f5aabf, #e88aa5);
  aspect-ratio: 1 / 1;
}

.product-gallery__main[role="button"] {
  cursor: zoom-in;
}

.product-gallery__main.is-loaded {
  background: none;
}

.product-gallery__main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 0.38s ease, transform 0.38s ease;
}

.product-gallery__main img.img-ready {
  opacity: 1;
  transform: scale(1);
}

.product-gallery__thumbs {
  margin-top: 10px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 8px;
}

.product-gallery__hint {
  margin: 8px 0 0;
  font-size: 0.84rem;
  color: var(--muted);
}

.gallery-fullscreen-btn {
  margin-top: 8px;
  border: 1px solid rgba(79, 47, 36, 0.28);
  background: rgba(255, 252, 253, 0.86);
  color: color-mix(in srgb, var(--brown-700) 78%, var(--rose-700) 22%);
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.gallery-fullscreen-btn:hover {
  background: #fff;
}

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: none;
}

.image-lightbox.is-open {
  display: block;
}

.image-lightbox__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  width: 100%;
  background: rgba(16, 10, 12, 0.92);
  cursor: zoom-out;
}

.image-lightbox__content {
  position: relative;
  z-index: 1;
  height: 100%;
  width: 100%;
  display: grid;
  place-items: center;
  gap: 10px;
  padding: 24px;
}

.image-lightbox__stage {
  width: 100%;
  height: 100%;
  max-height: calc(100vh - 120px);
  display: grid;
  place-items: center;
  overflow: hidden;
  touch-action: none;
  cursor: grab;
}

.image-lightbox__stage:active {
  cursor: grabbing;
}

.image-lightbox__img {
  max-width: min(1200px, 100%);
  max-height: calc(100vh - 48px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
  background: #fff;
  transition: transform 0.12s ease-out;
  transform-origin: center center;
  user-select: none;
  -webkit-user-drag: none;
}

.image-lightbox__close {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 2;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(22, 15, 18, 0.68);
  color: #fff;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.image-lightbox__controls {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #fff;
  background: rgba(22, 15, 18, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  padding: 6px 10px;
}

.image-lightbox__control-btn {
  border: 1px solid rgba(255, 255, 255, 0.3);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border-radius: 999px;
  min-width: 34px;
  height: 34px;
  cursor: pointer;
}

.image-lightbox__hint {
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 0.82rem;
  text-align: center;
}

.thumb-btn {
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
  height: 74px;
  background: #fff;
  cursor: pointer;
  padding: 0;
}

.thumb-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.thumb-btn img.img-ready {
  opacity: 1;
  transform: scale(1);
}

.thumb-placeholder {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(120deg, #f1d7e2, #f7eaf0);
}

.thumb-btn.is-active {
  outline: 2px solid var(--accent);
}

.product-info h3 {
  margin: 0;
  font-family: "Newsreader", Georgia, serif;
  font-size: 2rem;
}

.product-price {
  margin: 8px 0 2px;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--accent-strong);
}

.stock-pill {
  width: fit-content;
  margin: 8px 0 0;
  border-radius: 999px;
  border: 1px solid transparent;
  padding: 4px 10px;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.stock-pill--in_stock {
  color: #1c7c49;
  background: rgba(55, 170, 102, 0.14);
  border-color: rgba(55, 170, 102, 0.36);
}

.stock-pill--low_stock {
  color: #9f5c00;
  background: rgba(250, 186, 58, 0.16);
  border-color: rgba(204, 146, 31, 0.42);
}

.stock-pill--out_of_stock {
  color: #a02835;
  background: rgba(208, 72, 88, 0.14);
  border-color: rgba(181, 58, 73, 0.34);
}

.stock-pill--pre_order {
  color: color-mix(in srgb, var(--brown-700) 58%, var(--rose-700) 42%);
  background: rgba(161, 106, 84, 0.12);
  border-color: rgba(120, 73, 56, 0.34);
}

.variant-block {
  margin: 10px 0 14px;
  display: grid;
  gap: 6px;
}

.variant-block label {
  font-size: 0.84rem;
  color: var(--muted);
  font-weight: 600;
}

.variant-block select {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff8fb;
  color: var(--ink);
  padding: 10px;
  font: inherit;
}

.product-rating {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.92rem;
}

.product-description {
  margin: 0 0 14px;
  color: var(--ink);
  line-height: 1.6;
}

.product-actions {
  margin-bottom: 12px;
}

.product-actions .whatsapp-btn.is-in-cart {
  background: linear-gradient(135deg, #7a1237, #a41c4d);
}

.product-reviews h4 {
  margin: 12px 0 8px;
  font-size: 1rem;
}

.reviews-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

.review-item,
.review-empty {
  border: 1px solid rgba(122, 18, 55, 0.15);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.65);
  padding: 10px;
}

.review-item p {
  margin: 6px 0 0;
  color: var(--ink);
}

.review-form {
  margin-top: 12px;
  display: grid;
  gap: 8px;
}

.review-form input,
.review-form select,
.review-form textarea {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff8fb;
  padding: 10px;
  font: inherit;
}

.review-submit {
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  padding: 10px 12px;
  cursor: pointer;
}
