/* ===================================================
   Cozy Loops — Crochet Shop Stylesheet
   Very Light Pink Theme
=================================================== */

/* ---------- CSS Variables ---------- */
:root {
  --bg:          #FFFAFC;
  --bg-alt:      #FFF5F9;
  --pink-light:  #FFE8F2;
  --pink-mid:    #FFCCE3;
  --pink:        #FFB3D4;
  --pink-dark:   #F4849E;
  --rose:        #C85C7A;
  --text:        #4A2535;
  --text-soft:   #7A5568;
  --text-light:  #B8909E;
  --white:       #FFFFFF;
  --shadow-sm:   0 2px 12px rgba(244, 132, 158, 0.12);
  --shadow-md:   0 6px 28px rgba(244, 132, 158, 0.18);
  --shadow-lg:   0 14px 44px rgba(244, 132, 158, 0.22);
  --radius-sm:   12px;
  --radius-md:   20px;
  --radius-lg:   28px;
  --radius-xl:   40px;
  --font-head:   'Outfit', sans-serif;
  --font-body:   'Nunito', sans-serif;
  --transition:  0.25s ease;
  --nav-h:       70px;
}

/* ---------- Reset & Base ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
}

body {
  font-family: var(--font-body);
  background-color: var(--bg);
  background-image: radial-gradient(circle, #FFCCE3 1px, transparent 1px);
  background-size: 28px 28px;
  background-attachment: fixed;
  color: var(--text);
  line-height: 1.7;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }

/* ---------- Typography ---------- */
h1, h2, h3 { line-height: 1.2; }

/* ---------- Scrollbar ---------- */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--pink-light); }
::-webkit-scrollbar-thumb { background: var(--pink-mid); border-radius: 4px; }

/* ---------- Utility ---------- */
.section {
  padding: 80px 24px;
  max-width: 1200px;
  margin: 0 auto;
  background: var(--bg);
  position: relative;
}
.section-alt {
  background: var(--bg-alt);
  max-width: 100%;
  padding: 80px 24px;
  position: relative;
}
.section-alt > * { max-width: 1200px; margin-left: auto; margin-right: auto; }

.section-header {
  text-align: center;
  margin-bottom: 56px;
}
.section-tag {
  display: inline-block;
  font-family: var(--font-head);
  font-size: 0.95rem;
  letter-spacing: 0.04em;
  color: var(--rose);
  background: var(--pink-light);
  border: 2px solid var(--pink-mid);
  border-radius: var(--radius-xl);
  padding: 4px 18px;
  margin-bottom: 14px;
}
.section-title {
  font-family: var(--font-head);
  font-size: clamp(2rem, 5vw, 3.2rem);
  color: var(--text);
  margin-bottom: 14px;
  letter-spacing: 0.01em;
}
.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-soft);
  max-width: 560px;
  margin: 0 auto;
}

/* ===================================================
   NAVBAR
=================================================== */
.navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  /* No backdrop-filter here — it creates a stacking context that
     prevents position:fixed children from escaping the element.
     The blur lives on ::before instead. */
  border-bottom: 2px solid var(--pink-mid);
  transition: box-shadow var(--transition);
}
/* Frosted-glass background via pseudo-element so the navbar
   itself stays stacking-context–free */
.navbar::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255, 250, 252, 0.94);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  z-index: -1;
}
.navbar.scrolled { box-shadow: var(--shadow-md); }

.nav-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 16px;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
  z-index: 1; /* always above any sibling overflow */
}
.logo-icon { width: 36px; height: 36px; }
.logo-text {
  font-family: var(--font-head);
  font-size: 1.55rem;
  color: var(--pink-dark);
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.nav-link {
  padding: 6px 16px;
  border-radius: var(--radius-xl);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--text-soft);
  transition: background var(--transition), color var(--transition);
}
.nav-link:hover {
  background: var(--pink-light);
  color: var(--pink-dark);
}

