/* Espart — Home page sections (requires main.css) */

/* Centered section head (categories / brands). Fixed height like the design;
   content intentionally overflows downwards into the gap. */
.sec-head--center {
  flex-direction: column; justify-content: flex-start; align-items: center; gap: 8px;
  height: 28px; text-align: center;
}
.sec-head--center .sec-head__title { font-weight: 900; font-size: 24px; line-height: 36px; }
.sec-head--center .sec-head__text { display: flex; flex-direction: column; align-items: center; gap: 2px; }

/* Countdown */
.countdown { display: flex; align-items: center; gap: 4px; }
.countdown__box {
  display: flex; flex-direction: column; align-items: center;
  width: 40px; padding: 6px 0; border-radius: 10px; background: var(--gray-900);
}
.countdown__num { color: var(--white); font-weight: 900; font-size: 14px; line-height: 24px; }
.countdown__unit { color: var(--gray-350); font-weight: 500; font-size: 10px; line-height: 16px; }
.countdown__sep { width: 5px; text-align: center; color: var(--gray-600); font-weight: 900; font-size: 14px; line-height: 24px; }

.cat__ill { width: 52px; height: 62.4px; transition: transform .2s; }
.cat__label { font-weight: 500; font-size: 12px; line-height: 20px; color: var(--gray-700); white-space: nowrap; }

