/* Saltfah Mobile Layout Controller - Frontend */
@media (max-width: 768px) {
  body.sorfah-mobile-layout-active {
    overflow-x: hidden;
  }

  body.sorfah-mobile-layout-active img {
    max-width: 100%;
    height: auto;
  }

  body.sorfah-mobile-layout-active .site,
  body.sorfah-mobile-layout-active #page,
  body.sorfah-mobile-layout-active .site-content,
  body.sorfah-mobile-layout-active .content-area,
  body.sorfah-mobile-layout-active main,
  body.sorfah-mobile-layout-active .elementor-section-wrap {
    max-width: 100%;
    overflow-x: hidden;
  }

  body.sorfah-mobile-layout-active .container,
  body.sorfah-mobile-layout-active .site-container,
  body.sorfah-mobile-layout-active .ast-container,
  body.sorfah-mobile-layout-active .woocommerce .content-area,
  body.sorfah-mobile-layout-active .elementor-container {
    width: 100% !important;
    max-width: 100% !important;
    padding-left: var(--sf-ml-padding, 12px) !important;
    padding-right: var(--sf-ml-padding, 12px) !important;
    box-sizing: border-box !important;
  }

  body.sorfah-mobile-layout-active .elementor-section,
  body.sorfah-mobile-layout-active section,
  body.sorfah-mobile-layout-active .wp-block-group {
    margin-bottom: var(--sf-ml-gap, 18px);
  }

  body.sorfah-mobile-layout-active.sf-ml-hide-topbar .top-bar,
  body.sorfah-mobile-layout-active.sf-ml-hide-topbar .site-topbar,
  body.sorfah-mobile-layout-active.sf-ml-hide-topbar .ast-above-header-wrap,
  body.sorfah-mobile-layout-active.sf-ml-hide-topbar .header-top,
  body.sorfah-mobile-layout-active.sf-ml-hide-topbar [class*="topbar"],
  body.sorfah-mobile-layout-active.sf-ml-hide-topbar [class*="top-bar"] {
    display: none !important;
  }

  body.sorfah-mobile-layout-active.sf-ml-compact-header header,
  body.sorfah-mobile-layout-active.sf-ml-compact-header .site-header,
  body.sorfah-mobile-layout-active.sf-ml-compact-header .main-header-bar {
    min-height: auto !important;
  }

  body.sorfah-mobile-layout-active.sf-ml-compact-header .site-branding img,
  body.sorfah-mobile-layout-active.sf-ml-compact-header .custom-logo {
    max-height: 58px !important;
    width: auto !important;
  }

  body.sorfah-mobile-layout-active.sf-ml-home img[src*="banner"],
  body.sorfah-mobile-layout-active.sf-ml-home [class*="banner"] img,
  body.sorfah-mobile-layout-active.sf-ml-home [class*="hero"] img,
  body.sorfah-mobile-layout-active.sf-ml-home .swiper-slide img,
  body.sorfah-mobile-layout-active.sf-ml-home .slick-slide img {
    border-radius: var(--sf-ml-banner-radius, 18px) !important;
    object-fit: cover;
  }

  body.sorfah-mobile-layout-active.sf-ml-home [class*="hero"],
  body.sorfah-mobile-layout-active.sf-ml-home [class*="banner"],
  body.sorfah-mobile-layout-active.sf-ml-home .swiper,
  body.sorfah-mobile-layout-active.sf-ml-home .slick-slider {
    overflow: hidden;
    border-radius: var(--sf-ml-banner-radius, 18px);
  }

  /* Saltfah real hero/banner: keep mobile frame exactly to image ratio (no blank bottom). */
  body.sorfah-mobile-layout-active.sf-ml-home .sfcb-hero-banner,
  body.sorfah-mobile-layout-active.sf-ml-home .sfcb-hero-slider,
  body.sorfah-mobile-layout-active.sf-ml-home .sfbp-hero-main,
  body.sorfah-mobile-layout-active.sf-ml-home .sfbp-slider {
    height: auto !important;
    min-height: 0 !important;
    aspect-ratio: 922 / 530 !important;
    background: transparent !important;
  }

  body.sorfah-mobile-layout-active.sf-ml-home .sfcb-hero-banner img,
  body.sorfah-mobile-layout-active.sf-ml-home .sfcb-hero-slider img,
  body.sorfah-mobile-layout-active.sf-ml-home .sfbp-slide img {
    width: 100% !important;
    height: 100% !important;
    display: block !important;
    object-fit: contain !important;
    object-position: center center !important;
    background: transparent !important;
  }

  body.sorfah-mobile-layout-active.sf-ml-home [class*="category"] ul,
  body.sorfah-mobile-layout-active.sf-ml-home [class*="categories"] ul,
  body.sorfah-mobile-layout-active.sf-ml-home .product-categories,
  body.sorfah-mobile-layout-active.sf-ml-home .wc-block-product-categories-list {
    display: grid !important;
    grid-template-columns: repeat(var(--sf-ml-cat-cols, 2), minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  body.sorfah-mobile-layout-active.sf-ml-home .products,
  body.sorfah-mobile-layout-active.sf-ml-home ul.products,
  body.sorfah-mobile-layout-active.sf-ml-home .wc-block-grid__products {
    display: grid !important;
    grid-template-columns: repeat(var(--sf-ml-product-cols, 2), minmax(0, 1fr)) !important;
    gap: 12px !important;
  }

  body.sorfah-mobile-layout-active.sf-ml-home ul.products li.product,
  body.sorfah-mobile-layout-active.sf-ml-home .wc-block-grid__product {
    width: 100% !important;
    margin: 0 !important;
    border-radius: var(--sf-ml-radius, 16px) !important;
    overflow: hidden;
  }

  body.sorfah-mobile-layout-active.sf-ml-hide-extra-banners [class*="banner"]:nth-of-type(n+4) {
    display: none !important;
  }

  body.sorfah-mobile-layout-active.sf-ml-shop .products,
  body.sorfah-mobile-layout-active.sf-ml-shop ul.products,
  body.sorfah-mobile-layout-active.sf-ml-shop .wc-block-grid__products {
    display: grid !important;
    grid-template-columns: repeat(var(--sf-ml-shop-cols, 2), minmax(0, 1fr)) !important;
    gap: 12px !important;
  }

  body.sorfah-mobile-layout-active.sf-ml-shop ul.products li.product,
  body.sorfah-mobile-layout-active.sf-ml-shop .wc-block-grid__product {
    width: 100% !important;
    margin: 0 !important;
    border-radius: var(--sf-ml-radius, 16px) !important;
    overflow: hidden;
  }

  body.sorfah-mobile-layout-active.sf-ml-shop-hide-sidebar aside,
  body.sorfah-mobile-layout-active.sf-ml-shop-hide-sidebar .sidebar,
  body.sorfah-mobile-layout-active.sf-ml-shop-hide-sidebar #secondary {
    display: none !important;
  }

  body.sorfah-mobile-layout-active.sf-ml-shop-filter .woocommerce-result-count,
  body.sorfah-mobile-layout-active.sf-ml-shop-filter .woocommerce-ordering {
    width: 100% !important;
    float: none !important;
    margin: 0 0 10px !important;
  }

  body.sorfah-mobile-layout-active.sf-ml-shop-filter .woocommerce-ordering select {
    width: 100% !important;
    min-height: 42px;
    border-radius: 12px;
  }

  body.sorfah-mobile-layout-active.sf-ml-shop-compact ul.products li.product .woocommerce-loop-product__title,
  body.sorfah-mobile-layout-active.sf-ml-shop-compact .wc-block-grid__product-title {
    font-size: 13px !important;
    line-height: 1.35 !important;
  }

  body.sorfah-mobile-layout-active.sf-ml-shop-compact ul.products li.product .price {
    font-size: 14px !important;
    font-weight: 800 !important;
  }

  body.sorfah-mobile-layout-active.sf-ml-single-product .woocommerce-product-gallery,
  body.sorfah-mobile-layout-active.sf-ml-single-product .woocommerce-product-gallery__wrapper {
    width: 100% !important;
    max-width: 100% !important;
  }

  body.sorfah-mobile-layout-active.sf-ml-single-product .woocommerce-product-gallery img {
    max-height: var(--sf-ml-gallery-height, 360px);
    object-fit: contain;
    border-radius: var(--sf-ml-radius, 16px);
  }

  body.sorfah-mobile-layout-active.sf-ml-single-product .summary,
  body.sorfah-mobile-layout-active.sf-ml-single-product .entry-summary {
    width: 100% !important;
    padding: 0 !important;
  }

  body.sorfah-mobile-layout-active.sf-ml-single-compact .product_title {
    font-size: 22px !important;
    line-height: 1.25 !important;
  }

  body.sorfah-mobile-layout-active.sf-ml-single-compact .price {
    font-size: 20px !important;
    font-weight: 900 !important;
  }

  body.sorfah-mobile-layout-active.sf-ml-single-sticky-cart form.cart,
  body.sorfah-mobile-layout-active.sf-ml-single-sticky-cart .single_add_to_cart_button {
    z-index: 9998;
  }

  body.sorfah-mobile-layout-active.sf-ml-single-sticky-cart .single_add_to_cart_button {
    position: fixed !important;
    left: 12px !important;
    right: 12px !important;
    bottom: 12px !important;
    width: calc(100% - 24px) !important;
    min-height: 52px !important;
    border-radius: 16px !important;
    box-shadow: 0 14px 30px rgba(0,0,0,.28) !important;
  }

  body.sorfah-mobile-layout-active.sf-ml-single-sticky-cart {
    padding-bottom: 78px;
  }

  body.sorfah-mobile-layout-active .sorfah-ml-bottom-nav {
    position: fixed;
    left: 10px;
    right: 10px;
    bottom: 10px;
    z-index: 9997;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
    padding: 8px;
    border-radius: 18px;
    background: rgba(10, 12, 18, .94);
    border: 1px solid rgba(255,255,255,.10);
    box-shadow: 0 18px 40px rgba(0,0,0,.40);
    backdrop-filter: blur(12px);
  }

  body.sorfah-mobile-layout-active .sorfah-ml-bottom-nav a {
    text-align: center;
    color: #fff;
    text-decoration: none;
    font-size: 11px;
    font-weight: 800;
    padding: 7px 4px;
    border-radius: 12px;
  }

  body.sorfah-mobile-layout-active .sorfah-ml-bottom-nav a:hover,
  body.sorfah-mobile-layout-active .sorfah-ml-bottom-nav a.is-active {
    background: linear-gradient(135deg, #ff3b2f, #ff6a3d);
  }

  body.sorfah-mobile-layout-active.sf-ml-bottom-nav-on {
    padding-bottom: 78px;
  }
}

/* v6.4.6 Homepage mobile product cards: remove nested frame and make cover image flush */
@media (max-width: 768px) {
  body.sorfah-mobile-layout-active.sf-ml-home .sfbp-product-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
  }

  body.sorfah-mobile-layout-active.sf-ml-home .sfbp-product-card,
  html.saltfah-light-mode body.sorfah-mobile-layout-active.sf-ml-home .sfbp-product-card {
    padding: 0 0 12px !important;
    border-radius: 17px !important;
    overflow: hidden !important;
    background-clip: padding-box !important;
  }

  body.sorfah-mobile-layout-active.sf-ml-home .sfbp-product-card > a,
  body.sorfah-mobile-layout-active.sf-ml-home .sfbp-product-card-link {
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
  }

  body.sorfah-mobile-layout-active.sf-ml-home .sfbp-product-img {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1 !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    border-radius: 16px 16px 0 0 !important;
    background: transparent !important;
    overflow: hidden !important;
  }

  body.sorfah-mobile-layout-active.sf-ml-home .sfbp-product-img img,
  body.sorfah-mobile-layout-active.sf-ml-home .sfbp-product-card img {
    display: block !important;
    width: 100% !important;
    height: 100% !important;
    aspect-ratio: 1 / 1 !important;
    object-fit: cover !important;
    object-position: center center !important;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    outline: 0 !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    background: transparent !important;
  }

  body.sorfah-mobile-layout-active.sf-ml-home .sfbp-product-info {
    padding: 10px 12px 0 !important;
  }

  body.sorfah-mobile-layout-active.sf-ml-home .sfbp-product-info h3 {
    padding: 0 !important;
    margin: 0 0 8px !important;
  }

  body.sorfah-mobile-layout-active.sf-ml-home .sfbp-price {
    padding: 0 !important;
    margin: 0 !important;
  }
}

/* v6.4.7 Homepage mobile product card typography/alignment */
@media (max-width: 768px) {
  body.sorfah-mobile-layout-active.sf-ml-home .sfbp-product-card > a,
  body.sorfah-mobile-layout-active.sf-ml-home .sfbp-product-card-link {
    display: flex !important;
    flex-direction: column !important;
    height: 100% !important;
  }

  body.sorfah-mobile-layout-active.sf-ml-home .sfbp-product-info {
    display: flex !important;
    flex: 1 1 auto !important;
    flex-direction: column !important;
    padding: 11px 12px 0 !important;
    min-height: 92px !important;
  }

  body.sorfah-mobile-layout-active.sf-ml-home .sfbp-product-info h3 {
    margin: 0 !important;
    min-height: 48px !important;
    font-size: 13px !important;
    line-height: 1.28 !important;
  }

  body.sorfah-mobile-layout-active.sf-ml-home .sfbp-price,
  body.sorfah-mobile-layout-active.sf-ml-home .sfbp-price * {
    margin-top: auto !important;
    padding-top: 8px !important;
    font-size: 14px !important;
    line-height: 1.15 !important;
    letter-spacing: -.01em !important;
  }
}


/* v4: Mobile vertical menu visibility */
@media (max-width: 900px) {
  body.sorfah-mobile-layout-active .sf-ml-mobile-vertical-menu-target {
    transition: opacity .18s ease, transform .18s ease;
  }

  body.sorfah-mobile-layout-active .sf-ml-mobile-vertical-menu-target:not(.sf-ml-mobile-menu-visible) {
    display: none !important;
  }

  body.sorfah-mobile-layout-active .sf-ml-mobile-vertical-menu-target.sf-ml-mobile-menu-visible {
    display: block !important;
  }

  body.sorfah-mobile-layout-active [data-sf-nav-toggle],
  body.sorfah-mobile-layout-active .sf-mobile-toggle {
    position: relative !important;
    z-index: 10050 !important;
    pointer-events: auto !important;
    touch-action: manipulation;
  }

  body.sorfah-mobile-layout-active [data-sf-nav].is-open,
  body.sorfah-mobile-layout-active .sf-nav.is-open {
    display: block !important;
    position: relative;
    z-index: 1004;
  }

  body.sorfah-mobile-layout-active [data-sf-nav].is-open .sf-menu,
  body.sorfah-mobile-layout-active [data-sf-nav].is-open .sf-ml-mobile-vertical-menu-target,
  body.sorfah-mobile-layout-active .sf-nav.is-open .sf-menu,
  body.sorfah-mobile-layout-active .sf-nav.is-open .sf-ml-mobile-vertical-menu-target {
    display: flex !important;
  }

  body.sorfah-mobile-layout-active .saltfah-mobile-menu-panel {
    position: fixed !important;
    left: 14px !important;
    right: 14px !important;
    z-index: 10040 !important;
    display: none !important;
    flex-direction: column !important;
    gap: 8px !important;
    padding: 14px !important;
    max-height: min(70vh, 520px) !important;
    overflow-y: auto !important;
    border: 1px solid rgba(255, 91, 66, .42) !important;
    border-radius: 18px !important;
    background: linear-gradient(145deg, rgba(18, 19, 25, .98), rgba(45, 24, 24, .98)) !important;
    box-shadow: 0 18px 45px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .04) inset !important;
  }

  body.sorfah-mobile-layout-active .saltfah-mobile-menu-panel.is-open {
    display: flex !important;
  }

  body.sorfah-mobile-layout-active .saltfah-mobile-menu-panel a {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    min-height: 46px !important;
    padding: 12px 14px !important;
    border-radius: 14px !important;
    border: 1px solid rgba(255, 255, 255, .08) !important;
    background: rgba(255, 255, 255, .045) !important;
    color: #fff7e8 !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    text-decoration: none !important;
  }

  body.sorfah-mobile-layout-active .saltfah-mobile-menu-panel a:after {
    content: "›";
    color: #ffb25b;
    font-size: 22px;
    line-height: 1;
  }
}


