body.papillon-theme .topbar{min-height:34px;background:var(--pap-purple-strong);color:#fff;font-size:11.5px;}
body.papillon-theme .topbar-inner{display:flex;min-height:34px;align-items:center;justify-content:center;gap:14px;white-space:nowrap;overflow:hidden;}
body.papillon-theme .topbar-inner i{width:3px;height:3px;flex:0 0 3px;border-radius:50%;background:#d2e0e3;}
body.papillon-theme .site-header{position:relative;z-index:50;width:100%;border-bottom:1px solid var(--pap-line);background:var(--pap-panel);box-shadow:0 2px 10px rgba(19,43,48,.03);}
body.papillon-theme .header-main{position:relative;display:grid;grid-template-columns:minmax(180px,1fr) minmax(320px,560px) minmax(180px,1fr);grid-template-areas:"actions search brand";align-items:center;gap:32px;min-height:92px;direction:ltr;}
body.papillon-theme .brand{grid-area:brand;display:inline-flex;min-width:0;align-items:center;justify-self:end;gap:10px;direction:rtl;color:var(--pap-ink);text-decoration:none;}
body.papillon-theme :where(.brand-logo-image,.brand .custom-logo){display:block;width:auto;max-width:178px;max-height:68px;object-fit:contain;}
body.papillon-theme .header-main>.site-search{position:relative;grid-area:search;display:flex;width:100%;height:48px;align-items:center;border:1px solid var(--pap-line);border-radius:12px;background:#fafafa;overflow:hidden;direction:rtl;transition:border-color var(--pap-motion-fast) var(--pap-ease),box-shadow var(--pap-motion-fast) var(--pap-ease),background-color var(--pap-motion-fast) var(--pap-ease);}
body.papillon-theme .site-search:focus-within{border-color:#a3c2c8;background:var(--pap-panel);box-shadow:0 0 0 4px rgba(52,118,131,.08);}
body.papillon-theme .site-search input{width:100%;min-width:0;height:100%;padding:0 15px;border:0;outline:0;background:transparent;font-size:12px;}
body.papillon-theme .site-search input::placeholder{color:var(--pap-muted-2);}
body.papillon-theme .site-search button{display:grid;width:50px;height:100%;flex:0 0 50px;place-items:center;padding:0;border:0;background:transparent;color:var(--pap-purple);}
body.papillon-theme .site-search-kbd{display:inline-flex;min-width:42px;height:26px;align-items:center;justify-content:center;margin-inline-end:5px;padding-inline:7px;border:1px solid #dadfe0;border-radius:7px;background:var(--pap-panel);color:#446f78;font:700 12px var(--pap-font-family);direction:ltr;white-space:nowrap;box-shadow:0 2px 5px rgba(19,43,48,.04);}
body.papillon-theme .hamburger-icon .papillon-icon{width:16px;height:16px;}
body.papillon-theme :where(.site-search svg,.header-action svg){display:block;width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round;}
body.papillon-theme .header-action svg{color:var(--pap-purple);}
body.papillon-theme .site-search svg{color:var(--pap-purple);}
body.papillon-theme .header-actions{grid-area:actions;display:flex;align-items:center;justify-self:start;justify-content:flex-start;gap:16px;direction:rtl;}
body.papillon-theme .header-action{position:relative;display:inline-flex;min-height:42px;align-items:center;gap:7px;padding:6px 8px;border:1px solid transparent;border-radius:11px;color:var(--pap-ink);font-size:11.5px;text-decoration:none;white-space:nowrap;transition:color var(--pap-motion-fast) var(--pap-ease),background-color var(--pap-motion-fast) var(--pap-ease),border-color var(--pap-motion-fast) var(--pap-ease),box-shadow var(--pap-motion-base) var(--pap-ease);}
body.papillon-theme .header-action:hover{border-color:#d8dee0;background:#f8fafb;color:var(--pap-purple);box-shadow:0 6px 16px rgba(26,57,63,.06);}
/* بج تعداد روی گوشهٔ بالا-راست آیکن سبد می‌نشیند (سمت آیکن، نه سمت برچسب) و
   کمی از کادر دکمه بیرون می‌زند تا شکل «نشان» بگیرد و روی متن نیفتد. */
body.papillon-theme .header-cart-count{position:absolute;z-index:2;inset-block-start:-4px;inset-inline-start:auto;inset-inline-end:-3px;display:grid;min-width:19px;height:19px;place-items:center;padding-inline:4px;border:2px solid #fff;border-radius:999px;background:#abbabd;color:#fff;font-size:11.5px;font-weight:700;line-height:1;direction:ltr;box-shadow:0 3px 8px rgba(19,43,48,.12);}
/* دکمهٔ سبد خرید از paint containment مستثناست: بج بالا از کادر بیرون می‌زند و
   containment همان تکه را می‌بُرید (عدد ناقص/زیر کادر دیده می‌شد). */
body.papillon-theme .header-action.cart-action{contain:layout;}
body.papillon-theme .header-cart-count.has-items{background:var(--pap-pink);}
body.papillon-theme .mobile-menu{grid-area:menu;display:none;width:44px;height:44px;padding:9px;border:1px solid var(--pap-line);border-radius:11px;background:var(--pap-panel);box-shadow:0 5px 13px rgba(21,48,53,.05);}
body.papillon-theme .mobile-menu span{display:block;width:22px;height:2px;margin:4px auto;border-radius:2px;background:var(--pap-purple);}
body.papillon-theme :where(.mobile-navigation,.mobile-navigation-backdrop){display:none;}


body.papillon-theme .category-nav{position:relative;border-top:1px solid #eff1f2;background:var(--pap-panel);}
body.papillon-theme .category-nav-inner{display:flex;min-height:48px;align-items:center;gap:30px;overflow-x:auto;scrollbar-width:none;}
body.papillon-theme .category-nav-inner::-webkit-scrollbar{display:none;}
body.papillon-theme .category-nav a{position:relative;display:inline-flex;height:48px;align-items:center;gap:7px;font-size:11.5px;text-decoration:none;white-space:nowrap;}
body.papillon-theme .category-nav a:where(:not(.all-categories)):where(:not(.nav-sale)){color:var(--pap-ink-2);}
body.papillon-theme .category-nav button{font:inherit;cursor:pointer;}
body.papillon-theme .category-nav a:not(.all-categories)::after{position:absolute;inset-inline:0;inset-block-end:0;height:2px;background:var(--pap-purple);content:"";transform:scaleX(0);transform-origin:center;transition:transform var(--pap-motion-fast) var(--pap-ease);}
body.papillon-theme .category-nav a:not(.all-categories):hover::after{transform:scaleX(1);}
body.papillon-theme .category-nav a:where(:not(.all-categories)):hover{color:var(--pap-purple);}
body.papillon-theme .all-categories{display:inline-flex;height:34px;align-items:center;padding-inline:15px;border:0;border-radius:8px;background:var(--pap-purple);color:#fff!important;font-weight:700;box-shadow:0 8px 18px rgba(34,89,100,.18);}
body.papillon-theme .all-categories[aria-expanded="true"]{background:var(--pap-purple-strong);box-shadow:0 0 0 3px rgba(52,118,131,.13),0 9px 21px rgba(34,89,100,.22);}
body.papillon-theme .hamburger-icon{font-size:14px;line-height:1;}
body.papillon-theme .nav-sale{color:var(--pap-danger);font-weight:700;}
body.papillon-theme .category-mega-menu{position:absolute;inset-block-start:calc(100% + 9px);left:50%;right:auto;z-index:60;display:none;width:min(1240px,calc(100vw - 48px));max-width:calc(100vw - 48px);padding:22px 24px;border:1px solid #d9e0e1;border-radius:16px;background:rgba(255,255,255,.98);box-shadow:0 22px 55px rgba(19,48,54,.16);backdrop-filter:blur(14px);transform:translateX(-50%);overflow:hidden;}
body.papillon-theme .category-mega-menu.is-open{display:block;animation:papillon-menu-in var(--pap-motion-fast) var(--pap-ease) both;}
body.papillon-theme .category-mega-head{display:flex;align-items:flex-end;justify-content:space-between;gap:18px;padding-bottom:16px;border-bottom:1px solid var(--pap-line);}
body.papillon-theme .category-mega-head .eyebrow{margin-bottom:5px;}
body.papillon-theme .category-mega-head h2{margin:0;font-size:20px;line-height:1.5;}
body.papillon-theme .category-mega-grid{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:9px;margin-top:16px;}
body.papillon-theme .category-mega-item{display:flex;min-height:68px;height:auto;align-items:center;gap:10px;padding:10px 12px;border:1px solid var(--pap-line);border-radius:11px;background:linear-gradient(145deg,#fff,#fafbfb);transition:transform var(--pap-motion-fast) var(--pap-ease),border-color var(--pap-motion-fast) var(--pap-ease),box-shadow var(--pap-motion-fast) var(--pap-ease);}
body.papillon-theme .category-mega-item::after{display:none;}
body.papillon-theme .category-mega-item:hover{border-color:#a4c2c8;box-shadow:0 8px 18px rgba(34,89,100,.1);transform:translateY(-2px);}
body.papillon-theme .category-mega-icon{display:grid;width:31px;height:31px;flex:0 0 31px;place-items:center;border-radius:9px;background:var(--pap-purple-soft);color:var(--pap-purple);font-size:15px;}
body.papillon-theme .category-mega-item>span:nth-child(2){display:flex;min-width:0;flex:1;flex-direction:column;gap:2px;}
body.papillon-theme .category-mega-item b{overflow:hidden;font-size:11.5px;text-overflow:ellipsis;white-space:nowrap;}
body.papillon-theme .category-mega-item small{color:var(--pap-muted);font-size:11.5px;}
body.papillon-theme .category-mega-item i{color:var(--pap-purple);font-size:14px;font-style:normal;}
@keyframes papillon-menu-in{from{opacity:0;transform:translate(-50%,-5px);}to{opacity:1;transform:translate(-50%,0);}}


@media(max-width:1024px){
  body.papillon-theme .header-main{display:grid;grid-template-columns:48px minmax(0,1fr) 96px;grid-template-rows:54px 48px;grid-template-areas:"menu brand actions" "search search search";gap:9px 10px;min-height:0;padding:10px 18px 12px;direction:ltr;}
  body.papillon-theme .mobile-menu{display:block;align-self:center;justify-self:start;}
  body.papillon-theme .brand{align-self:center;justify-self:center;}
  body.papillon-theme :where(.brand-logo-image,.brand .custom-logo){max-width:140px;max-height:54px;}
  body.papillon-theme .header-actions{align-self:center;justify-self:end;gap:2px;}
  body.papillon-theme .header-action{width:44px;min-width:44px;height:44px;justify-content:center;padding:8px;border:1px solid #d9dfe0;border-radius:11px;background:var(--pap-panel);color:var(--pap-purple);box-shadow:0 6px 16px rgba(26,57,63,.07);}
  body.papillon-theme .header-action span{display:none;}
  body.papillon-theme .header-action svg{width:24px;height:24px;}
  body.papillon-theme .header-cart-count{inset-block-start:-2px;inset-inline-start:auto;inset-inline-end:-2px;}
  body.papillon-theme .header-main>.site-search{grid-area:search;width:100%;max-width:none;height:48px;margin:0;align-self:stretch;box-shadow:0 7px 20px rgba(26,57,63,.065);}
  body.papillon-theme .category-nav{display:none;}
  body.papillon-theme .category-mega-menu{display:none;}
  body.papillon-theme .mobile-navigation{position:fixed;top:0;bottom:0;left:auto;right:0;z-index:100;display:flex;width:min(86vw,360px);flex-direction:column;padding:20px;background:var(--pap-panel);box-shadow:-18px 0 38px rgba(0,0,0,.16);visibility:hidden;transform:translateX(105%);transition:transform var(--pap-motion-base) var(--pap-ease),visibility 0s linear var(--pap-motion-base);overflow-y:auto;overscroll-behavior:contain;direction:rtl;}
  body.papillon-theme .mobile-navigation.is-open{visibility:visible;transform:none;transition:transform var(--pap-motion-base) var(--pap-ease),visibility 0s linear 0s;}
  body.papillon-theme .mobile-navigation-backdrop{position:fixed;inset:0;z-index:90;display:block;background:rgba(19,43,48,.4);opacity:0;pointer-events:none;transition:opacity var(--pap-motion-base) var(--pap-ease);}
  body.papillon-theme .mobile-navigation-backdrop.is-open{opacity:1;pointer-events:auto;}
  body.papillon-theme .mobile-navigation-head{display:flex;align-items:center;justify-content:space-between;padding-bottom:16px;border-bottom:1px solid var(--pap-line);font-size:16px;}
  body.papillon-theme .mobile-menu-close{display:grid;width:40px;height:40px;place-items:center;padding:0;border:1px solid var(--pap-line);border-radius:10px;background:var(--pap-panel);color:var(--pap-muted);font-size:26px;line-height:1;}
  body.papillon-theme .mobile-navigation>a{display:flex;min-height:52px;align-items:center;justify-content:space-between;padding:14px 7px;border-bottom:1px solid var(--pap-line);color:var(--pap-ink);font-size:12px;text-decoration:none;}
  body.papillon-theme .mobile-navigation>a span{color:var(--pap-purple);font-size:16px;}
  body.papillon-theme .mobile-navigation>a.is-current{color:var(--pap-purple);font-weight:700;box-shadow:inset -3px 0 0 var(--pap-purple);}
  body.papillon-theme .mobile-navigation-title{flex:0 0 auto;margin:18px 0 2px;padding:0 7px;color:var(--pap-muted);font-size:11.5px;font-weight:700;}
}
@media(max-width:600px){
  body.papillon-theme .topbar{font-size:11.5px;}
  body.papillon-theme .topbar-inner{justify-content:center;gap:8px;padding-inline:10px;}
  body.papillon-theme .topbar-inner span:nth-of-type(2),
  body.papillon-theme .topbar-inner span:nth-of-type(3),
  body.papillon-theme .topbar-inner i{display:none;}
  body.papillon-theme .header-main{grid-template-columns:44px minmax(0,1fr) 88px;grid-template-rows:50px 46px;gap:8px;padding:9px 12px 11px;}
  body.papillon-theme .header-main>.site-search{height:46px;}
  body.papillon-theme :where(.brand-logo-image,.brand .custom-logo){max-width:126px;max-height:48px;}
  body.papillon-theme .header-action{width:42px;min-width:42px;height:42px;}
  body.papillon-theme .site-search-kbd{display:none;}
}
@media(max-width:370px){
  body.papillon-theme .header-main{grid-template-columns:42px minmax(0,1fr) 82px;padding-inline:10px;}
  body.papillon-theme :where(.brand-logo-image,.brand .custom-logo){max-width:112px;}
  body.papillon-theme .site-search input{padding-inline:11px;font-size:11.5px;}
  body.papillon-theme .site-search button{width:44px;flex-basis:44px;}
}