.hero { display: flex; flex-direction: column; gap: 12px; padding-top: 16px; padding-bottom: 8px; }
.slide {
  position: relative; overflow: hidden;
  display: flex; flex-direction: column; gap: 12px;
  padding: 16px; border-radius: 20px; background: var(--white); box-shadow: var(--shadow-xs);
}
.slide__copy { display: contents; }
.slide__title { font-weight: 900; font-size: 20px; line-height: 32px; color: var(--gray-900); }
.slide__desc { font-weight: 400; font-size: 13px; line-height: 22px; color: var(--gray-700); }
/* SmartSearch sits flat inside the slide on mobile */
.qsearch--hero { align-self: stretch; padding: 4px 0 0; border-radius: 0; box-shadow: none; background: none; }
.slide__nav { display: flex; justify-content: center; padding-top: 4px; }
.slide__arrows { display: none; }
.slide__visual {
  order: -1; position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  height: 140px; border-radius: 12px; background: var(--white);
}
.slide__blob { display: none; }
.slide__photo { position: relative; overflow: hidden; width: 296px; height: 132px; flex: none; }
.slide__photo img { position: absolute; top: 0; left: -6.198%; width: 206.59%; height: 100%; max-width: none; object-fit: fill; }
.dots { display: flex; align-items: center; gap: 6px; }
.dots__dot { width: 8px; height: 8px; border-radius: 4px; background: var(--gray-500); transition: width .2s, background-color .2s; }
.dots__dot.is-active { width: 22px; background: var(--primary); }
.usp { display: flex; gap: 8px; }
.usp__item {
  display: flex; align-items: center; gap: 6px; flex: none;
  padding: 6px 10px; border: 1px solid var(--gray-300); border-radius: 999px; background: var(--white);
}
.usp__icon { color: var(--primary); }
.usp__icon .ic { width: 14px; height: 14px; }
.usp__label { font-weight: 500; font-size: 12px; line-height: 20px; color: var(--gray-700); white-space: nowrap; }
.sec-parts { display: flex; flex-direction: column; gap: 16px; padding-top: 24px; padding-bottom: 8px; }
.parts-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.parts-grid > :nth-child(1) { display: none; }
.parts-grid > :nth-child(2) { order: 3; }
.parts-grid > :nth-child(3) { order: 4; }
.parts-grid > :nth-child(4) { order: 1; }
.parts-grid > :nth-child(5) { order: 2; }
.sec-cats { display: flex; flex-direction: column; gap: 24px; padding-top: 40px; padding-bottom: 32px; }
.cats { display: grid; grid-template-columns: repeat(4, 72px); justify-content: space-between; row-gap: 24px; }
.cat { display: flex; flex-direction: column; align-items: center; gap: 6px; text-align: center; }
.cat:hover .cat__ill { transform: translateY(-3px); }
.cat:hover .cat__label { color: var(--primary); }
.sec-deals { padding-top: 24px; padding-bottom: 8px; padding-left: 0; }
.deals { display: flex; flex-direction: column; gap: 14px; }
.deals__intro { display: flex; flex-direction: column; align-items: flex-start; gap: 10px; }
.deals__head { display: flex; flex-direction: column; gap: 2px; }
.deals__title-row { display: flex; align-items: center; gap: 4px; color: var(--danger); }
.deals__title-row .ic { width: 16px; height: 16px; }
.deals__title { font-weight: 700; font-size: 18px; line-height: 28px; color: var(--gray-900); }
.deals__ends { font-weight: 500; font-size: 10px; line-height: 16px; color: var(--gray-600); }
.deals__cards { display: flex; gap: 12px; }
.deals__cards .pcard { flex: 0 0 150px; }
.sec-brands { display: flex; flex-direction: column; gap: 24px; padding-top: 40px; padding-bottom: 32px; }
.bcar { display: flex; flex-direction: column; align-items: center; gap: 12px; }
.bcar__row { display: flex; align-items: center; gap: 16px; align-self: stretch; }
.brands { display: flex; flex: 1 1 auto; min-width: 0; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; }
.brands::-webkit-scrollbar { display: none; }
.brands > li { flex: 0 0 112px; scroll-snap-align: start; }
.brand { display: flex; align-items: center; justify-content: center; height: 72px; }
.brand img { width: 88px; height: 27px; object-fit: contain; transition: transform .2s, opacity .2s; }
.brand:hover img { transform: scale(1.04); }
.bcar .dots__dot { cursor: pointer; }
.sec-articles { display: flex; flex-direction: column; gap: 14px; padding-top: 24px; padding-bottom: 24px; padding-left: 0; }
.sec-articles .sec-head { align-items: flex-end; padding-left: 16px; }
.articles { display: flex; gap: 12px; }
.article {
  display: flex; flex-direction: column; flex: 0 0 260px; overflow: hidden;
  background: var(--white); border: 1px solid var(--gray-300); border-radius: 16px;
  transition: box-shadow .2s;
}
.article:hover { box-shadow: 0 8px 24px -8px rgba(33, 37, 41, .16); }
.article__img { height: 140px; overflow: hidden; }
.article__img img { width: 100%; height: 100%; object-fit: cover; }
.article__body { display: flex; flex-direction: column; gap: 8px; padding: 14px; }
.article__title {
  height: 48px; overflow: hidden; font-weight: 700; font-size: 14px; line-height: 24px; color: var(--gray-900);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.article__excerpt {
  display: none; height: 44px; overflow: hidden; font-weight: 400; font-size: 13px; line-height: 22px; color: var(--gray-700);
  -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.article__meta { display: flex; align-items: center; gap: 12px; padding-top: 4px; font-weight: 500; font-size: 10px; line-height: 16px; color: var(--gray-600); }
.article__time { display: flex; align-items: center; gap: 4px; }
.article__time .ic { width: 14px; height: 14px; }
.sec-b2b { padding-top: 24px; padding-bottom: 24px; }
.b2b {
  display: flex; flex-direction: column; gap: 12px; padding: 16px;
  background: var(--accent-50); border: 1px solid var(--accent); border-radius: 16px;
}
.b2b__icon { display: none; }
.b2b__text { display: flex; flex-direction: column; gap: 12px; }
.b2b__title { font-weight: 700; font-size: 16px; line-height: 26px; color: var(--gray-900); }
.b2b__desc { font-weight: 400; font-size: 13px; line-height: 22px; color: var(--gray-700); }
.b2b__actions { display: flex; }
.b2b__actions .btn--accent { width: 100%; }
@media (min-width: 600px) {
  .parts-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .cats { grid-template-columns: repeat(8, 72px); }
  .sec-articles .sec-head { padding-left: var(--gutter); }
}
@media (min-width: 900px) and (max-width: 1199.98px) {
  .parts-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .parts-grid > :nth-child(1) { display: flex; order: 5; }
}
@media (min-width: 1200px) {
  .hero { gap: 20px; padding-top: 32px; padding-bottom: 8px; }
  .slide {
    flex-direction: row; align-items: center; gap: 40px;
    padding: 40px 56px 40px 32px; border-radius: 24px;
  }
  .slide__copy { display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 20px; flex: 1 1 auto; min-width: 0; }
  .slide__title { font-size: clamp(26px, 2.2222vw, 32px); line-height: 1.5; }
  .slide__desc { font-size: 16px; line-height: 28px; align-self: stretch; }
  .qsearch--hero { padding: 16px; border-radius: 16px; background: var(--white); box-shadow: 0 8px 24px rgba(33, 37, 41, .12); }
  .slide__nav { justify-content: flex-start; align-items: center; gap: 16px; padding-top: 0; }
  .slide__arrows { display: flex; gap: 8px; }
  .slide__arrows .ic { width: 18px; height: 18px; }
  .slide__visual { order: 0; display: block; flex: none; width: clamp(280px, 26.3889vw, 380px); height: 356px; border-radius: 0; background: none; overflow: visible; }
  .slide__blob { display: block; position: absolute; left: 13.158%; top: 28px; width: 78.947%; aspect-ratio: 1; border-radius: 50%; background: var(--primary-50); }
  .slide__photo { position: absolute; left: 0; top: 68px; width: 100%; height: auto; aspect-ratio: 380 / 240; }
  .slide__photo img { left: -8.4489%; width: 241.38%; }
  .usp {
    justify-content: space-between; align-items: center; gap: 0;
    padding: 20px 32px; border: 1px solid var(--gray-300); border-radius: 20px; background: var(--white);
  }
  .usp__item { gap: 12px; padding: 0; border: 0; border-radius: 0; background: none; }
  .usp__icon { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; border-radius: 12px; background: var(--primary-50); }
  .usp__icon .ic { width: 22px; height: 22px; }
  .usp__text { display: flex !important; flex-direction: column; }
  .usp__text b { font-weight: 700; font-size: 14px; line-height: 24px; color: var(--gray-900); }
  .usp__text small { font-weight: 400; font-size: 12px; line-height: 20px; color: var(--gray-600); }
  .sec-parts { gap: 24px; padding-top: 16px; padding-bottom: 40px; }
  .sec-parts .sec-head { height: 32px; }
  .parts-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 20px; }
  .parts-grid > * { order: 0 !important; display: flex !important; }
  .sec-cats { gap: 40px; padding-top: 72px; padding-bottom: 56px; }
  .cats { grid-template-columns: repeat(8, 120px); align-items: end; }
  .cat { gap: 12px; }
  .sec-deals { padding-top: 24px; padding-bottom: 24px; padding-left: var(--gutter); }
  .deals {
    flex-direction: row; align-items: flex-start; gap: 24px; padding: 24px;
    background: var(--white); border: 1px solid var(--gray-300); border-radius: 24px;
  }
  .deals__intro { flex: 0 0 236px; gap: 14px; padding: 8px 0; }
  .deals__badge {
    display: inline-flex !important; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 999px;
    background: var(--danger); color: var(--white); font-weight: 700; font-size: 12px; line-height: 20px;
  }
  .deals__badge .ic { width: 14px; height: 14px; }
  .deals__big { display: block !important; font-weight: 900; font-size: 28px; line-height: 42px; color: var(--gray-900); }
  .deals__desc { display: block !important; align-self: stretch; font-weight: 400; font-size: 13px; line-height: 22px; color: var(--gray-700); }
  .deals__ends { font-size: 12px; line-height: 20px; }
  .deals .countdown__box { width: 46px; }
  .deals .countdown__num { font-size: 18px; line-height: 28px; }
  .deals__spacer { display: block !important; width: 1px; height: 4px; }
  .deals__cards { flex: 1 1 auto; align-items: center; gap: 16px; min-width: 0; overflow: visible; }
  .deals__cards .pcard { flex: 0 1 234px; }
  .sec-brands { gap: 40px; padding-top: 72px; padding-bottom: 56px; }
  .sec-brands .sec-head--center { height: 56px; }
  .sec-brands .sec-head__sub { font-size: 14px; line-height: 24px; }
  .bcar { gap: 20px; }
  .brands > li { flex-basis: 194px; }
  .brand { height: 96px; }
  .brand img { width: 150px; height: 44px; }
  .bcar__arrow .ic { width: 18px; height: 18px; }
  .sec-articles { gap: 20px; padding-top: 32px; padding-bottom: 64px; padding-left: var(--gutter); }
  .sec-articles .sec-head { padding-left: 0; }
  .sec-articles .sec-head__text { display: flex; flex-direction: column; gap: 2px; }
  .articles { gap: 24px; overflow: visible; }
  .article { flex: 1 1 0; min-width: 0; }
  .article__img { height: 200px; }
  .article__body { padding: 20px; }
  .article__title { height: 52px; font-size: 16px; line-height: 26px; -webkit-line-clamp: 2; }
  .article__excerpt { display: -webkit-box; }
  .sec-b2b { position: relative; z-index: 1; padding-top: 24px; padding-bottom: 0; margin-bottom: -64px; }
  .b2b {
    flex-direction: row; align-items: center; gap: 24px; padding: 32px;
    box-shadow: 0 12px 32px -4px rgba(33, 37, 41, .18);
  }
  .b2b__icon { display: flex; align-items: center; justify-content: center; flex: none; width: 64px; height: 64px; border-radius: 16px; background: var(--accent); color: var(--gray-900); }
  .b2b__icon .ic { width: 32px; height: 32px; }
  .b2b__text { flex: 1 1 auto; gap: 4px; min-width: 0; }
  .b2b__title { font-size: 20px; line-height: 32px; }
  .b2b__desc { font-size: 14px; line-height: 24px; }
  .b2b__actions { gap: 24px; }
  .btn--lg-d { height: 52px; padding: 0 24px; font-size: 16px; line-height: 28px; }
  .btn--lg-d .ic { width: 20px; height: 20px; }
  .b2b__actions .btn--accent { width: auto; }
}
@media (min-width: 1440px) {
  .deals__cards .pcard { flex-shrink: 0; }
}

@media (min-width: 1200px) {
  .cat__ill { width: 84px; height: 100.8px; }
  .cat__label { font-size: 13px; line-height: 22px; }
  .sec-head--center { height: 32px; gap: 10px; }
  .sec-head--center .sec-head__title { font-size: 28px; line-height: 42px; }
}

/* ==========================================================================
   Promo popup — desktop: centred modal (760) · mobile: bottom sheet
   ========================================================================== */
.popup { position: fixed; inset: 0; z-index: 100; display: flex; align-items: flex-end; justify-content: center; }
.popup[hidden] { display: none; }
.popup__scrim { position: absolute; inset: 0; background: rgba(33, 37, 41, .55); animation: pop-fade .2s ease-out; }
.popup__card {
  position: relative; display: flex; flex-direction: column; width: 100%; max-height: 100%; overflow: auto;
  padding-bottom: calc(24px + env(safe-area-inset-bottom)); border-radius: 24px 24px 0 0; background: var(--white);
  box-shadow: 0 16px 48px rgba(15, 23, 41, .18); animation: pop-up .25s ease-out;
}
.popup__card:focus { outline: 0; }
.popup__handle { align-self: center; flex: none; width: 40px; height: 4px; margin: 10px 0 4px; border-radius: 2px; background: var(--gray-300); }
.popup__visual { display: flex; align-items: center; justify-content: center; flex: none; height: 140px; overflow: hidden; background: var(--primary-50); }
.popup__visual img { width: 120px; height: 144px; }
.popup__content { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 16px 16px 0; }
.popup__badge { padding: 4px 10px; border-radius: 999px; background: var(--primary-50); font-weight: 700; font-size: 12px; line-height: 20px; color: var(--gray-700); }
.popup__title { font-weight: 900; font-size: 24px; line-height: 36px; color: var(--gray-900); }
.popup__desc { font-weight: 400; font-size: 14px; line-height: 24px; color: var(--gray-700); }
.popup__legal { font-weight: 400; font-size: 10px; line-height: 16px; color: var(--gray-600); }
.popup__close {
  position: absolute; left: 12px; top: 16px; display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 8px; background: var(--primary-50); color: var(--primary);
}
.popup__close .ic { width: 18px; height: 18px; }
.popup__close:hover { background: var(--primary-100); }

html.is-locked { overflow: hidden; }
@keyframes pop-fade { from { opacity: 0; } }
@keyframes pop-up { from { transform: translateY(40px); opacity: 0; } }
@media (min-width: 800px) {
  .popup { align-items: center; padding: 24px; }
  .popup__card { flex-direction: row; width: 760px; max-width: 100%; padding-bottom: 0; border-radius: 24px; }
  .popup__handle { display: none; }
  .popup__visual { order: 1; flex: 0 0 300px; height: auto; align-self: stretch; }
  .popup__visual img { width: 200px; height: 240px; }
  .popup__content { flex: 1 1 auto; min-width: 0; padding: 48px 40px 40px; }
  .popup__title { font-size: 28px; line-height: 42px; }
  .popup__close { top: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .popup__scrim, .popup__card { animation: none; }
}