.cart-btn {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--pink-light);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pink-dark);
  transition: background var(--transition), transform var(--transition);
  flex-shrink: 0;
}
.cart-btn svg { width: 20px; height: 20px; }
.cart-btn:hover { background: var(--pink-mid); transform: scale(1.05); }

.cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: var(--pink-dark);
  color: var(--white);
  font-size: 0.65rem;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.cart-badge.bump { transform: scale(1.5); }

.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  padding: 6px;
  margin-left: 8px;
}
.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--pink-dark);
  border-radius: 2px;
  transition: all 0.3s;
}

/* -------------------------------------------------------
   Nav links — desktop: inline flex row (default)
   Mobile: body-level fixed dropdown, hidden until open
------------------------------------------------------- */

/* On desktop show links inline; hamburger stays hidden */
.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

/* Mobile: full-width fixed dropdown.
   The navbar's blur lives on ::before (not the element itself),
   so the navbar is stacking-context–free and position:fixed
   here correctly escapes to the viewport.
   Three-layer hide (visibility + opacity + max-height) so
   the menu is invisible even if one property misfires. */
@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: var(--nav-h);
    left: 0;
    right: 0;
    z-index: 99;
    flex-direction: column;
    background: var(--white);
    border-bottom: 2px solid var(--pink-mid);
    box-shadow: var(--shadow-md);
    padding: 0 24px;
    gap: 0;
    margin-left: 0;

    /* --- CLOSED state (bulletproof) --- */
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    max-height: 0;
    overflow: hidden;
    transition:
      visibility  0s      linear 0.25s,
      opacity     0.25s   ease,
      max-height  0.3s    ease,
      padding     0.3s    ease;
  }

  .nav-links.open {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
    max-height: 280px;
    padding: 16px 24px;
    transition:
      visibility  0s      linear 0s,
      opacity     0.22s   ease,
      max-height  0.3s    ease,
      padding     0.3s    ease;
  }

  .nav-link {
    width: 100%;
    text-align: center;
    padding: 13px 16px;
    font-size: 1.05rem;
    border-radius: var(--radius-md);
  }

  .hamburger { display: flex; margin-left: auto; }
}

/* ===================================================
   HERO
=================================================== */
.hero {
  min-height: calc(100vh - var(--nav-h));
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: 48px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 60px 24px;
  background: var(--bg);
}

.hero-tag {
  display: inline-block;
  font-family: var(--font-head);
  background: var(--pink-light);
  color: var(--rose);
  font-size: 1rem;
  letter-spacing: 0.03em;
  border: 2px solid var(--pink-mid);
  padding: 6px 20px;
  border-radius: var(--radius-xl);
  margin-bottom: 20px;
}

.hero-title {
  font-family: var(--font-head);
  font-size: clamp(2.4rem, 6vw, 4rem);
  color: var(--text);
  margin-bottom: 20px;
  line-height: 1.2;
  letter-spacing: 0.01em;
}
.hero-title em {
  font-style: normal;
  color: var(--pink-dark);
}

.hero-subtitle {
  font-size: 1.1rem;
  color: var(--text-soft);
  max-width: 480px;
  margin-bottom: 36px;
}

.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; }

.hero-illustration {
  display: flex;
  justify-content: center;
  align-items: center;
}
.hero-illustration svg {
  width: 100%;
  max-width: 400px;
  animation: floatAnim 5s ease-in-out infinite;
  filter: drop-shadow(0 12px 24px rgba(244, 132, 158, 0.2));
}

@keyframes floatAnim {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-14px); }
}

@media (max-width: 768px) {
  .hero {
    grid-template-columns: 1fr;
    text-align: center;
    padding: 48px 24px;
    min-height: auto;
    gap: 40px;
  }
  .hero-content { order: 1; }
  .hero-illustration { order: 0; }
  .hero-illustration svg { max-width: 260px; }
  .hero-subtitle { margin-left: auto; margin-right: auto; }
  .hero-cta { justify-content: center; }
}

