/* 6.79.141: dense, touch-friendly homepage category icons and compact product cards.
   All selectors are scoped to the existing theme's public cards; checkout,
   single-product purchase controls, and admin interfaces are untouched. */

/* Product details remain accessible via each card's image and product title.
   Remove only their redundant buttons and floating favourite controls. */
body :is(ul.products, .products) li.product :is(
  .mp-card-actions, .mp-card-action, .mp-product-actions, .mp-card-bottom-actions,
  .mp-card-buttons, .mp-card-quick-actions, .mp-card-quickview,
  .mp-card-buy-btn, .mp-card-choose, .mp-card-select,
  .mp-card-fav, .mp-card-favorite, .mp-card-heart, .mp-card-like,
  .mp-card-wishlist, .mp-wishlist-btn, .yith-wcwl-add-to-wishlist,
  .mmp-product-cta, .add_to_cart_button, .ajax_add_to_cart, .added_to_cart,
  .product_type_simple, .product_type_variable, .product_type_external,
  .button, button.button, [class*="wishlist"], [class*="favorite"],
  [class*="favourite"], [class*="quick-view"], [class*="quick_view"],
  [aria-label*="علاقه"], [title*="علاقه"],
  [aria-label*="favorite" i], [title*="favorite" i]
),
body .mp-product-card :is(
  .mp-card-actions, .mp-card-action, .mp-product-actions, .mp-card-fav, .mp-card-favorite,
  .mp-card-heart, .mp-card-like, .mp-card-buy-btn, .mp-card-select,
  .mp-card-wishlist, .mmp-product-cta, .button, button.button,
  [class*="wishlist"], [class*="favorite"], [class*="favourite"],
  [aria-label*="علاقه"], [title*="علاقه"]
),
body .mmp-store-product :is(.mmp-product-cta, .add_to_cart_button, .button, button.button, [class*="wishlist"])
,
body :is(ul.products, .products) li.product button,
body .mp-product-card button
{ display:none!important; }

/* 6.79.145: the real theme wraps the lingering orange CTA in an action
   strip. Also hide the strip before the JavaScript cleaner removes its DOM. */
html body.woocommerce ul.products li.product.mp-product-card > .mp-card-actions,
html body ul.products li.product.mp-product-card > .mp-card-actions,
html body ul.products li.product > .mp-card-actions,
html body .mp-product-card > .mp-card-actions,
html body .mp-product-card > .mp-card-buttons,
html body .mp-product-card > .mp-product-actions,
html body .studio-product-card > .mp-card-actions {
  display:none!important;
  height:0!important;
  min-height:0!important;
  margin:0!important;
  padding:0!important;
  overflow:hidden!important;
}

/* 6.79.143: the theme also renders "انتخاب مشخصات" and favourite controls
   as ordinary anchor elements. Include their button-shaped class variants and
   markers set by the small dynamic-card script. */
body :is(ul.products li.product, .mp-product-card, .mmp-store-product, .studio-product-card) :is(
  .mmp-card-control-hidden, .mmp-card-control-shell-hidden,
  .mp-card-cta, .mp-card-cta-link, .mp-card-details-button,
  .mp-card-footer-actions, .mp-card-footer-buttons, .mp-card-controls,
  .mp-card-favourite, .mp-card-wish, .mp-card-compare,
  a[class*="wishlist"], a[class*="favorite"], a[class*="favourite"],
  a[class*="quickview"], a[class*="quick-view"], a[class*="quick_view"],
  a[class*="-btn"], a[class*="-button"], a[class*="-cta"],
  a[aria-label*="انتخاب مشخصات"], a[title*="انتخاب مشخصات"]
) {display:none!important;}

body :is(ul.products, .products) li.product.mp-product-card,
body :is(ul.products, .products) li.product,
body .mp-product-card {
  min-height:0!important;
  height:auto!important;
  padding-bottom:clamp(8px,1vw,12px)!important;
}

/* Deferred-home skeletons should anticipate the shorter real cards. */
body.home .studio-home .mmp-home-skeleton-button { display:none!important; }
body.home .studio-home .mmp-home-skeleton-card { min-height:210px!important; }
@media (max-width:767px) {
  body.home .studio-home .mmp-home-skeleton-card { min-height:218px!important; }
}

