/* ---------- footer ---------- */

/* Give "Get in touch" more room — it holds the longest single line of
   text in the footer (the email address) — at the expense of "Baby
   Ocean" and "Policies & Terms", which only hold a couple of short
   links each and don't need as much width. */
html body.bo-storefront .footer.bo-ft .bg5 {
  grid-template-columns: 1.3fr .75fr .75fr 1.1fr 1.7fr;
}

/* .bt collides with the unrelated "button text" class used elsewhere
   (e.g. .bo-kact .bt), which sets display:flex — that squeezes this
   contact text into roughly half the column's actual width, which is
   what was forcing "info@babyocean.com.pk" to wrap. Block layout lets
   it use the column's full width as intended. */
html body.bo-storefront .footer.bo-ft .bct .bt {
  display: block;
  overflow-wrap: break-word;
}

/* Column headings */
html body.bo-storefront .footer.bo-ft .bc h4 {
  font-size: 19px !important;
  line-height: 1.3 !important;
}

/* Link gap — the column's flex gap plus each link's own bottom margin
   were stacking (13px + 9px), so the real page-link spacing needs both
   addressed, not just the flex gap. */
html body.bo-storefront .footer.bo-ft .bc {
  gap: 11px;
}
html body.bo-storefront .footer.bo-ft .bc > a {
  margin-bottom: 0;
}

/* Contact value (phone/email/hours/address) centered on its icon —
   belt-and-braces on top of .bct > a's own align-items:center, since
   the .bt display:flex bug above (fixed to block) was also throwing
   this off before. */
html body.bo-storefront .footer.bo-ft .bct > a,
html body.bo-storefront .footer.bo-ft .bct > div {
  align-items: center;
}

/* ---------- homepage: hero USP row ---------- */

/* At <=360px specifically, typography.css/design.css's own narrowest
   breakpoint drops the homepage USP row (after the hero) to a single
   column — 4 stacked rows instead of 2x2 everywhere else (375px and
   up already renders 2 columns correctly, so this is a one-off gap
   at the very narrowest width, not a general mobile issue). Each
   .h8-tr card already has min-width:0 + its own compact padding
   (set elsewhere for this exact breakpoint), so 2 columns fit here
   without any text overflow — same as at 375px. */
@media (max-width: 360px) {
  html body.bo-storefront .wrap.bo-ttopw .h8-trust {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }
}
/* Below ~330px the longest card ("Nationwide Delivery / 3-5 working
   days across Pakistan") no longer fits 2-up without overflowing by a
   few px — fall back to 1 column only for that sliver of very old/rare
   devices (e.g. first-gen iPhone SE, 320px). */
