/* ============================================================
   بوبوتل — استایل اصلی
   ساختار: ۱) توکن‌ها  ۲) پایه  ۳) اجزای عمومی  ۴) بخش‌ها  ۵) واکنش‌گرا
   ============================================================ */

/* ── ۱) توکن‌ها ───────────────────────────────────────────── */
:root {
  /* رنگ */
  --teal-900: #0B3B39;   /* تیره‌ترین: بخش عمده‌فروشی و فوتر */
  --teal-700: #12706B;   /* رنگ برند: تیترها و تأکید */
  --teal-500: #1B8C84;
  --teal-050: #E7F1EF;
  --amber:    #D98A16;   /* دکمه‌های اقدام */
  --amber-dk: #B87111;
  --paper:    #F6F9F9;   /* پس‌زمینه صفحه */
  --white:    #FFFFFF;
  --ink:      #16292C;   /* متن اصلی */
  --ink-soft: #5B7175;   /* متن ثانویه */
  --line:     #DCE7E5;
  --whatsapp: #1FA855;

  /* فاصله و شعاع */
  --r-sm: 8px;
  --r-md: 14px;
  --r-lg: 22px;
  --gap: 24px;
  --wrap: 1180px;
  --header-h: 72px;

  /* سایه: فقط دو سطح، برای حفظ سلسله‌مراتب */
  --shadow-1: 0 1px 2px rgba(11, 59, 57, .06);
  --shadow-2: 0 18px 40px -24px rgba(11, 59, 57, .45);
}

/* ── ۲) پایه ─────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 12px); }

body {
  margin: 0;
  font-family: Vazirmatn, "Segoe UI", Tahoma, sans-serif;
  font-size: 16px;
  line-height: 1.85;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4 { margin: 0 0 .6em; line-height: 1.35; font-weight: 800; }
p  { margin: 0 0 1em; }
ul { margin: 0; padding: 0; list-style: none; }
a  { color: var(--teal-700); text-decoration: none; }
a:hover { color: var(--teal-500); }
img { max-width: 100%; display: block; }

:focus-visible {
  outline: 3px solid var(--amber);
  outline-offset: 2px;
  border-radius: 4px;
}

.wrap { width: min(100% - 40px, var(--wrap)); margin-inline: auto; }

.skip-link {
  position: absolute; inset-inline-start: -9999px; top: 8px;
  background: var(--teal-900); color: var(--white);
  padding: 10px 16px; border-radius: var(--r-sm); z-index: 200;
}
.skip-link:focus { inset-inline-start: 16px; color: var(--white); }

/* ── ۳) اجزای عمومی ──────────────────────────────────────── */

/* دکمه‌ها */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 26px;
  font: inherit; font-weight: 700;
  border: 1.5px solid transparent; border-radius: var(--r-md);
  cursor: pointer; text-align: center;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}
.btn-sm    { padding: 9px 16px; font-size: .9rem; border-radius: var(--r-sm); }
.btn-block { width: 100%; }

.btn-amber   { background: var(--amber); color: var(--white); }
.btn-amber:hover { background: var(--amber-dk); color: var(--white); }

.btn-teal    { background: var(--teal-700); color: var(--white); }
.btn-teal:hover { background: var(--teal-900); color: var(--white); }

.btn-outline { background: transparent; color: var(--teal-900); border-color: var(--line); }
.btn-outline:hover { border-color: var(--teal-700); color: var(--teal-700); background: var(--white); }

.btn-whatsapp { background: var(--whatsapp); color: var(--white); }
.btn-whatsapp:hover { background: #17853F; color: var(--white); }

.icon-btn {
  position: relative;
  display: inline-grid; place-items: center;
  width: 42px; height: 42px;
  background: var(--white); color: var(--teal-900);
  border: 1.5px solid var(--line); border-radius: var(--r-md);
  cursor: pointer;
}
.icon-btn svg { width: 21px; height: 21px; }
.icon-btn:hover { border-color: var(--teal-700); color: var(--teal-700); }

.cart-count {
  position: absolute; top: -7px; inset-inline-end: -7px;
  min-width: 20px; height: 20px; padding: 0 5px;
  display: grid; place-items: center;
  background: var(--amber); color: var(--white);
  font-size: .72rem; font-weight: 700; border-radius: 999px;
}

/* عنوان بخش‌ها */
.section { padding: 76px 0; }
.section-paper { background: var(--white); border-block: 1px solid var(--line); }

.section-head { max-width: 62ch; margin-bottom: 34px; }
.section-head h2 { font-size: clamp(1.5rem, 3vw, 2.05rem); color: var(--teal-900); }
.section-head p  { color: var(--ink-soft); margin: 0; }

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

/* ── ۴) بخش‌ها ───────────────────────────────────────────── */

/* هدر */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(246, 249, 249, .92);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  min-height: var(--header-h);
  display: flex; align-items: center; gap: 18px;
}