/* Every real banner destination receives a legible, high-contrast pill. */
body.home .studio-home .studio-banner-slide .mmp-banner-image-link:not(.studio-banner-slide) {
  position:relative!important;
  display:block!important;
  width:100%;
  height:100%;
}
body.home .studio-home .studio-banner-slide .mmp-banner-cta-pill,
body.home .studio-home .studio-banner-slide .mmp-banner-cta-text-link {
  box-sizing:border-box!important;
  display:inline-flex!important;
  align-items:center!important;
  justify-content:center!important;
  min-height:36px!important;
  max-width:calc(100% - 24px)!important;
  padding:7px 16px!important;
  border:1px solid rgba(255,255,255,.95)!important;
  border-radius:999px!important;
  background:#f36614!important;
  background-image:none!important;
  color:#fff!important;
  -webkit-text-fill-color:#fff!important;
  font-size:clamp(11px,1.2vw,14px)!important;
  font-weight:900!important;
  line-height:1.5!important;
  text-decoration:none!important;
  white-space:nowrap!important;
  box-shadow:0 5px 17px rgba(79,39,16,.27),inset 0 1px rgba(255,255,255,.36)!important;
}
body.home .studio-home .studio-banner-slide .mmp-banner-cta-pill {
  position:absolute!important;
  z-index:4!important;
  inset:auto 5% 9% auto!important;
  pointer-events:none!important;
}
/* The theme positions native CTA anchors from its per-banner admin setting.
   Do not overwrite top/left/right/bottom or position on those links. */
body.home .studio-home .studio-banner-slide .mmp-banner-cta-text-link.mmp-banner-cta-generated {
  position:absolute!important;
  z-index:4!important;
  inset:auto 5% 9% auto!important;
}
body.home .studio-home .studio-banner-slide :is(.mmp-banner-cta-pill,.mmp-banner-cta-generated)[data-mmp-cta-placement="bottom-left"] {
  top:auto!important;right:auto!important;bottom:9%!important;left:5%!important;
}
body.home .studio-home .studio-banner-slide :is(.mmp-banner-cta-pill,.mmp-banner-cta-generated)[data-mmp-cta-placement="bottom-right"] {
  top:auto!important;right:5%!important;bottom:9%!important;left:auto!important;
}
body.home .studio-home .studio-banner-slide :is(.mmp-banner-cta-pill,.mmp-banner-cta-generated)[data-mmp-cta-placement="top-left"] {
  top:9%!important;right:auto!important;bottom:auto!important;left:5%!important;
}
body.home .studio-home .studio-banner-slide :is(.mmp-banner-cta-pill,.mmp-banner-cta-generated)[data-mmp-cta-placement="top-right"] {
  top:9%!important;right:5%!important;bottom:auto!important;left:auto!important;
}
body.home .studio-home .studio-banner-slide .mmp-banner-cta-text-link:focus-visible {
  outline:3px solid #fff!important;
  outline-offset:3px!important;
}

/* Turn the pair of CTAs below the mobile hero into readable capsules too. */
@media (max-width:767px) {
  body.home .studio-home .studio-hero.mmp-hc622-mobile > .studio-hero-actions > a {
    min-height:48px!important;
    border-radius:999px!important;
    font-weight:850!important;
    box-shadow:0 4px 12px rgba(63,43,27,.12)!important;
  }
  body.home .studio-home .studio-hero .studio-hero-actions > a.mmp-mobile-calc-jump::before,
  body.home .studio-home .studio-hero .studio-hero-actions > a.mmp-mobile-calc-jump::after {
    content:none!important;
    display:none!important;
  }
  body.home .studio-home .studio-banner-slide .mmp-banner-cta-pill,
  body.home .studio-home .studio-banner-slide .mmp-banner-cta-text-link {
    min-height:30px!important;
    padding:5px 12px!important;
    font-size:11px!important;
  }
  body.home .studio-home .studio-banner-slide :is(.mmp-banner-cta-pill,.mmp-banner-cta-generated)[data-mmp-cta-placement="bottom-left"] {
    bottom:11%!important;left:4%!important;
  }
  body.home .studio-home .studio-banner-slide :is(.mmp-banner-cta-pill,.mmp-banner-cta-generated)[data-mmp-cta-placement="bottom-right"] {
    bottom:11%!important;right:4%!important;
  }
  body.home .studio-home .studio-banner-slide :is(.mmp-banner-cta-pill,.mmp-banner-cta-generated)[data-mmp-cta-placement="top-left"] {
    top:11%!important;left:4%!important;
  }
  body.home .studio-home .studio-banner-slide :is(.mmp-banner-cta-pill,.mmp-banner-cta-generated)[data-mmp-cta-placement="top-right"] {
    top:11%!important;right:4%!important;
  }
}

/* Tablet and phone: preserve title size but halve the visual's scale and
   bring the category rail between search and the first homepage banner. */