/* ===================================================
   BUTTONS
=================================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 13px 28px;
  border-radius: var(--radius-xl);
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 700;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background: linear-gradient(135deg, var(--pink), var(--pink-dark));
  color: var(--white);
  box-shadow: 0 5px 0 var(--rose), 0 6px 18px rgba(244, 132, 158, 0.25);
}
.btn-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 0 var(--rose), 0 10px 28px rgba(244, 132, 158, 0.32);
  filter: brightness(1.05);
}
.btn-primary:active {
  transform: translateY(3px);
  box-shadow: 0 2px 0 var(--rose), 0 4px 12px rgba(244, 132, 158, 0.18);
}

.btn-ghost {
  background: transparent;
  color: var(--rose);
  border: 2px solid var(--pink-mid);
  box-shadow: 0 4px 0 var(--pink-mid);
}
.btn-ghost:hover {
  background: var(--pink-light);
  transform: translateY(-2px);
  box-shadow: 0 6px 0 var(--pink-mid);
}
.btn-ghost:active {
  transform: translateY(2px);
  box-shadow: 0 2px 0 var(--pink-mid);
}

.btn-full { width: 100%; }
.btn-sm { padding: 8px 16px; font-size: 0.85rem; }

/* ===================================================
   PRODUCTS GRID
=================================================== */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 28px;
}

.product-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 2px solid var(--pink-mid);
  box-shadow: 0 4px 0 var(--pink-mid), var(--shadow-sm);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  display: flex;
  flex-direction: column;
  cursor: pointer;
}
.product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 4px 0 var(--pink-dark), var(--shadow-lg);
}
.product-card:active {
  transform: scale(0.97);
  transition: transform 0.1s ease;
}

.product-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}
.product-img svg { width: 100%; height: 100%; }

.product-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--pink-dark);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 3px 10px;
  border-radius: var(--radius-xl);
  text-transform: uppercase;
}

.product-body {
  padding: 18px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.product-name {
  font-family: var(--font-head);
  font-size: 1.3rem;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}
.product-desc {
  font-size: 0.88rem;
  color: var(--text-soft);
  flex: 1;
  margin-bottom: 14px;
}
.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.product-price {
  font-family: var(--font-head);
  font-size: 1.3rem;
  color: var(--rose);
  background: var(--pink-light);
  border: 1.5px solid var(--pink-mid);
  padding: 2px 14px;
  border-radius: var(--radius-xl);
  display: inline-block;
}
.add-to-cart-btn {
  background: var(--pink-light);
  color: var(--pink-dark);
  border: none;
  padding: 8px 16px;
  border-radius: var(--radius-xl);
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
  transition: background var(--transition), transform 0.15s;
  white-space: nowrap;
}
.add-to-cart-btn:hover { background: var(--pink-mid); color: var(--white); }
.add-to-cart-btn:active { transform: scale(0.95); }
.add-to-cart-btn.added {
  background: var(--pink-dark);
  color: var(--white);
}

/* ===================================================
   FEATURES STRIP
=================================================== */
.features-strip {
  background: linear-gradient(135deg, var(--pink-light), var(--pink-mid));
  border-top: 2px solid var(--pink-mid);
  border-bottom: 2px solid var(--pink-mid);
  padding: 40px 24px;
}
.features-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 24px;
}
.feature-item {
  display: flex;
  align-items: center;
  gap: 16px;
  color: var(--rose);
}
.feature-icon {
  font-size: 2rem;
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,0.08));
}
.feature-item strong {
  display: block;
  font-family: var(--font-head);
  font-size: 1rem;
  margin-bottom: 2px;
  color: var(--text);
}
.feature-item span {
  font-size: 0.82rem;
  color: var(--text-soft);
}