.brand { display: flex; align-items: center; gap: 10px; color: var(--teal-900); }
.brand-mark svg { width: 40px; height: 40px; display: block; }
.brand-text strong { display: block; font-size: 1.06rem; font-weight: 800; line-height: 1.2; }
.brand-text small  { display: block; font-size: .72rem; color: var(--ink-soft); }

.main-nav { display: flex; gap: 4px; margin-inline: auto; }
.main-nav a {
  padding: 9px 14px; border-radius: var(--r-sm);
  color: var(--ink); font-size: .95rem; font-weight: 600;
}
.main-nav a:hover { background: var(--teal-050); color: var(--teal-700); }
.main-nav a.is-current { background: var(--teal-050); color: var(--teal-900); }

.header-actions { display: flex; align-items: center; gap: 10px; }
.menu-toggle { display: none; }

/* هیرو */
.hero { padding: 56px 0 64px; }
.hero-grid {
  display: grid; grid-template-columns: 1.05fr .95fr;
  gap: 48px; align-items: center;
}

.hero-badge {
  display: inline-block; margin: 0 0 20px;
  padding: 7px 15px;
  background: var(--white); border: 1px solid var(--line);
  border-radius: 999px;
  font-size: .82rem; font-weight: 600; color: var(--teal-700);
}

.hero-logo {
  width: 226px; max-width: 100%;
  padding: 10px; margin-bottom: 22px;
  background: var(--white); border: 1px solid var(--line);
  border-radius: var(--r-lg); box-shadow: var(--shadow-1);
}
.hero-logo svg { width: 100%; height: auto; }

/* انیمیشن شعار اصلی: بوبوتل، انتخاب باب دل */
.animated-slogan {
  font-size: clamp(2.1rem, 6vw, 3.5rem);
  font-weight: 900;
  letter-spacing: -0.5px;
  margin-bottom: 0.35em;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.brand-name {
  color: var(--teal-700);
  opacity: 0;
  transform: translateY(20px);
  animation: smoothPop 0.8s cubic-bezier(0.22, 0.8, 0.3, 1) forwards;
}

.magic-text {
  background: linear-gradient(120deg, var(--amber), var(--amber-dk), var(--teal-500), var(--amber));
  background-size: 300% 300%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  
  opacity: 0;
  transform: translateY(20px);
  animation: 
    smoothPop 0.8s cubic-bezier(0.22, 0.8, 0.3, 1) forwards 0.3s,
    gradientShift 5s ease-in-out infinite alternate;
}

@keyframes smoothPop {
  to { opacity: 1; transform: translateY(0); }
}

@keyframes gradientShift {
  0% { background-position: 0% 50%; }
  50% { background-position: 100% 50%; }
  100% { background-position: 0% 50%; }
}

.hero-lead {
  max-width: 46ch; font-size: 1.06rem; color: var(--ink-soft); margin-bottom: 28px;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; }

.hero-stats {
  display: flex; flex-wrap: wrap; gap: 34px;
  margin-top: 36px; padding-top: 26px; border-top: 1px solid var(--line);
}
.hero-stats b    { display: block; font-size: 1.35rem; color: var(--teal-900); }
.hero-stats span { font-size: .85rem; color: var(--ink-soft); }

.hero-media { position: relative; margin: 0; }
.hero-art {
  border-radius: var(--r-lg); 
  overflow: hidden; 
  box-shadow: var(--shadow-2);
  background: var(--teal-050);
  position: relative;
  animation: floatHero 5s ease-in-out infinite;
}
.hero-art img {
  width: 100%; height: auto; display: block;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  object-position: center;
}

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

.hero-art::after {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(
        to right,
        rgba(255, 255, 255, 0) 0%,
        rgba(255, 255, 255, 0.25) 50%,
        rgba(255, 255, 255, 0) 100%
    );
    transform: rotate(30deg);
    animation: shine 6s linear infinite;
    pointer-events: none;
}

@keyframes shine {
    0% { left: -100%; top: -100%; }
    100% { left: 100%; top: 100%; }
}

.hero-chip {
  position: absolute; inset-inline-start: 22px; bottom: 22px;
  inset-inline-end: 22px;
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 12px 18px;
  background: rgba(255, 255, 255, .95);
  border-radius: var(--r-md);
  font-size: .9rem; font-weight: 600; color: var(--teal-900);
}
.hero-chip b {
  padding: 5px 12px;
  background: var(--teal-900); color: var(--white);
  border-radius: 999px; font-size: .8rem;
}

/* نوار مزیت‌ها */
.strip { background: var(--teal-900); color: var(--white); padding: 26px 0; }
.strip-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap);
}
.strip-grid b    { display: block; font-size: 1rem; }
.strip-grid span { font-size: .85rem; color: rgba(246, 249, 249, .72); }

