/* 3DPlayLearning — single-page catalog */

:root {
  --plum: #5C4256;
  --terracotta: #C26B4F;
  --cream: #F5EDE5;
  --beige: #E5D2C2;
  --sage: #9CB39A;
  --ocra: #F2B65C;
  --ink: #3C2C36;
  --muted: #7A6470;
  --shadow: 0 4px 20px rgba(92, 66, 86, 0.12);
  --shadow-lg: 0 12px 40px rgba(92, 66, 86, 0.22);
  --radius: 14px;
  --maxw: 1200px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 { font-family: 'Poppins', sans-serif; font-weight: 600; color: var(--plum); margin: 0 0 .6em; }
h1 { font-size: clamp(2rem, 4vw + 1rem, 3.6rem); line-height: 1.15; }
h2 { font-size: clamp(1.6rem, 2vw + 1rem, 2.4rem); margin-bottom: 1em; }
h3 { font-size: 1.2rem; }

a { color: var(--plum); text-decoration: none; }
a:hover { color: var(--terracotta); }

img { display: block; max-width: 100%; height: auto; }

/* ── Header ──────────────────────────── */
.site-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 24px;
  background: rgba(245, 237, 229, 0.92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(92, 66, 86, 0.08);
}
.brand { display: flex; align-items: center; text-decoration: none; }
.brand-header { height: 48px; width: auto; display: block; }
.site-nav { display: flex; gap: 28px; }
.site-nav a { font-weight: 500; font-size: .98rem; }

/* ── Hero ────────────────────────────── */
.hero {
  padding: 80px 24px 70px;
  text-align: center;
  background:
    radial-gradient(circle at 20% 20%, rgba(229, 210, 194, 0.6) 0, transparent 50%),
    radial-gradient(circle at 80% 70%, rgba(156, 179, 154, 0.35) 0, transparent 50%),
    var(--cream);
}
.hero-inner { max-width: 720px; margin: 0 auto; }
.hero .lead {
  font-size: 1.2rem; color: var(--muted);
  margin: 0 0 .4rem;
}
.hero .tagline {
  font-family: 'Poppins', sans-serif;
  font-size: 1rem; color: var(--terracotta);
  margin: 0 0 1.8rem;
  letter-spacing: .01em;
}

.btn-primary {
  display: inline-block;
  padding: 14px 32px;
  background: var(--plum);
  color: var(--cream);
  border-radius: 999px;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  letter-spacing: .02em;
  transition: transform .15s, background .15s;
  border: 0;
  cursor: pointer;
  font-size: 1rem;
}
.btn-primary:hover { background: var(--terracotta); color: var(--cream); transform: translateY(-2px); }

/* ── Catalog ─────────────────────────── */
.catalog-section, .contact-section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 64px 24px;
}
.catalog-section h2, .contact-section h2 { text-align: center; }

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 28px;
  margin-top: 2rem;
}
.product-card {
  background: white;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: transform .2s, box-shadow .2s;
  display: flex;
  flex-direction: column;
}
.product-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.card-carousel {
  position: relative;
  background: var(--beige);
  aspect-ratio: 4 / 3;
  overflow: hidden;
  cursor: pointer;
}
.card-carousel-track {
  position: absolute; inset: 0;
}
.card-carousel-track img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  opacity: 0; transition: opacity .25s;
}
.card-carousel-track img.is-active { opacity: 1; }

.card-carousel-prev, .card-carousel-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(245, 237, 229, 0.85);
  border: 0; color: var(--plum);
  width: 36px; height: 36px; border-radius: 999px;
  font-size: 1.5rem; cursor: pointer; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
  opacity: 0; transition: opacity .2s, background .15s;
}
.card-carousel:hover .card-carousel-prev,
.card-carousel:hover .card-carousel-next { opacity: 1; }
.card-carousel-prev { left: 8px; }
.card-carousel-next { right: 8px; }
.card-carousel-prev:hover, .card-carousel-next:hover { background: var(--cream); }

