/* =========================================================
   SHILA HANDICRAFT — style.css
   Soft pink, feminine, handmade. All styles for index.html.
   ========================================================= */

/* ---------- Design tokens ---------- */
:root {
  --pink-soft: #FFE4EE;
  --pink-light: #FFB6C1;
  --rose-gold: #C9A0A0;
  --rose-deep: #D4537E;
  --rose-deeper: #b8355f;
  --cream: #FFF5F7;
  --ink: #4a3a40;
  --ink-soft: #8a7077;
  --white: #ffffff;

  --shadow-soft: 0 10px 30px rgba(212, 83, 126, 0.12);
  --shadow-card: 0 14px 40px rgba(201, 160, 160, 0.22);
  --radius: 22px;
  --radius-sm: 14px;
  --maxw: 1180px;

  --font-head: "Playfair Display", Georgia, serif;
  --font-body: "Poppins", "Segoe UI", sans-serif;
}

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

/* The hidden attribute must always win over display rules below */
[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background: var(--cream);
  line-height: 1.6;
  font-weight: 300;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

.container { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 22px; }

/* ---------- Shared headings ---------- */
.eyebrow {
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--rose-deep);
  font-weight: 500;
  margin-bottom: 10px;
}
.eyebrow.center { text-align: center; }

.section-title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: clamp(1.9rem, 4vw, 2.8rem);
  line-height: 1.15;
  color: var(--ink);
}
.section-title.center { text-align: center; }
.section-title em { color: var(--rose-deep); font-style: italic; }

/* ---------- Buttons ---------- */
.btn {
  font-family: var(--font-body);
  font-size: 0.95rem;
  font-weight: 500;
  border: none;
  border-radius: 999px;
  padding: 13px 30px;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}
.btn.full { width: 100%; }

.btn-primary {
  background: linear-gradient(135deg, var(--rose-deep), var(--pink-light));
  color: var(--white);
  box-shadow: var(--shadow-soft);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 14px 34px rgba(212,83,126,0.3); }

.btn-ghost {
  background: transparent;
  color: var(--rose-deep);
  border: 1.5px solid var(--pink-light);
}
.btn-ghost:hover { background: var(--pink-soft); }

/* Visible keyboard focus everywhere */
a:focus-visible, button:focus-visible, input:focus-visible, textarea:focus-visible {
  outline: 3px solid var(--rose-deep);
  outline-offset: 2px;
  border-radius: 6px;
}

/* ---------- Brand mark ---------- */
.brand-mark { color: var(--rose-deep); font-size: 1.1em; }
.brand-text { font-family: var(--font-head); font-weight: 600; }
.brand-text em { font-style: italic; color: var(--rose-deep); }

/* =========================================================
   NAVBAR
   ========================================================= */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 245, 247, 0.85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(201,160,160,0.18);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.brand { display: flex; align-items: center; gap: 8px; font-size: 1.3rem; }

.nav-links { display: flex; gap: 30px; }
.nav-link {
  font-size: 0.95rem;
  font-weight: 400;
  position: relative;
  padding: 4px 0;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: -2px;
  width: 0; height: 2px;
  background: var(--rose-deep);
  transition: width 0.25s ease;
}
.nav-link:hover::after { width: 100%; }

.nav-actions { display: flex; align-items: center; gap: 14px; }

.cart-btn {
  position: relative;
  background: var(--white);
  border: 1px solid rgba(201,160,160,0.3);
  width: 44px; height: 44px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.15rem;
  display: grid; place-items: center;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.cart-btn:hover { transform: scale(1.06); box-shadow: var(--shadow-soft); }
.cart-count {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--rose-deep);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 600;
  min-width: 20px; height: 20px;
  border-radius: 999px;
  display: grid; place-items: center;
  padding: 0 5px;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
}
.hamburger span {
  width: 24px; height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.3s ease, opacity 0.3s ease;
}
.hamburger.open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* =========================================================
   HERO
   ========================================================= */
.hero {
  position: relative;
  background:
    radial-gradient(circle at 80% 20%, rgba(255,182,193,0.55), transparent 45%),
    radial-gradient(circle at 15% 80%, rgba(255,228,238,0.8), transparent 50%),
    linear-gradient(160deg, var(--pink-soft), var(--cream));
  padding: 90px 0 130px;
  text-align: center;
  overflow: hidden;
}
.hero-inner { position: relative; z-index: 2; }
.hero-title {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: clamp(2.4rem, 6.5vw, 4.6rem);
  line-height: 1.08;
  color: var(--ink);
  margin-bottom: 18px;
}
.hero-title em { font-style: italic; color: var(--rose-deep); }
.hero-sub {
  max-width: 560px;
  margin: 0 auto 30px;
  color: var(--ink-soft);
  font-size: 1.05rem;
}