/* ===================================================
   ABOUT
=================================================== */
.about-container {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 380px 1fr;
  gap: 72px;
  align-items: center;
  padding: 0 24px;
}

.about-image-wrap {
  position: relative;
  flex-shrink: 0;
}
.about-image-placeholder {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  border: 3px solid var(--pink-light);
  background: var(--pink-light);
}
.about-image-placeholder svg { width: 100%; display: block; }

.about-badge {
  position: absolute;
  bottom: -16px;
  right: -16px;
  background: var(--white);
  border: 2px solid var(--pink-light);
  border-radius: var(--radius-xl);
  padding: 10px 18px;
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--pink-dark);
  box-shadow: var(--shadow-md);
}

.about-text {
  font-size: 1rem;
  color: var(--text-soft);
  margin-bottom: 16px;
}

.about-stats {
  display: flex;
  gap: 32px;
  margin-top: 32px;
  padding-top: 32px;
  border-top: 1px solid var(--pink-light);
  flex-wrap: wrap;
}
.stat { text-align: center; }
.stat-number {
  display: block;
  font-family: var(--font-head);
  font-size: 2rem;
  color: var(--rose);
  line-height: 1;
  margin-bottom: 4px;
}
.stat-label {
  font-size: 0.82rem;
  color: var(--text-light);
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-weight: 600;
}

@media (max-width: 880px) {
  .about-container {
    grid-template-columns: 1fr;
    gap: 48px;
  }
  .about-image-wrap { max-width: 300px; margin: 0 auto; }
  .about-content { text-align: center; }
  .about-stats { justify-content: center; }
}

/* ===================================================
   ORDER FORM
=================================================== */
.form-container {
  max-width: 720px;
  margin: 0 auto;
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 48px 52px;
  box-shadow: 0 6px 0 var(--pink-mid), var(--shadow-lg);
  border: 2px solid var(--pink-mid);
}

@media (max-width: 640px) {
  .form-container { padding: 32px 24px; }
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
@media (max-width: 560px) {
  .form-row { grid-template-columns: 1fr; }
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 20px;
}

.form-group label {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}
.required { color: var(--pink-dark); }
.optional {
  font-size: 0.78rem;
  font-weight: 400;
  color: var(--text-light);
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 12px 16px;
  border: 1.5px solid #EBC8D8;
  border-radius: var(--radius-md);
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
  -webkit-appearance: none;
  appearance: none;
}
.form-group select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23E8799A' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 38px;
}
.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  border-color: var(--pink-mid);
  box-shadow: 0 0 0 3px rgba(255, 179, 212, 0.35);
}
.form-group input.error,
.form-group select.error,
.form-group textarea.error {
  border-color: #E57373;
  box-shadow: 0 0 0 3px rgba(229, 115, 115, 0.15);
}
.form-group textarea { resize: vertical; min-height: 80px; }
.form-group input::placeholder,
.form-group textarea::placeholder { color: var(--text-light); }

.field-error {
  font-size: 0.8rem;
  color: #C62828;
  min-height: 1em;
}

/* Custom checkbox */
.checkbox-group { flex-direction: row; align-items: center; gap: 0; }
.checkbox-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 0.92rem;
  color: var(--text-soft);
  user-select: none;
}
.checkbox-label input[type="checkbox"] { display: none; }
.checkbox-custom {
  width: 20px;
  height: 20px;
  border: 2px solid var(--pink-mid);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background var(--transition), border-color var(--transition);
}
.checkbox-label input:checked ~ .checkbox-custom {
  background: var(--pink-mid);
  border-color: var(--pink-mid);
}
.checkbox-label input:checked ~ .checkbox-custom::after {
  content: '';
  width: 5px;
  height: 9px;
  border: 2px solid white;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translateY(-1px);
}

/* ===================================================
   PRODUCT DETAIL MODAL
=================================================== */
.product-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(74, 37, 53, 0.45);
  z-index: 250;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: modalFadeIn 0.22s ease;
}
.product-modal-overlay[hidden] { display: none !important; }

