/* Saba Markazi — v10 responsive visual patch.
   This file is deliberately additive: no changes to models, prices, views,
   URL routing, existing sliders, order logic or original CSS files.
   Depends on card-system-v9.css; asset_v handles cache invalidation. */
:root {
  --sm10-orange: #ff7900;
  --sm10-card-line: #d7dfe7;
  --sm10-card-photo: #e9eef3;
  --sm10-price-bg: #f9fafb;
}

/* One consistent frame, including hover in horizontally scrolling rails.
   Inset border is drawn ON the card: no cropped external outlines. */
:is(.welding-card,.smc-product-card,.sma-card,.featured-card,.related-product-card) {
  min-width:0!important;
  box-sizing:border-box!important;
  border:1px solid var(--sm10-card-line)!important;
  border-radius:17px!important;
  overflow:hidden!important;
  background:#fff!important;
  isolation:isolate;
  transform:none!important;
  outline:0!important;
  box-shadow:0 6px 18px rgba(22,34,49,.055)!important;
}
:is(.welding-card,.smc-product-card,.sma-card,.featured-card,.related-product-card)::after {
  inset:0!important;
  border:2.5px solid transparent!important;
  border-radius:inherit!important;
  z-index:7!important;
  pointer-events:none!important;
}
:is(.welding-card,.smc-product-card,.sma-card,.featured-card,.related-product-card):is(:hover,:focus-within,:active,.sm-card-touching) {
  border-color:var(--sm10-orange)!important;
  outline:0!important;
  transform:none!important;
  box-shadow:0 8px 24px rgba(255,121,0,.14)!important;
}
:is(.welding-card,.smc-product-card,.sma-card,.featured-card,.related-product-card):is(:hover,:focus-within,:active,.sm-card-touching)::after {
  border-color:var(--sm10-orange)!important;
}

/* Media lives inside its own fixed, self-contained panel.
   Especially fixes image escaping its panel on /products/ at 360px. */
:is(.welding-card-image,.smc-product-image,.sma-page .sma-card .sma-card-image,.featured-card .product-image,.related-product-image) {
  display:flex!important;
  flex:0 0 auto!important;
  align-items:center!important;
  justify-content:center!important;
  box-sizing:border-box!important;
  width:100%!important;
  min-width:0!important;
  height:210px!important;
  min-height:0!important;
  max-height:none!important;
  padding:12px!important;
  margin:0!important;
  background:var(--sm10-card-photo)!important;
  position:relative!important;
  overflow:hidden!important;
}
:is(.welding-card-image,.smc-product-image,.sma-page .sma-card .sma-card-image,.featured-card .product-image,.related-product-image)>img {
  display:block!important;
  box-sizing:border-box!important;
  position:static!important;
  flex:0 0 auto!important;
  width:100%!important;
  height:100%!important;
  max-width:100%!important;
  max-height:100%!important;
  object-fit:contain!important;
  object-position:center!important;
  border-radius:9px!important;
  border:1px solid #e2e7ec!important;
  background:#fff!important;
  padding:7px!important;
  margin:0!important;
  transform:none!important;
}
/* All-products: preserve the category and title between the image and price. */
.sma-page .sma-card {display:flex!important; flex-direction:column!important;}
.sma-page .sma-card .sma-card-body {
  display:flex!important;
  flex:1 1 auto!important;
  flex-direction:column!important;
  min-width:0!important;
  padding:13px!important;
  gap:5px!important;
}
.sma-page .sma-card .sma-card-body h3 {margin:0!important; min-height:0!important;}
.sma-page .sma-card .sma-card-model,
.sma-page .sma-card .sma-card-description {max-width:100%;overflow-wrap:anywhere;}

/* Small readable subtype pills from the existing Django relationships. */
:is(.smx-card-tags,.welding-type-badges) {
  top:8px!important;
  inset-block-start:8px!important;
  inset-inline-start:8px!important;
  max-width:calc(100% - 16px)!important;
  gap:3px!important;
  flex-wrap:wrap!important;
  align-items:flex-start!important;
}
:is(.smx-card-tag,.welding-type-badge) {
  padding:2px 6px!important;
  border-radius:999px!important;
  font-size:9px!important;
  line-height:1.35!important;
  font-weight:750!important;
  max-width:100%!important;
  white-space:nowrap!important;
  overflow:hidden!important;
  text-overflow:ellipsis!important;
  color:#c96003!important;
  border:1px solid #ffd6b2!important;
  background:#fff4e9!important;
  box-shadow:none!important;
}
/* Existing extra homepage 'recommended' label should not overwhelm type pills. */
.featured-track .featured-card .product-badge {
  top:8px!important;
  left:8px!important;
  right:auto!important;
  padding:2px 6px!important;
  border-radius:999px!important;
  min-height:0!important;
  font-size:9px!important;
  line-height:1.35!important;
  background:#fff4e9!important;
  color:#c96003!important;
  border:1px solid #ffd6b2!important;
  box-shadow:none!important;
}