/* Floating petals (signature decorative pattern) */
.hero-petals {
  position: absolute; inset: 0; z-index: 1;
  background-image:
    radial-gradient(circle, rgba(212,83,126,0.18) 30%, transparent 31%),
    radial-gradient(circle, rgba(255,182,193,0.45) 30%, transparent 31%);
  background-size: 90px 90px, 70px 70px;
  background-position: 0 0, 40px 35px;
  opacity: 0.5;
  mask-image: radial-gradient(circle at center, black 10%, transparent 70%);
}

/* Scalloped bottom edge — handmade signature */
.hero-scallop {
  position: absolute;
  left: 0; right: 0; bottom: -1px;
  height: 30px;
  background:
    radial-gradient(circle at 15px -3px, var(--cream) 16px, transparent 17px) repeat-x;
  background-size: 32px 30px;
}

/* =========================================================
   CATEGORIES
   ========================================================= */
.categories { padding: 80px 0; }
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 40px;
}
.category-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  text-align: center;
  transition: transform 0.3s ease;
}
.category-card:hover { transform: translateY(-6px); }
.category-thumb {
  height: 150px;
  display: grid; place-items: center;
  font-size: 2.4rem;
}
.category-card h3 {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.25rem;
  margin: 18px 0 4px;
}
.category-card .cat-count { color: var(--ink-soft); font-size: 0.85rem; }
.cat-browse {
  margin: 14px auto 22px;
  display: inline-block;
  background: var(--pink-soft);
  color: var(--rose-deeper);
  border: none;
  border-radius: 999px;
  padding: 8px 22px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s ease;
}
.cat-browse:hover { background: var(--pink-light); color: var(--white); }

/* =========================================================
   SHOP
   ========================================================= */
.shop { padding: 40px 0 90px; }
.shop-controls {
  margin: 36px 0 34px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}
.search-wrap {
  position: relative;
  width: 100%; max-width: 420px;
}
.search-icon {
  position: absolute;
  left: 18px; top: 50%;
  transform: translateY(-50%);
  font-size: 0.95rem;
  opacity: 0.6;
}
.search-input {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 14px 18px 14px 46px;
  border: 1.5px solid rgba(201,160,160,0.3);
  border-radius: 999px;
  background: var(--white);
  color: var(--ink);
}
.search-input::placeholder { color: var(--ink-soft); }

.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; }
.filter-btn {
  font-family: var(--font-body);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 9px 20px;
  border-radius: 999px;
  border: 1.5px solid rgba(201,160,160,0.35);
  background: var(--white);
  color: var(--ink-soft);
  cursor: pointer;
  transition: all 0.2s ease;
}
.filter-btn:hover { border-color: var(--pink-light); color: var(--rose-deep); }
.filter-btn.active {
  background: var(--rose-deep);
  border-color: var(--rose-deep);
  color: var(--white);
}

/* Product grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 26px;
}
.product-card {
  position: relative;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.product-card:hover { transform: translateY(-6px); box-shadow: 0 20px 48px rgba(201,160,160,0.32); }

.product-media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--pink-soft);
  overflow: hidden;
}
.product-media img,
.product-media video {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}
.product-card:hover .product-media img { transform: scale(1.06); }

/* Color-block placeholder for items without a photo yet */
.product-placeholder {
  width: 100%; height: 100%;
  display: grid; place-items: center;
  font-family: var(--font-head);
  font-size: 2.6rem;
  color: rgba(255,255,255,0.85);
}

.wishlist-btn {
  position: absolute;
  top: 12px; right: 12px;
  width: 38px; height: 38px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.9);
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  display: grid; place-items: center;
  transition: transform 0.2s ease, background 0.2s ease;
  color: var(--rose-deep);
}
.wishlist-btn:hover { transform: scale(1.12); }
.wishlist-btn.active { background: var(--rose-deep); color: var(--white); }

.product-tag {
  position: absolute;
  top: 12px; left: 12px;
  background: rgba(255,255,255,0.92);
  color: var(--rose-deeper);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 999px;
}

.product-body { padding: 18px 18px 20px; display: flex; flex-direction: column; flex: 1; }
.product-name {
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.12rem;
  margin-bottom: 4px;
}
.product-desc { color: var(--ink-soft); font-size: 0.85rem; margin-bottom: 14px; flex: 1; }
.product-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.product-price { font-weight: 600; color: var(--rose-deep); font-size: 1.05rem; }
.add-btn {
  background: var(--pink-soft);
  color: var(--rose-deeper);
  border: none;
  border-radius: 999px;
  padding: 9px 16px;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: 0.82rem;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}