/* v5: Mobile heading and product card controls */
@media (max-width: 768px) {
  body.sorfah-mobile-layout-active.sf-ml-home h1,
  body.sorfah-mobile-layout-active.sf-ml-home h2,
  body.sorfah-mobile-layout-active.sf-ml-shop h1,
  body.sorfah-mobile-layout-active.sf-ml-shop h2,
  body.sorfah-mobile-layout-active [class*="section-title"],
  body.sorfah-mobile-layout-active [class*="heading"] h2,
  body.sorfah-mobile-layout-active .elementor-heading-title {
    font-size: var(--sf-ml-heading-size, 28px) !important;
    line-height: var(--sf-ml-heading-line, 1.15) !important;
  }

  body.sorfah-mobile-layout-active.sf-ml-heading-single_line .elementor-heading-title,
  body.sorfah-mobile-layout-active.sf-ml-heading-single_line [class*="section-title"],
  body.sorfah-mobile-layout-active.sf-ml-heading-single_line h2 {
    white-space: nowrap;
    font-size: min(var(--sf-ml-heading-size, 28px), 24px) !important;
  }

  body.sorfah-mobile-layout-active.sf-ml-heading-compact .elementor-heading-title,
  body.sorfah-mobile-layout-active.sf-ml-heading-compact [class*="section-title"],
  body.sorfah-mobile-layout-active.sf-ml-heading-compact h2 {
    font-size: min(var(--sf-ml-heading-size, 28px), 22px) !important;
    line-height: 1.05 !important;
    margin-bottom: 10px !important;
  }

  body.sorfah-mobile-layout-active ul.products li.product,
  body.sorfah-mobile-layout-active .wc-block-grid__product {
    border-radius: var(--sf-ml-radius, 16px) !important;
  }

  body.sorfah-mobile-layout-active ul.products li.product img,
  body.sorfah-mobile-layout-active .wc-block-grid__product img {
    height: var(--sf-ml-product-image-height, 190px) !important;
    object-fit: cover !important;
    width: 100% !important;
  }

  body.sorfah-mobile-layout-active ul.products li.product .woocommerce-loop-product__title,
  body.sorfah-mobile-layout-active .wc-block-grid__product-title,
  body.sorfah-mobile-layout-active ul.products li.product h2,
  body.sorfah-mobile-layout-active ul.products li.product h3 {
    font-size: var(--sf-ml-product-title-size, 14px) !important;
    line-height: 1.35 !important;
  }

  body.sorfah-mobile-layout-active ul.products li.product .price,
  body.sorfah-mobile-layout-active .wc-block-grid__product-price {
    font-size: var(--sf-ml-product-price-size, 15px) !important;
    line-height: 1.25 !important;
  }

  body.sorfah-mobile-layout-active ul.products li.product .button,
  body.sorfah-mobile-layout-active ul.products li.product .add_to_cart_button,
  body.sorfah-mobile-layout-active .wc-block-grid__product .wp-block-button__link {
    min-height: var(--sf-ml-product-button-height, 46px) !important;
    font-size: var(--sf-ml-product-button-size, 15px) !important;
    border-radius: 14px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
  }

  body.sorfah-mobile-layout-active.sf-ml-product-style-large_1col .products,
  body.sorfah-mobile-layout-active.sf-ml-product-style-large_1col ul.products,
  body.sorfah-mobile-layout-active.sf-ml-product-style-large_1col .wc-block-grid__products {
    grid-template-columns: 1fr !important;
  }

  body.sorfah-mobile-layout-active.sf-ml-product-style-large_1col {
    --sf-ml-product-image-height: 300px;
    --sf-ml-product-title-size: 18px;
    --sf-ml-product-price-size: 18px;
    --sf-ml-product-button-height: 52px;
  }

  body.sorfah-mobile-layout-active.sf-ml-product-style-compact_2col .products,
  body.sorfah-mobile-layout-active.sf-ml-product-style-compact_2col ul.products,
  body.sorfah-mobile-layout-active.sf-ml-product-style-compact_2col .wc-block-grid__products {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 12px !important;
  }

  body.sorfah-mobile-layout-active.sf-ml-product-style-mini_2col .products,
  body.sorfah-mobile-layout-active.sf-ml-product-style-mini_2col ul.products,
  body.sorfah-mobile-layout-active.sf-ml-product-style-mini_2col .wc-block-grid__products {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 8px !important;
  }

  body.sorfah-mobile-layout-active.sf-ml-product-style-mini_2col {
    --sf-ml-product-image-height: 150px;
    --sf-ml-product-title-size: 12px;
    --sf-ml-product-price-size: 13px;
    --sf-ml-product-button-height: 38px;
    --sf-ml-product-button-size: 12px;
  }

  body.sorfah-mobile-layout-active.sf-ml-product-style-premium_card ul.products li.product,
  body.sorfah-mobile-layout-active.sf-ml-product-style-premium_card .wc-block-grid__product {
    background: linear-gradient(180deg, rgba(255,255,255,.06), rgba(255,59,47,.10)) !important;
    border: 1px solid rgba(255,255,255,.10) !important;
    box-shadow: 0 14px 30px rgba(0,0,0,.22) !important;
    padding: 10px !important;
  }
}