@media (max-width:1099px) {
  /* 6.79.154: category icons are the first home content. Hide the theme's
     eyebrow/heading/"all products" strip, but retain the real tile rail
     whether it is direct or wrapped by the arrow/slider enhancement. */
  html body.home .studio-home .studio-categories > :not(.studio-category-grid):not(.mmp-home-tiles-shell):not(:has(.studio-category-grid)),
  html body.home .studio-home .studio-categories :is(.studio-section-head,.studio-section-header,.studio-section-heading,.studio-categories-header,.studio-category-heading,.section-header,.section-head) {
    display:none!important;
  }
  body.home .studio-home .studio-categories {
    width:100%!important;
    min-width:0!important;
    /* 6.79.157: halve the visible whitespace above and below the tile rail. */
    margin:10px 0 4px!important;
    padding:0 0 4px!important;
    box-sizing:border-box!important;
  }
  body.home .studio-home .studio-categories .studio-category-grid {
    gap:7px!important;
    /* First/last tile edge spacing matches the 7px gap between tiles. */
    padding:2px 7px 4px!important;
    scroll-padding-inline:7px!important;
    align-items:stretch!important;
  }
  body.home .studio-home.mmp-home-categories-first .studio-categories { order:-10!important; }
  body.home .studio-home.mmp-home-categories-first .studio-hero { order:-9!important; }
  html body.home .studio-home .studio-categories .studio-category-grid > a.studio-category.mmp-home-custom-tile[data-mmp-home-category] {
    box-sizing:border-box!important;
    flex:0 0 clamp(82px,11vw,105px)!important;
    width:clamp(82px,11vw,105px)!important;
    min-width:0!important;
    max-width:none!important;
    min-height:0!important;
    height:auto!important;
    padding:5px 3px 7px!important;
    border-radius:14px!important;
    scroll-snap-align:start;
  }
  html body.home .studio-home .studio-categories .mmp-home-custom-tile .mmp-home-card-visual {
    box-sizing:border-box!important;
    flex:0 0 auto!important;
    width:clamp(68px,9vw,87px)!important;
    height:clamp(68px,9vw,87px)!important;
    max-width:100%!important;
    aspect-ratio:1/1!important;
    margin:0 auto 4px!important;
    border-radius:50%!important;
    overflow:hidden!important;
  }
  html body.home .studio-home .studio-categories .mmp-home-custom-tile .mmp-home-card-visual img.mmp-home-approved-art {
    width:100%!important;
    height:100%!important;
    object-fit:contain!important;
  }
  html body.home .studio-home .studio-categories .studio-category-grid > a.studio-category.mmp-home-custom-tile[data-mmp-home-category] > .mmp-home-card-inner > .mmp-home-card-footer {
    display:grid!important;
    grid-template-columns:minmax(0,1fr)!important;
    place-items:center!important;
    width:100%!important;
    min-width:0!important;
    min-height:2.8em!important;
    height:auto!important;
    margin:0!important;
    padding:0!important;
    text-align:center!important;
    direction:rtl!important;
  }
  html body.home .studio-home .studio-categories .studio-category-grid > a.studio-category.mmp-home-custom-tile[data-mmp-home-category] > .mmp-home-card-inner > .mmp-home-card-footer > strong {
    display:block!important;
    width:100%!important;
    min-width:0!important;
    max-width:100%!important;
    font-size:12px!important;
    font-weight:750!important;
    line-height:1.45!important;
    text-align:center!important;
    direction:rtl!important;
    white-space:normal!important;
    overflow-wrap:normal!important;
    word-break:normal!important;
  }
  body.home .studio-home .studio-categories .mmp-home-custom-tile .mmp-home-card-arrow,
  body.home .studio-home .studio-categories .mmp-home-tiles-nav {
    display:none!important;
  }
}
@media (max-width:767px) {
  html body.home .studio-home .studio-categories .studio-category-grid > a.studio-category.mmp-home-custom-tile[data-mmp-home-category] {
    flex-basis:clamp(74px,21vw,88px)!important;
    width:clamp(74px,21vw,88px)!important;
  }
  html body.home .studio-home .studio-categories .mmp-home-custom-tile .mmp-home-card-visual {
    width:clamp(59px,17vw,73px)!important;
    height:clamp(59px,17vw,73px)!important;
  }
}

/* Actual calculator may be relocated after the sale rail on mobile. */
body.home #mmp-home-calculator-618 { scroll-margin-top:105px; }
@media (prefers-reduced-motion:no-preference) {
  body.home:has(.mmp-home-categories-first) { scroll-behavior:smooth; }
}
