/* ENTEBHOOMI home page: mobile polish pass (spacing, sizing, alignment). Presentation only. Loaded LAST. */
@media (max-width:640px){
  /* 1. Poster ads: were full-width squares (fish / chicken photos ~390px tall). Cap them to a banner. */
  body[data-page="home"] .hm-ads .deal-ad--poster{border-radius:16px}
  body[data-page="home"] .hm-ads .deal-ad--poster .deal-ad-media{
    width:100%;height:auto;aspect-ratio:16/9;max-height:210px;object-fit:cover;object-position:center}
  /* every ad slot: same rhythm */
  body[data-page="home"] .hm-ads{margin:0 0 12px;padding-left:2px;padding-right:2px}
  body[data-page="home"] .hm-ads .deal-ad{margin:0 0 10px}
  body[data-page="home"] .hm-ads .deal-ad:last-child{margin-bottom:0}
  /* automatic photo ads: slightly shorter, photo and text balanced */
  body[data-page="home"] .hd-autoad .hd-ad{min-height:118px;max-height:150px}
  body[data-page="home"] .hd-autoad .hd-ad:not(.hd-ad--brand) .hd-ad-img{min-height:118px;flex-basis:38%}

  /* 2. Quick row: 5 icons fit across, labels wrap to 2 lines instead of "Refer & E..." */
  body[data-page="home"] #homeQuick .hq-item{flex:1 0 68px!important;min-width:68px!important;max-width:84px!important;padding:2px 2px!important}
  body[data-page="home"] #homeQuick .hq-lb{white-space:normal!important;overflow:hidden;text-overflow:clip;
    display:-webkit-box!important;-webkit-line-clamp:2;-webkit-box-orient:vertical;
    font-size:10.5px;line-height:1.2;min-height:2.4em;word-break:normal}
  body[data-page="home"] #homeQuick .hq-ic{width:48px;height:48px;margin-bottom:6px}

  /* 3. Panels: one consistent gap between sections */
  body[data-page="home"] .deals-panel,
  body[data-page="home"] .hm-block,
  body[data-page="home"] .hl-panel{margin-bottom:12px}
  body[data-page="home"] #neonMore{margin:4px auto 12px}

  /* 4. Featured Today: bigger thumbnails and readable text */
  body[data-page="home"] #featuredToday .ft-pic{width:50px;height:50px;flex-basis:50px}
  body[data-page="home"] #featuredToday .ft-name{font-size:.78rem;max-width:104px}
  body[data-page="home"] #featuredToday .ft-price{font-size:.8rem}
  body[data-page="home"] #featuredToday .ft-chip{padding:8px 12px 8px 8px}

  /* 5. Top Deals: a little more room for the price row and the + button */
  body[data-page="home"] #featuredDeals .deals-track .card-price{font-size:.95rem!important}
  body[data-page="home"] #featuredDeals .deals-track .card-name{line-height:1.25!important}

  /* 6. Real estate / listing rails: cards a bit wider, "See all" tile same height, not a big empty block */
  body[data-page="home"] .hl-card{flex-basis:176px}
  body[data-page="home"] .hl-title{min-height:2.6em}
  body[data-page="home"] .hl-more{flex:0 0 92px;align-self:stretch;gap:8px;font-weight:700;font-size:.82rem;text-align:center}
  body[data-page="home"] .hl-more span{display:grid;place-items:center;width:34px;height:34px;border-radius:50%;
    background:var(--eb57-surface-ffffff,#fff);border:1.5px solid var(--eb57-border-bfd6c6,#BFD6C6);font-size:1.2rem}

  /* 7. Footer on the home page: tighter, and clear of the bottom nav */
  body[data-page="home"] #siteFooter{margin-top:20px}
  body[data-page="home"] #siteFooter{padding-bottom:calc(84px + env(safe-area-inset-bottom,0px))}
}

/* ===== round 2 (from phone screenshots) ===== */
@media (max-width:640px){
  /* gap between the catalog circles and the banner: the reserved 46px for the hidden "Shop by Catalog" row */
  body[data-page="home"] .hd-catwrap,
  body[data-page="home"] .hd-catwrap.hd-reserve{min-height:0!important;margin:0!important;padding:0!important}
  body[data-page="home"] .hd-catwrap:empty,
  body[data-page="home"] #featuredCatalogs[hidden]{display:none!important}
  body[data-page="home"] #homeCats.hm-cats{padding-bottom:4px!important;margin-bottom:0!important}
  html body[data-page="home"] #heroCarousel{margin-top:4px!important;margin-bottom:10px!important}

  /* Shop / Offers / Coupons / Categories / Brands: fit 5 across, shorter tiles, labels never cut */
  body[data-page="home"] #neonQuick{margin:0 auto 10px}
  body[data-page="home"] #neonQuick .nq-row{gap:6px}
  body[data-page="home"] #neonQuick .nq-item{padding:8px 1px 7px!important;gap:5px!important;border-radius:16px!important;min-width:0}
  body[data-page="home"] #neonQuick .nq-item>span:last-child{
    font-size:10.5px!important;line-height:1.15!important;font-weight:700;letter-spacing:-.2px;
    max-width:100%;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block}
  body[data-page="home"] #neonQuick .nq-ic{width:40px!important;height:40px!important;border-radius:13px!important}
  body[data-page="home"] #neonQuick .nq-ic svg{width:22px!important;height:22px!important}

  /* ads: same side margin as the panels (the old 16px padding stacked on top of the page padding) */
  body[data-page="home"] .hm-ads,
  body[data-page="home"] #homeAds0,body[data-page="home"] #homeAds1,body[data-page="home"] #homeAds2{
    padding-left:0!important;padding-right:0!important;margin:0 0 10px!important}
  body[data-page="home"] .hd-autoad,
  body[data-page="home"] .hd-show{margin-left:0!important;margin-right:0!important;padding-left:0!important;padding-right:0!important}
  body[data-page="home"] .deal-ad-row{padding:0!important}
  body[data-page="home"] .deal-ad-row>.deal-ad{flex-basis:94%!important}
  body[data-page="home"] .hm-ads:empty{display:none!important;margin:0!important}
}