/* v6: Home page product grid and image controls */
@media (max-width: 768px) {
  body.sorfah-mobile-layout-active.sf-ml-home .products,
  body.sorfah-mobile-layout-active.sf-ml-home ul.products,
  body.sorfah-mobile-layout-active.sf-ml-home .wc-block-grid__products,
  body.sorfah-mobile-layout-active.sf-ml-home [class*="products"] ul,
  body.sorfah-mobile-layout-active.sf-ml-home [class*="product-grid"] {
    display: grid !important;
    grid-template-columns: repeat(var(--sf-ml-home-product-cols-override, 2), minmax(0, 1fr)) !important;
    gap: var(--sf-ml-home-product-gap, 12px) !important;
    align-items: stretch !important;
  }

  body.sorfah-mobile-layout-active.sf-ml-home ul.products li.product,
  body.sorfah-mobile-layout-active.sf-ml-home .products li.product,
  body.sorfah-mobile-layout-active.sf-ml-home .wc-block-grid__product,
  body.sorfah-mobile-layout-active.sf-ml-home [class*="product-card"],
  body.sorfah-mobile-layout-active.sf-ml-home [class*="product-item"] {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: var(--sf-ml-home-product-card-padding, 8px) !important;
    box-sizing: border-box !important;
  }

  body.sorfah-mobile-layout-active.sf-ml-home ul.products li.product img,
  body.sorfah-mobile-layout-active.sf-ml-home .products li.product img,
  body.sorfah-mobile-layout-active.sf-ml-home .wc-block-grid__product img,
  body.sorfah-mobile-layout-active.sf-ml-home [class*="product-card"] img,
  body.sorfah-mobile-layout-active.sf-ml-home [class*="product-item"] img {
    height: var(--sf-ml-home-product-image-height, 170px) !important;
    width: 100% !important;
    object-fit: var(--sf-ml-home-product-image-fit, cover) !important;
  }

  body.sorfah-mobile-layout-active.sf-ml-home ul.products li.product .woocommerce-loop-product__title,
  body.sorfah-mobile-layout-active.sf-ml-home .products li.product .woocommerce-loop-product__title,
  body.sorfah-mobile-layout-active.sf-ml-home .wc-block-grid__product-title {
    min-height: auto !important;
  }

  /* Make 3-4 columns tighter automatically */
  body.sorfah-mobile-layout-active.sf-ml-home {
    --sf-ml-auto-small-title: clamp(10px, 3vw, var(--sf-ml-product-title-size, 14px));
  }

  body.sorfah-mobile-layout-active.sf-ml-home ul.products li.product .woocommerce-loop-product__title,
  body.sorfah-mobile-layout-active.sf-ml-home .wc-block-grid__product-title {
    font-size: var(--sf-ml-auto-small-title) !important;
  }
}


