:root {
  --bg: #eef1f6;
  --surface: #fff;
  --text: #0b0c10;
  --text-muted: #687086;
  --red: #d81f2a;
  --green: #0f7a3b;
  --green-dark: #165c2f;
  --gold: #f0c74a;
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 8px 22px rgba(0,0,0,0.12);
  --shadow-lg: 0 16px 36px rgba(0,0,0,0.15);
  --shadow-xl: 0 24px 60px rgba(0,0,0,0.25);
  --product-scale: 0.92;
}

/* ============ Reset ============ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { touch-action: manipulation; -webkit-text-size-adjust: 100%; }
body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background:
    radial-gradient(1200px 800px at 10% -10%, rgba(255,255,255,0.8), transparent 60%),
    radial-gradient(1000px 800px at 110% 0%, rgba(255,255,255,0.7), transparent 60%),
    var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ============ Layout ============ */
.stage { max-width: 1200px; margin: 0 auto; padding: 24px; }
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; gap: 16px; }

/* ============ Buttons ============ */
.btn {
  padding: 10px 18px;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.1);
  background: var(--surface);
  color: var(--text);
  font-weight: 500;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.15s ease;
  box-shadow: var(--shadow-sm);
  user-select: none;
}
.btn:hover { border-color: var(--red); transform: translateY(-1px); box-shadow: var(--shadow-md); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; transform: none !important; }

#pi { color: var(--text-muted); font-size: 0.95rem; font-weight: 500; }
#pi b { color: var(--text); font-weight: 600; }

/* ============ Logo ============ */
.logo-container { display: flex; justify-content: center; margin-bottom: 20px; }
.logo { max-width: 240px; height: auto; object-fit: contain; }

/* ============ Book ============ */
.book {
  width: 100%;
  max-width: 1000px;
  margin: 0 auto;
  position: relative;
  cursor: grab;
  backface-visibility: hidden;
  box-shadow: var(--shadow-lg);
  border-radius: 12px;
  user-select: none;
  touch-action: pan-y;
}
.book:active { cursor: grabbing; }
.book img { pointer-events: none; -webkit-user-drag: none; }

/* PageFlip Overrides */
.book .page, .book .page * { backface-visibility: hidden; }
.book .page { transform-style: preserve-3d; }
.stf__item, .stf__hardPage, .stf__block { background: var(--surface) !important; }
.stf__wrapper { background: transparent !important; }
.stf__outerShadow, .stf__hardShadow { opacity: 0 !important; display: none !important; }

/* Hide page backs completely */
.stf__page { background: var(--surface) !important; }
.stf__pageInner { background: var(--surface) !important; }

/* Smooth page transitions */
.stf__canvas { transition: opacity 0.2s ease !important; }

/* Better mobile handling */
@media (max-width: 430px) {
  .book { overflow: hidden !important; -webkit-overflow-scrolling: touch; }
  .stf__item { background: var(--surface) !important; }
}

/* ============ Pages ============ */
.page {
  position: relative;
  background: var(--surface);
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  backface-visibility: hidden;
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,0.06),
    0 10px 24px rgba(0,0,0,0.08);
}
.page::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(1200px 900px at 10% 10%, rgba(0,0,0,0.03) 0%, transparent 60%);
  opacity: 0.16;
  pointer-events: none;
}
.page::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0; right: 0;
  width: 28px;
  background: linear-gradient(90deg, transparent 0%, rgba(16,96,52,0.18) 100%);
  pointer-events: none;
}
.page > * { position: relative; z-index: 1; }

