/* ============================================================
   Outgrown — kids & baby store
   Original implementation inspired by soft-pastel kids-store
   design language. Fonts: Lato (body), Poppins (headings),
   Preahvihear (handwritten accents).
   ============================================================ */

:root {
  --theme: #719378;
  --theme-dark: #5c7a62;
  --theme-25: #7193783f;
  --logo: #ec8a4e;
  --hero-bg: #f3f1ec;
  --ink: #222;
  --text: #666;
  --line: #ececec;
  --bg-soft: #f7f5f0;
  --radius: 10px;
  --container: 1400px;
  --font-body: 'Lato', sans-serif;
  --font-head: 'Poppins', sans-serif;
  --font-script: 'Preahvihear', cursive;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.7;
  color: var(--text);
  background: #fff;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-head);
  color: var(--ink);
  font-weight: 600;
  line-height: 1.3;
}

a { color: inherit; text-decoration: none; transition: color .25s; }
a:hover { color: var(--theme); }

button { font-family: inherit; cursor: pointer; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 30px;
}

.section { padding: 70px 0; }

.center { text-align: center; }

/* ---------- shared bits ---------- */

.accent-script {
  font-family: var(--font-script);
  color: var(--theme);
  font-size: 18px;
  display: block;
  margin-bottom: 6px;
  position: relative;
  z-index: 2;
}

.section-head p {
  position: relative;
  z-index: 2;
}

.section-head {
  text-align: center;
  max-width: 640px;
  margin: 0 auto 45px;
}

.section-head h2,
.blog-intro h2 {
  font-family: var(--font-script);
  font-weight: 400;
  font-size: 38px;
  margin-bottom: 12px;
}

/* soft "paint stain" blob behind the heading */
.section-head h2 {
  position: relative;
  z-index: 1;
}

.section-head h2::before {
  content: '';
  position: absolute;
  z-index: -1;
  width: 110px;
  height: 105px;
  left: 41%;
  top: -30px;
  background: #f3dcdc;
  border-radius: 53% 47% 62% 38% / 51% 60% 40% 49%;
  transform: rotate(-8deg);
}

.btn {
  display: inline-block;
  background: var(--theme);
  color: #fff;
  font-family: var(--font-head);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  padding: 14px 36px;
  border: 2px solid var(--theme);
  border-radius: 999px;
  transition: all .3s;
}
.btn:hover { background: var(--theme-dark); border-color: var(--theme-dark); color: #fff; }
.btn.outline { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn.outline:hover { background: var(--ink); color: #fff; }
.btn.light { background: #fff; color: var(--ink); border-color: #fff; }
.btn.light:hover { background: var(--theme); border-color: var(--theme); color: #fff; }

/* ============ HEADER ============ */

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--hero-bg);
}

.header-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 40px;
  height: 88px;
}

.header-inner .main-nav { justify-self: start; }
.header-inner .logo { justify-self: center; }
.header-inner .header-icons { justify-self: end; }

.logo {
  font-family: var(--font-script);
  font-size: 30px;
  color: var(--logo);
  line-height: 1;
}
.logo:hover { color: var(--logo); }

.main-nav > ul {
  display: flex;
  gap: 36px;
  list-style: none;
}

.main-nav > ul > li { position: relative; }

.main-nav > ul > li > a {
  font-family: var(--font-head);
  font-size: 15px;
  font-weight: 500;
  color: var(--ink);
  padding: 32px 0;
  display: inline-block;
}

.main-nav > ul > li > a:hover { color: var(--theme); }

.sub-menu {
  position: absolute;
  top: 100%;
  left: -20px;
  min-width: 220px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 0 0 var(--radius) var(--radius);
  box-shadow: 0 18px 40px rgba(0,0,0,.08);
  list-style: none;
  padding: 14px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px);
  transition: all .3s;
}

.has-sub:hover .sub-menu { opacity: 1; visibility: visible; transform: translateY(0); }

.sub-menu li a, .sub-menu.mega a {
  display: block;
  padding: 8px 24px;
  font-size: 14px;
  color: var(--text);
}

.sub-menu.mega {
  display: flex;
  gap: 30px;
  min-width: 620px;
  padding: 28px 20px;
  left: 50%;
  translate: -50% 0;
}

.sub-menu.mega li { flex: 1; }

.mega-title {
  display: block;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 14px;
  color: var(--ink);
  padding: 0 24px 10px;
}

.header-icons { display: flex; align-items: center; gap: 18px; }

.icon-btn {
  position: relative;
  background: none;
  border: none;
  color: var(--ink);
  display: inline-flex;
}

.icon-btn svg {
  width: 22px; height: 22px;
  fill: none; stroke: currentColor;
  stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round;
}

.icon-btn:hover { color: var(--theme); }

.icon-btn .count {
  position: absolute;
  top: -7px; right: -9px;
  background: var(--theme);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  min-width: 17px; height: 17px;
  border-radius: 999px;
  display: grid;
  place-items: center;
}

.nav-toggle { display: none; }

.mobile-drawer {
  position: fixed;
  inset: 88px 0 auto 0;
  background: #fff;
  border-bottom: 1px solid var(--line);
  z-index: 99;
  padding: 10px 30px 20px;
}

.mobile-drawer a {
  display: block;
  padding: 12px 0;
  font-family: var(--font-head);
  font-weight: 600;
  text-transform: uppercase;
  font-size: 14px;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}

/* ============ HERO ============ */

.hero {
  position: relative;
  background: var(--hero-bg);
  overflow: hidden;
}

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
  padding-top: 60px;
  padding-bottom: 200px;
}