/* v6.1: Home page product font size controls */
@media (max-width: 768px) {
  body.sorfah-mobile-layout-active.sf-ml-home ul.products li.product .woocommerce-loop-product__title,
  body.sorfah-mobile-layout-active.sf-ml-home .products li.product .woocommerce-loop-product__title,
  body.sorfah-mobile-layout-active.sf-ml-home .wc-block-grid__product-title,
  body.sorfah-mobile-layout-active.sf-ml-home ul.products li.product h2,
  body.sorfah-mobile-layout-active.sf-ml-home ul.products li.product h3 {
    font-size: var(--sf-ml-home-product-title-size, 12px) !important;
    line-height: 1.32 !important;
  }

  body.sorfah-mobile-layout-active.sf-ml-home ul.products li.product .price,
  body.sorfah-mobile-layout-active.sf-ml-home .wc-block-grid__product-price,
  body.sorfah-mobile-layout-active.sf-ml-home ul.products li.product .price *,
  body.sorfah-mobile-layout-active.sf-ml-home .wc-block-grid__product-price * {
    font-size: var(--sf-ml-home-product-price-size, 13px) !important;
    line-height: 1.25 !important;
  }

  body.sorfah-mobile-layout-active.sf-ml-home ul.products li.product .price del,
  body.sorfah-mobile-layout-active.sf-ml-home ul.products li.product .price del *,
  body.sorfah-mobile-layout-active.sf-ml-home .wc-block-grid__product-price del,
  body.sorfah-mobile-layout-active.sf-ml-home .wc-block-grid__product-price del * {
    font-size: calc(var(--sf-ml-home-product-price-size, 13px) - 1px) !important;
    opacity: .9 !important;
  }
}


