/* ===================== Sanaat Metal — public site ===================== */
:root {
  --sm-primary: #22318a;
  --sm-primary-2: #2c3fa0;
  --sm-accent: #f5b301;
  --sm-accent-2: #ffd24a;
  --sm-accent-ink: #8a5f00;
  --sm-on-accent: #16215c;
  --sm-navy: #121b4d;
  --sm-bg: #f3f4f8;
  --sm-surface: #ffffff;
  --sm-surface-2: #eef2f7;
  --sm-text: #161d33;
  --sm-muted: #5d6680;
  --sm-border: #dfe2ec;
  --sm-shadow: 0 10px 30px rgba(15, 40, 70, .08);
  --sm-shadow-lg: 0 24px 60px rgba(15, 40, 70, .16);
  --sm-radius: 18px;
  --sm-hero-overlay: linear-gradient(100deg, rgba(14, 21, 62, .94) 0%, rgba(14, 21, 62, .78) 45%, rgba(14, 21, 62, .25) 100%);
  --sm-font: "Vazirmatn", Tahoma, sans-serif;
  --sm-title: "Titr", "Lalezar", "Vazirmatn", sans-serif;
  --bs-body-font-family: var(--sm-font);
}

[data-bs-theme="dark"] {
  --sm-primary: #8fa2ff;
  --sm-primary-2: #6f84f0;
  --sm-accent-ink: #f5b301;
  --sm-bg: #0b0f22;
  --sm-surface: #131a36;
  --sm-surface-2: #1a2244;
  --sm-text: #e7e9f4;
  --sm-muted: #9aa1bd;
  --sm-border: #262f57;
  --sm-shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --sm-shadow-lg: 0 24px 60px rgba(0, 0, 0, .5);
  --bs-body-bg: var(--sm-bg);
  --bs-body-color: var(--sm-text);
}

html { scroll-behavior: smooth; }
body {
  font-family: var(--sm-font);
  background: var(--sm-bg);
  color: var(--sm-text);
  transition: background-color .3s, color .3s;
  -webkit-font-smoothing: antialiased;
}
html[lang="en"] body { letter-spacing: .1px; }
a { color: var(--sm-primary); text-decoration: none; }
a:hover { color: var(--sm-primary-2); }
.text-muted, .sm-muted { color: var(--sm-muted) !important; }
.fw-black { font-weight: 900; }
.sm-title { font-family: var(--sm-title); font-weight: 400; letter-spacing: 0; }
html[lang="en"] .sm-title { font-family: var(--sm-font); font-weight: 800; }
::selection { background: var(--sm-accent); color: var(--sm-on-accent); }
:focus-visible { outline: 3px solid var(--sm-accent); outline-offset: 2px; }