.product-modal {
  background: var(--white);
  border-radius: var(--radius-xl);
  border: 2px solid var(--pink-mid);
  box-shadow: 0 8px 0 var(--pink-mid), var(--shadow-lg);
  padding: 44px 40px 36px;
  max-width: 480px;
  width: 100%;
  text-align: center;
  position: relative;
  animation: modalSlideUp 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  max-height: 90vh;
  overflow-y: auto;
}

/* Mobile — bottom sheet style */
@media (max-width: 600px) {
  .product-modal-overlay {
    align-items: flex-end;
    padding: 0;
    backdrop-filter: blur(4px);
  }
  .product-modal {
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
    border-bottom: none;
    animation: modalSlideUpSheet 0.35s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    padding: 32px 24px;
    padding-bottom: calc(28px + env(safe-area-inset-bottom));
    max-height: 92vh;
    max-width: 100%;
  }
  /* Drag handle visual cue */
  .product-modal::before {
    content: '';
    display: block;
    width: 40px;
    height: 4px;
    background: var(--pink-mid);
    border-radius: 2px;
    margin: 0 auto 24px;
  }
}

.product-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--pink-light);
  color: var(--pink-dark);
  font-size: 1.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
  line-height: 1;
  flex-shrink: 0;
}
.product-modal-close:hover { background: var(--pink-mid); color: var(--white); }

.modal-emoji {
  font-size: 7rem;
  line-height: 1;
  margin-bottom: 16px;
  display: block;
  filter: drop-shadow(0 8px 16px rgba(0,0,0,0.1));
  animation: modalEmojiBounce 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both;
}
@media (max-width: 600px) { .modal-emoji { font-size: 5.5rem; } }

.modal-badge-tag {
  display: inline-block;
  background: var(--pink-dark);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 3px 14px;
  border-radius: var(--radius-xl);
  text-transform: uppercase;
  margin-bottom: 10px;
}

.modal-name {
  font-family: var(--font-head);
  font-size: 2rem;
  color: var(--text);
  margin-bottom: 10px;
}
@media (max-width: 600px) { .modal-name { font-size: 1.6rem; } }

.modal-desc {
  color: var(--text-soft);
  font-size: 0.95rem;
  line-height: 1.7;
  margin-bottom: 24px;
  max-width: 380px;
  margin-left: auto;
  margin-right: auto;
}

.modal-footer {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.modal-price {
  font-family: var(--font-head);
  font-size: 1.7rem;
  color: var(--rose);
  background: var(--pink-light);
  border: 1.5px solid var(--pink-mid);
  padding: 4px 20px;
  border-radius: var(--radius-xl);
}

.modal-note {
  font-size: 0.82rem;
  color: var(--text-light);
  font-style: italic;
  margin-top: 12px;
}

@keyframes modalFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes modalSlideUp {
  from { opacity: 0; transform: scale(0.88) translateY(24px); }
  to   { opacity: 1; transform: scale(1)    translateY(0); }
}
@keyframes modalSlideUpSheet {
  from { transform: translateY(100%); }
  to   { transform: translateY(0); }
}
@keyframes modalEmojiBounce {
  from { transform: scale(0.4); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

/* Error banner */
.form-error-banner {
  background: #FFF0F0;
  border: 1.5px solid #FFAAAA;
  border-radius: var(--radius-md);
  color: #C62828;
  font-size: 0.9rem;
  font-weight: 600;
  padding: 12px 18px;
  margin-bottom: 16px;
}

/* Success state */
.form-success {
  text-align: center;
  padding: 40px 20px;
}
.success-icon { font-size: 4rem; margin-bottom: 16px; }
.form-success h3 {
  font-family: var(--font-head);
  font-size: 2rem;
  color: var(--pink-dark);
  margin-bottom: 12px;
}
.form-success p {
  color: var(--text-soft);
  margin-bottom: 10px;
  max-width: 440px;
  margin-left: auto;
  margin-right: auto;
}
.success-sub { font-size: 0.88rem; color: var(--text-light); }
.form-success .btn { margin-top: 24px; }

/* ===================================================
   CART SIDEBAR
=================================================== */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(74, 37, 53, 0.35);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}
.cart-overlay.active { opacity: 1; pointer-events: auto; }

.cart-sidebar {
  position: fixed;
  top: 0;
  right: 0;
  width: min(400px, 100vw);
  height: 100vh;
  background: var(--white);
  z-index: 201;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -8px 0 40px rgba(74, 37, 53, 0.14);
}
.cart-sidebar.open { transform: translateX(0); }

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 24px;
  border-bottom: 1px solid var(--pink-light);
}
.cart-header h2 {
  font-family: var(--font-head);
  font-size: 1.6rem;
  color: var(--text);
}
.cart-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--pink-light);
  color: var(--pink-dark);
  font-size: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
}
.cart-close:hover { background: var(--pink-mid); color: var(--white); }

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.cart-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 40px 24px;
  color: var(--text-soft);
}
.cart-empty p { margin-top: 10px; font-weight: 600; }
.cart-empty-sub { font-size: 0.88rem; color: var(--text-light); }