.hero-copy {
  text-align: center;
  justify-self: center;
  max-width: 520px;
}

.hero-copy h1 {
  font-family: var(--font-script);
  font-weight: 400;
  font-size: clamp(52px, 6.5vw, 88px);
  line-height: 1.12;
  margin-bottom: 28px;
}

.hero-copy p {
  max-width: 44ch;
  margin: 0 auto 34px;
  font-size: 16px;
}

.hero-media {
  justify-self: center;
  width: min(100%, 560px);
}

.hero-media img {
  border-radius: 999px 999px 0 0;
}

.hero-clouds {
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  z-index: 3;
  pointer-events: none;
}

.hero-clouds img { width: 100%; height: 140px; object-fit: fill; }

.doodle {
  position: absolute;
  z-index: 2;
  animation: floaty 5s ease-in-out infinite;
}

.d-balloon { width: 54px; top: 18%; left: 52%; }
.d-feather { width: 44px; top: 46%; left: 47%; }
.d-star    { width: 30px; top: 66%; left: 38%; }

@keyframes floaty {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50%      { transform: translateY(-14px) rotate(6deg); }
}

/* ---------- hero entrance animations ---------- */

.hero-clouds {
  animation: cloud-rise 1.1s cubic-bezier(.25,.7,.3,1) both;
}

.hero-media {
  animation: slide-from-right 1s .15s cubic-bezier(.25,.7,.3,1) both;
}

.hero-copy h1  { animation: fade-up .8s .45s ease-out both; }
.hero-copy p   { animation: fade-up .8s .65s ease-out both; }
.hero-copy .btn{ animation: fade-up .8s .85s ease-out both; }

.doodle { opacity: 0; animation: floaty 5s ease-in-out infinite, doodle-in .8s 1s ease-out forwards; }
.d-feather { animation-delay: 1.3s, 1.1s; }
.d-star    { animation-delay: 2.6s, 1.2s; }

@keyframes cloud-rise {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}

@keyframes slide-from-right {
  from { transform: translateX(90px); opacity: 0; }
  to   { transform: translateX(0); opacity: 1; }
}