/* v6.2: Force home product font size for custom Saltfah product cards */
@media (max-width: 768px) {
  body.sorfah-mobile-layout-active.sf-ml-home {
    --sf-ml-auto-small-title: var(--sf-ml-home-product-title-size, 12px) !important;
  }

  /* Product title: WooCommerce + common custom theme cards */
  body.sorfah-mobile-layout-active.sf-ml-home ul.products li.product .woocommerce-loop-product__title,
  body.sorfah-mobile-layout-active.sf-ml-home ul.products li.product .woocommerce-loop-product__title *,
  body.sorfah-mobile-layout-active.sf-ml-home .products li.product .woocommerce-loop-product__title,
  body.sorfah-mobile-layout-active.sf-ml-home .products li.product .woocommerce-loop-product__title *,
  body.sorfah-mobile-layout-active.sf-ml-home .wc-block-grid__product-title,
  body.sorfah-mobile-layout-active.sf-ml-home .wc-block-grid__product-title *,
  body.sorfah-mobile-layout-active.sf-ml-home ul.products li.product h2,
  body.sorfah-mobile-layout-active.sf-ml-home ul.products li.product h2 *,
  body.sorfah-mobile-layout-active.sf-ml-home ul.products li.product h3,
  body.sorfah-mobile-layout-active.sf-ml-home ul.products li.product h3 *,
  body.sorfah-mobile-layout-active.sf-ml-home .products li.product h2,
  body.sorfah-mobile-layout-active.sf-ml-home .products li.product h2 *,
  body.sorfah-mobile-layout-active.sf-ml-home .products li.product h3,
  body.sorfah-mobile-layout-active.sf-ml-home .products li.product h3 *,
  body.sorfah-mobile-layout-active.sf-ml-home [class*="product"] [class*="title"],
  body.sorfah-mobile-layout-active.sf-ml-home [class*="product"] [class*="title"] *,
  body.sorfah-mobile-layout-active.sf-ml-home [class*="product"] .name,
  body.sorfah-mobile-layout-active.sf-ml-home [class*="product"] .name *,
  body.sorfah-mobile-layout-active.sf-ml-home [class*="product-card"] a:not(.button):not(.add_to_cart_button),
  body.sorfah-mobile-layout-active.sf-ml-home [class*="product-item"] a:not(.button):not(.add_to_cart_button) {
    font-size: var(--sf-ml-home-product-title-size, 12px) !important;
    line-height: 1.25 !important;
  }

  /* Price: WooCommerce + common custom theme cards */
  body.sorfah-mobile-layout-active.sf-ml-home ul.products li.product .price,
  body.sorfah-mobile-layout-active.sf-ml-home ul.products li.product .price *,
  body.sorfah-mobile-layout-active.sf-ml-home .products li.product .price,
  body.sorfah-mobile-layout-active.sf-ml-home .products li.product .price *,
  body.sorfah-mobile-layout-active.sf-ml-home .wc-block-grid__product-price,
  body.sorfah-mobile-layout-active.sf-ml-home .wc-block-grid__product-price *,
  body.sorfah-mobile-layout-active.sf-ml-home [class*="product"] [class*="price"],
  body.sorfah-mobile-layout-active.sf-ml-home [class*="product"] [class*="price"] *,
  body.sorfah-mobile-layout-active.sf-ml-home .amount,
  body.sorfah-mobile-layout-active.sf-ml-home .amount *,
  body.sorfah-mobile-layout-active.sf-ml-home bdi {
    font-size: var(--sf-ml-home-product-price-size, 13px) !important;
    line-height: 1.2 !important;
  }

  body.sorfah-mobile-layout-active.sf-ml-home del,
  body.sorfah-mobile-layout-active.sf-ml-home del *,
  body.sorfah-mobile-layout-active.sf-ml-home .price del,
  body.sorfah-mobile-layout-active.sf-ml-home .price del *,
  body.sorfah-mobile-layout-active.sf-ml-home [class*="price"] del,
  body.sorfah-mobile-layout-active.sf-ml-home [class*="price"] del * {
    font-size: calc(var(--sf-ml-home-product-price-size, 13px) - 1px) !important;
    line-height: 1.2 !important;
  }

  /* Keep sale badge readable but configurable by price size */
  body.sorfah-mobile-layout-active.sf-ml-home .onsale,
  body.sorfah-mobile-layout-active.sf-ml-home .sale,
  body.sorfah-mobile-layout-active.sf-ml-home [class*="sale"] {
    font-size: max(9px, calc(var(--sf-ml-home-product-title-size, 12px) - 1px)) !important;
  }
}