/* ===== footer (home page, phones): clean, compact, professional ===== */
@media (max-width:640px){
  html body[data-page="home"] #siteFooter{
    margin:16px 12px calc(84px + env(safe-area-inset-bottom,0px))!important;width:auto!important;
    background:var(--eb57-surface-ffffff,#fff)!important;border:1px solid var(--eb57-border-e6e8f2,#E6E8F2)!important;border-radius:20px!important;
    box-shadow:0 6px 20px -12px var(--eb57-shadow-1e1b4b-250000,rgba(30,27,75,.25))!important;overflow:hidden;padding:0!important;
    border-top:1px solid var(--eb57-border-e6e8f2,#E6E8F2)!important}
  html body[data-page="home"] #siteFooter::before{display:none!important}
  #siteFooter .footer-top{display:flex!important;flex-direction:column;gap:0!important;padding:18px 16px 6px!important;text-align:left!important}
  #siteFooter .footer-col{padding:0!important;border:0!important}
  /* brand */
  #siteFooter .footer-brand-head{display:flex;align-items:center;gap:12px;margin:0 0 14px!important;padding-bottom:14px;border-bottom:1px solid var(--eb57-border-eef0f7,#EEF0F7);justify-content:flex-start!important}
  #siteFooter .footer-brand-head img{width:44px;height:44px;border-radius:12px;box-shadow:0 2px 8px var(--eb57-shadow-000000-120000,rgba(0,0,0,.12))}
  #siteFooter .footer-brand-head span{font-size:1.1rem!important;font-weight:800;color:var(--eb57-text-14111c,#14111c)!important}
  #siteFooter .footer-tagline{margin:2px 0 0!important;font-size:.72rem!important;color:var(--eb57-text-5b5b7a,#5b5b7a)!important}
  #siteFooter .footer-about,#siteFooter .footer-quote{display:none!important}
  /* contact */
  #siteFooter .footer-col h4{display:none!important}
  #siteFooter .footer-contact-list{display:flex;flex-direction:column;gap:10px!important;align-items:stretch!important;margin:0 0 14px}
  #siteFooter .footer-contact-item{display:flex;align-items:flex-start;gap:10px;font-size:.8rem!important;line-height:1.4;color:var(--eb57-text-33334d,#33334d)!important;opacity:1!important;text-align:left}
  #siteFooter .footer-contact-item svg{flex:0 0 28px;width:28px!important;height:28px!important;padding:6px;margin:0!important;border-radius:9px;background:var(--eb57-surface-eef0ff,#EEF0FF);color:var(--eb57-text-4f46e5,#4f46e5)!important;box-sizing:border-box}
  #siteFooter .footer-contact-item a{color:inherit!important;word-break:break-all}
  /* links as one tidy row */
  #siteFooter .footer-links{display:flex!important;flex-wrap:wrap;justify-content:center;gap:4px 0;padding:12px 0!important;border-top:1px solid var(--eb57-border-eef0f7,#EEF0F7)!important}
  #siteFooter .footer-links a{display:inline-block!important;margin:0!important;padding:4px 14px!important;background:none!important;border-radius:0!important;
    font-size:.8rem!important;font-weight:600;color:var(--eb57-text-3730a3,#3730a3)!important;opacity:1!important;border-left:1px solid var(--eb57-border-daddee,#DADDEE);width:auto!important}
  #siteFooter .footer-links a:first-of-type{border-left:0}
  /* social */
  #siteFooter #footerSocialCol{padding:4px 0 14px!important}
  #siteFooter .footer-social{display:flex;justify-content:center!important;gap:12px!important}
  #siteFooter .footer-social a{width:38px!important;height:38px!important;border-radius:12px!important;margin:0!important}
  /* bottom bar */
  #siteFooter .footer-bottom{border-top:1px solid var(--eb57-border-eef0f7,#EEF0F7)!important;background:var(--eb57-surface-f7f8fd,#F7F8FD)}
  #siteFooter .footer-bottom-inner{padding:12px 14px!important;justify-content:center!important;text-align:center;font-size:.7rem!important;color:var(--eb57-text-6b6b88,#6b6b88)!important;opacity:1!important}
  #siteFooter .footer-bottom-links{display:none!important}
}

/* ===== footer v2: compact (about 190px tall on a phone) ===== */
@media (max-width:640px){
  html body[data-page="home"] footer.site-footer{margin:12px 12px calc(76px + env(safe-area-inset-bottom,0px))!important;padding:0!important;border-radius:16px!important}
  html body footer.site-footer .footer-top{padding:12px 14px 4px!important;display:flex!important;flex-direction:column!important;gap:0!important}
  /* row 1: brand on the left, social icons on the right */
  html body footer.site-footer .footer-brand{display:flex!important;flex-direction:row!important;align-items:center!important;justify-content:space-between!important;gap:8px!important}
  html body footer.site-footer .footer-brand-head{flex:1 1 auto;min-width:0;margin:0!important;padding:0!important;border:0!important;gap:10px!important}
  html body footer.site-footer .footer-brand-head img{width:36px!important;height:36px!important;border-radius:10px!important}
  html body footer.site-footer .footer-brand-head span{font-size:.95rem!important;line-height:1.15!important}
  html body footer.site-footer .footer-tagline{font-size:.64rem!important;margin:1px 0 0!important;line-height:1.2!important}
  html body footer.site-footer #footerSocialCol{flex:0 0 auto;padding:0!important;margin:0!important}
  html body footer.site-footer .footer-social{gap:6px!important;flex-wrap:nowrap!important}
  html body footer.site-footer .footer-social a{width:30px!important;height:30px!important;border-radius:9px!important}
  /* row 2: contact, small */
  html body footer.site-footer #footerContactCol{padding:10px 0 2px!important;margin-top:10px;border-top:1px solid var(--eb57-border-eef0f7,#EEF0F7)!important}
  html body footer.site-footer .footer-contact-list{gap:6px!important;margin:0!important}
  html body footer.site-footer .footer-contact-item{font-size:.74rem!important;line-height:1.3!important;gap:8px!important;align-items:center!important}
  html body footer.site-footer .footer-contact-item svg{flex:0 0 22px!important;width:22px!important;height:22px!important;padding:5px!important;border-radius:7px!important}
  /* row 3: links inline on one line */
  html body footer.site-footer .footer-links{flex-wrap:nowrap!important;padding:8px 0 8px!important;margin-top:4px;justify-content:space-around!important}
  html body footer.site-footer .footer-links h4{display:none!important}
  html body footer.site-footer .footer-links a{font-size:.74rem!important;padding:2px 10px!important;white-space:nowrap}
  /* bottom bar: no more empty block under the copyright */
  html body footer.site-footer .footer-bottom,
  html body.site-has-continue-bar footer.site-footer .footer-bottom{padding:0!important}
  html body footer.site-footer .footer-bottom-inner{padding:8px 12px!important;font-size:.64rem!important}
}

/* ===== alignment fixes: footer brand + social row on phones ===== */
/* `#siteFooter .footer-social a{38px}` (id selector) was beating the compact 30px rule, so the three icons
   pushed past the card edge and the WhatsApp icon got clipped. */
@media (max-width:640px){
  /* root cause of the overflow: the column was flex-wrap:wrap, so its single line sized itself to the widest
     item (the contact text, ~323px) instead of the card width. nowrap makes every row fit the card. */
  html body footer#siteFooter .footer-top{flex-wrap:nowrap!important}
  html body footer#siteFooter .footer-brand{min-width:0}
  html body footer#siteFooter .footer-brand-head{min-width:0}
  html body footer#siteFooter .footer-brand-text{min-width:0}
  html body footer#siteFooter #footerSocialCol{flex:0 0 auto;max-width:100%}
  html body footer#siteFooter .footer-social{gap:6px!important;flex-wrap:nowrap!important;justify-content:flex-end!important}
  html body footer#siteFooter .footer-social a{width:30px!important;height:30px!important;border-radius:9px!important;flex:0 0 30px}
}