@keyframes fade-up {
  from { transform: translateY(26px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

@keyframes doodle-in {
  to { opacity: 1; }
}

/* peeking teddy — leans out of the left edge after the doodles appear */
.bear-peek {
  position: absolute;
  left: 0;
  top: 20%;
  width: 175px;
  z-index: 2;
  pointer-events: none;
  transform-origin: 15% 85%;
  transform: translateX(-110%) rotate(-5deg);
  animation: bear-peek 1s 1.25s cubic-bezier(.34,1.56,.64,1) forwards;
}

@keyframes bear-peek {
  to { transform: translateX(-26%) rotate(32deg); }
}

@media (prefers-reduced-motion: reduce) {
  .hero-clouds, .hero-media, .hero-copy h1, .hero-copy p, .hero-copy .btn, .doodle, .bear-peek {
    animation: none;
    opacity: 1;
  }
  .bear-peek { transform: translateX(-26%) rotate(32deg); }
}

/* ============ PRODUCT CARDS ============ */

.product-card { position: relative; }

.product-media {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-soft);
}

.product-media .img-alt {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity .45s;
}

.product-card:hover .img-alt { opacity: 1; }

.badge {
  position: absolute;
  z-index: 2;
  left: 14px;
  font-family: var(--font-head);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
  color: #fff;
  padding: 3px 12px;
  border-radius: 999px;
  text-transform: lowercase;
}

.badge.hot  { top: 14px; background: #e2574c; }
.badge.sale { top: 14px; left: auto; right: 14px; background: var(--theme); }
.badge.stock{ top: 44px; background: #999; }

.hover-actions {
  position: absolute;
  z-index: 2;
  left: 50%;
  bottom: 18px;
  translate: -50% 0;
  display: flex;
  gap: 8px;
  opacity: 0;
  transform: translateY(12px);
  transition: all .35s;
}

.product-card:hover .hover-actions { opacity: 1; transform: translateY(0); }

.hover-actions button {
  width: 42px; height: 42px;
  border-radius: 50%;
  border: none;
  background: #fff;
  box-shadow: 0 6px 18px rgba(0,0,0,.12);
  font-size: 16px;
  transition: all .25s;
}

.hover-actions button:hover { background: var(--theme); color: #fff; }

.product-info { padding: 16px 4px 0; text-align: center; }

.product-info .cat {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: #aaa;
}

.product-info h3 { font-size: 15px; font-weight: 500; margin: 2px 0 6px; }

.price { font-family: var(--font-head); font-weight: 600; color: var(--ink); }
.price del { color: #b5b5b5; font-weight: 400; margin-right: 6px; }
.price ins { text-decoration: none; color: #e2574c; }
.price.big { font-size: 24px; margin: 18px 0 26px; }

.swatches { display: flex; gap: 6px; justify-content: center; margin-top: 10px; }

.swatch {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--c);
  border: 2px solid #fff;
  outline: 1px solid #ddd;
  cursor: pointer;
}
.swatch:hover { outline-color: var(--theme); }

/* ============ CAROUSEL ============ */

.carousel { position: relative; }

.carousel-track {
  display: flex;
  gap: 26px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  padding-bottom: 6px;
}
.carousel-track::-webkit-scrollbar { display: none; }

.carousel-track .product-card {
  flex: 0 0 calc(25% - 20px);
  scroll-snap-align: start;
}

.carousel-arrow {
  position: absolute;
  top: 40%;
  z-index: 5;
  width: 48px; height: 48px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 6px 20px rgba(0,0,0,.1);
  font-size: 24px;
  line-height: 1;
  color: var(--ink);
  transition: all .25s;
}
.carousel-arrow:hover { background: var(--theme); border-color: var(--theme); color: #fff; }
.carousel-arrow.prev { left: -22px; }
.carousel-arrow.next { right: -22px; }

/* ============ SPOTLIGHT ============ */

.spotlight { background: var(--bg-soft); }

.spotlight-inner {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 60px;
  align-items: center;
}

.spotlight-media img { border-radius: var(--radius); }

.spotlight-copy h2 { font-size: 34px; margin-bottom: 16px; }
.spotlight-copy p { max-width: 46ch; }

/* ============ BANNERS ============ */

.banners-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 26px;
}

.banner-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 460px;
}

.banner-card img {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .8s;
}

.banner-card:hover img { transform: scale(1.05); }

.banner-copy {
  position: relative;
  z-index: 2;
  padding: 56px 48px;
  max-width: 420px;
}

.banner-copy h2 { font-size: 30px; margin-bottom: 12px; }
.banner-copy p { margin-bottom: 22px; }

.dots { display: flex; gap: 10px; }

.dots span {
  width: 34px; height: 34px;
  border-radius: 50%;
  border: 1px solid var(--ink);
  display: grid;
  place-items: center;
  font-family: var(--font-head);
  font-size: 13px;
  color: var(--ink);
  cursor: pointer;
  transition: all .25s;
}
.dots span.active, .dots span:hover { background: var(--theme); border-color: var(--theme); color: #fff; }

/* ============ TABS + GRID ============ */

.tabs {
  display: flex;
  gap: 12px;
  justify-content: center;
  margin-bottom: 45px;
  flex-wrap: wrap;
}

.tab {
  background: none;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 30px;
  font-family: var(--font-head);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  transition: all .25s;
}

.tab:hover, .tab.active {
  background: var(--theme);
  border-color: var(--theme);
  color: #fff;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 26px 26px;
  margin-bottom: 50px;
}

.product-card.is-hidden { display: none; }

/* ============ BLOG ============ */

.blog { background: var(--bg-soft); }

.blog-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 30px;
  align-items: start;
}

.blog-intro { padding-right: 20px; }
.blog-intro h2 { font-size: 34px; margin-bottom: 14px; }
.blog-intro p { margin-bottom: 24px; }

.post-card {
  background: #fff;
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform .35s, box-shadow .35s;
}

.post-card:hover { transform: translateY(-6px); box-shadow: 0 18px 40px rgba(0,0,0,.08); }

.post-media { display: block; overflow: hidden; }
.post-media img { transition: transform .6s; }
.post-card:hover .post-media img { transform: scale(1.06); }

.post-body { padding: 22px 24px 26px; }

.post-body time {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--theme);
}

.post-body h3 { font-size: 17px; margin: 8px 0 8px; }
.post-body p { font-size: 14px; }

/* ============ INSTAGRAM ============ */

.instagram { padding-bottom: 0; }

.insta-strip {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
}

.insta-strip a { position: relative; overflow: hidden; display: block; }

.insta-strip img { transition: transform .6s; width: 100%; }

.insta-strip a::after {
  content: '♡';
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 30px;
  color: #fff;
  background: var(--theme-25);
  opacity: 0;
  transition: opacity .35s;
}

.insta-strip a:hover::after { opacity: 1; }
.insta-strip a:hover img { transform: scale(1.08); }

/* ============ FOOTER ============ */

.site-footer {
  background: var(--bg-soft);
  margin-top: 0;
}

.footer-art img { width: 100%; }

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1.4fr;
  gap: 40px;
  padding-top: 30px;
  padding-bottom: 60px;
}

.footer-logo { display: inline-block; margin-bottom: 18px; }

.footer-col h4 {
  font-size: 16px;
  margin-bottom: 18px;
}

.footer-col a { display: block; padding: 4px 0; font-size: 14px; }

.footer-col p { font-size: 14px; margin-bottom: 12px; }

.newsletter-form { display: flex; gap: 10px; margin-top: 16px; }

.newsletter-form input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 12px 20px;
  font-family: inherit;
  font-size: 14px;
  outline: none;
}

.newsletter-form input:focus { border-color: var(--theme); }

.newsletter-form .btn { padding: 12px 26px; }

.footer-bottom {
  border-top: 1px solid var(--line);
  padding: 22px 0;
  font-size: 13px;
  text-align: center;
}

/* ============ RESPONSIVE ============ */

@media (max-width: 1100px) {
  .main-nav > ul { gap: 20px; }
  .main-nav > ul > li > a { font-size: 14px; }
  .products-grid { grid-template-columns: repeat(3, 1fr); }
  .carousel-track .product-card { flex-basis: calc(33.33% - 18px); }
  .blog-grid { grid-template-columns: repeat(2, 1fr); }
  .blog-intro { grid-column: 1 / -1; text-align: center; padding: 0; }
  .blog-intro p { max-width: 520px; margin-inline: auto; margin-bottom: 24px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .insta-strip { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 820px) {
  .main-nav { display: none; }
  .nav-toggle {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    padding: 4px;
  }
  .nav-toggle span { width: 24px; height: 2px; background: var(--ink); }
  .header-inner { justify-content: space-between; }
  .hide-mobile { display: none; }
  .hero-inner { grid-template-columns: 1fr; padding-bottom: 150px; }
  .hero-media { order: -1; width: min(100%, 400px); }
  .d-balloon, .d-feather { display: none; }
  .bear-peek { width: 110px; top: 8%; }
  .section-head h2::before { width: 84px; height: 80px; top: -22px; }
  .hero-clouds img { height: 80px; }
  .spotlight-inner { grid-template-columns: 1fr; gap: 34px; }
  .banners-grid { grid-template-columns: 1fr; }
  .products-grid { grid-template-columns: repeat(2, 1fr); gap: 18px; }
  .carousel-track .product-card { flex-basis: calc(50% - 13px); }
  .carousel-arrow { display: none; }
  .section { padding: 48px 0; }
  .section-head h2 { font-size: 28px; }
  .blog-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .insta-strip { grid-template-columns: repeat(2, 1fr); }
}