.cart-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--pink-light);
  margin-bottom: 10px;
  background: var(--bg);
  animation: slideIn 0.25s ease;
}
@keyframes slideIn {
  from { opacity: 0; transform: translateX(20px); }
  to { opacity: 1; transform: translateX(0); }
}

.cart-item-emoji {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  background: var(--pink-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cart-item-price { font-size: 0.85rem; color: var(--pink-dark); font-weight: 600; }

.cart-qty {
  display: flex;
  align-items: center;
  gap: 6px;
}
.qty-btn {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--pink-light);
  color: var(--pink-dark);
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition);
  line-height: 1;
}
.qty-btn:hover { background: var(--pink-mid); color: var(--white); }
.qty-num { font-weight: 700; font-size: 0.9rem; min-width: 20px; text-align: center; }

.cart-item-remove {
  color: var(--text-light);
  font-size: 1.2rem;
  padding: 4px;
  border-radius: 50%;
  transition: color var(--transition), background var(--transition);
}
.cart-item-remove:hover { color: #C62828; background: #FFEBEE; }

.cart-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--pink-light);
}
.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  margin-bottom: 6px;
}
.cart-note { font-size: 0.78rem; color: var(--text-light); margin-bottom: 16px; }

/* ===================================================
   TOAST
=================================================== */
.toast-container {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  pointer-events: none;
}
.toast {
  background: var(--white);
  color: var(--rose);
  border: 2px solid var(--pink-mid);
  box-shadow: 0 4px 0 var(--pink-mid), var(--shadow-md);
  padding: 12px 24px;
  border-radius: var(--radius-xl);
  font-family: var(--font-head);
  font-size: 1rem;
  white-space: nowrap;
  animation: toastIn 0.3s ease, toastOut 0.3s ease 2.4s forwards;
  pointer-events: auto;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateY(16px) scale(0.9); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes toastOut {
  to { opacity: 0; transform: translateY(8px) scale(0.9); }
}

/* ===================================================
   FOOTER
=================================================== */
.footer {
  background: var(--pink-light);
  border-top: 2px solid var(--pink-mid);
  color: var(--text-soft);
  padding: 60px 24px 0;
}
.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  padding-bottom: 48px;
}
@media (max-width: 700px) {
  .footer-container { grid-template-columns: 1fr; gap: 32px; }
}

.footer-logo { color: var(--rose); font-size: 1.8rem; display: block; margin-bottom: 12px; }
.footer-tagline { font-size: 0.9rem; line-height: 1.6; color: var(--text-soft); }