.card-carousel-dots {
  position: absolute; bottom: 10px; left: 0; right: 0;
  display: flex; justify-content: center; gap: 6px;
  pointer-events: none;
}
.card-carousel-dot {
  pointer-events: auto;
  width: 7px; height: 7px; border-radius: 999px;
  background: rgba(245, 237, 229, 0.7); border: 0; cursor: pointer; padding: 0;
  transition: background .15s, transform .15s;
}
.card-carousel-dot.is-active { background: var(--plum); transform: scale(1.3); }

@media (hover: none) {
  /* On touch, always show arrows (no hover) */
  .card-carousel-prev, .card-carousel-next { opacity: 1; }
}

.product-meta { padding: 18px 20px 22px; flex: 1; display: flex; flex-direction: column; gap: 10px; }
.product-meta h3 { margin: 0; }
.product-detail-btn {
  align-self: flex-start;
  background: transparent; border: 0; padding: 0;
  font-family: 'Poppins', sans-serif; font-weight: 500;
  color: var(--terracotta); cursor: pointer; font-size: .95rem;
  transition: color .15s;
}
.product-detail-btn:hover { color: var(--plum); }

/* ── Contact ─────────────────────────── */
.contact-section { text-align: center; padding-bottom: 96px; }
.contact-section p { color: var(--muted); margin-bottom: 1.8rem; }
.btn-instagram {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 14px 28px;
  background: var(--terracotta); color: var(--cream);
  border-radius: 999px; font-weight: 600; font-family: 'Poppins', sans-serif;
  transition: background .15s, transform .15s;
}
.btn-instagram:hover { background: var(--plum); color: var(--cream); transform: translateY(-2px); }

/* ── Footer ──────────────────────────── */
.site-footer {
  text-align: center; padding: 28px 24px;
  background: var(--plum); color: var(--cream);
  font-size: .9rem;
}
.site-footer p { margin: 0; }

/* ── Modal ───────────────────────────── */
.modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(60, 44, 54, 0.85);
  display: none;
  align-items: center; justify-content: center;
  padding: 16px;
  overflow-y: auto;
}
.modal.is-open { display: flex; }
.modal-close {
  position: fixed; top: 18px; right: 24px; z-index: 102;
  background: rgba(245, 237, 229, 0.9); border: 0;
  width: 44px; height: 44px; border-radius: 999px;
  font-size: 1.8rem; cursor: pointer; color: var(--plum);
  line-height: 1;
}
.modal-body {
  background: var(--cream);
  border-radius: var(--radius);
  width: 100%;
  max-width: 1100px;
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr);
  gap: 0;
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  max-height: 92vh;
}
@media (max-width: 800px) {
  .modal-body { grid-template-columns: 1fr; max-height: none; }
}

.carousel {
  position: relative;
  background: var(--beige);
  display: flex; flex-direction: column;
  min-width: 0;
}
.carousel-track {
  flex: 1;
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
}
.carousel-track img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; opacity: 0; transition: opacity .25s;
}
.carousel-track img.is-active { opacity: 1; }

.carousel-prev, .carousel-next {
  position: absolute; top: 50%; transform: translateY(-50%);
  background: rgba(245, 237, 229, 0.9);
  border: 0; color: var(--plum);
  width: 44px; height: 44px; border-radius: 999px;
  font-size: 1.8rem; cursor: pointer; line-height: 1;
  display: flex; align-items: center; justify-content: center;
  z-index: 2;
}
.carousel-prev { left: 12px; }
.carousel-next { right: 12px; }
.carousel-prev:hover, .carousel-next:hover { background: var(--cream); }