/* v6.3: Mobile only section title / view all visibility controls */
@media (max-width: 768px) {
  body.sorfah-mobile-layout-active .sfcb-section-head h2,
  body.sorfah-mobile-layout-active .sfcb-section-title,
  body.sorfah-mobile-layout-active .sfbp-section-head h2,
  body.sorfah-mobile-layout-active .sfbp-section-title,
  body.sorfah-mobile-layout-active [class*="section-head"] h2,
  body.sorfah-mobile-layout-active [class*="section-title"] {
    display: var(--sf-ml-mobile-hide-section-heading, block) !important;
  }

  body.sorfah-mobile-layout-active .sfcb-section-head > a,
  body.sorfah-mobile-layout-active .sfcb-section-link,
  body.sorfah-mobile-layout-active .sfbp-section-head > a,
  body.sorfah-mobile-layout-active .sfbp-section-link,
  body.sorfah-mobile-layout-active [class*="section-head"] > a,
  body.sorfah-mobile-layout-active [class*="view-all"],
  body.sorfah-mobile-layout-active [class*="see-all"] {
    display: var(--sf-ml-mobile-hide-section-view-all, inline-flex) !important;
  }

  /* ถ้าซ่อนทั้งหัวข้อและปุ่ม ให้ลดช่องว่างหัวแบนเนอร์ */
  body.sorfah-mobile-layout-active .sfcb-section-head,
  body.sorfah-mobile-layout-active .sfbp-section-head,
  body.sorfah-mobile-layout-active [class*="section-head"] {
    min-height: 0 !important;
  }
}