/* A genuinely shared slim rectangular footer, not oversized square buttons. */
:is(.welding-card-footer,.smc-product-bottom,.sma-card-footer,.featured-card .product-bottom,.related-product-bottom).smx-card-footer {
  display:grid!important;
  box-sizing:border-box!important;
  grid-template-columns:minmax(0,1fr) minmax(0,1fr)!important;
  align-items:stretch!important;
  gap:7px!important;
  min-width:0!important;
  margin-top:auto!important;
  padding-top:10px!important;
  height:auto!important;
}
.smx-card-footer>.smx-price,
.smx-card-footer>.smx-card-cta {
  box-sizing:border-box!important;
  width:100%!important;
  min-height:0!important;
  height:69px!important;
  max-height:69px!important;
  border-radius:9px!important;
  margin:0!important;
  overflow:hidden!important;
}
.smx-card-footer>.smx-price {
  padding:6px 8px!important;
  background:var(--sm10-price-bg)!important;
  border:1px solid #e2e6eb!important;
  display:flex!important;
  flex-direction:column!important;
  justify-content:center!important;
  gap:2px!important;
}
.smx-price-heading {min-height:0!important;gap:3px!important;align-items:center!important;}
.smx-price-label {font-size:9px!important;line-height:1.2!important;}
.smx-price-discount {position:static!important;padding:2px 4px!important;font-size:9px!important;line-height:1.2!important;flex-shrink:0!important;}
.smx-price-before {font-size:9px!important;line-height:1.3!important;margin:0!important;white-space:nowrap!important;}
.smx-price-before small {font-size:8px!important;}
.smx-price-final {font-size:clamp(12px,1.05vw,15px)!important;line-height:1.3!important;white-space:nowrap!important;letter-spacing:-.15px!important;}
.smx-price-final small {font-size:9px!important;}
.smx-price-inquiry {font-size:11px!important;}
.smx-stock {font-size:9px!important;line-height:1.3!important;}
.smx-card-footer>.smx-card-cta {
  display:flex!important;
  justify-content:center!important;
  align-items:center!important;
  padding:6px!important;
  font-size:11px!important;
  font-weight:850!important;
  line-height:1.4!important;
  white-space:nowrap!important;
  background:var(--sm10-orange)!important;
  color:#fff!important;
  text-decoration:none!important;
  border:1px solid var(--sm10-orange)!important;
}
.smx-card-footer>.smx-card-cta::after {font-size:11px!important;}
.smx-card-footer>.smx-card-cta:hover {background:#e56c00!important;}
/* Prevent the background photo panel overlapping the text. */
.featured-track .featured-card .product-details,
.related-products-grid .related-product-card .related-product-content {
  flex:1 1 auto!important;
  min-width:0!important;
  display:flex!important;
  flex-direction:column!important;
}

/* New miniature industrial cart symbol: icon stroke + a single orange spark. */
.site-header .cart-icon {
  position:relative;
  flex:0 0 37px!important;
  width:37px!important;
  height:37px!important;
  border-radius:10px!important;
  background:#fff8f2!important;
  color:#202326!important;
  border:1px solid #ffe1c3!important;
  display:grid!important;
  place-items:center!important;
}
.site-header .cart-icon .sm-cart-svg {display:block;width:25px!important;height:25px!important;}
.site-header .cart-icon .cart-badge {z-index:3!important;}

@media (min-width:701px) and (max-width:1100px) {
  :is(.welding-card-image,.smc-product-image,.sma-page .sma-card .sma-card-image,.featured-card .product-image,.related-product-image){height:195px!important;}
  .smx-card-footer>.smx-price,.smx-card-footer>.smx-card-cta {height:65px!important;max-height:65px!important;}
  .smx-price-final {font-size:clamp(11px,1.25vw,14px)!important;}
}
@media (max-width:700px) {
  :is(.welding-card,.smc-product-card,.sma-card,.featured-card,.related-product-card) {border-radius:13px!important;}
  :is(.welding-card-image,.smc-product-image,.sma-page .sma-card .sma-card-image,.featured-card .product-image,.related-product-image){height:138px!important; padding:6px!important;}
  :is(.welding-card-image,.smc-product-image,.sma-page .sma-card .sma-card-image,.featured-card .product-image,.related-product-image)>img {padding:3px!important;border-radius:7px!important;}
  .sma-page .sma-grid {grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:9px!important;}
  .sma-page .sma-card .sma-card-body {padding:8px!important; gap:4px!important;}
  .sma-page .sma-card .sma-card-body h3 {font-size:11px!important;line-height:1.5!important;min-height:33px!important;max-height:52px!important;overflow:hidden!important;}
  .sma-page .sma-card .sma-card-model {font-size:9px!important;line-height:1.6!important;}
  .sma-page .sma-card .sma-card-description {display:none!important;}
  :is(.smx-card-tags,.welding-type-badges) {top:5px!important;inset-block-start:5px!important;inset-inline-start:5px!important;max-width:calc(100% - 10px)!important;gap:2px!important;}
  :is(.smx-card-tag,.welding-type-badge) {font-size:7px!important;line-height:1.35!important;padding:2px 4px!important;}
  /* Dense tags from admin remain available on desktop; mobile prioritizes readability. */
  :is(.smx-card-tags,.welding-type-badges)>:not(:first-child) {display:none!important;}
  .featured-track .featured-card .product-badge {top:5px!important;left:5px!important;font-size:7px!important;padding:2px 4px!important;}
  :is(.welding-card-footer,.smc-product-bottom,.sma-card-footer,.featured-card .product-bottom,.related-product-bottom).smx-card-footer {
    grid-template-columns:minmax(0,1fr)!important;
    gap:5px!important;
    padding-top:7px!important;
  }
  .smx-card-footer>.smx-price,.smx-card-footer>.smx-card-cta {height:auto!important;max-height:none!important;border-radius:8px!important;}
  .smx-card-footer>.smx-price {min-height:55px!important;padding:5px 6px!important;gap:1px!important;}
  .smx-card-footer>.smx-card-cta {min-height:31px!important;padding:5px!important;font-size:10px!important;}
  .smx-price-discount {font-size:7px!important;padding:1px 3px!important;}
  .smx-price-label {font-size:8px!important;}
  .smx-price-before,.smx-price-before small {font-size:8px!important;}
  .smx-price-final {font-size:clamp(10px,2.8vw,13px)!important;letter-spacing:-.3px!important;}
  .smx-price-final small {font-size:8px!important;}
  .smx-stock {font-size:8px!important;}
  .site-header .cart-icon {width:32px!important;height:32px!important;flex-basis:32px!important;}
  .site-header .cart-icon .sm-cart-svg {width:22px!important;height:22px!important;}
  .related-products-grid .related-product-content {min-height:0!important;}
}
@media (max-width:370px) {
  .sma-page .sma-card .sma-card-image {height:132px!important;}
  .smx-price-final {font-size:10px!important;}
  .smx-price-final small {font-size:7px!important;}
}

/* About / Contact: retain the exact original desktop photographs on phones.
   The image now covers the ENTIRE hero (not a separate top strip). The
   horizontal dark overlay keeps the right-aligned Persian copy legible. */
@media (min-width:641px) and (max-width:1000px) {
  .saba-about-v2 .sa-hero,
  .saba-contact-v3 .sc-hero {padding:28px 30px!important;min-height:340px!important;}
  .saba-about-v2 .sa-hero-copy,
  .saba-contact-v3 .sc-hero-content {max-width:55%!important;}
  .saba-about-v2 .sa-hero h1,
  .saba-contact-v3 .sc-hero h1 {font-size:clamp(27px,3.7vw,38px)!important;line-height:1.5!important;}
  .saba-about-v2 .sa-hero-photo,
  .saba-contact-v3 .sc-hero-photo {background-size:cover!important;background-repeat:no-repeat!important;background-position:34% center!important;}
}
@media (max-width:640px) {
  .saba-about-v2 .sa-hero,
  .saba-contact-v3 .sc-hero {
    min-height:380px!important;
    height:auto!important;
    padding:24px 17px!important;
    display:flex!important;
    align-items:center!important;
    background:#12161c!important;
    overflow:hidden!important;
    border-radius:16px!important;
    box-shadow:0 12px 26px rgba(17,20,27,.15)!important;
  }
  .saba-about-v2 .sa-hero {min-height:410px!important;}
  .saba-about-v2 .sa-hero-photo,
  .saba-contact-v3 .sc-hero-photo {
    inset:0!important;
    opacity:.98!important;
    background-size:cover!important;
    background-repeat:no-repeat!important;
    background-position:21% center!important;
  }
  .saba-contact-v3 .sc-hero-photo {background-position:23% center!important;}
  .saba-about-v2 .sa-hero::before,
  .saba-contact-v3 .sc-hero::before {
    background:linear-gradient(270deg,
      rgba(17,20,27,.96) 0%,
      rgba(17,20,27,.87) 48%,
      rgba(17,20,27,.55) 77%,
      rgba(17,20,27,.28) 100%)!important;
  }
  .saba-about-v2 .sa-hero-copy,
  .saba-contact-v3 .sc-hero-content {position:relative!important;z-index:1!important;max-width:100%!important;width:100%!important;text-align:right!important;}
  .saba-about-v2 .sa-hero h1,
  .saba-contact-v3 .sc-hero h1 {font-size:clamp(23px,6.2vw,29px)!important;line-height:1.45!important;margin:6px 0 7px!important;}
  .saba-about-v2 .sa-hero p,
  .saba-contact-v3 .sc-hero p {font-size:11px!important;line-height:1.9!important;margin:0!important;}
  .saba-about-v2 .sa-hero-actions {margin-top:12px!important;gap:7px!important;}
  .saba-about-v2 .sa-hero-actions a {font-size:10px!important;padding:9px 11px!important;}
  .saba-about-v2 .sa-hero-tags,
  .saba-contact-v3 .sc-hero-chips {display:flex!important;flex-wrap:wrap!important;gap:5px!important;margin-top:12px!important;}
  .saba-about-v2 .sa-hero-tags span,
  .saba-contact-v3 .sc-hero-chips span {font-size:9px!important;padding:4px 7px!important;}
  .saba-about-v2 .sa-hero-sign,
  .saba-contact-v3 .sc-hero-mark {display:none!important;}
  .saba-contact-v3 .sc-overline,
  .saba-about-v2 .sa-eyebrow {font-size:10px!important;gap:6px!important;margin-bottom:5px!important;}
  .saba-contact-v3 .sc-latin,
  .saba-about-v2 .sa-eyebrow b {font-size:8px!important;letter-spacing:.4px!important;}
}
/* Compact but legible footer on phones; all destinations remain accessible. */
@media (max-width:640px) {
  .sm-home-footer .sm-footer-top {padding:19px 0!important;display:flex!important;flex-direction:column!important;align-items:flex-start!important;gap:10px!important;}
  .sm-home-footer .sm-footer-intro h2 {font-size:17px!important;line-height:1.5!important;margin:0 0 3px!important;}
  .sm-home-footer .sm-footer-intro p {font-size:10px!important;line-height:1.7!important;margin:0!important;}
  .sm-home-footer .sm-footer-call {margin:0!important;padding:9px 12px!important;font-size:11px!important;border-radius:9px!important;}
  .sm-home-footer .sm-footer-grid {display:grid!important;grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:17px 14px!important;padding:24px 0!important;}
  .sm-home-footer .sm-footer-brand {grid-column:1/-1!important;}
  .sm-home-footer .sm-footer-col {gap:7px!important;}
  .sm-home-footer .sm-footer-col h3 {font-size:13px!important;margin:0 0 2px!important;}
  .sm-home-footer .sm-footer-brand h3 {font-size:17px!important;}
  .sm-home-footer .sm-footer-col h3::after {height:2px!important;margin-top:5px!important;}
  .sm-home-footer .sm-footer-col p,.sm-home-footer .sm-footer-col a {font-size:10px!important;line-height:1.75!important;}
  .sm-home-footer .sm-footer-contact {grid-column:1/-1!important;}
  .sm-home-footer .sm-footer-contact>a {font-size:13px!important;}
  .sm-home-footer .sm-footer-bottom .container {min-height:0!important;padding:11px 0!important;gap:6px!important;font-size:9px!important;}
}
@media (prefers-reduced-motion:reduce) {
  :is(.welding-card,.smc-product-card,.sma-card,.featured-card,.related-product-card),
  :is(.welding-card,.smc-product-card,.sma-card,.featured-card,.related-product-card)::after {transition:none!important;}
}

/* V11 cart: a discreet, legible count on every screen size. */
.site-header .cart-icon .sm-cart-svg {
  display:block!important;
  width:25px!important;
  height:25px!important;
  flex:none!important;
}
.site-header .cart-icon .cart-badge {
  position:absolute!important;
  top:-5px!important;
  left:auto!important;
  right:-5px!important;
  inset-inline-start:auto!important;
  min-width:16px!important;
  width:auto!important;
  height:16px!important;
  padding:0 3px!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  font-size:9px!important;
  line-height:1!important;
  font-weight:700!important;
  border:1.5px solid #fff!important;
  border-radius:999px!important;
  background:#ff7900!important;
  color:#fff!important;
  box-sizing:border-box!important;
  font-variant-numeric:tabular-nums;
  z-index:4!important;
}
@media(max-width:700px){
  .site-header .cart-icon .sm-cart-svg {width:22px!important;height:22px!important;}
  .site-header .cart-icon .cart-badge {
    top:-4px!important;
    right:-4px!important;
    min-width:14px!important;
    height:14px!important;
    padding:0 2px!important;
    font-size:8px!important;
  }
}