/* ============ Cover (Front) ============ */
.cover { background: linear-gradient(145deg, #fff, #f1f2f4); }
.page.cover--front .cover-inner {
  height: 100%;
  display: grid;
  place-items: center;
  text-align: center;
  position: relative;
  /* Edge guard to keep content off the gold border */
  --edge: clamp(22px, 6.5vw, 48px);
  padding-block: calc(var(--edge) + 6px);
  padding-inline: var(--edge);
}
.page.cover--front .cover-inner::before {
  content: "";
  position: absolute;
  inset: clamp(16px, 3.5vw, 22px);
  border-radius: 10px;
  border: 3px solid var(--gold);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,0.04);
  pointer-events: none;
}
.page.cover--front .cover-inner::after {
  content: "Happy Holidays";
  position: absolute;
  top: clamp(12px, 3vw, 22px);
  right: clamp(-40px, -6vw, -28px);
  transform: rotate(35deg);
  background: linear-gradient(90deg, var(--red), var(--green-dark));
  color: #fff;
  font-weight: 700;
  font-size: clamp(0.72rem, 2.2vw, 0.85rem);
  letter-spacing: 0.04em;
  padding: 6px clamp(28px, 6vw, 46px);
  border-radius: 6px;
  box-shadow: var(--shadow-md);
  filter: drop-shadow(0 6px 14px rgba(0,0,0,.18));
  pointer-events: none;
  z-index: 10;
}
.page.cover--front .cover-inner img {
  max-width: 240px;
  margin: 12px auto;
  border-radius: 8px;
}
.page.cover--front .cover-inner h1 {
  max-width: min(90%, 540px);
  margin: clamp(8px, 1.8vh, 16px) auto 0;
  font-size: clamp(1.3rem, 4.8vw, 2rem);
  font-weight: 700;
  line-height: 1.22;
  text-wrap: balance;
}
.page.cover--front .cover-inner p { margin-top: 12px; font-size: 1rem; color: var(--text-muted); }
.page.cover--front .cover-inner a { color: var(--red); text-decoration: none; font-weight: 600; }
.page.cover--front .cover-inner a:hover { color: var(--green-dark); text-decoration: underline; }
.page.cover--front .logo {
  width: clamp(160px, 48vw, 260px);
  height: auto;
  object-fit: contain;
  display: block;
  margin: 8px auto 4px;
  image-rendering: -webkit-optimize-contrast;
}

/* ============ Simple Border (Inner Pages) - NO CANDY CANE ============ */
.page:not(.cover) {
  border: none !important;
  background: var(--surface) !important;
  box-shadow:
    inset 0 0 0 1px rgba(0,0,0,0.05),
    0 12px 26px rgba(0,0,0,0.09) !important;
}

/* Also hide during flip animations */
.stf__item:not(.cover),
.stf__hardPage:not(.cover) {
  border: none !important;
  background: var(--surface) !important;
}

/* ============ Page Title Hover ============ */
.page h2 {
  position: absolute;
  top: 16px; left: 16px; right: 16px;
  margin: 0; padding: 10px 16px;
  text-align: center;
  font-size: 1.4rem; font-weight: 700;
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(8px);
  border-radius: 8px;
  box-shadow: var(--shadow-sm);
  opacity: 0; transform: translateY(-10px);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none; z-index: 10;
}
.page:hover h2 { opacity: 1; transform: translateY(0); }

/* ============ Product Gallery ============ */
.gear-gallery {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(2, minmax(0, 1fr));
  width: 100%; height: 100%; gap: 0;
}
.gear-tile {
  display: flex; align-items: center; justify-content: center;
  overflow: hidden; background: var(--surface);
  border: 1px solid var(--gold); cursor: pointer;
  position: relative; transition: all 0.15s ease;
}
.gear-tile:hover { border-color: var(--text); z-index: 2; transform: scale(1.02); }
.gear-tile img {
  max-width: 100%; max-height: 100%;
  object-fit: contain; transform: scale(var(--product-scale));
  transition: transform 0.3s ease;
}
.gear-tile:hover img { transform: scale(calc(var(--product-scale) * 1.05)); }

/* Dots */
.dots { display: flex; justify-content: center; gap: 10px; margin-top: 16px; padding: 8px; }
.dot {
  width: 10px; height: 10px; border-radius: 50%;
  border: 2px solid rgba(15,122,59,0.3);
  background: var(--surface); cursor: pointer; transition: all 0.15s ease;
}
.dot:hover { transform: scale(1.15); border-color: var(--green); }
.dot.active {
  background: var(--green); border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(15,122,59,0.15);
  transform: scale(1.2);
}

/* Drag Hints - HIDDEN */
.drag-hint {
  display: none !important;
}

/* Ripple + Hint */
.ripple {
  position: absolute; border-radius: 50%; background: rgba(255,255,255,0.6);
  width: 20px; height: 20px; transform: translate(-50%, -50%) scale(0);
  animation: ripple-effect 0.6s ease-out; pointer-events: none; z-index: 100;
}
@keyframes ripple-effect { to { transform: translate(-50%, -50%) scale(15); opacity: 0; } }
@keyframes hint-flip { 0%, 100% { transform: rotateY(0deg); } 50% { transform: rotateY(12deg); } }

/* Body Lock when modal open */
body.modal-open { overflow: hidden; position: fixed; width: 100%; }
body.modal-open .book * { pointer-events: none !important; }
body.modal-open .modal * { pointer-events: auto !important; }

/* =========================================
   MODAL - MOBILE OPTIMIZED
   ========================================= */
.modal {
  position: fixed; inset: 0;
  display: grid; place-items: center;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  z-index: 999;
}
.modal.is-open { opacity: 1; visibility: visible; pointer-events: auto; }

.modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  opacity: 0; transition: opacity 0.3s ease;
}
.modal.is-open .modal__backdrop { opacity: 1; }