/* v6.4.4: clean mobile menu panel opened by the red Menu button only */
@media (max-width: 900px) {
  body.sorfah-mobile-layout-active [data-sf-nav].is-open,
  body.sorfah-mobile-layout-active .sf-nav.is-open {
    display: none !important;
  }

  body.sorfah-mobile-layout-active .saltfah-mobile-menu-panel {
    position: fixed !important;
    left: 14px !important;
    right: 14px !important;
    z-index: 10040 !important;
    display: none !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
    padding: 12px !important;
    max-height: min(70vh, 520px) !important;
    overflow-y: auto !important;
    border: 1px solid rgba(255, 91, 66, .42) !important;
    border-radius: 20px !important;
    background: linear-gradient(145deg, rgba(13, 14, 19, .98), rgba(35, 19, 21, .98)) !important;
    backdrop-filter: blur(14px) !important;
    box-shadow: 0 22px 54px rgba(0, 0, 0, .60), 0 0 0 1px rgba(255, 255, 255, .045) inset !important;
  }

  body.sorfah-mobile-layout-active .saltfah-mobile-menu-panel.is-open {
    display: grid !important;
  }

  body.sorfah-mobile-layout-active .saltfah-mobile-menu-panel a {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-height: 48px !important;
    padding: 12px 10px !important;
    border-radius: 14px !important;
    border: 1px solid rgba(255, 255, 255, .085) !important;
    background: linear-gradient(180deg, rgba(255, 255, 255, .075), rgba(255, 255, 255, .035)) !important;
    color: #fff7e8 !important;
    font-size: 15px !important;
    font-weight: 800 !important;
    text-align: center !important;
    text-decoration: none !important;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, .08) !important;
  }

  body.sorfah-mobile-layout-active .saltfah-mobile-menu-panel a::after {
    content: none !important;
  }

  body.sorfah-mobile-layout-active .saltfah-mobile-menu-panel a:hover,
  body.sorfah-mobile-layout-active .saltfah-mobile-menu-panel a:focus {
    border-color: rgba(255, 91, 66, .55) !important;
    background: linear-gradient(135deg, rgba(255, 91, 66, .28), rgba(255, 178, 91, .13)) !important;
    outline: none !important;
  }

  html.saltfah-light-mode body.sorfah-mobile-layout-active .saltfah-mobile-menu-panel {
    border-color: rgba(201, 129, 54, .28) !important;
    background: linear-gradient(145deg, rgba(255, 252, 246, .98), rgba(255, 243, 224, .98)) !important;
    box-shadow: 0 22px 54px rgba(92, 57, 24, .18), 0 0 0 1px rgba(255, 255, 255, .72) inset !important;
  }

  html.saltfah-light-mode body.sorfah-mobile-layout-active .saltfah-mobile-menu-panel a {
    color: #2b2018 !important;
    border-color: rgba(201, 129, 54, .22) !important;
    background: rgba(255, 255, 255, .68) !important;
  }
}

