/* Base reset & variables */
:root {
  --c-bg:#ffffff;
  --c-surface:#f5f7fa;
  --c-border:#e2e8f0;
  --c-border-strong:#cbd5e1;
  --c-text:#1e293b;
  --c-text-light:#64748b;
  --c-accent:#1d4ed8;
  --c-accent-rgb:29 78 216;
  --c-accent-alt:#fbbf24;
  --radius-xs:4px;
  --radius-sm:6px;
  --radius-md:10px;
  --shadow-sm:0 1px 2px rgba(0 0 0 / .06),0 0 0 1px rgba(0 0 0 / .04);
  --shadow-md:0 4px 10px -2px rgba(0 0 0 / .12);
  --transition: .25s cubic-bezier(.4,0,.2,1);
}
*{box-sizing:border-box;margin:0;padding:0;}
html{scroll-behavior:smooth;}
body{font-family:'Inter',system-ui,-apple-system,Segoe UI,Roboto,sans-serif;background:var(--c-bg);color:var(--c-text);line-height:1.4;font-size:15px;}
img{max-width:100%;display:block;height:auto;}
button,input,textarea{font:inherit;}
a{text-decoration:none;color:var(--c-accent);}a:hover{color:#143d9f;}
ul{list-style:none;}

/* RTL support */
html.is-rtl body{direction:rtl;}
html.is-rtl .topbar{direction:rtl;}
html.is-rtl .nav-list{flex-direction:row-reverse;}
html.is-rtl .dept-bar__inner{direction:rtl;flex-direction:row;justify-content:flex-start;}
html.is-rtl .dept-item{letter-spacing:0;} /* often better for Arabic */
html.is-rtl .carousel__btn.prev{left:auto;right:-18px;}
html.is-rtl .carousel__btn.next{right:auto;left:-18px;}
html.is-rtl .product__price{flex-direction:row-reverse;}
html.is-rtl .fav{right:auto;left:4px;}
@media (max-width:880px){
  html.is-rtl .nav-list{right:auto;left:0;}
  html.is-rtl .dept-bar__inner{padding-right:12px;padding-left:0;}
}

/* Layout */
.container{--max:1240px;max-width:var(--max);margin-inline:auto;padding:0 clamp(12px,2.2vw,40px);}
.site-header{background:#0f172a;color:#fff;position:sticky;top:0;z-index:60;box-shadow:0 2px 4px -2px rgba(0 0 0 /.4);} 
/* Secondary dept bar */
.dept-bar{background:#1e3a8a;box-shadow:0 1px 0 rgba(255 255 255 /.07),inset 0 -1px 0 rgba(255 255 255 /.05);} 
.dept-bar__inner{display:flex;align-items:center;gap:.5rem;overflow:auto;padding:.4rem 0;scrollbar-width:none;}
.dept-bar__inner::-webkit-scrollbar{display:none;}
.dept-item{background:transparent;color:#fff;border:1px solid transparent;padding:.44rem .85rem;font-size:.66rem;font-weight:600;letter-spacing:.55px;text-transform:uppercase;border-radius:26px;cursor:pointer;white-space:nowrap;transition:var(--transition);} 
.dept-item:hover{background:rgba(255 255 255 /.1);color:#fff;} 
.dept-item.is-active:hover{color:#0f172a;} /* сохранить читаемость на жёлтом фоне */
.dept-item.is-active{background:#fbbf24;color:#0f172a;}
.topbar{display:grid;grid-template-columns:auto 1fr auto auto;align-items:center;gap:28px;padding:.65rem 0;min-height:60px;}
.logo{font-weight:700;font-size:1.25rem;display:flex;align-items:center;gap:6px;}
.logo__dot{width:12px;height:12px;border-radius:50%;background:var(--c-accent-alt);display:inline-block;box-shadow:0 0 0 4px rgba(251 191 36 / .35);} 

.search{display:flex;gap:4px;align-items:center;position:relative;flex:1;min-width:0;}
.search input{flex:1;min-width:0;width:100%;max-width:420px;padding:.55rem .75rem;border:1px solid #334155;border-radius:var(--radius-sm);background:#1e293b;color:#fff;transition:var(--transition);}
.search input:focus{outline:2px solid var(--c-accent);}
.search-btn{display:inline-flex;align-items:center;justify-content:center;background:var(--c-accent);color:#fff;border-radius:var(--radius-sm);padding:.55rem .8rem;min-width:44px;font-size:1rem;font-weight:600;line-height:1;transition:var(--transition);}
.search-btn:hover{background:#143d9f;color:var(--c-accent-alt);} 

.main-nav{position:relative;}
.nav-toggle{display:none;background:#1e293b;color:#fff;border:1px solid #334155;padding:.5rem .75rem;border-radius:var(--radius-sm);cursor:pointer;}
.nav-list{display:flex;gap:22px;align-items:center;}
.nav-list a{color:#fff;font-weight:500;padding:.35rem .25rem;display:block;}
.nav-list a:hover{color:var(--c-accent-alt);} 
.user-actions{display:flex;align-items:center;gap:16px;}
.user-actions select{background:#1e293b;color:#fff;border:1px solid #334155;border-radius:var(--radius-sm);padding:.45rem .5rem;font-size:.7rem;letter-spacing:.5px;text-transform:uppercase;cursor:pointer;}
.btn-link{background:transparent;border:0;color:#fff;cursor:pointer;font-weight:500;transition:var(--transition);}
.btn-link:hover{color:var(--c-accent-alt);} 
.cart{background:#1e293b;border:1px solid #334155;color:#fff;border-radius:var(--radius-sm);padding:.4rem .8rem;cursor:pointer;position:relative;transition:var(--transition);} 
.cart:hover,.cart:focus{background:var(--c-accent);border-color:var(--c-accent);color:#fff;}
.cart:active{background:#143d9f;}
.cart:focus-visible{outline:2px solid var(--c-accent-alt);outline-offset:2px;}
.cart__count{position:absolute;top:-6px;right:-6px;background:var(--c-accent);color:#fff;font-size:.65rem;padding:2px 4px;border-radius:12px;line-height:1;}

/* Image placeholder fallback */
.img-fallback{background:#f1f5f9 url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="120" height="90" viewBox="0 0 120 90" fill="none"><rect width="120" height="90" rx="8" fill="%23e2e8f0"/><path d="M20 63l18-22 14 17 10-13 18 18H20z" fill="%23cbd5e1"/><circle cx="76" cy="32" r="8" fill="%23cbd5e1"/></svg>') center/60% no-repeat;}

/* A11y utility */
.visually-hidden{position:absolute !important;width:1px !important;height:1px !important;padding:0 !important;margin:-1px !important;overflow:hidden !important;clip:rect(0 0 0 0) !important;white-space:nowrap !important;border:0 !important;}

/* Hero (now structurally identical to brand-hero) */
.hero-full{display:grid;grid-template-columns:repeat(auto-fit,minmax(340px,1fr));gap:40px;align-items:center;margin:1.2rem auto 2.4rem;position:relative;background:linear-gradient(92deg,#f8fafc 0%,#eef4ff 55%,#e3efff 100%);padding:2.5rem 2.2rem;border-radius:var(--radius-md);overflow:hidden;box-shadow:var(--shadow-md);} 
.hero-full__media img{width:100%;border-radius:var(--radius-sm);box-shadow:0 8px 16px -4px rgba(0 0 0 /.35);max-height:400px;}
.hero-full__content{display:flex;flex-direction:column;gap:1.1rem;max-width:560px;}
.hero-full .btn{align-self:flex-start;}
.eyebrow{font-size:.68rem;font-weight:600;letter-spacing:.55px;text-transform:uppercase;color:var(--c-accent);}
.hero-full h1{font-size:clamp(2rem,3.6vw,3rem);line-height:1.02;font-weight:700;color:#0f172a;margin:0;}
.lead{color:var(--c-text-light);font-size:1rem;max-width:46ch;}
/* (hero-full inherits natural RTL behaviour like brand-hero; no custom overrides) */
@media (max-width:880px){
  .hero-full{grid-template-columns:1fr;padding:2rem 1.4rem;gap:32px;}
}
@media (max-width:560px){
  .hero-full{gap:26px;}
  .hero-full__media img{max-height:300px;}
}

/* Promo grid extracted from old hero */
.promo-tiles{margin:-.6rem auto 2.8rem;}
.promo-grid{--tile-min:190px;display:grid;grid-template-columns:repeat(auto-fill,minmax(var(--tile-min),1fr));gap:clamp(16px,1.4vw,26px);grid-auto-rows:210px;grid-auto-flow:dense;}
.promo-grid .promo-tile{min-height:unset;height:100%;}
.promo-tile{background:#f1f5f9;position:relative;overflow:hidden;}
.promo-tile img{transition:transform .85s cubic-bezier(.22,.6,.18,1),filter .4s;filter:brightness(.93);height:100%;width:100%;object-fit:cover;}
.promo-tile:hover img{transform:scale(1.07);filter:brightness(1);} 
.promo-tile__body{backdrop-filter:blur(6px);background:linear-gradient(180deg,rgba(15 23 42 /.0),rgba(15 23 42 /.65));}
/* Patterned spans for masonry */
.promo-grid .promo-tile:nth-child(6n+1){grid-row:span 2;}
.promo-grid .promo-tile:nth-child(8n+4){grid-column:span 2;}
.promo-grid .promo-tile:nth-child(10n+7){grid-row:span 2;}
.promo-tile--wide{grid-column:span 2;}
@media (max-width:960px){
  .promo-grid{grid-auto-rows:190px;}
  .promo-tile--wide{grid-column:span 1;}
  .promo-grid .promo-tile:nth-child(6n+1),
  .promo-grid .promo-tile:nth-child(10n+7){grid-row:span 1;}
}
.btn{--btn-bg:var(--c-accent);--btn-color:#fff;background:var(--btn-bg);color:var(--btn-color);border:0;padding:.75rem 1.2rem;font-weight:600;border-radius:var(--radius-sm);cursor:pointer;transition:var(--transition);box-shadow:0 1px 2px rgba(0 0 0 / .2);} 
.btn--primary:hover,.btn--primary:focus{background:#143d9f;color:var(--c-accent-alt);outline:none;}
.btn--primary:active{background:#0e3b91;}
.btn--primary:focus-visible{outline:2px solid var(--c-accent-alt);outline-offset:2px;}
.promo-tile{position:relative;display:flex;flex-direction:column;overflow:hidden;border-radius:var(--radius-md);background:var(--c-surface);box-shadow:var(--shadow-sm);min-height:200px;}
.promo-tile--tall{grid-row:span 2;}
.promo-tile img{width:100%;height:100%;object-fit:cover;}
.promo-tile__body{position:absolute;inset:auto 0 0 0;padding:.9rem 1rem;background:linear-gradient(0deg,rgba(0 0 0 /.55),rgba(0 0 0 /.05));color:#fff;}
.promo-tile__body h3{font-size:1rem;margin-bottom:.15rem;}
.promo-tile__body p{font-size:.75rem;font-weight:500;opacity:.9;}

/* Brand hero */
.brand-hero{display:grid;grid-template-columns:repeat(auto-fit,minmax(340px,1fr));gap:40px;align-items:center;margin:3rem auto 2.5rem;position:relative;background:linear-gradient(95deg,#0f172a,#1e3a8a);color:#fff;padding:2.5rem 2.2rem;border-radius:var(--radius-md);overflow:hidden;box-shadow:var(--shadow-md);} 
.brand-hero__media img{width:100%;border-radius:var(--radius-sm);box-shadow:0 8px 16px -4px rgba(0 0 0 /.4);}
.brand-hero__content h2{font-size:clamp(1.5rem,2.6vw,2.2rem);line-height:1.1;}
.brand-hero__content .lead{color:#cbd5e1;}
.brand-hero .btn{--btn-bg:var(--c-accent-alt);--btn-color:#1e293b;font-weight:700;}
/* Fix: кнопка наезжала на текст из‑за отсутствия вертикальных отступов после reset (у h2/p margin:0).
  Делаем колонку с gap, чтобы элементы имели расстояние и не прилипали/пересекались визуально. */
.brand-hero__content{display:flex;flex-direction:column;gap:1.1rem;}
.brand-hero__content h2,.brand-hero__content .lead{margin:0;}
.brand-hero__content .btn{align-self:flex-start;}

/* Features */
.features{margin:2.5rem auto 2rem;}
.features__list{display:grid;grid-template-columns:repeat(auto-fit,minmax(160px,1fr));gap:20px;}
.feature{background:var(--c-surface);border:1px solid var(--c-border);padding:1rem .9rem;border-radius:var(--radius-sm);display:flex;align-items:center;gap:.65rem;font-weight:600;font-size:.8rem;box-shadow:var(--shadow-sm);}
.feature__icon{background:#1e3a8a;color:#fff;display:inline-grid;place-items:center;width:34px;height:34px;border-radius:50%;font-size:1rem;}

/* App download */
.app-download{display:grid;grid-template-columns:repeat(auto-fit,minmax(300px,1fr));gap:48px;align-items:center;margin:3.5rem auto 2rem;background:linear-gradient(130deg,#fff,#e0f2fe);padding:2.2rem 2rem;border-radius:var(--radius-md);box-shadow:var(--shadow-md);}
.app-download__content h2{font-size:clamp(1.4rem,2.3vw,2rem);margin-bottom:.65rem;}
.app-download__content .lead{color:#334155;margin-bottom:1rem;}
.app-download__media img{width:100%;max-width:360px;margin-inline:auto;filter:drop-shadow(0 8px 16px rgba(0 0 0 /.25));}

/* Section */
.section-head{display:flex;align-items:center;gap:1rem;margin-bottom:1rem;flex-wrap:wrap;}
.section-head h2{font-size:1.5rem;}
.section-sub{color:var(--c-text-light);font-size:.85rem;font-weight:500;}
.carousel-section{margin-top:2.8rem;}
.tag{background:#e2e8f0;color:#0f172a;border:0;padding:.45rem .75rem;border-radius:20px;font-size:.7rem;font-weight:600;letter-spacing:.5px;text-transform:uppercase;cursor:pointer;}
.tag--rollback{background:#f87171;color:#fff;}
.tag--rollback:hover{background:#dc2626;}

/* Carousel */
.carousel{position:relative;}
.carousel__track{display:grid;grid-auto-flow:column;grid-auto-columns:calc(100%/2.2);gap:18px;overflow-x:auto;scroll-snap-type:x mandatory;padding:2px;margin:0;padding-bottom:4px;scrollbar-width:none;}
.carousel__track::-webkit-scrollbar{display:none;}
.carousel__track > *{scroll-snap-align:start;}
.carousel__btn{position:absolute;top:50%;translate:0 -50%;background:#fff;border:1px solid var(--c-border);width:42px;height:42px;border-radius:50%;display:grid;place-items:center;font-size:1.7rem;cursor:pointer;box-shadow:var(--shadow-sm);transition:var(--transition);z-index:5;}
.carousel__btn:hover{background:var(--c-accent);color:#fff;border-color:var(--c-accent);} 
.carousel__btn.prev{left:-18px;}
.carousel__btn.next{right:-18px;}
.carousel--flash .carousel__track{grid-auto-columns:calc(100%/2.2);}

/* Product card */
.product{background:var(--c-surface);border:1px solid var(--c-border);border-radius:var(--radius-sm);position:relative;display:flex;flex-direction:column;box-shadow:var(--shadow-sm);}
.product figure{display:flex;flex-direction:column;gap:.5rem;padding:.75rem;}
.product__img{width:100%;aspect-ratio:4/3;object-fit:cover;border-radius:var(--radius-xs);background:#fff;}
.product__info{display:flex;flex-direction:column;gap:.35rem;}
.product__title{font-size:.8rem;line-height:1.2;font-weight:500;min-height:2.1em;}
.product__price{font-size:.9rem;font-weight:600;display:flex;align-items:center;gap:.5rem;}
.product__price .now{color:#065f46;}
.product__price .old{text-decoration:line-through;color:var(--c-text-light);font-weight:400;font-size:.7rem;}
.btn-mini{--btn-bg:var(--c-accent);--btn-color:#fff;display:inline-block;background:var(--btn-bg);color:var(--btn-color);border:0;border-radius:var(--radius-xs);padding:.5rem .7rem;font-size:.7rem;font-weight:600;cursor:pointer;line-height:1;transition:var(--transition);text-align:center;}
.btn-mini:hover,.btn-mini:focus{background:#143d9f;color:var(--c-accent-alt);outline:none;}
.btn-mini:active{background:#0e3b91;}
.btn-mini:focus-visible{outline:2px solid var(--c-accent-alt);outline-offset:2px;}
.fav{position:absolute;top:4px;right:4px;background:#fff;border:1px solid var(--c-border);border-radius:50%;width:44px;height:44px;cursor:pointer;font-size:1.15rem;display:grid;place-items:center;line-height:1;text-decoration:none;color:var(--c-text);transition:var(--transition);box-shadow:0 2px 4px -1px rgba(0 0 0 /.15);z-index:5;} 
.fav:hover,.fav:focus{background:linear-gradient(135deg,#ffe4ec,#ffd5e3);border-color:#f472b6;color:#be185d;outline:none;} 
.fav.is-active{background:linear-gradient(135deg,#fecdd3,#fda4af);color:#b91c1c;border-color:#f87171;}

/* Categories grid */
.categories{margin-top:3rem;}
.cat-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(140px,1fr));gap:18px;margin-top:1rem;}
.cat{background:var(--c-surface);border:1px solid var(--c-border);border-radius:var(--radius-sm);display:flex;flex-direction:column;align-items:center;text-align:center;padding:.75rem;gap:.5rem;font-weight:500;color:var(--c-text);transition:var(--transition);box-shadow:var(--shadow-sm);}
.cat:hover{border-color:var(--c-accent);color:var(--c-accent);}
.cat img{width:100%;aspect-ratio:1/1;object-fit:cover;border-radius:var(--radius-xs);}
.cat__name{font-size:.75rem;line-height:1.1;}

/* Footer */
.site-footer{background:#0f172a;color:#cbd5e1;margin-top:4rem;font-size:.8rem;padding:2.5rem 0 2rem;}
.footer-top{margin-bottom:1.5rem;}
.footer-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));gap:2rem;align-items:start;}
.footer-col h3{color:#fff;font-size:.9rem;margin-bottom:.6rem;}
.footer-col ul{display:grid;gap:.35rem;}
.footer-col a{color:#cbd5e1;}
.footer-col a:hover{color:#fff;}
.subscribe{display:flex;gap:.5rem;}
.subscribe input{flex:1;padding:.55rem .7rem;border:1px solid #334155;background:#1e293b;color:#fff;border-radius:var(--radius-xs);}
.subscribe button{padding:.55rem .95rem;}
.legal{margin-top:2rem;text-align:center;color:#64748b;font-size:.7rem;}
.feedback .link{background:none;border:0;padding:0;color:var(--c-accent-alt);cursor:pointer;font-weight:600;}

/* (feedback modal styles removed) */

/* Utilities */
[hidden]{display:none !important;}

/* Responsive */
@media (max-width:1100px){
  .carousel__track{grid-auto-columns:calc(100%/2.3);}
}
@media (max-width:880px){
  .topbar{grid-template-columns:1fr auto auto;gap:14px;align-items:start;}
  .logo{grid-column:1 / -1;order:1;padding-bottom:.2rem;}
  .search{order:2;grid-column:1 / -1;margin-bottom:.25rem;}
  .user-actions{order:3;}
  .main-nav{order:4;}
  .dept-bar__inner{padding-left:12px;gap:.4rem;}
  .main-nav{order:3;}
  .nav-toggle{display:block;}
  .nav-list{position:absolute;inset:calc(100% + 8px) 0 auto auto;background:#1e293b;flex-direction:column;padding:1rem;min-width:200px;border:1px solid #334155;border-radius:var(--radius-sm);box-shadow:var(--shadow-sm);display:none;}
  .nav-list.is-open{display:flex;}
  .carousel__btn{display:none;}
  .carousel__track{grid-auto-columns:70%;}
  .brand-hero{grid-template-columns:1fr;padding:2rem 1.4rem;}
  .app-download{grid-template-columns:1fr;padding:2rem 1.4rem;}
}
@media (max-width:560px){
  .carousel__track{grid-auto-columns:82%;}
  .hero-card__content{padding:1.6rem 1.5rem;}
  .promo-tile__body{padding:.7rem .75rem;}
  .topbar{display:grid;grid-template-columns:auto 1fr auto;grid-template-areas:
    "nav logo logo"
    "actions actions actions";gap:6px 10px;align-items:center;padding:.5rem 16px .6rem;}
  .logo{grid-area:logo;justify-self:center;}
  .search{display:none;}
  .search input{display:none;}
  .main-nav{grid-area:nav;justify-self:start;}
  .user-actions{grid-area:actions;display:flex;gap:10px;align-items:center;justify-content:space-between;width:100%;flex-wrap:wrap;}
  .nav-toggle{position:static;margin:0;padding:.55rem .7rem;}
  .main-nav{display:flex;align-items:center;gap:6px;}
  .topbar + .dept-bar .dept-bar__inner{padding-left:10px;}
  .logo{font-size:1.05rem;}
  .nav-list a{padding:.55rem 0;}
  .user-actions select{padding:.4rem .45rem;font-size:.65rem;}
  .btn-link{font-size:.7rem;line-height:1.1;}
  .cart{padding:.45rem .6rem;}
  /* hero-full already responsive; ensure media stays visible */
  .hero-full__media{display:flex;}
  .promo-grid .promo-tile{min-height:160px;}
  .promo-grid .promo-tile:nth-child(3n+1){grid-row:span 1;min-height:200px;}
}
@media (prefers-reduced-motion:reduce){
  *{animation:none !important;transition:none !important;}
}