/* Modal Dialog */
.modal__dialog {
  position: relative;
  width: 92vw; max-width: 900px;
  height: 85vh; max-height: 800px;
  background: white; border-radius: 20px; overflow: hidden;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
  border: 1px solid rgba(0, 0, 0, 0.1);
  transform: scale(0.9); opacity: 0;
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1), opacity 0.3s ease;
}
.modal.is-open .modal__dialog { transform: scale(1); opacity: 1; }

.gear-tile-info {
  position: relative; background: white; border-radius: 12px; overflow: hidden;
  box-shadow: 0 4px 6px rgba(0,0,0,0.1);
  cursor: default; pointer-events: none;
  display: flex; align-items: center; justify-content: center;
}

.tile-info {
  width: 100%; max-width: 90%; height: auto; background: transparent; color: #1a1a1a;
  padding: clamp(10px, 2.5vw, 18px);
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  border-radius: 0; box-shadow: none; backdrop-filter: none; border: none;
  transition: all 0.3s ease; position: relative; overflow: hidden;
}
.tile-info::before {
  content: ''; position: absolute; top: 0; left: -100%; width: 100%; height: 100%;
  background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
  transition: left 0.5s ease;
}
.tile-info:active::before { left: 100%; }
.tile-info:active { transform: scale(0.98); box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4); }

/* iPhone 12 specific */
@media screen and (max-width: 390px) {
  .tile-info { min-height: 180px; padding: 20px 16px; border-radius: 12px; }
}

/* Safe area support */
@supports (padding: max(0px)) {
  .tile-info {
    padding-left: max(16px, env(safe-area-inset-left));
    padding-right: max(16px, env(safe-area-inset-right));
  }
}

.tile-info h3 {
  margin: 0 0 12px 0;
  font-size: clamp(1.1rem, 4vw, 1.4rem);
  font-weight: 600; letter-spacing: -0.02em; line-height: 1.2;
  color: #1a1a1a; text-align: center;
}
.tile-info p {
  margin: 0;
  font-size: clamp(0.85rem, 3.5vw, 1rem);
  line-height: 1.5; color: #555; font-weight: 400; letter-spacing: 0.01em;
  text-align: center;
}
.tile-info .badge {
  display: inline-block; padding: 4px 12px; background: rgba(102, 126, 234, 0.1);
  border-radius: 20px; font-size: 0.75rem; font-weight: 500; margin-top: 12px;
  width: fit-content; backdrop-filter: blur(10px);
}

/* Improved readability on smaller screens */
@media screen and (max-width: 390px) {
  .tile-info h3 { margin-bottom: 8px; font-size: 1.15rem; }
  .tile-info p { font-size: 0.9rem; line-height: 1.4; }
}

