/* =========================================================
   EDIUSFA — Mobile polish (phones first)
   @version 1.9.25
   ========================================================= */

/* Safe area + prevent horizontal overflow */
html, body{overflow-x:hidden;}
img, video, iframe{max-width:100%;height:auto;}

@media (max-width:760px){
  /* ---- Spacing ---- */
  .pdp-container, .home-section, .section{padding-inline:14px !important;}
  .home-section, .ds-section, section.section{padding-block:28px 24px;}
  .section-head, .home-section-head, .pdp-section-head{
    flex-wrap:wrap; gap:8px; margin-bottom:14px !important;
  }
  .section-head h2, .home-section-head h2{font-size:18px !important; line-height:1.35;}
  .section-head p, .home-section-head p{font-size:12.5px !important;}

  /* ---- Header ---- */
  .comp-util-bar{
    font-size:10.5px; padding:6px 12px; gap:10px;
    overflow-x:auto; white-space:nowrap; -webkit-overflow-scrolling:touch;
  }
  .comp-util-bar .comp-rec{flex-shrink:0;}
  .comp-header{
    padding:10px 12px !important;
    gap:8px !important;
    min-height:56px !important;
  }
  .comp-logo{gap:6px !important; max-width:46%;}
  .comp-logo-name{font-size:13.5px !important;}
  .comp-logo-sub{display:none !important;}
  .comp-logo-img{height:32px !important; max-width:120px !important;}
  .comp-logo-mark{width:28px !important; height:28px !important; font-size:10px !important;}
  .comp-header-nav{display:none !important;}
  .comp-header-search{display:none !important;} /* use mobile search toggle */
  .header-search-toggle{display:flex !important;}
  .comp-header-actions{gap:4px !important; margin-right:0 !important;}
  .comp-header-actions .icon-btn{
    width:36px !important; height:36px !important;
    padding:0 !important;
  }
  .hdr-action-label{display:none !important;}
  .mega-menu{display:none !important;}

  /* Alternate header styles */
  .ef-hdr-editorial .ef-hdr-nav-center,
  .ef-hdr-command .ef-cmd-nav,
  .ef-hdr-floating .ef-float-nav{display:none !important;}
  .ef-hdr-command .ef-cmd-search{display:none !important;}
  .ef-hdr-digikala .ef-dk-util{display:none !important;}
  .ef-hdr-digikala .ef-dk-main{flex-wrap:wrap; gap:12px; padding:12px;}
  .ef-hdr-digikala .ef-dk-search{max-width:100% !important; order:3; width:100%;}
  .ef-hdr-digikala .ef-dk-action span{display:none;}
  .ef-hdr-twotier .ef-tt-top{flex-wrap:wrap; gap:12px; padding:12px;}
  .ef-hdr-twotier .ef-tt-search{max-width:100% !important; order:3; width:100%;}
  .ef-hdr-twotier .ef-tt-action-txt{display:none;}
  .ef-hdr-floating{padding:10px 12px;}
  .ef-float-bar{padding:8px 12px !important; gap:10px !important;}

  /* ---- Hero ---- */
  .hero{padding:24px 0 28px !important;}
  .hero-copy h1{font-size:22px !important; max-width:100% !important;}
  .hero-copy > p{font-size:13.5px !important; margin-bottom:16px !important;}
  .hero-search{
    flex-direction:column !important;
    align-items:stretch !important;
    gap:10px !important;
    padding:12px !important;
    border-radius:14px !important;
  }
  .hero-search .btn{width:100%; justify-content:center;}
  .hero-suggest{gap:6px; margin-top:10px;}
  .hero-suggest a{font-size:11px; padding:5px 10px;}

  /* ---- Quick cats ---- */
  .quick-cats-grid{
    display:flex !important;
    overflow-x:auto !important;
    gap:10px !important;
    padding-bottom:8px;
    scroll-snap-type:x mandatory;
    -webkit-overflow-scrolling:touch;
  }
  .quick-cats-grid .cat-card{
    flex:0 0 100px !important;
    scroll-snap-align:start;
  }

  /* ---- Stats ---- */
  .stats-row{gap:10px !important;}
  .stats-row .stat-card, .stats-row > *{padding:14px 12px !important;}

  /* ---- Product cards (homepage scroll) ---- */
  .prod-row{
    display:flex !important;
    overflow-x:auto !important;
    gap:12px !important;
    padding-bottom:10px !important;
    scroll-snap-type:x mandatory;
    -webkit-overflow-scrolling:touch;
    scrollbar-width:none;
  }
  .prod-row::-webkit-scrollbar{display:none;}
  .prod-row .prod-card{
    flex:0 0 158px !important;
    width:158px !important;
    max-width:158px !important;
    scroll-snap-align:start;
  }
  .prod-card h4, .prod-card .prod-body h4{
    font-size:12.5px !important;
    line-height:1.4 !important;
    -webkit-line-clamp:2;
    display:-webkit-box;
    -webkit-box-orient:vertical;
    overflow:hidden;
  }
  .prod-card .price, .prod-foot .price{font-size:12.5px !important;}
  .prod-card .add-btn{width:30px !important; height:30px !important; font-size:16px !important;}

  /* Shop/archive 2-col */
  .product-grid, .archive-grid, .woocommerce ul.products{
    grid-template-columns:repeat(2, minmax(0,1fr)) !important;
    gap:10px !important;
  }

  /* ---- Track / software path ---- */
  .track-cards-row{grid-template-columns:1fr !important; gap:12px !important;}

  /* ---- Season ---- */
  .season-grid{grid-template-columns:1fr !important; gap:12px !important;}

  /* ---- Why / proof / articles ---- */
  .why-grid{grid-template-columns:1fr 1fr !important; gap:10px !important;}
  .review-row, .article-row{grid-template-columns:1fr !important;}
  .proof-stats-strip{padding:14px !important; gap:12px !important;}
  .psx-score b{font-size:22px !important;}
  .cta-banner{padding:20px 16px !important; flex-direction:column; align-items:stretch !important; text-align:center;}
  .cta-banner-left{flex-direction:column;}
  .cta-banner-actions{justify-content:center;}

  /* ---- Footer ---- */
  .comp-footer{padding-bottom:12px;}
  .comp-footer-grid{grid-template-columns:1fr !important; gap:22px !important;}
  .comp-footer-bottom{flex-direction:column; gap:8px; text-align:center; font-size:11.5px;}

  /* ---- Sticky bottom nav safe area ---- */
  body{padding-bottom:calc(64px + env(safe-area-inset-bottom, 0px)) !important;}
  .mobile-sticky-nav{
    padding-bottom:calc(8px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* ---- Chatbot above bottom nav ---- */
  .chatbot-fab, .chat-fab, [class*="chatbot"] button.fab,
  .ef-chat-trigger, #chatbotToggle{
    bottom:calc(72px + env(safe-area-inset-bottom, 0px)) !important;
  }

  /* ---- Product detail ---- */
  .pdp-hero, .pdp-layout, .product-layout{
    grid-template-columns:1fr !important;
  }
  .preview-stage{min-height:220px !important; border-radius:12px !important;}
  .pdp-tabs{overflow-x:auto; flex-wrap:nowrap !important; -webkit-overflow-scrolling:touch;}
  .pdp-tabs a, .pdp-tabs button{flex-shrink:0; white-space:nowrap;}

  /* ---- Cart / checkout ---- */
  .woocommerce-cart-form, .cart-layout, .checkout-layout{
    grid-template-columns:1fr !important;
  }
  .woocommerce table.shop_table{display:block; overflow-x:auto;}

  /* ---- Buttons touch size ---- */
  .btn, .button, button.btn-primary{
    min-height:42px;
  }
}

@media (max-width:420px){
  .prod-row .prod-card{flex:0 0 148px !important; width:148px !important;}
  .why-grid{grid-template-columns:1fr !important;}
  .hero-copy h1{font-size:20px !important;}
  .comp-logo{max-width:42%;}
}