/* گروه‌های اصلی */
.group-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.group-card {
  padding: 28px 26px 24px;
  background:
    linear-gradient(rgba(255,255,255,.94), rgba(255,255,255,.98)),
    repeating-linear-gradient(90deg, var(--teal-050) 0 1px, transparent 1px 26px),
    repeating-linear-gradient(0deg, var(--teal-050) 0 1px, transparent 1px 26px);
  border: 1px solid var(--line); border-radius: var(--r-lg);
}
.group-card h3 { font-size: 1.2rem; color: var(--teal-900); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; }
.chips li {
  padding: 5px 12px;
  background: var(--teal-050); color: var(--teal-700);
  border-radius: 999px; font-size: .82rem; font-weight: 600;
}

.link-cta { font-weight: 700; border-bottom: 2px solid var(--amber); padding-bottom: 2px; }

/* کاتالوگ و کارت‌های محصولات */
.filters { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 30px; }
.filter {
  padding: 9px 18px;
  font: inherit; font-size: .92rem; font-weight: 600;
  color: var(--ink); background: var(--paper);
  border: 1.5px solid var(--line); border-radius: 999px; cursor: pointer;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}
.filter:hover { border-color: var(--teal-500); color: var(--teal-700); }
.filter.is-active { background: var(--teal-900); border-color: var(--teal-900); color: var(--white); }

.product-grid { 
  display: grid; 
  grid-template-columns: repeat(4, 1fr); 
  gap: 20px; 
}

.product {
  display: flex; flex-direction: column;
  background: var(--white);
  border: 1px solid var(--line); border-radius: var(--r-lg);
  overflow: hidden;
  transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease;
}

.product:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-2);
  border-color: var(--teal-500);
}

.product[hidden] { display: none; }

.thumb-container {
  width: 100%;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #F8FAFA;
  display: grid;
  place-items: center;
  border-bottom: 1px solid var(--line);
}

.thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.product:hover .thumb {
  transform: scale(1.06);
}

.product-body { padding: 18px 18px 8px; flex: 1; text-align: right; }
.tag {
  display: inline-block; margin-bottom: 6px;
  font-size: .75rem; font-weight: 700; color: var(--teal-500);
}
.product-body h3 { font-size: 1rem; color: var(--teal-900); margin-bottom: .3em; }
.product-meta {
  font-size: .8rem !important; font-weight: 600;
  color: var(--teal-700) !important; margin-bottom: .4em !important;
}
.price { font-weight: 700; color: var(--amber-dk) !important; font-size: .95rem; }

.product-actions { display: grid; gap: 8px; padding: 0 18px 18px; }

/* بخش اینستاگرام (جدید) */
#instagram-feed {
  background: var(--white);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.instagram-container {
  width: 100%;
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
  overflow: hidden;
  box-shadow: var(--shadow-1);
}

/* همکاری عمده‌فروشی */
.wholesale { background: var(--teal-900); color: var(--white); }
.wholesale-grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: 52px; align-items: start;
}
.wholesale h2 { color: var(--white); font-size: clamp(1.5rem, 3vw, 2.05rem); }
.wholesale-copy p { color: rgba(246, 249, 249, .8); max-width: 48ch; }

.check-list { margin-top: 24px; display: grid; gap: 12px; }
.check-list li {
  position: relative; padding-inline-start: 30px;
  color: rgba(246, 249, 249, .9);
}
.check-list li::before {
  content: ""; position: absolute; inset-inline-start: 0; top: 11px;
  width: 16px; height: 16px; border-radius: 50%;
  background: var(--amber);
}

.wholesale-form {
  padding: 30px; background: var(--white); color: var(--ink);
  border-radius: var(--r-lg);
}
.wholesale-form h3 { font-size: 1.15rem; color: var(--teal-900); margin-bottom: 20px; }

