/* JUJU v1.4.4 — visual refinements; requires header-v143.css. */
/* Keep the old controls in DOM; hide only the original top strip when our contacts exist. */
#top:has(.juju-top-details) {padding:0!important; min-height:0;}
#top:has(.juju-top-details) > .container {display:block!important;}
#top:has(.juju-top-details) > .container > :not(.juju-top-details) {display:none!important;}
#top .juju-top-details {display:flex; justify-content:space-between; align-items:center; gap:8px 20px; padding:6px 0; font-size:14px; line-height:1.4;}
#top .juju-top-details > :is(a,span) {min-height:28px;}
#top .juju-top-details a[href*="wa.me"] {color:#176c49!important; font-weight:650;}
#top .juju-top-details a:hover {text-decoration:underline;}
header {padding:12px 0;}
header .row:has(#logo):has(#search):has(#cart) {grid-template-columns:minmax(130px,.85fr) minmax(180px,2fr) minmax(155px,1fr);gap:16px;}
#search .form-control {font-size:15px;}
#menu:has(.juju-nav-extra) .navbar-nav {gap:4px;}
#menu:has(.juju-nav-extra) .navbar-nav > .nav-item > .nav-link {display:block;padding:10px 16px;font-size:14px;line-height:1.45;border-radius:8px;}
/* Preserve native quick-cart form, buttons and AJAX. */
#cart .dropdown-menu {width:min(520px,calc(100vw - 24px));min-width:0;max-height:min(72vh,560px);overflow:auto;overscroll-behavior:contain;background:var(--juju-white);padding:12px;}
#cart .dropdown-menu .table {width:100%;font-size:13px;--bs-table-bg:transparent;--bs-table-striped-bg:#faf2f4;}
#cart .dropdown-menu .table td {vertical-align:middle;padding:8px 5px;}
#cart .dropdown-menu .table td:is(.text-end,.text-right),#cart .dropdown-menu .table td:nth-last-child(2),#cart .dropdown-menu .table td:last-child {white-space:nowrap;}
#cart .dropdown-menu .table td a {white-space:normal;overflow-wrap:anywhere;}
#cart .dropdown-menu img {width:58px;height:58px;object-fit:cover;border-radius:8px;}
#cart .dropdown-menu .btn {min-height:32px;min-width:32px;padding:5px 8px;border-radius:8px;}
#cart .dropdown-menu :is(p,div).text-end > a {display:inline-flex;align-items:center;gap:5px;padding:8px 10px;border-radius:8px;text-decoration:none;}
#cart .dropdown-menu a[href*="checkout/checkout"] {background:var(--juju-rose);color:#fff!important;font-weight:650;}
#cart .dropdown-menu a[href*="checkout/checkout"]:hover {background:#702b48;}
/* Reduce the excess blank space before the new footer only on the homepage. */
#common-home.juju-home {padding-bottom:8px!important;}
#common-home .juju-contact {margin-bottom:0;}
@media(max-width:767px){
  #top .juju-top-details {display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 10px;padding:6px 0;font-size:12px;}
  #top .juju-top-details > :is(a,span) {min-height:24px;white-space:normal;}
  #top .juju-top-details > :nth-child(even) {justify-self:end;}
  header {padding:9px 0;}
  header .row:has(#logo):has(#search):has(#cart) {grid-template-columns:minmax(0,1fr) minmax(0,1.25fr);gap:9px;}
  #menu:has(.juju-nav-extra) .navbar-nav > .nav-item > .nav-link {padding:10px 12px;}
  #cart .dropdown-menu {width:min(360px,calc(100vw - 24px));padding:6px;}
  #cart .dropdown-menu .table {font-size:11px;}
  #cart .dropdown-menu .table td {padding:6px 3px;}
  #cart .dropdown-menu img {width:40px;height:40px;}
  #cart .dropdown-menu .btn {min-width:28px;min-height:28px;padding:4px;}
}
@media(max-width:350px){#top .juju-top-details {font-size:11px;gap:3px 6px;}}

/* JUJU v1.4.7d — mini-cart layout only. Keep native cart controls and AJAX. */
#cart .dropdown-menu {
  box-sizing:border-box;
  width:min(560px,calc(100vw - 24px));
  min-width:0!important;
  max-width:calc(100vw - 24px)!important;
  padding:12px;
  white-space:normal;
}
#cart .dropdown-menu > li,
#cart .dropdown-menu > li > div,
#cart .dropdown-menu > div,
#cart .dropdown-menu .table-responsive,
#cart .dropdown-menu form {
  min-width:0!important;
  max-width:100%;
  box-sizing:border-box;
}
#cart .dropdown-menu .table {
  width:100%!important;
  min-width:0!important;
  max-width:100%;
  table-layout:fixed;
  margin-bottom:8px;
}
#cart .dropdown-menu .table td {
  min-width:0!important;
  padding:8px 5px;
  overflow-wrap:anywhere;
  white-space:normal;
}
/* Native product rows: image, name, quantity, price, remove. */
#cart .dropdown-menu .table tr:has(> td:nth-child(5)) > td:nth-child(1) {width:72px;}
#cart .dropdown-menu .table tr:has(> td:nth-child(5)) > td:nth-child(2) {width:auto;white-space:normal!important;overflow-wrap:anywhere;}
#cart .dropdown-menu .table tr:has(> td:nth-child(5)) > td:nth-child(3) {width:40px;white-space:nowrap;}
#cart .dropdown-menu .table tr:has(> td:nth-child(5)) > td:nth-child(4) {width:92px;white-space:nowrap;}
#cart .dropdown-menu .table tr:has(> td:nth-child(5)) > td:nth-child(5) {width:48px;text-align:center;white-space:nowrap;}
#cart .dropdown-menu .table tr:has(> td:nth-child(5)) > td:nth-child(2) :is(a,small,span) {white-space:normal!important;overflow-wrap:anywhere;}
#cart .dropdown-menu .table tr:has(> td:nth-child(5)) > td:nth-child(2) small {display:block;}
#cart .dropdown-menu .table tr:has(> td:nth-child(5)) > td:first-child img {
  display:block;width:58px!important;height:58px!important;max-width:100%!important;object-fit:cover;padding:2px;
}
#cart .dropdown-menu .table tr:has(> td:nth-child(5)) > td:last-child .btn {
  display:inline-flex;align-items:center;justify-content:center;
  width:34px;min-width:34px;max-width:100%;height:34px;min-height:34px;padding:0!important;
}
/* Totals table: leave ample room for labels and keep monetary values intact. */
#cart .dropdown-menu .table tr:has(> td:nth-child(2)):not(:has(> td:nth-child(3))) > td:last-child {width:112px;white-space:nowrap;}
#cart .dropdown-menu .table tr:has(> td:nth-child(2)):not(:has(> td:nth-child(3))) > td:first-child {white-space:normal;}
#cart .dropdown-menu :is(p,div).text-end:has(> a[href*="checkout/checkout"]) {display:flex;flex-wrap:wrap;gap:8px;justify-content:flex-end;margin-bottom:4px;}
#cart .dropdown-menu :is(p,div).text-end > a {white-space:normal;max-width:100%;justify-content:center;text-align:center;}
@media(max-width:767px){
  #cart .dropdown-menu {width:min(420px,calc(100vw - 24px));padding:8px;}
  #cart .dropdown-menu .table {font-size:12px;}
  #cart .dropdown-menu .table td {padding:6px 3px;}
  #cart .dropdown-menu .table tr:has(> td:nth-child(5)) > td:nth-child(1) {width:48px;}
  #cart .dropdown-menu .table tr:has(> td:nth-child(5)) > td:nth-child(3) {width:32px;}
  #cart .dropdown-menu .table tr:has(> td:nth-child(5)) > td:nth-child(4) {width:78px;}
  #cart .dropdown-menu .table tr:has(> td:nth-child(5)) > td:nth-child(5) {width:40px;}
  #cart .dropdown-menu .table tr:has(> td:nth-child(5)) > td:first-child img {width:42px!important;height:42px!important;}
  #cart .dropdown-menu .table tr:has(> td:nth-child(5)) > td:last-child .btn {width:32px;min-width:32px;height:36px;min-height:36px;}
  #cart .dropdown-menu .table tr:has(> td:nth-child(2)):not(:has(> td:nth-child(3))) > td:last-child {width:94px;}
  #cart .dropdown-menu :is(p,div).text-end:has(> a[href*="checkout/checkout"]) > a {flex:1 1 100%;min-height:42px;}
}