/* ---------- Buttons ---------- */
.btn { border-radius: 10px; font-weight: 700; padding: .6rem 1.2rem; transition: background-color .2s, border-color .2s, color .2s; }
.btn-sm { border-radius: 10px; padding: .35rem .8rem; }
.btn-sm-primary { background: var(--sm-primary); color: #fff; border: 0; }
.btn-sm-primary:hover, .btn-sm-primary:focus-visible { background: var(--sm-primary-2); color: #fff; }
[data-bs-theme="dark"] .btn-sm-primary { background: #3a4fc4; }
[data-bs-theme="dark"] .btn-sm-primary:hover { background: #4a60d8; }
.btn-sm-accent { background: var(--sm-accent); color: var(--sm-on-accent); border: 0; }
.btn-sm-accent:hover, .btn-sm-accent:focus-visible { background: var(--sm-accent-2); color: var(--sm-on-accent); }
.btn-sm-ghost { background: rgba(255, 255, 255, .1); color: #fff; border: 1px solid rgba(255, 255, 255, .35); backdrop-filter: blur(6px); }
.btn-sm-ghost:hover { background: rgba(255, 255, 255, .2); color: #fff; }
.btn-sm-outline { border: 1.5px solid var(--sm-border); color: var(--sm-text); background: var(--sm-surface); }
.btn-sm-outline:hover { border-color: var(--sm-primary); color: var(--sm-primary); }
.btn-icon { width: 42px; height: 42px; padding: 0; display: inline-flex; align-items: center; justify-content: center; border-radius: 12px; }

/* ---------- Top bar & navbar ---------- */
.sm-topbar { background: var(--sm-navy); color: #c9d6e6; font-size: .82rem; }
.sm-topbar a { color: #c9d6e6; }
.sm-topbar a:hover { color: #fff; }
.sm-nav {
  position: sticky; top: 0; z-index: 1030;
  background: color-mix(in srgb, var(--sm-surface) 85%, transparent);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--sm-border);
  transition: box-shadow .3s, background .3s;
}
.sm-nav.scrolled { box-shadow: var(--sm-shadow); }
.sm-brand { display: flex; align-items: center; gap: .6rem; color: var(--sm-text); }
.sm-brand:hover { color: var(--sm-text); }
.sm-brand-logo {
  width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center;
  background: var(--sm-primary); color: #fff; font-size: 1.3rem;
}
.sm-brand-logo:has(img) { background: none; border-radius: 50%; box-shadow: 0 6px 16px rgba(31, 47, 122, .3); }
.sm-brand-logo img { width: 100%; height: 100%; object-fit: contain; border-radius: 50%; transition: transform .5s cubic-bezier(.3,1.6,.5,1); }
.sm-brand:hover .sm-brand-logo img { transform: scale(1.08) rotate(-8deg); }
.sm-wm { font-family: var(--sm-font); font-weight: 900; letter-spacing: -.3px; direction: ltr; }
.sm-wm b { color: #f5b301; font-weight: 900; }
.sm-brand-name { font-family: var(--sm-title); font-size: 1.45rem; line-height: 1; }
html[lang="en"] .sm-brand-name { font-family: var(--sm-font); font-weight: 900; font-size: 1.2rem; }
.sm-brand-sub { font-size: .7rem; color: var(--sm-muted); }
.sm-nav .nav-link { color: var(--sm-text); font-weight: 600; padding: .5rem .9rem !important; border-radius: 10px; position: relative; }
.sm-nav .nav-link::after {
  content: ""; position: absolute; inset-inline: 30%; bottom: 2px; height: 3px; border-radius: 3px;
  background: var(--sm-accent); transform: scaleX(0); transition: transform .25s;
}
.sm-nav .nav-link:hover::after, .sm-nav .nav-link.active::after { transform: scaleX(1); }
.sm-nav .nav-link.active, .sm-nav .nav-link:hover { color: var(--sm-primary); }
.sm-cart-btn { position: relative; }
.sm-cart-badge {
  position: absolute; top: -6px; inset-inline-end: -6px; min-width: 20px; height: 20px; border-radius: 10px;
  background: var(--sm-accent); color: var(--sm-on-accent); font-weight: 800; font-size: .72rem; display: grid; place-items: center; padding: 0 5px;
  box-shadow: 0 0 0 2px var(--sm-surface);
}
.sm-cart-badge.bump { animation: bump .5s; }
@keyframes bump { 30% { transform: scale(1.4); } 60% { transform: scale(.9); } }

.theme-toggle .bi-sun { display: none; }
[data-bs-theme="dark"] .theme-toggle .bi-sun { display: inline; }
[data-bs-theme="dark"] .theme-toggle .bi-moon-stars { display: none; }

/* ---------- Hero ---------- */
.sm-hero { position: relative; background: var(--sm-navy); }
.sm-hero .swiper { height: min(78vh, 680px); min-height: 460px; }
.sm-hero .swiper-slide { position: relative; overflow: hidden; }
.sm-hero-bg {
  position: absolute; inset: 0; background-size: cover; background-position: center;
  transform: scale(1.08); transition: transform 7s ease-out;
}
.sm-hero .swiper-slide-active .sm-hero-bg { transform: scale(1); }
.sm-hero-overlay { position: absolute; inset: 0; background: var(--sm-hero-overlay); }
html[dir="ltr"] .sm-hero-overlay { background: linear-gradient(260deg, rgba(14, 21, 62, .94) 0%, rgba(14, 21, 62, .78) 45%, rgba(14, 21, 62, .25) 100%); }
/* Blueprint: fine engineering grid + a flange drawn in section, the one decorative element of the site */
.sm-hero-pattern {
  position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(143, 162, 255, .09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(143, 162, 255, .09) 1px, transparent 1px),
    linear-gradient(rgba(143, 162, 255, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(143, 162, 255, .045) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
}
.sm-hero-pattern.bp::after {
  content: ""; position: absolute; top: 50%; inset-inline-end: 2%; width: min(62vh, 560px); aspect-ratio: 1; transform: translateY(-50%);
  background: url("/img/blueprint-flange.svg") center / contain no-repeat; opacity: .5;
}
.sm-hero-content { position: relative; z-index: 2; height: 100%; display: flex; align-items: center; color: #fff; }
.sm-hero-content h1 { font-family: var(--sm-title); font-size: clamp(2rem, 4.6vw, 3.6rem); line-height: 1.35; text-wrap: balance; }
html[lang="en"] .sm-hero-content h1 { font-family: var(--sm-font); font-weight: 900; line-height: 1.15; }
.sm-hero-content p { font-size: clamp(1rem, 1.6vw, 1.2rem); color: #cdd3ee; max-width: 60ch; line-height: 1.9; }
.sm-hero-chip {
  display: inline-flex; gap: .5rem; align-items: center; padding: .35rem .9rem; border-radius: 30px;
  background: rgba(245, 179, 1, .12); color: var(--sm-accent-2); border: 1px solid rgba(245, 179, 1, .45); font-size: .85rem; font-weight: 600;
}
.sm-hero-product { position: relative; z-index: 2; }
.sm-hero-product img {
  max-height: 420px; width: 100%; object-fit: contain; filter: drop-shadow(0 30px 40px rgba(0, 0, 0, .45));
}
.sm-hero .swiper-slide-active .anim-up { animation: fadeUp .7s cubic-bezier(.2, .8, .2, 1) both; }
.sm-hero .swiper-slide-active .anim-up.d1 { animation-delay: .15s; }
.sm-hero .swiper-slide-active .anim-up.d2 { animation-delay: .3s; }
.sm-hero .swiper-slide-active .anim-up.d3 { animation-delay: .45s; }
@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.sm-hero .swiper-pagination-bullet { background: #fff; opacity: .5; width: 10px; height: 10px; transition: all .3s; }
.sm-hero .swiper-pagination-bullet-active { opacity: 1; width: 30px; border-radius: 6px; background: var(--sm-accent); }
.sm-hero .swiper-button-next, .sm-hero .swiper-button-prev {
  color: #fff; width: 44px; height: 44px; border-radius: 50%; border: 1px solid rgba(255, 255, 255, .25);
}
.sm-hero .swiper-button-next::after, .sm-hero .swiper-button-prev::after { font-size: 1.1rem; font-weight: 900; }
.sm-hero-wave { position: absolute; bottom: -1px; inset-inline: 0; z-index: 3; line-height: 0; }
.sm-hero-wave path { fill: var(--sm-bg); transition: fill .3s; }

/* ---------- Stats ---------- */
.sm-stats { margin-top: -70px; position: relative; z-index: 5; }
.sm-stat {
  background: var(--sm-surface); border-radius: var(--sm-radius); padding: 1.4rem; box-shadow: var(--sm-shadow-lg);
  display: flex; gap: 1rem; align-items: center; border: 1px solid var(--sm-border); height: 100%;
}
.sm-stat-icon {
  width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; font-size: 1.5rem; flex-shrink: 0;
  background: color-mix(in srgb, var(--sm-primary) 12%, transparent); color: var(--sm-primary);
}
.sm-stat:nth-child(even) .sm-stat-icon, .col:nth-child(even) .sm-stat-icon { background: color-mix(in srgb, var(--sm-accent) 18%, transparent); color: var(--sm-accent-ink); }
.sm-stat-num { font-size: 1.8rem; font-weight: 900; line-height: 1; font-variant-numeric: tabular-nums; }

/* ---------- Sections ---------- */
.sm-section { padding: 5rem 0; }
.sm-section-alt { background: var(--sm-surface); border-block: 1px solid var(--sm-border); }
.sm-section-head { text-align: center; margin-bottom: 3rem; }
.sm-section-head .eyebrow { color: var(--sm-accent-ink); font-weight: 700; font-size: .9rem; }
.sm-section-head h2 { font-family: var(--sm-title); font-size: clamp(1.8rem, 3vw, 2.5rem); margin: .4rem 0 .6rem; }
html[lang="en"] .sm-section-head h2 { font-family: var(--sm-font); font-weight: 900; }
.sm-section-head p { color: var(--sm-muted); max-width: 60ch; line-height: 1.9; margin: 0 auto; }
.sm-section-head .line { width: 64px; height: 4px; border-radius: 4px; margin: .8rem auto 0; background: var(--sm-accent); }

/* ---------- Category cards ---------- */
.sm-cat {
  position: relative; display: block; border-radius: var(--sm-radius); overflow: hidden; background: var(--sm-surface);
  border: 1px solid var(--sm-border); padding: 1.6rem; height: 100%; color: var(--sm-text); transition: border-color .25s, box-shadow .25s;
}
.sm-cat::before {
  content: ""; position: absolute; inset: 0; opacity: 0; transition: opacity .35s;
  background: var(--sm-primary);
}
.sm-cat > * { position: relative; }
.sm-cat:hover { box-shadow: var(--sm-shadow-lg); color: #fff; border-color: var(--sm-primary); }
.sm-cat:hover::before { opacity: 1; }
.sm-cat:hover .text-muted { color: #cfe0f2 !important; }
.sm-cat-img { height: 120px; display: grid; place-items: center; margin-bottom: 1rem; }
.sm-cat-img img { max-height: 110px; max-width: 80%; transition: transform .5s; }
.sm-cat:hover .sm-cat-img img { transform: scale(1.05); }
.sm-cat h3 { font-size: 1.25rem; font-weight: 800; }
.sm-cat .arrow { position: absolute; top: 1.2rem; inset-inline-end: 1.2rem; width: 36px; height: 36px; border-radius: 50%; display: grid; place-items: center; background: var(--sm-surface-2); color: var(--sm-primary); transition: all .35s; }
.sm-cat:hover .arrow { background: var(--sm-accent); color: var(--sm-on-accent); transform: rotate(-45deg); }
html[dir="ltr"] .sm-cat:hover .arrow { transform: rotate(45deg); }

/* ---------- Product card ---------- */
.sm-card {
  background: var(--sm-surface); border: 1px solid var(--sm-border); border-radius: var(--sm-radius);
  overflow: hidden; height: 100%; display: flex; flex-direction: column; transition: box-shadow .25s, border-color .25s;
}
.sm-card:hover { box-shadow: var(--sm-shadow-lg); border-color: color-mix(in srgb, var(--sm-primary) 40%, transparent); }
.sm-card-img {
  position: relative; aspect-ratio: 4 / 3; background: radial-gradient(circle at 50% 40%, var(--sm-surface) 0%, var(--sm-surface-2) 100%);
  display: grid; place-items: center; overflow: hidden;
}
.sm-card-img img { width: 78%; height: 78%; object-fit: contain; transition: transform .6s cubic-bezier(.2, .8, .2, 1); }
.sm-card:hover .sm-card-img img { transform: scale(1.04); }
.sm-badge-off {
  position: absolute; top: 12px; inset-inline-start: 12px; background: #c81e45; color: #fff;
  font-weight: 800; font-size: .78rem; padding: .25rem .6rem; border-radius: 6px; font-variant-numeric: tabular-nums;
}
.sm-badge-cat {
  position: absolute; bottom: 12px; inset-inline-end: 12px; background: color-mix(in srgb, var(--sm-surface) 85%, transparent);
  backdrop-filter: blur(6px); font-size: .75rem; padding: .2rem .6rem; border-radius: 8px; color: var(--sm-text); border: 1px solid var(--sm-border);
}
.sm-card-body { padding: 1.1rem 1.2rem; display: flex; flex-direction: column; flex: 1; }
.sm-card-title { font-weight: 800; font-size: 1.02rem; color: var(--sm-text); margin-bottom: .3rem; line-height: 1.6; }
.sm-card-title:hover { color: var(--sm-primary); }
.sm-card-meta { font-size: .8rem; color: var(--sm-muted); display: flex; flex-wrap: wrap; gap: .4rem .9rem; }
.sm-card-foot { margin-top: auto; padding-top: .9rem; display: flex; align-items: end; justify-content: space-between; gap: .5rem; border-top: 1px dashed var(--sm-border); }
.sm-price { font-weight: 900; font-size: 1.08rem; color: var(--sm-text); font-variant-numeric: tabular-nums; }
.sm-price small { font-weight: 500; font-size: .72rem; color: var(--sm-muted); }
.sm-price-old { text-decoration: line-through; color: var(--sm-muted); font-size: .8rem; }
.sm-call { color: var(--sm-accent-ink); font-weight: 800; display: inline-flex; align-items: center; gap: .35rem; }

/* ---------- Why us ---------- */
.sm-feature { text-align: center; padding: 2rem 1.4rem; border-radius: var(--sm-radius); background: var(--sm-bg); height: 100%; border: 1px solid var(--sm-border); }
.sm-feature-icon {
  width: 74px; height: 74px; margin: 0 auto 1.2rem; border-radius: 22px; display: grid; place-items: center; font-size: 2rem; color: #fff;
  background: var(--sm-primary);
}
.sm-feature:nth-child(even) .sm-feature-icon, .col-md-6:nth-child(even) .sm-feature-icon { background: var(--sm-accent); color: var(--sm-on-accent); }

/* ---------- Clients slider ---------- */
.sm-clients .swiper-wrapper { transition-timing-function: linear !important; }
.sm-client {
  background: var(--sm-surface); border: 1px solid var(--sm-border); border-radius: 16px; padding: 1.1rem; height: 150px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .6rem; transition: all .3s; text-align: center;
}
.sm-client img { max-height: 70px; max-width: 80%; object-fit: contain; filter: grayscale(1) opacity(.7); transition: filter .3s; }
.sm-client:hover { box-shadow: var(--sm-shadow); border-color: var(--sm-primary); }
.sm-client:hover img { filter: none; }
.sm-client span { font-size: .82rem; font-weight: 700; color: var(--sm-muted); }
[data-bs-theme="dark"] .sm-client img { filter: grayscale(1) invert(.85) opacity(.8); }
[data-bs-theme="dark"] .sm-client:hover img { filter: invert(.85); }

/* ---------- Contact ---------- */
.sm-contact {
  position: relative; border-radius: 28px; overflow: hidden; background: var(--sm-navy); color: #fff;
}
.sm-contact::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image: linear-gradient(rgba(143, 162, 255, .07) 1px, transparent 1px), linear-gradient(90deg, rgba(143, 162, 255, .07) 1px, transparent 1px);
  background-size: 24px 24px;
}
.sm-contact > .row { position: relative; z-index: 1; }
.sm-contact .form-control, .sm-contact .form-select {
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .22); color: #fff; border-radius: 12px; padding: .75rem 1rem;
}
.sm-contact .form-control::placeholder { color: rgba(255, 255, 255, .6); }
.sm-contact .form-control:focus { background: rgba(255, 255, 255, .14); border-color: var(--sm-accent-2); box-shadow: 0 0 0 .25rem rgba(245, 179, 1, .25); color: #fff; }
.sm-contact-info li { display: flex; gap: .9rem; align-items: flex-start; margin-bottom: 1.2rem; }
.sm-contact-info i { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: rgba(255, 255, 255, .12); font-size: 1.2rem; flex-shrink: 0; }
/* Offices (two branches) inside the contact panel */
.sm-offices { display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: .8rem; }
.sm-office { background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .14); border-radius: 14px; padding: 1rem 1.1rem; display: flex; flex-direction: column; gap: .5rem; }
.sm-office-title { font-weight: 800; display: flex; align-items: center; gap: .5rem; color: var(--sm-accent-2); }
.sm-office-addr { margin: 0; display: flex; gap: .5rem; font-size: .9rem; line-height: 1.8; color: #d5daf3; }
.sm-office-addr i, .sm-office-tel i { opacity: .7; flex-shrink: 0; }
.sm-office-tel { color: #fff; font-weight: 800; font-size: 1.05rem; display: inline-flex; align-items: center; gap: .5rem; align-self: flex-start; font-variant-numeric: tabular-nums; }
.sm-office-tel:hover { color: var(--sm-accent-2); }
.sm-foot-office { display: flex; flex-direction: column; gap: .3rem; margin-bottom: 1rem !important; }
.sm-foot-office b { color: #fff; font-size: .92rem; }
.hp-field { position: absolute !important; inset-inline-start: -9999px !important; width: 1px; height: 1px; overflow: hidden; }

/* ---------- Forms (general) ---------- */
.form-control, .form-select { border-radius: 12px; border-color: var(--sm-border); background-color: var(--sm-surface); color: var(--sm-text); }
.form-control:focus, .form-select:focus { border-color: var(--sm-primary); box-shadow: 0 0 0 .22rem color-mix(in srgb, var(--sm-primary) 20%, transparent); background-color: var(--sm-surface); color: var(--sm-text); }
.ltr-input { direction: ltr; text-align: left; }

/* ---------- Page header ---------- */
.sm-page-head { background: var(--sm-navy); color: #fff; padding: 2.2rem 0 2.5rem; position: relative; overflow: hidden; }
.sm-page-head::after { content: ""; position: absolute; inset: 0; background-image: linear-gradient(rgba(143, 162, 255, .08) 1px, transparent 1px), linear-gradient(90deg, rgba(143, 162, 255, .08) 1px, transparent 1px); background-size: 24px 24px; }
.sm-page-head > .container { position: relative; z-index: 1; }
.sm-page-head h1 { font-family: var(--sm-title); font-size: clamp(1.8rem, 3vw, 2.6rem); }
html[lang="en"] .sm-page-head h1 { font-family: var(--sm-font); font-weight: 900; }
.sm-page-head .breadcrumb { --bs-breadcrumb-divider-color: #9aa3cf; --bs-breadcrumb-item-active-color: #fff; margin: 0; }
.sm-page-head .breadcrumb a { color: #c9cff0; }
/* خط طلایی کوتاه زیر عنوان صفحه */
.sm-page-head h1::after { content: ""; display: block; width: 2.25rem; height: 3px; border-radius: 3px; background: var(--sm-accent, #f5b301); margin-top: .55rem; }
/* موبایل: کادر عنوان کم‌ارتفاع و جمع‌وجور، و فاصله کمتر تا محتوای زیرش */
@media (max-width: 767.98px) {
    .sm-page-head { padding: 1rem 0 1.15rem; }
    .sm-page-head::after { background-size: 18px 18px; }
    .sm-page-head .breadcrumb { font-size: .78rem; margin-bottom: .2rem !important; }
    .sm-page-head h1 { font-size: 1.4rem; line-height: 1.45; margin-bottom: 0 !important; }
    .sm-page-head h1::after { width: 1.75rem; height: 2px; margin-top: .4rem; }
    .sm-page-head p { font-size: .85rem; margin-top: .45rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
    .sm-page-head + .sm-section { padding-top: 1.25rem !important; }
}

/* ---------- Products list ---------- */
.sm-filter { background: var(--sm-surface); border: 1px solid var(--sm-border); border-radius: var(--sm-radius); padding: 1.3rem; position: sticky; top: 90px; }
.sm-filter h6 { font-weight: 800; margin-bottom: .8rem; }
.sm-filter .list-group-item { background: transparent; border: 0; border-radius: 10px !important; padding: .5rem .8rem; color: var(--sm-text); display: flex; justify-content: space-between; }
.sm-filter .list-group-item:hover { background: var(--sm-surface-2); }
.sm-filter .list-group-item.active { background: color-mix(in srgb, var(--sm-primary) 12%, transparent); color: var(--sm-primary); font-weight: 700; }
.pagination .page-link { border-radius: 10px !important; margin: 0 3px; border: 1px solid var(--sm-border); background: var(--sm-surface); color: var(--sm-text); }
.pagination .page-item.active .page-link { background: var(--sm-primary); border-color: var(--sm-primary); color: #fff; }

/* ---------- Product detail ---------- */
.sm-gallery { background: var(--sm-surface); border: 1px solid var(--sm-border); border-radius: var(--sm-radius); padding: 1rem; position: sticky; top: 90px; }
.sm-gallery .main .swiper-slide { aspect-ratio: 1 / 1; display: grid; place-items: center; background: radial-gradient(circle, var(--sm-surface), var(--sm-surface-2)); border-radius: 14px; }
.sm-gallery .main img { max-width: 85%; max-height: 85%; object-fit: contain; }
.sm-gallery .thumbs { margin-top: .8rem; }
.sm-gallery .thumbs .swiper-slide { aspect-ratio: 1 / 1; border-radius: 12px; border: 2px solid var(--sm-border); display: grid; place-items: center; cursor: pointer; opacity: .6; background: var(--sm-surface-2); }
.sm-gallery .thumbs .swiper-slide-thumb-active { border-color: var(--sm-accent); opacity: 1; }
.sm-gallery .thumbs img { max-width: 80%; max-height: 80%; object-fit: contain; }
.sm-spec { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: .7rem; }
.sm-spec div { background: var(--sm-surface); border: 1px solid var(--sm-border); border-radius: 12px; padding: .7rem .9rem; }
.sm-spec span { display: block; font-size: .75rem; color: var(--sm-muted); }
.sm-spec b { font-size: .95rem; }
.sm-variants { background: var(--sm-surface); border: 1px solid var(--sm-border); border-radius: var(--sm-radius); overflow: hidden; }
.sm-variants table { margin: 0; --bs-table-bg: transparent; --bs-table-color: var(--sm-text); }
.sm-variants thead th { background: var(--sm-surface-2); font-size: .82rem; color: var(--sm-muted); font-weight: 700; border: 0; white-space: nowrap; }
.sm-variants td { font-variant-numeric: tabular-nums; vertical-align: middle; border-color: var(--sm-border); }
.qty-box { display: inline-flex; align-items: center; border: 1px solid var(--sm-border); border-radius: 10px; overflow: hidden; background: var(--sm-surface); }
.qty-box button { border: 0; background: transparent; width: 32px; height: 34px; color: var(--sm-text); }
.qty-box button:hover { background: var(--sm-surface-2); }
.qty-box input { width: 52px; border: 0; text-align: center; background: transparent; color: var(--sm-text); font-weight: 700; -moz-appearance: textfield; }
.qty-box input::-webkit-outer-spin-button, .qty-box input::-webkit-inner-spin-button { -webkit-appearance: none; }
.sm-tabs .nav-link { border: 0; color: var(--sm-muted); font-weight: 700; padding: .8rem 1.2rem; border-bottom: 3px solid transparent; border-radius: 0; }
.sm-tabs .nav-link.active { color: var(--sm-primary); border-bottom-color: var(--sm-accent); background: transparent; }
.sm-doc {
  display: flex; align-items: center; gap: 1rem; padding: 1rem; border-radius: 14px; background: var(--sm-surface); border: 1px solid var(--sm-border); transition: all .3s;
}
.sm-doc:hover { border-color: var(--sm-primary); box-shadow: var(--sm-shadow); }
.sm-doc-icon { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; font-size: 1.5rem; flex-shrink: 0; background: #fee2e2; color: #dc2626; }
.sm-doc-icon.cert { background: #dcfce7; color: #16a34a; }
[data-bs-theme="dark"] .sm-doc-icon { background: rgba(220, 38, 38, .15); }
[data-bs-theme="dark"] .sm-doc-icon.cert { background: rgba(22, 163, 74, .15); }
.sm-rich { line-height: 2; }
.sm-rich img { max-width: 100%; }

/* ---------- Cart ---------- */
.sm-cart-item { display: flex; gap: 1rem; align-items: center; padding: 1rem; border-bottom: 1px solid var(--sm-border); animation: fadeUp .4s both; }
.sm-cart-item img { width: 76px; height: 76px; object-fit: contain; background: var(--sm-surface-2); border-radius: 12px; padding: 6px; }
.sm-cart-box { background: var(--sm-surface); border: 1px solid var(--sm-border); border-radius: var(--sm-radius); }
.sm-summary { position: sticky; top: 90px; }
.offcanvas { background: var(--sm-surface); color: var(--sm-text); }
.sm-empty { text-align: center; padding: 3rem 1rem; color: var(--sm-muted); }
.sm-empty i { font-size: 4rem; opacity: .4; }

/* ---------- Footer ---------- */
.sm-footer { background: #0b1033; color: #aab0d0; padding-top: 4rem; position: relative; }
.sm-footer h5 { color: #fff; font-weight: 800; margin-bottom: 1.2rem; font-size: 1.05rem; }
.sm-footer a { color: #aab0d0; }
.sm-footer a:hover { color: var(--sm-accent-2); }
.sm-footer ul { list-style: none; padding: 0; }
.sm-footer li { margin-bottom: .6rem; }
.sm-footer .social a { width: 40px; height: 40px; border-radius: 12px; display: inline-grid; place-items: center; background: rgba(255, 255, 255, .07); margin-inline-end: .4rem; transition: all .3s; }
.sm-footer .social a:hover { background: var(--sm-accent); color: var(--sm-on-accent); }
.sm-footer-bottom { border-top: 1px solid rgba(255, 255, 255, .08); padding: 1.2rem 0; margin-top: 3rem; font-size: .85rem; }

/* ---------- Misc ---------- */
.back-top {
  position: fixed; bottom: 22px; inset-inline-start: 22px; width: 46px; height: 46px; border-radius: 14px; border: 0; z-index: 1040;
  background: var(--sm-primary); color: #fff; opacity: 0; pointer-events: none; transition: all .3s; box-shadow: var(--sm-shadow-lg);
}
.back-top.show { opacity: 1; pointer-events: auto; }
.sm-toast { position: fixed; bottom: 22px; inset-inline-end: 22px; z-index: 1090; }
.sm-toast .toast { border-radius: 14px; border: 0; box-shadow: var(--sm-shadow-lg); background: var(--sm-surface); color: var(--sm-text); }
.alert { border-radius: 14px; }
.card { border-radius: var(--sm-radius); border-color: var(--sm-border); background: var(--sm-surface); }
.table { --bs-table-bg: transparent; }
.sm-search-pop { border-radius: 16px; }
.dropdown-menu { border-radius: 14px; border-color: var(--sm-border); box-shadow: var(--sm-shadow); }

@media (max-width: 991.98px) {
  .sm-filter form { margin-bottom: .8rem !important; }
  .sm-stats { margin-top: -50px; }
  .sm-section { padding: 3.5rem 0; }
  .sm-filter, .sm-gallery, .sm-summary { position: static; }
  /* Phone/tablet menu: full-height panel from the right; backdrop-filter would trap the fixed panel inside the navbar */
  .sm-nav { backdrop-filter: none; background: var(--sm-surface); }
  .sm-nav.menu-open { z-index: 1050; }
  .sm-menu { width: min(86vw, 340px) !important; background: var(--sm-surface); color: var(--sm-text); }
  .sm-menu .offcanvas-header { border-bottom: 1px solid var(--sm-border); padding: .9rem 1.1rem; justify-content: space-between; }
  .sm-menu .offcanvas-header .btn-close { order: -1; margin: 0; }
  html[dir="ltr"] .sm-menu .offcanvas-header .btn-close { order: 1; }
  .sm-menu .offcanvas-body { display: flex; flex-direction: column; gap: 1rem; padding: 1rem 1.1rem calc(1rem + env(safe-area-inset-bottom)); }
  .sm-menu .navbar-nav { margin: 0 !important; }
  .sm-menu .nav-link { padding: .8rem .9rem !important; font-size: 1.02rem; border-radius: 10px; }
  .sm-menu .nav-link.active { background: color-mix(in srgb, var(--sm-primary) 9%, transparent); }
  .sm-menu .nav-link::after { display: none; }
  .sm-menu .dropdown-menu { position: static !important; transform: none !important; box-shadow: none; border: 0; background: var(--sm-surface-2); margin: .2rem 0 .4rem; }
  .sm-menu form { margin: 0 !important; }
}
@media (max-width: 575.98px) {
  .sm-hero .swiper { min-height: 560px; }
  .sm-stat { padding: 1rem; }
  .sm-stat-num { font-size: 1.4rem; }
  .sm-variants table { font-size: .85rem; }
  .sm-cart-item img { width: 60px; height: 60px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

.ic { margin-inline-end: .45rem; }
.sm-nav .nav-link { white-space: nowrap; }
@media (min-width: 992px) and (max-width: 1199.98px) { .sm-nav .nav-link { padding: .5rem .55rem !important; font-size: .92rem; } }

/* ---------- Hero quick search ---------- */
.sm-hero-search { display: flex; gap: .4rem; max-width: 520px; padding: .35rem; border-radius: 14px; background: rgba(255, 255, 255, .96); }
.sm-hero-search input { flex: 1; min-width: 0; border: 0; background: transparent; padding: .55rem .8rem; color: #161d33; font-weight: 500; }
.sm-hero-search input:focus { outline: none; }
.sm-hero-search:focus-within { box-shadow: 0 0 0 3px var(--sm-accent); }
.sm-hero-search .btn { padding: .55rem 1.1rem; }
.sm-hero-hints { font-size: .82rem; color: #aeb6e0; }
.sm-hero-hints a { color: #dfe3fb; border-bottom: 1px dashed rgba(255, 255, 255, .35); }
.sm-hero-hints a:hover { color: var(--sm-accent-2); }

/* ---------- Mobile action bar ---------- */
.sm-mbar { display: none; }
@media (max-width: 767.98px) {
  .sm-footer-bottom { padding-bottom: calc(64px + 1.2rem + env(safe-area-inset-bottom)); }
  body:not(:has(.sm-footer)) { padding-bottom: calc(64px + env(safe-area-inset-bottom)); }
  .sm-mbar {
    display: grid; grid-template-columns: repeat(4, 1fr); position: fixed; inset-inline: 0; bottom: 0; z-index: 1035;
    background: var(--sm-surface); border-top: 1px solid var(--sm-border); padding-bottom: env(safe-area-inset-bottom);
  }
  .sm-mbar a { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; height: 64px; font-size: .72rem; font-weight: 700; color: var(--sm-muted); position: relative; }
  .sm-mbar a i { font-size: 1.25rem; }
  .sm-mbar a.active { color: var(--sm-primary); }
  .sm-mbar a.call { color: var(--sm-on-accent); background: var(--sm-accent); }
  .sm-mbar .sm-cart-badge { top: 5px; inset-inline-end: calc(50% - 30px); }
  .back-top { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .sm-toast { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .sm-hero-pattern.bp::after { opacity: .22; inset-inline-end: -30%; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
.v-add-label { display: none; }
@media (min-width: 768px) { .v-add-label { display: inline; } }

/* Phones: size rows become stacked cards so price, quantity and add-to-cart stay on screen */
@media (max-width: 575.98px) {
  .sm-variants .table-responsive { overflow: visible; }
  .sm-variants thead { display: none; }
  .sm-variants tbody tr { display: flex; flex-wrap: wrap; align-items: center; gap: .55rem .9rem; padding: .95rem 1rem; border-bottom: 1px solid var(--sm-border); }
  .sm-variants tbody tr:last-child { border-bottom: 0; }
  .sm-variants tbody td { border: 0; padding: 0; background: transparent; }
  .sm-variants .v-size { font-size: 1.1rem; }
  .sm-variants .v-meta { font-size: .85rem; color: var(--sm-muted); }
  .sm-variants .v-meta::before { content: attr(data-label) " "; font-size: .75rem; }
  .sm-variants .v-price { flex-basis: 100%; white-space: normal; }
  .sm-variants .v-add { flex: 1; }
  .sm-variants .v-add .btn { width: 100%; padding: .5rem .8rem; }
  .sm-variants .v-add-label { display: inline; }
  .sm-hero-search .btn .ic { margin: 0; }
  .sm-hero-search .btn span { display: none; }
  .sm-stat { gap: .7rem; }
  .sm-stat-icon { width: 44px; height: 44px; border-radius: 12px; font-size: 1.2rem; }
  .sm-tabs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .sm-tabs .nav-link { white-space: nowrap; padding: .7rem .9rem; }
}