.footer-links, .footer-contact { display: flex; flex-direction: column; gap: 10px; }
.footer h4 {
  font-family: var(--font-head);
  font-size: 1rem;
  color: var(--rose);
  margin-bottom: 4px;
}
.footer-links a {
  font-size: 0.9rem;
  color: var(--text-soft);
  transition: color var(--transition);
}
.footer-links a:hover { color: var(--pink-dark); }
.footer-contact p { font-size: 0.9rem; line-height: 1.6; color: var(--text-soft); }

.footer-bottom {
  border-top: 1.5px solid var(--pink-mid);
  padding: 20px 0;
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-soft);
}

/* ===================================================
   PRODUCT CARD ILLUSTRATIONS (inline SVG colors)
=================================================== */
/* very light pink product card backgrounds */
.prod-bg-1  { background: linear-gradient(135deg, #FFE8F4, #FFD8EC); } /* blush */
.prod-bg-2  { background: linear-gradient(135deg, #FFF0F7, #FFE4F2); } /* petal */
.prod-bg-3  { background: linear-gradient(135deg, #FFF5FB, #FFEAF6); } /* whisper */
.prod-bg-4  { background: linear-gradient(135deg, #FFDCEE, #FFCCE6); } /* rose */
.prod-bg-5  { background: linear-gradient(135deg, #F8E8FF, #F0D8FF); } /* lavender blush */
.prod-bg-6  { background: linear-gradient(135deg, #FFE4EE, #FFD4E6); } /* carnation */
.prod-bg-7  { background: linear-gradient(135deg, #FFF0FA, #FFE0F4); } /* orchid */
.prod-bg-8  { background: linear-gradient(135deg, #FFF8E8, #FFF0D4); } /* peach blossom */
.prod-bg-9  { background: linear-gradient(135deg, #FFE8F6, #FFD8F0); } /* flamingo */
.prod-bg-10 { background: linear-gradient(135deg, #FFEEF8, #FFE2F4); } /* magnolia */

.prod-emoji {
  font-size: 5rem;
  line-height: 1;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.1));
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.product-card:hover .prod-emoji {
  transform: scale(1.18) rotate(-5deg);
  animation: wiggle 0.5s ease;
}
@keyframes wiggle {
  0%   { transform: scale(1.18) rotate(-5deg); }
  25%  { transform: scale(1.18) rotate(5deg); }
  50%  { transform: scale(1.18) rotate(-3deg); }
  75%  { transform: scale(1.18) rotate(3deg); }
  100% { transform: scale(1.18) rotate(-5deg); }
}

/* ===================================================
   MOBILE & TOUCH OPTIMISATIONS
=================================================== */

/* ---------- Global touch fixes ---------- */

/* Remove blue/grey tap flash on iOS & Android */
* { -webkit-tap-highlight-color: transparent; }

/* Remove 300ms tap delay on all interactive elements */
a, button, label, select, input, textarea, [role="button"] {
  touch-action: manipulation;
}

/* Prevent long strings / URLs from breaking layout */
body { overflow-wrap: break-word; word-break: break-word; }

/* ---------- Dynamic viewport height (iOS Safari address-bar fix) ---------- */
/* 100dvh shrinks as the browser chrome appears/disappears — no content cut-off */
@supports (height: 100dvh) {
  .hero { min-height: calc(100dvh - var(--nav-h)); }
}

/* ---------- iOS navbar safe-area (notch / Dynamic Island / home bar) ---------- */
.navbar {
  padding-left:  env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

/* Cart sidebar & footer respect the iPhone home-indicator bar */
.cart-sidebar { padding-bottom: env(safe-area-inset-bottom); }
.cart-footer  { padding-bottom: calc(20px + env(safe-area-inset-bottom)); }

/* ---------- iOS input zoom prevention ---------- */
/* iOS Safari zooms in when an input's font-size < 16px — force 16px on mobile */
@media (max-width: 768px) {
  .form-group input,
  .form-group select,
  .form-group textarea {
    font-size: 16px !important;
  }
}

/* ---------- Touch target sizes (WCAG recommends 44×44 px minimum) ---------- */
@media (max-width: 768px) {
  .btn            { min-height: 48px; padding: 14px 28px; }
  .add-to-cart-btn { min-height: 44px; padding: 10px 18px; }
  .qty-btn        { width: 36px; height: 36px; font-size: 1.1rem; }
  .cart-close     { width: 44px; height: 44px; }
  .cart-btn       { width: 48px; height: 48px; }
  .nav-link       { padding: 10px 18px; min-height: 44px; }
  .hamburger      { padding: 10px; }
}

/* ---------- Tighter padding on small phones ---------- */
@media (max-width: 480px) {
  .section     { padding: 56px 16px; }
  .section-alt { padding: 56px 16px; }

  .hero {
    padding: 36px 16px;
    gap: 28px;
  }

  .section-header  { margin-bottom: 36px; }
  .section-title   { font-size: clamp(1.7rem, 8vw, 2.4rem); }

  .about-container { padding: 0 16px; }

  .products-grid   { gap: 18px; }
  .product-body    { padding: 14px 16px; }

  .form-container  { padding: 28px 18px; border-radius: var(--radius-lg); }
  .form-row        { gap: 14px; }
  .form-group      { margin-bottom: 14px; }

  .features-container { gap: 16px; }

  .footer-container { padding-bottom: 36px; }

  /* Hero illustration smaller on tiny phones */
  .hero-illustration svg { max-width: 220px; }
}

/* ---------- Very small phones (iPhone SE, 320-375 px) ---------- */
@media (max-width: 380px) {
  .hero-cta { flex-direction: column; }
  .hero-cta .btn { width: 100%; }

  /* Hide illustration to give content more room */
  .hero-illustration { display: none; }

  .hero { text-align: left; }
  .hero-tag { font-size: 0.85rem; }
  .hero-title { font-size: 2rem; }
}

/* ---------- Cart sidebar full-width on very small screens ---------- */
@media (max-width: 400px) {
  .cart-sidebar { width: 100vw; }
}

/* ---------- Toast — prevent overflow on narrow screens ---------- */
@media (max-width: 480px) {
  .toast {
    white-space: normal;
    text-align: center;
    max-width: calc(100vw - 32px);
    font-size: 0.9rem;
  }
}

/* ---------- Product grid — 2 columns on all phones ---------- */
@media (min-width: 381px) and (max-width: 768px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }
  /* Compact card layout so two fit comfortably */
  .product-body    { padding: 12px 12px; }
  .product-name    { font-size: 0.95rem; margin-bottom: 4px; }
  .product-desc    { font-size: 0.78rem; margin-bottom: 10px;
                     display: -webkit-box; -webkit-line-clamp: 2;
                     -webkit-box-orient: vertical; overflow: hidden; }
  .product-price   { font-size: 0.9rem; padding: 2px 10px; }
  .product-footer  { flex-wrap: wrap; gap: 6px; }
  .add-to-cart-btn { font-size: 0.78rem; padding: 6px 10px; min-height: 36px; }
  .prod-emoji      { font-size: 3.5rem; }
  .product-badge   { font-size: 0.6rem; padding: 2px 8px; }
}

/* ---------- About badge — reposition on small screens ---------- */
@media (max-width: 480px) {
  .about-badge {
    right: 0;
    bottom: -12px;
    font-size: 0.82rem;
    padding: 8px 14px;
  }
}

/* ---------- Disable emoji wiggle animation on touch devices (performance) ---------- */
@media (hover: none) {
  .product-card:hover .prod-emoji {
    transform: none;
    animation: none;
  }
  /* Show a gentle scale on tap instead */
  .product-card:active .prod-emoji {
    transform: scale(1.12);
    transition: transform 0.15s ease;
  }
}