/* Close Button */
.modal__close {
  position: absolute; top: 12px; right: 12px;
  width: 44px; height: 44px; min-width: 44px; min-height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%; border: none;
  background: rgba(0, 0, 0, 0.1); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  cursor: pointer; font-size: 28px; line-height: 1; color: #333;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 1000; transition: all 0.2s ease; -webkit-tap-highlight-color: transparent;
}
.modal__close:active { background: rgba(0, 0, 0, 0.25); transform: scale(0.95); }

/* Modal Grid & Cards */
.modal__grid {
  display: flex; align-items: stretch; justify-content: center;
  gap: 16px; padding: 20px; height: 100%; flex-wrap: nowrap;
}
.modal__card {
  flex: 1; max-width: 420px; height: 100%; perspective: 1200px;
  border-radius: 16px; overflow: hidden; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.modal__cardInner {
  position: relative; width: 100%; height: 100%;
  transform-style: preserve-3d; transition: transform 0.6s cubic-bezier(0.22, 0.61, 0.36, 1);
  cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.modal__cardInner.is-flipped { transform: rotateY(180deg); }

.modal__face {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  border-radius: 16px; overflow: hidden;
}
.modal__face--front { z-index: 2; background: white; }
.modal__face--front img {
  max-width: 90%; max-height: 90%; width: auto; height: auto; object-fit: contain; display: block;
}
.modal__face--back {
  transform: rotateY(180deg);
  background: linear-gradient(135deg, #f5f7fa 0%, #fff 100%);
  padding: 20px; overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.modal__backInner { max-width: 520px; margin: 0 auto; }

/* Product Detail (inside modal) */
.product-detail {
  padding: 1rem; display: flex; flex-direction: column; gap: 1rem;
  --pd-bg: #ffffff;
  --pd-bg-soft: #fafafa;
  --pd-text: #1f2937;
  --pd-muted: #6b7280;
  --pd-border: #e5e7eb;
  --pd-accent: #7c4bd2;
  --pd-radius: 12px;
  --pd-radius-sm: 8px;
  --pd-shadow: 0 6px 20px rgba(0,0,0,.08);
  --pd-transition: .22s cubic-bezier(.2,.6,.2,1);
  color: var(--pd-text);
  background: var(--pd-bg-soft);
  border: 1px solid var(--pd-border);
  border-radius: var(--pd-radius);
}
.badge {
  display: inline-block; padding: 0.4rem 0.9rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white; border-radius: 20px; font-size: 0.75rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.5px; width: fit-content;
  box-shadow: 0 2px 8px rgba(102, 126, 234, 0.3);
}
.badge-new { background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); }
.badge-sport { background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%); }
.badge-winter { background: linear-gradient(135deg, #a8edea 0%, #fed6e3 100%); color: #333; }
.badge-default { background: linear-gradient(135deg, #ffd89b 0%, #19547b 100%); }
.product-detail h2 { font-size: 1.5rem; font-weight: 700; color: #1a1a1a; line-height: 1.3; margin: 0.5rem 0; }

.features { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.feature-tag {
  padding: 0.4rem 0.8rem; background: rgba(102,126,234,0.1);
  border: 1px solid rgba(102,126,234,0.2); border-radius: 12px;
  font-size: 0.75rem; color: #667eea; font-weight: 500;
}
.description { line-height: 1.6; color: #555; font-size: 0.95rem; }
.specs {
  display: flex; flex-direction: column; gap: 0.5rem; padding: 1rem;
  background: rgba(0,0,0,0.02); border-radius: 12px; border: 1px solid rgba(0,0,0,0.05);
}
.spec-item { display: flex; justify-content: space-between; font-size: 0.85rem; color: #666; }
.spec-item strong { color: #333; font-weight: 600; }

.carry-section {
  padding: 1.25rem;
  background: linear-gradient(135deg, rgba(102,126,234,0.05) 0%, rgba(118,75,162,0.05) 100%);
  border-radius: 12px; border-left: 3px solid #667eea;
}
.carry-section h3 { margin: 0 0 1rem; font-size: 1.1rem; font-weight: 700; color: #667eea; }
.carry-list { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 0.6rem; }
.carry-list li {
  padding: 0.7rem 0.85rem 0.7rem 2.2rem; background: white; border-radius: 8px;
  font-size: 0.9rem; color: #333; box-shadow: 0 1px 3px rgba(0,0,0,0.05); position: relative;
}
.carry-list li:before {
  content: '✓'; position: absolute; left: 0.75rem; color: #667eea; font-weight: bold; font-size: 1.1em;
}

/* Dropdowns inside product-detail */
/* Product Detail Dropdown Component */

.product-detail > h2 {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}

/* Dropdown Container */
.product-detail .dropdown {
  margin-block: 0.5rem;
  border: 1px solid var(--pd-border);
  border-radius: var(--pd-radius-sm);
  background: var(--pd-bg);
  overflow: hidden;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.product-detail .dropdown:hover {
  border-color: #d9dce3;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.06);
}

.product-detail .dropdown[open] {
  box-shadow: var(--pd-shadow);
}

.product-detail .dropdown + .dropdown {
  margin-block-start: 0.5rem;
}

/* Summary (Clickable Header) */
.product-detail .dropdown > summary {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1rem;
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--pd-text, #1a1a1a);
  list-style: none;
  cursor: pointer;
  user-select: none;
  position: relative;
  outline: none;
  transition: background-color 0.15s ease;
}

.product-detail .dropdown > summary::-webkit-details-marker {
  display: none;
}

.product-detail .dropdown > summary:hover {
  background: rgba(0, 0, 0, 0.02);
}

.product-detail .dropdown > summary:active {
  background: rgba(0, 0, 0, 0.04);
}

.product-detail .dropdown > summary:focus-visible {
  outline: 2px solid var(--pd-accent);
  outline-offset: -2px;
}

.product-detail .dropdown[open] > summary {
  border-bottom: 1px solid var(--pd-border);
  background: rgba(0, 0, 0, 0.01);
}

/* Chevron Icon */
.product-detail .dropdown > summary::after {
  content: "";
  margin-inline-start: auto;
  width: 0.5rem;
  height: 0.5rem;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  opacity: 0.6;
}

.product-detail .dropdown[open] > summary::after {
  transform: rotate(-135deg);
}

/* Dropdown Content */
.product-detail .dropdown__content,
.product-detail .dropdown ul {
  padding: 1rem 1.25rem 1rem 1.5rem;
  margin: 0;
  animation: slideDown 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-detail .dropdown ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* List Items */
.product-detail .dropdown li {
  position: relative;
  padding-inline-start: 1.25rem;
  color: var(--pd-text, #2d2d2d);
  font-size: 0.925rem;
  line-height: 1.6;
}

.product-detail .dropdown li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 0.65em;
  width: 0.375rem;
  height: 0.375rem;
  border-radius: 50%;
  background: var(--pd-accent, #6366f1);
  opacity: 0.75;
}

/* Animations */
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-0.5rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  .product-detail .dropdown,
  .product-detail .dropdown > summary::after,
  .product-detail .dropdown__content,
  .product-detail .dropdown ul {
    transition: none;
    animation: none;
  }
}


/* Ripple + Hint */
.ripple {
  position: absolute; border-radius: 50%; background: rgba(255,255,255,0.6);
  width: 20px; height: 20px; transform: translate(-50%, -50%) scale(0);
  animation: ripple-effect 0.6s ease-out; pointer-events: none; z-index: 100;
}
@keyframes ripple-effect { to { transform: translate(-50%, -50%) scale(15); opacity: 0; } }
@keyframes hint-flip { 0%, 100% { transform: rotateY(0deg); } 50% { transform: rotateY(12deg); } }

/* Body Lock when modal open */
body.modal-open { overflow: hidden; position: fixed; width: 100%; }
body.modal-open .book * { pointer-events: none !important; }
body.modal-open .modal * { pointer-events: auto !important; }

/* =========================================
   RESPONSIVE DESIGN
   ========================================= */

/* Tablet and Mobile Landscape */
@media (max-width: 900px) {
  .modal__grid { flex-direction: column; gap: 12px; }
  .modal__card { width: 100%; max-width: none; height: 48vh; min-height: 320px; }
}

/* Mobile Portrait */
@media (max-width: 768px) {
  .btn { padding: 10px 14px; font-size: 0.9rem; }
  #pi { font-size: 0.85rem; }
  .cover-inner h1 { font-size: 1.5rem; }
  .page h2 { font-size: 1.2rem; }

  .modal__dialog { width: 95vw; height: 90vh; max-height: none; border-radius: 16px; }
  .modal__close {
    top: 8px; right: 8px; width: 48px; height: 48px; font-size: 32px;
    background: rgba(255, 255, 255, 0.95); box-shadow: 0 2px 12px rgba(0, 0, 0, 0.2);
  }
  .modal__grid { padding: 16px; overflow-y: auto; -webkit-overflow-scrolling: touch; }

  .product-detail h2 { font-size: 1.25rem; }
  .badge { font-size: 0.7rem; padding: 0.35rem 0.75rem; }
  .feature-tag { font-size: 0.7rem; padding: 0.35rem 0.7rem; }
  .description { font-size: 0.9rem; }
  .carry-section { padding: 1rem; }
  .carry-section h3 { font-size: 1rem; }
  .carry-list li { font-size: 0.85rem; padding: 0.6rem 0.75rem 0.6rem 2rem; }
}

/* iPhone 12/13/14 and similar (390px width) */
@media (max-width: 430px) {
  .stage { padding: 16px; }
  .book { height: 68svh; max-height: 78svh; }
  .btn { padding: 12px 16px; font-size: 15px; }
  .logo { max-width: 180px; }
  .dots { gap: 12px; }
  .dot { width: 12px; height: 12px; }
  :root { --product-scale: 0.90; }

  .page h2 { opacity: 1; transform: none; font-size: 1.1rem; top: 12px; padding: 8px 12px; }
  .page.cover--front .cover-inner::after { top: 16px; right: -36px; padding: 6px 36px; font-size: 0.75rem; }
  .page.cover--front .cover-inner h1 { font-size: 1.3rem; }
  .page.cover--front .cover-inner p { font-size: 0.9rem; }

  .modal__dialog { width: 96vw; height: 92vh; border-radius: 12px; }
  .modal__grid { padding: 12px; gap: 10px; }
  .modal__card { height: 45vh; min-height: 280px; border-radius: 12px; }
  .modal__face--back { padding: 16px; }

  .product-detail { padding: 0.75rem; gap: 0.75rem; }
  .product-detail h2 { font-size: 1.15rem; }
  .features { gap: 0.4rem; }
  .feature-tag { font-size: 0.65rem; padding: 0.3rem 0.6rem; }
  .description { font-size: 0.85rem; line-height: 1.5; }
  .carry-section { padding: 0.9rem; }
  .carry-list li { font-size: 0.8rem; padding: 0.55rem 0.65rem 0.55rem 1.8rem; }
}

/* Landscape mode on mobile */
@media (max-height: 500px) and (orientation: landscape) {
  .modal__dialog { height: 95vh; width: 85vw; }
  .modal__grid { flex-direction: row; overflow-x: auto; }
  .modal__card { width: 45vw; height: 100%; min-height: auto; }
}

/* Safe area support for iPhone notches */
@supports (padding: max(0px)) {
  .modal__dialog {
    padding-top: max(12px, env(safe-area-inset-top));
    padding-bottom: max(12px, env(safe-area-inset-bottom));
  }
  .modal__close {
    top: max(8px, calc(env(safe-area-inset-top) + 8px));
    right: max(8px, calc(env(safe-area-inset-right) + 8px));
  }
}

/* Print */
@media print {
  .topbar, .dots, .drag-hint, .modal { display: none !important; }
  .page { break-inside: avoid; }
}

/* Tile-info text overflow fix for mobile */
.tile-info h3 { word-wrap: break-word; overflow-wrap: break-word; }
.tile-info p  { word-wrap: break-word; overflow-wrap: break-word; display: block; }

@media (max-width: 430px) {
  .tile-info { padding: 10px 8px; }
  .tile-info h3 { font-size: 0.95rem; margin-bottom: 5px; line-height: 1.2; }
  .tile-info p  { font-size: 0.7rem; line-height: 1.35; }
}

/* =========================================
   BACK COVER - MOBILE OPTIMIZED (EVEN SMALLER)
   ========================================= */
.cover--back .cover-inner {
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2.5% 2.5%;
  gap: 6px;
  position: relative;
}

.cover--back .cover-inner::before {
  content: "";
  position: absolute;
  inset: 18px;
  border-radius: 10px;
  border: 3px solid var(--gold);
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.04);
  pointer-events: none;
  z-index: 0;
}

.cover--back .giftcard-link {
  display: block;
  max-width: 220px;
  width: 32%;
  flex-shrink: 1;
  position: relative;
  z-index: 1;
}

.cover--back .giftcard-img {
  width: 100%;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  display: block;
  transition: transform 0.2s ease;
}

.cover--back .giftcard-link:hover .giftcard-img {
  transform: translateY(-2px);
}

.cover--back h1 {
  font-size: clamp(0.95rem, 2.6vw, 1.5rem);
  font-weight: 700;
  margin: 0;
  line-height: 1.2;
  color: #1a1a1a;
  position: relative;
  z-index: 1;
  max-width: 520px;
}

.cover--back p {
  margin: 0;
  font-size: clamp(0.65rem, 1.3vw, 0.82rem);
  color: #555;
  font-weight: 400;
  line-height: 1.3;
  position: relative;
  z-index: 1;
}

.cover--back p a {
  color: var(--red);
  text-decoration: none;
  font-weight: 600;
  transition: color 0.2s ease;
}

.cover--back p a:hover {
  color: var(--green-dark);
  text-decoration: underline;
}

/* Desktop */
@media (min-width: 1024px) {
  .cover--back .cover-inner {
    padding: 4.5% 5.5%;
    gap: 14px;
  }
  
  .cover--back .giftcard-link {
    max-width: 320px;
    width: 40%;
  }
  
  .cover--back h1 {
    font-size: 1.65rem;
  }
  
  .cover--back p {
    font-size: 0.95rem;
  }
}

/* Tablet */
@media (max-width: 900px) and (min-width: 431px) {
  .cover--back .cover-inner {
    padding: 3% 3%;
    gap: 8px;
  }
  
  .cover--back .giftcard-link {
    max-width: 250px;
    width: 38%;
  }
  
  .cover--back h1 {
    font-size: 1.3rem;
  }
  
  .cover--back p {
    font-size: 0.8rem;
  }
  
  .cover--back .cover-inner::before {
    inset: 16px;
  }
}

/* Mobile Portrait */
@media (max-width: 430px) {
  .cover--back .cover-inner {
    padding: 2.5% 2%;
    gap: 5px;
  }
  
  .cover--back .giftcard-link {
    max-width: 48%;
    width: 48%;
  }
  
  .cover--back h1 {
    font-size: 0.95rem;
    line-height: 1.25;
  }
  
  .cover--back p {
    font-size: 0.65rem;
  }
  
  .cover--back .cover-inner::before {
    inset: 12px;
    border-width: 2.5px;
  }
}

/* Very small phones */
@media (max-width: 375px) {
  .cover--back .cover-inner {
    gap: 4px;
    padding: 2.5% 1.5%;
  }
  
  .cover--back .giftcard-link {
    max-width: 50%;
    width: 50%;
  }
  
  .cover--back h1 {
    font-size: 0.9rem;
  }
  
  .cover--back p {
    font-size: 0.62rem;
  }
  
  .cover--back .cover-inner::before {
    inset: 10px;
    border-width: 2px;
  }
}

/* Landscape on mobile */
@media (max-height: 500px) and (orientation: landscape) {
  .cover--back .cover-inner {
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 2%;
    padding: 2% 3%;
  }
  
  .cover--back .giftcard-link {
    max-width: 24%;
    width: 24%;
  }
  
  .cover--back h1 {
    font-size: 0.95rem;
    text-align: left;
    line-height: 1.2;
  }
  
  .cover--back p {
    font-size: 0.65rem;
    text-align: left;
  }
  
  .cover--back .cover-inner::before {
    inset: 10px;
  }
}