.field { margin-bottom: 16px; }
.field label { display: block; font-size: .88rem; font-weight: 600; margin-bottom: 6px; }
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px;
  font: inherit; font-size: .95rem; color: var(--ink);
  background: var(--paper);
  border: 1.5px solid var(--line); border-radius: var(--r-sm);
}
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--teal-500); background: var(--white); outline: none;
}
.field textarea { resize: vertical; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.form-note { margin: 12px 0 0; font-size: .87rem; color: var(--teal-700); min-height: 1.4em; }
.form-note.is-error { color: #B3261E; }

/* شهرها */
.city-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.city-grid li {
  padding: 18px 20px; text-align: center;
  background: var(--white); border: 1px solid var(--line); border-radius: var(--r-md);
  font-weight: 600; color: var(--teal-900);
}

/* گالری مغازه */
.gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.gallery figure { margin: 0; border-radius: var(--r-lg); overflow: hidden; background: var(--teal-050); }
.gallery img { aspect-ratio: 4 / 5; object-fit: cover; width: 100%; }

.gallery figcaption {
  padding: 12px 16px; font-size: .88rem; font-weight: 600; color: var(--teal-900);
  background: var(--paper); border-top: 1px solid var(--line);
}

/* فوتر */
.site-footer { background: var(--teal-900); color: rgba(246, 249, 249, .82); padding: 58px 0 24px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: var(--gap); }
.site-footer h3 { color: var(--white); font-size: 1.3rem; }
.site-footer h4 { color: var(--white); font-size: 1rem; }
.site-footer a  { color: rgba(246, 249, 249, .82); }
.site-footer a:hover { color: var(--amber); }
.footer-list { display: grid; gap: 9px; font-size: .93rem; }

.footer-bottom {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  margin-top: 40px; padding-top: 20px;
  border-top: 1px solid rgba(246, 249, 249, .16);
  font-size: .85rem; color: rgba(246, 249, 249, .6);
}

/* سبد خرید (کشویی) */
.drawer-backdrop {
  position: fixed; inset: 0; z-index: 110;
  background: rgba(11, 59, 57, .45);
}
.drawer {
  position: fixed; inset-block: 0; inset-inline-end: 0; z-index: 120;
  width: min(390px, 92vw);
  display: flex; flex-direction: column;
  background: var(--white);
  transform: translateX(100%);
  transition: transform .25s ease;
  box-shadow: var(--shadow-2);
}
[dir="rtl"] .drawer { transform: translateX(-100%); }
.drawer.is-open, [dir="rtl"] .drawer.is-open { transform: none; }

.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 22px; border-bottom: 1px solid var(--line);
}
.drawer-head h2 { margin: 0; font-size: 1.1rem; color: var(--teal-900); }
.drawer-body { flex: 1; overflow-y: auto; padding: 18px 22px; }
.drawer-foot { padding: 18px 22px; border-top: 1px solid var(--line); }
.drawer-note { font-size: .85rem; color: var(--ink-soft); margin-bottom: 12px; }

.cart-row {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.cart-row h4 { margin: 0; font-size: .95rem; font-weight: 700; }
.cart-row small { color: var(--ink-soft); font-size: .82rem; }
.qty { display: flex; align-items: center; gap: 8px; }
.qty button {
  width: 30px; height: 30px; font: inherit; font-weight: 700; cursor: pointer;
  background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--r-sm);
  color: var(--teal-900);
}
.qty button:hover { border-color: var(--teal-500); }

/* دکمه شناور واتساپ */
.fab-whatsapp {
  position: fixed; inset-inline-start: 20px; bottom: 20px; z-index: 90;
  width: 54px; height: 54px;
  display: grid; place-items: center;
  background: var(--whatsapp); color: var(--white);
  border-radius: 50%; box-shadow: var(--shadow-2);
}
.fab-whatsapp svg { width: 28px; height: 28px; }
.fab-whatsapp:hover { background: #17853F; color: var(--white); }

/* ── ۵) واکنش‌گرا ────────────────────────────────────────── */

@media (max-width: 1200px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 1024px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .hero-media { order: -1; }
  .hero-lead { max-width: none; }
  .group-grid, .gallery { grid-template-columns: repeat(2, 1fr); }
  .strip-grid { grid-template-columns: repeat(2, 1fr); row-gap: 18px; }
  .wholesale-grid { grid-template-columns: 1fr; gap: 32px; }
  .footer-grid { grid-template-columns: repeat(2, 1fr); row-gap: 32px; }
}

@media (max-width: 900px) {
  .product-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 860px) {
  .menu-toggle { display: inline-grid; }
  .header-actions .btn { display: none; }

  .main-nav {
    position: absolute; inset-inline: 0; top: 100%;
    display: none; flex-direction: column; gap: 2px;
    padding: 12px 20px 18px;
    background: var(--white); border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-2);
  }
  .main-nav.is-open { display: flex; }
  .main-nav a { padding: 12px 14px; }
  .site-header { position: sticky; }
  .header-inner { position: relative; justify-content: space-between; }
}

@media (max-width: 620px) {
  .wrap { width: calc(100% - 32px); }
  .section { padding: 56px 0; }
  .hero { padding: 34px 0 48px; }
  .hero-cta .btn { flex: 1 1 100%; }
  .hero-stats { gap: 22px; }
  .group-grid, .product-grid, .gallery, .strip-grid { grid-template-columns: 1fr; }
  .city-grid { grid-template-columns: repeat(2, 1fr); }
  .field-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
  .wholesale-form { padding: 22px; }
  .hero-chip { flex-direction: column; align-items: flex-start; gap: 6px; }
}

/* چاپ */
@media print {
  .site-header, .fab-whatsapp, .drawer, .drawer-backdrop, .product-actions { display: none !important; }
  body { background: #fff; }
}