.add-btn:hover { background: var(--rose-deep); color: var(--white); }

.empty-state { text-align: center; color: var(--ink-soft); padding: 40px 0; }

/* =========================================================
   CART DRAWER + OVERLAY
   ========================================================= */
.overlay {
  position: fixed; inset: 0;
  background: rgba(74,58,64,0.45);
  z-index: 80;
  opacity: 0;
  transition: opacity 0.3s ease;
}
.overlay.show { opacity: 1; }

.cart-drawer {
  position: fixed;
  top: 0; right: 0;
  height: 100%;
  width: 380px; max-width: 88vw;
  background: var(--cream);
  z-index: 90;
  box-shadow: -10px 0 40px rgba(74,58,64,0.2);
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  display: flex;
  flex-direction: column;
}
.cart-drawer.open { transform: translateX(0); }

.cart-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 24px;
  border-bottom: 1px solid rgba(201,160,160,0.2);
}
.cart-title { font-family: var(--font-head); font-weight: 600; font-size: 1.4rem; }
.cart-close { background: none; border: none; font-size: 1.8rem; line-height: 1; cursor: pointer; color: var(--ink-soft); }
.cart-close:hover { color: var(--rose-deep); }

.cart-items { flex: 1; overflow-y: auto; padding: 18px 24px; }
.cart-empty { padding: 50px 24px; text-align: center; color: var(--ink-soft); }

.cart-line { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px solid rgba(201,160,160,0.18); }
.cart-line-media {
  width: 64px; height: 64px; flex-shrink: 0;
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: grid; place-items: center;
  font-size: 1.4rem; color: #fff;
}
.cart-line-media img, .cart-line-media video { width: 100%; height: 100%; object-fit: cover; }
.cart-line-info { flex: 1; }
.cart-line-name { font-weight: 500; font-size: 0.9rem; }
.cart-line-price { color: var(--rose-deep); font-size: 0.85rem; font-weight: 500; }
.qty-row { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.qty-btn {
  width: 26px; height: 26px;
  border-radius: 50%;
  border: 1px solid rgba(201,160,160,0.4);
  background: var(--white);
  cursor: pointer;
  font-size: 1rem; line-height: 1;
  display: grid; place-items: center;
}
.qty-btn:hover { background: var(--pink-soft); }
.qty-num { min-width: 18px; text-align: center; font-size: 0.9rem; }
.line-remove { margin-left: auto; background: none; border: none; cursor: pointer; color: var(--ink-soft); font-size: 0.8rem; }
.line-remove:hover { color: var(--rose-deep); text-decoration: underline; }

.cart-foot { padding: 20px 24px 26px; border-top: 1px solid rgba(201,160,160,0.2); display: flex; flex-direction: column; gap: 12px; }
.cart-subtotal { display: flex; justify-content: space-between; font-size: 1.05rem; }
.cart-subtotal strong { color: var(--rose-deep); font-family: var(--font-head); }

/* =========================================================
   ABOUT
   ========================================================= */
.about { padding: 90px 0; background: linear-gradient(180deg, var(--cream), var(--pink-soft)); }
.about-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: center; }
.about-copy p { color: var(--ink-soft); margin-top: 16px; }
.highlight-grid { display: grid; gap: 18px; }
.highlight {
  background: var(--white);
  border-radius: var(--radius);
  padding: 24px 26px;
  box-shadow: var(--shadow-soft);
}
.highlight-icon { font-size: 1.8rem; }
.highlight h3 { font-family: var(--font-head); font-weight: 600; font-size: 1.15rem; margin: 8px 0 4px; }
.highlight p { color: var(--ink-soft); font-size: 0.9rem; }

/* =========================================================
   CONTACT
   ========================================================= */
.contact { padding: 90px 0; }
.contact-inner { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; align-items: start; }
.contact-info p { color: var(--ink-soft); margin-top: 14px; }
.contact-list { list-style: none; margin-top: 22px; display: flex; flex-direction: column; gap: 14px; }
.contact-list li { display: flex; align-items: center; gap: 12px; }
.contact-list a:hover { color: var(--rose-deep); }