.carousel-dots {
  display: flex; justify-content: center; gap: 8px;
  padding: 12px;
  flex-wrap: wrap;
}
.carousel-dot {
  width: 9px; height: 9px; border-radius: 999px;
  background: rgba(92, 66, 86, 0.3); border: 0; cursor: pointer; padding: 0;
  transition: background .15s, transform .15s;
}
.carousel-dot.is-active { background: var(--plum); transform: scale(1.3); }

.modal-info {
  padding: 28px 32px;
  overflow-y: auto;
  display: flex; flex-direction: column;
}
.modal-title { font-family: 'Poppins', sans-serif; margin: 0 0 8px; color: var(--plum); }
.modal-price {
  font-family: 'Poppins', sans-serif; font-weight: 700; color: var(--terracotta);
  font-size: 1.5rem; margin: 0 0 18px;
}
.modal-desc {
  flex: 1; font-size: .95rem; color: var(--ink);
  margin-bottom: 24px;
}
.modal-desc p { margin: 0 0 12px; }
.modal-desc ul { margin: 0 0 12px; padding-left: 20px; }
.modal-desc li { margin-bottom: 4px; }
.modal-cta { align-self: flex-start; }

/* ── Body lock when modal open ───────── */
body.modal-open { overflow: hidden; }


/* ╔════════════════════════════════════════════════════╗
   ║  Mobile / tablet tweaks                            ║
   ╚════════════════════════════════════════════════════╝ */

/* Tablet & small laptop */
@media (max-width: 900px) {
  .catalog-section, .contact-section { padding: 48px 20px; }
  .hero { padding: 60px 20px 50px; }
  .product-grid { gap: 20px; }
}

/* Phones */
@media (max-width: 600px) {
  .site-header { padding: 10px 16px; }
  .brand-header { height: 36px; }
  .site-nav { gap: 18px; }
  .site-nav a { font-size: .92rem; }

  .hero { padding: 48px 18px 40px; }
  .hero h1 { line-height: 1.2; }
  .hero .lead { font-size: 1rem; }

  .catalog-section, .contact-section { padding: 40px 16px; }
  .catalog-section h2, .contact-section h2 { margin-bottom: 1.4rem; }

  .product-grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }
  .product-card { border-radius: 12px; }
  .product-meta { padding: 16px 18px 20px; }

  /* Bigger arrows + dots on touch (44 px Apple guideline) */
  .card-carousel-prev, .card-carousel-next {
    width: 40px; height: 40px; font-size: 1.6rem;
  }
  .card-carousel-prev { left: 6px; }
  .card-carousel-next { right: 6px; }
  .card-carousel-dot { width: 8px; height: 8px; }

  .btn-primary { padding: 13px 26px; font-size: .95rem; }
  .btn-instagram { padding: 13px 24px; }

  /* Modal: full-screen feel on phones */
  .modal { padding: 0; align-items: stretch; }
  .modal-body {
    border-radius: 0;
    max-width: 100%;
    max-height: 100vh;
    height: 100vh;
    grid-template-rows: 60vh 1fr;
    grid-template-columns: 1fr;
  }
  .modal-info { padding: 20px 22px 28px; }
  .modal-title { font-size: 1.25rem; }
  .modal-close {
    top: 10px; right: 10px;
    width: 40px; height: 40px;
    background: rgba(245, 237, 229, 0.95);
  }
  .carousel-prev, .carousel-next { width: 40px; height: 40px; font-size: 1.5rem; }
  .modal-cta { width: 100%; text-align: center; }

  .site-footer { font-size: .82rem; padding: 22px 16px; }
}

/* Tiny screens (≤ 380px): tighten further */
@media (max-width: 380px) {
  .hero h1 { font-size: 1.7rem; }
  .hero .lead { font-size: .95rem; }
  .modal-body { grid-template-rows: 56vh 1fr; }
}

/* Reduce-motion users: disable image transitions */
@media (prefers-reduced-motion: reduce) {
  * { transition-duration: 0s !important; }
  html { scroll-behavior: auto; }
}