/* v6.4.5: make mobile product cards match brand/flavor archive cards */
@media (max-width: 768px) {
  body.sorfah-mobile-layout-active .products,
  body.sorfah-mobile-layout-active ul.products,
  body.sorfah-mobile-layout-active .wc-block-grid__products,
  body.sorfah-mobile-layout-active .sfcb-product-grid,
  body.sorfah-mobile-layout-active .sfbp-product-grid {
    display: grid !important;
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 14px !important;
    align-items: stretch !important;
  }

  body.sorfah-mobile-layout-active ul.products li.product,
  body.sorfah-mobile-layout-active .products li.product,
  body.sorfah-mobile-layout-active .wc-block-grid__product,
  body.sorfah-mobile-layout-active .sfcb-product-card,
  body.sorfah-mobile-layout-active .sfbp-product-card,
  body.sorfah-mobile-layout-active [class*="product-card"] {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 0 14px !important;
    overflow: hidden !important;
    border-radius: 17px !important;
    border: 1px solid rgba(255,255,255,.12) !important;
    background: #11141d !important;
    box-shadow: 0 12px 26px rgba(0,0,0,.24) !important;
  }

  body.sorfah-mobile-layout-active ul.products li.product .woocommerce-LoopProduct-link,
  body.sorfah-mobile-layout-active .products li.product .woocommerce-LoopProduct-link,
  body.sorfah-mobile-layout-active .sfcb-product-card > a,
  body.sorfah-mobile-layout-active .sfbp-product-card > a {
    display: block !important;
    color: inherit !important;
    text-decoration: none !important;
  }

  body.sorfah-mobile-layout-active ul.products li.product img,
  body.sorfah-mobile-layout-active .products li.product img,
  body.sorfah-mobile-layout-active .wc-block-grid__product img,
  body.sorfah-mobile-layout-active .sfcb-product-card img,
  body.sorfah-mobile-layout-active .sfbp-product-card img,
  body.sorfah-mobile-layout-active [class*="product-card"] img {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 1 / 1 !important;
    display: block !important;
    object-fit: contain !important;
    object-position: center center !important;
    background: #f6f4ee !important;
    border-radius: 16px 16px 0 0 !important;
    margin: 0 !important;
  }

  body.sorfah-mobile-layout-active ul.products li.product .woocommerce-loop-product__title,
  body.sorfah-mobile-layout-active .products li.product .woocommerce-loop-product__title,
  body.sorfah-mobile-layout-active .wc-block-grid__product-title,
  body.sorfah-mobile-layout-active .sfcb-product-title,
  body.sorfah-mobile-layout-active .sfbp-product-title,
  body.sorfah-mobile-layout-active [class*="product-card"] h2,
  body.sorfah-mobile-layout-active [class*="product-card"] h3,
  body.sorfah-mobile-layout-active [class*="product-card"] [class*="title"] {
    display: block !important;
    padding: 12px 12px 0 !important;
    margin: 0 !important;
    min-height: 0 !important;
    color: #fff !important;
    font-size: 13px !important;
    font-weight: 850 !important;
    line-height: 1.34 !important;
    letter-spacing: -.01em !important;
    text-align: left !important;
  }

  body.sorfah-mobile-layout-active ul.products li.product .price,
  body.sorfah-mobile-layout-active .products li.product .price,
  body.sorfah-mobile-layout-active .wc-block-grid__product-price,
  body.sorfah-mobile-layout-active .sfcb-product-price,
  body.sorfah-mobile-layout-active .sfbp-product-price,
  body.sorfah-mobile-layout-active [class*="product-card"] [class*="price"] {
    display: block !important;
    padding: 9px 12px 0 !important;
    margin: 0 !important;
    color: #ffd783 !important;
    font-size: 13px !important;
    font-weight: 900 !important;
    line-height: 1.2 !important;
    text-align: left !important;
  }

  body.sorfah-mobile-layout-active ul.products li.product .button,
  body.sorfah-mobile-layout-active ul.products li.product .add_to_cart_button,
  body.sorfah-mobile-layout-active .sfcb-product-card .button,
  body.sorfah-mobile-layout-active .sfbp-product-card .button,
  body.sorfah-mobile-layout-active [class*="product-card"] .button,
  body.sorfah-mobile-layout-active [class*="product-card"] .add_to_cart_button {
    display: none !important;
  }

  html.saltfah-light-mode body.sorfah-mobile-layout-active ul.products li.product,
  html.saltfah-light-mode body.sorfah-mobile-layout-active .products li.product,
  html.saltfah-light-mode body.sorfah-mobile-layout-active .wc-block-grid__product,
  html.saltfah-light-mode body.sorfah-mobile-layout-active .sfcb-product-card,
  html.saltfah-light-mode body.sorfah-mobile-layout-active .sfbp-product-card,
  html.saltfah-light-mode body.sorfah-mobile-layout-active [class*="product-card"] {
    background: #fffaf1 !important;
    border-color: rgba(201,129,54,.24) !important;
    box-shadow: 0 12px 26px rgba(92,57,24,.12) !important;
  }

  html.saltfah-light-mode body.sorfah-mobile-layout-active ul.products li.product .woocommerce-loop-product__title,
  html.saltfah-light-mode body.sorfah-mobile-layout-active .products li.product .woocommerce-loop-product__title,
  html.saltfah-light-mode body.sorfah-mobile-layout-active .wc-block-grid__product-title,
  html.saltfah-light-mode body.sorfah-mobile-layout-active .sfcb-product-title,
  html.saltfah-light-mode body.sorfah-mobile-layout-active .sfbp-product-title,
  html.saltfah-light-mode body.sorfah-mobile-layout-active [class*="product-card"] h2,
  html.saltfah-light-mode body.sorfah-mobile-layout-active [class*="product-card"] h3,
  html.saltfah-light-mode body.sorfah-mobile-layout-active [class*="product-card"] [class*="title"] {
    color: #18120d !important;
  }

  html.saltfah-light-mode body.sorfah-mobile-layout-active ul.products li.product .price,
  html.saltfah-light-mode body.sorfah-mobile-layout-active .products li.product .price,
  html.saltfah-light-mode body.sorfah-mobile-layout-active .wc-block-grid__product-price,
  html.saltfah-light-mode body.sorfah-mobile-layout-active .sfcb-product-price,
  html.saltfah-light-mode body.sorfah-mobile-layout-active .sfbp-product-price,
  html.saltfah-light-mode body.sorfah-mobile-layout-active [class*="product-card"] [class*="price"] {
    color: #b36b12 !important;
  }
}