.contact-form {
  background: var(--white);
  border-radius: var(--radius);
  padding: 30px;
  box-shadow: var(--shadow-card);
}
.field { margin-bottom: 18px; }
.field label { display: block; font-size: 0.85rem; font-weight: 500; margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 0.95rem;
  padding: 12px 14px;
  border: 1.5px solid rgba(201,160,160,0.3);
  border-radius: var(--radius-sm);
  background: var(--cream);
  color: var(--ink);
  resize: vertical;
}
.field input:focus, .field textarea:focus { border-color: var(--rose-deep); }
.error { color: #c0392b; font-size: 0.78rem; display: block; margin-top: 5px; min-height: 14px; }
.field.invalid input, .field.invalid textarea { border-color: #e07a8b; }
.form-success { margin-top: 14px; color: #2e8b57; font-weight: 500; text-align: center; }

/* =========================================================
   FOOTER
   ========================================================= */
.footer { background: var(--ink); color: #f4e6ea; padding: 60px 0 0; }
.footer-inner { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 36px; }
.footer-brand .brand-text { color: #fff; font-size: 1.3rem; }
.footer-brand .brand-text em { color: var(--pink-light); }
.footer-tag { margin-top: 12px; color: #c8aeb6; font-size: 0.9rem; }
.footer h4 { font-family: var(--font-head); font-weight: 600; margin-bottom: 14px; font-size: 1.05rem; }
.footer-links { display: flex; flex-direction: column; gap: 9px; }
.footer-links a, .social-row a { color: #c8aeb6; font-size: 0.9rem; transition: color 0.2s ease; }
.footer-links a:hover, .social-row a:hover { color: var(--pink-light); }
.social-row { display: flex; flex-direction: column; gap: 9px; }
.copyright {
  text-align: center;
  margin-top: 50px;
  padding: 22px;
  border-top: 1px solid rgba(255,255,255,0.08);
  color: #a98e96;
  font-size: 0.8rem;
}

/* =========================================================
   CHECKOUT MODAL + TOAST
   ========================================================= */
.modal {
  position: fixed; inset: 0;
  z-index: 100;
  background: rgba(74,58,64,0.5);
  display: grid; place-items: center;
  padding: 20px;
  animation: fadeIn 0.25s ease;
}
.modal-card {
  position: relative;
  background: var(--cream);
  border-radius: var(--radius);
  width: 100%; max-width: 440px;
  padding: 36px 30px 30px;
  text-align: center;
  box-shadow: 0 30px 70px rgba(74,58,64,0.35);
  max-height: 90vh; overflow-y: auto;
}
.modal-close { position: absolute; top: 14px; right: 18px; background: none; border: none; font-size: 1.6rem; cursor: pointer; color: var(--ink-soft); }
.modal-mark { font-size: 2rem; color: var(--rose-deep); }
.modal-card h2 { font-family: var(--font-head); font-weight: 600; margin: 6px 0 18px; }
.modal-items { text-align: left; margin-bottom: 16px; }
.modal-line { display: flex; justify-content: space-between; padding: 7px 0; border-bottom: 1px dashed rgba(201,160,160,0.3); font-size: 0.9rem; }
.modal-total { display: flex; justify-content: space-between; font-size: 1.1rem; margin: 8px 0 16px; }
.modal-total strong { color: var(--rose-deep); font-family: var(--font-head); }
.modal-note { font-size: 0.82rem; color: var(--ink-soft); margin-bottom: 18px; }
.modal-note a { color: var(--rose-deep); text-decoration: underline; }

.toast {
  position: fixed;
  bottom: 24px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--ink);
  color: #fff;
  padding: 13px 24px;
  border-radius: 999px;
  font-size: 0.88rem;
  z-index: 120;
  opacity: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  box-shadow: var(--shadow-soft);
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

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

/* =========================================================
   SCROLL FADE-IN (Intersection Observer adds .visible)
   ========================================================= */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 980px) {
  .category-grid { grid-template-columns: repeat(2, 1fr); }
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .about-inner, .contact-inner { grid-template-columns: 1fr; gap: 36px; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 720px) {
  .nav-links {
    position: fixed;
    top: 72px; right: 0;
    width: 240px;
    height: calc(100vh - 72px);
    background: var(--cream);
    flex-direction: column;
    gap: 0;
    padding: 20px;
    transform: translateX(100%);
    transition: transform 0.3s ease;
    box-shadow: -8px 0 30px rgba(74,58,64,0.15);
  }
  .nav-links.open { transform: translateX(0); }
  .nav-link { padding: 14px 0; border-bottom: 1px solid rgba(201,160,160,0.18); }
  .nav-link::after { display: none; }
  .hamburger { display: flex; }
  .product-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
  .product-grid { grid-template-columns: 1fr; }
  .category-grid { grid-template-columns: 1fr; }
  .footer-inner { grid-template-columns: 1fr; }
  .hero { padding: 64px 0 100px; }
  .product-foot { flex-direction: column; align-items: stretch; }
  .add-btn { width: 100%; }
}

/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}