@media (max-width: 330px) {
  html body.bo-storefront .wrap.bo-ttopw .h8-trust {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

/* ---------- category page: subcategory card images ---------- */

/* design.css deliberately uses object-fit:contain (+ padding) for these
   cards, because the built-in category images are pre-made cutouts
   (isolated product photos on a transparent background) meant to be
   shown whole, not cropped. A category image uploaded through the
   admin panel is an ordinary photo, not a cutout — object-fit:contain
   shrinks it to fit with empty space on the sides whenever it isn't
   already square (e.g. a portrait photo), instead of filling the card
   like every other thumbnail on the site. .subcat-native marks that
   fallback path (see archive-product.php) so it can be treated as a
   normal photo instead, without touching the real cutouts' look. No
   fill colour behind it: admin-uploaded images are expected to have a
   transparent background too, so a visible background here would just
   double it up the same way product photo cards used to. This holds at
   every breakpoint since only object-fit/padding change here —
   width/height still come from design.css's own responsive .subcat img
   rules. */
html body.bo-storefront .bo-stage-subcats > .subcat img.subcat-native.subcat-native {
  object-fit: cover !important;
  padding: 0 !important;
  background: transparent !important;
}

/* ---------- shop/category: sort dropdown, top-right of the grid ---------- */

/* design.css deliberately hides the whole toolbar on desktop ("keep the
   filter sidebar without a results toolbar"), which left sort with
   nowhere to live except as radio options disguised as category
   checkboxes inside the rail (now removed — see
   babyocean_render_filter_rail()). Re-show the toolbar here, but only
   the product count + sort dropdown: the mobile "Filters" toggle stays
   hidden since the rail is already visible on desktop. */
@media (min-width: 1101px) {
  html body.bo-storefront .c9-shell .c9-tools {
    display: flex !important;
    align-items: center;
    gap: 14px;
    position: static;
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
  }
  html body.bo-storefront .c9-tools .c9-mobfilter {
    display: none !important;
  }
  html body.bo-storefront .c9-tools .c9-sort {
    margin-left: auto;
  }
}

/* The dropdown itself — was only ever designed for the cramped mobile
   toolbar; this matches the site's standard input/select look
   (border, radius, focus color) instead of browser-default styling. */
html body.bo-storefront .catalog-sort {
  appearance: none;
  -webkit-appearance: none;
  height: 44px;
  min-width: 190px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 36px 0 16px;
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23697A77' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 12px center;
  background-size: 16px;
  cursor: pointer;
  transition: border-color .2s;
}
html body.bo-storefront .catalog-sort:hover {
  border-color: var(--mint-light, var(--mint));
}
html body.bo-storefront .catalog-sort:focus-visible {
  outline: none;
  border-color: var(--mint);
  box-shadow: 0 0 0 3px var(--mint-50);
}

/* ---------- shop/category: filter rail typography + spacing ---------- */

/* Scoped through .c9-rail (not just the bare class) so these reliably
   win over typography.css's own blanket coverage of .c9-ck/.c9-price-num
   (both load after this file, and tie on specificity otherwise — the
   extra .c9-rail ancestor is what actually breaks the tie). */
html body.bo-storefront .c9-rail .c9-rail-hd b {
  font-size: 15px !important;
}
html body.bo-storefront .c9-rail .c9-grp {
  padding: 17px 0 !important;
}
html body.bo-storefront .c9-rail .c9-grp > summary,
html body.bo-storefront .c9-rail .bo-filter-stage > summary {
  font-size: 13px !important;
}
html body.bo-storefront .c9-rail .c9-grp .body {
  gap: 11px !important;
  padding-top: 14px !important;
}
html body.bo-storefront .c9-rail .c9-ck {
  font-size: 13px !important;
}
html body.bo-storefront .c9-rail .c9-ck .n {
  font-size: 11.5px !important;
}
html body.bo-storefront .c9-rail .c9-price-field,
html body.bo-storefront .c9-rail .c9-price-num {
  font-size: 12.5px !important;
}
html body.bo-storefront .c9-rail .c9-price-vals {
  font-size: 12px !important;
}

/* Touch previews share the desktop alternate photo, without hiding link targets. */
html body.bo-storefront .h8-prod .ph.bo-peek .bo-alt {opacity:1!important;}
html body.bo-storefront .h8-prod .ph.bo-peek img:not(.bo-alt):not(.bo-hover-img) {opacity:0!important;}
#quickModal .modalcard {height:auto;animation:none;}
.bo-quick-loading {min-height:0;}
.bo-quick-loading img {object-fit:contain;border-radius:12px;}
.bo-quick-loading [role=status] {color:var(--muted);}

/* Customer exchange fields use the same mint affordance as the storefront. */
.dbx-modal .f select,.dbx-modal .f textarea {border:1.5px solid #49B8A6!important;background:#fff;border-radius:10px;}
.dbx-modal .f select:focus,.dbx-modal .f textarea:focus {outline:2px solid #BFE9E1;outline-offset:2px;border-color:#1F6E61!important;}
.dbx-modal input[type=checkbox] {accent-color:#49B8A6;}
.dbx-modal input[type=checkbox]:focus-visible {outline:2px solid #49B8A6;outline-offset:3px;}
.dbx-profile-details .select2-container {width:100%!important;min-width:0;}
.dbx-profile-details .select2-selection--single {height:48px;border:1.5px solid #CFE6E0;border-radius:12px;}
.dbx-profile-details .select2-selection--single .select2-selection__rendered {line-height:45px;padding:0 36px 0 14px;}
.dbx-profile-details .select2-selection--single .select2-selection__arrow {height:46px;}
.bo-product-back {display:inline-flex;align-items:center;gap:8px;min-height:44px;margin:0 0 12px;color:#1F6E61;font-weight:700;text-decoration:none;}
.bo-product-back:hover {text-decoration:underline;}
.bo-product-back:focus-visible {outline:2px solid #49B8A6;outline-offset:3px;}
.h8-prod:hover .ph.has-hover-img .bo-hover-img,.h8-prod .ph.has-hover-img.bo-peek .bo-hover-img {opacity:1!important;}
.h8-prod:hover .ph.has-hover-img img:not(.bo-hover-img),.h8-prod .ph.has-hover-img.bo-peek img:not(.bo-hover-img) {opacity:0!important;}
.bo-eov.bo-kit-quick .bo-emod {height:auto;}

@media (max-width:760px) {
  html body.bo-storefront .product-detail .gallerybox {width:100%;min-width:0;}
  html body.bo-storefront .product-detail .mainphoto {
    width:100%;height:auto!important;min-height:0!important;aspect-ratio:1/1;padding:0!important;
  }
  html body.bo-storefront .product-detail .mainphoto #pdpMainImg {
    width:100%!important;height:100%!important;max-height:none!important;object-fit:contain!important;padding:0!important;
  }
  html body.bo-storefront .c9-shell .c9-tools {
    display:flex!important;flex-direction:row!important;align-items:center;flex-wrap:wrap;gap:6px 8px!important;padding:8px!important;border-radius:12px!important;
  }
  html body.bo-storefront .c9-tools .c9-mobfilter {width:auto!important;flex:0 0 auto;height:44px!important;min-height:44px;padding:0 12px!important;}
  html body.bo-storefront .c9-tools .c9-sort {order:2!important;flex:1;min-width:0;width:auto!important;margin-left:0!important;}
  html body.bo-storefront .c9-tools .catalog-sort {width:100%;height:44px!important;min-width:0;font-size:13px!important;padding-left:12px;}
  html body.bo-storefront .c9-tools .c9-count {order:3!important;flex-basis:100%;margin:0!important;font-size:12px!important;line-height:1.3!important;}
}
