/* =====================================================================
   CARMO — Verzendkosten popup  (main_page=popup_shipping_estimator)
   Scoped to body#popupShippingEstimator so it ONLY touches the standalone
   shipping-estimator popup window. Auto-loaded via the /^style/ rule in
   common/html_header.php — no PHP/template changes required.
   Brand: orange #96171a, ink #232323, on soft neutral.
   ===================================================================== */

body#popupShippingEstimator {
  margin: 0;
  padding: 30px 16px 46px;
  background: #eceef1 !important;              /* override stylesheet.css #f5f5f5 */
  font-family: 'Open Sans', 'Segoe UI', Arial, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  color: #2b2b2b;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* ---- card ---------------------------------------------------------- */
body#popupShippingEstimator .shippingEstimatorWrapper {
  position: relative;
  max-width: 560px;
  margin: 0 auto;
  background: #ffffff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(20,22,26,.18), 0 3px 10px rgba(20,22,26,.08);
  font-size: 14px;                             /* neutralise .biggerText */
}

/* ---- top-right close (×) sits on the dark header ------------------- */
body#popupShippingEstimator .shippingEstimatorWrapper > p:first-of-type {
  position: absolute;
  top: 0; right: 0;
  z-index: 3;
  margin: 0;
  padding: 0;
}
body#popupShippingEstimator .shippingEstimatorWrapper > p:first-of-type a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px; height: 62px;
  font-size: 0;                                /* hide "[ Sluit venster ]" text */
  color: rgba(255,255,255,.75);
  text-decoration: none;
  transition: color .18s ease, background .18s ease;
}
body#popupShippingEstimator .shippingEstimatorWrapper > p:first-of-type a::after {
  content: "\00d7";                            /* × */
  font-size: 26px;
  line-height: 1;
  font-weight: 300;
}
body#popupShippingEstimator .shippingEstimatorWrapper > p:first-of-type a:hover {
  color: #96171a;
}

/* ---- content shell ------------------------------------------------- */
body#popupShippingEstimator #shippingEstimatorContent { padding: 0; }
body#popupShippingEstimator #shippingEstimatorContent form { margin: 0; padding: 0 26px 26px; }

/* ---- header band (the H2) — appearance (both states) -------------- */
body#popupShippingEstimator h2 {
  background: #232323;
  color: #ffffff;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: .01em;
  line-height: 1.25;
  text-transform: none;
  border-bottom: 3px solid #96171a;
}
body#popupShippingEstimator h2::first-letter { text-transform: uppercase; }
body#popupShippingEstimator h2::before {
  content: "\f0d1";                            /* fa-truck */
  font-family: FontAwesome;
  font-weight: normal;
  margin-right: 11px;
  color: #96171a;
  font-size: 17px;
}
/* full-bleed inside the padded form (populated state) */
body#popupShippingEstimator #shippingEstimatorContent h2 { margin: 0 -26px; padding: 21px 60px 20px 26px; }
/* empty-cart state: H2 is a direct child of the wrapper */
body#popupShippingEstimator .shippingEstimatorWrapper > h2 { margin: 0; padding: 21px 60px 20px 26px; }

/* ---- totals strip -------------------------------------------------- */
body#popupShippingEstimator .cartTotalsDisplay.important {
  padding: 12px 26px;
  background: #f6f7f9;
  border-bottom: 1px solid #e9ecf0;
  color: #5b6270;
  font-size: 13px;
  font-weight: 400;
  text-align: left;                            /* templatecss centres this by default */
}
body#popupShippingEstimator #shippingEstimatorContent .cartTotalsDisplay.important { margin: 0 -26px 22px; }
body#popupShippingEstimator .shippingEstimatorWrapper > .cartTotalsDisplay.important { margin: 0; }

/* ---- form fields --------------------------------------------------- */
body#popupShippingEstimator label.inputLabel {
  display: inline-block;
  width: 92px;
  margin: 0 8px 12px 0;
  vertical-align: middle;
  color: #374151;
  font-size: 13px;
  font-weight: 600;
}
body#popupShippingEstimator select,
body#popupShippingEstimator input[type="text"] {
  display: inline-block;
  vertical-align: middle;
  margin: 0 0 12px;
  padding: 9px 12px;
  min-height: 42px;
  max-width: 100%;
  border: 1px solid #d3d7de;
  border-radius: 8px;
  background: #fff;
  color: #232323;
  font-family: inherit;
  font-size: 14px;
  box-sizing: border-box;
  transition: border-color .15s ease, box-shadow .15s ease;
}
body#popupShippingEstimator select {
  width: calc(100% - 104px);                   /* right edge aligns with table */
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%23888' d='M1 1l5 5 5-5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 13px center;
  padding-right: 34px;
  cursor: pointer;
}
body#popupShippingEstimator input[name="zip_code"] { width: 140px; letter-spacing: .06em; }
body#popupShippingEstimator input#state { width: calc(100% - 104px); }
body#popupShippingEstimator select:focus,
body#popupShippingEstimator input[type="text"]:focus {
  outline: none;
  border-color: #96171a;
  box-shadow: 0 0 0 3px rgba(150,23,26,.16);
}

/* ---- Bijwerken button (primary CTA) -------------------------------- */
body#popupShippingEstimator .buttonRow.forward { margin: 2px 0 6px; }
body#popupShippingEstimator .buttonRow.forward button,
body#popupShippingEstimator .buttonRow.forward input[type="submit"] {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: auto !important;
  min-height: 44px;
  padding: 11px 26px;
  background: #96171a;
  color: #fff;
  border: none;
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .02em;
  cursor: pointer;
  box-shadow: 0 2px 0 #781215, 0 6px 16px rgba(150,23,26,.28);
  transition: background .18s ease, transform .06s ease, box-shadow .18s ease;
}
body#popupShippingEstimator .buttonRow.forward button:hover,
body#popupShippingEstimator .buttonRow.forward input[type="submit"]:hover {
  background: #871517;
  box-shadow: 0 2px 0 #781215, 0 8px 22px rgba(150,23,26,.36);
}
body#popupShippingEstimator .buttonRow.forward button:active,
body#popupShippingEstimator .buttonRow.forward input[type="submit"]:active {
  transform: translateY(2px);
  box-shadow: 0 0 0 #781215, 0 3px 10px rgba(150,23,26,.28);
}
body#popupShippingEstimator .buttonRow.forward button::before {
  content: "\f021";                            /* fa-refresh */
  font-family: FontAwesome;
  font-weight: normal;
  font-size: 13px;
}

/* ---- results table ------------------------------------------------- */
body#popupShippingEstimator #shippingEstimatorContent table {
  width: 100% !important;
  margin: 8px 0 4px;
  border: 0 !important;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 0 0 1px #e6e8ec;
  font-size: 13px;
}
body#popupShippingEstimator #shippingEstimatorContent table td,
body#popupShippingEstimator #shippingEstimatorContent table th { border: 0 !important; }

/* criteria caption row */
body#popupShippingEstimator .seDisplayedAddressLabel {
  padding: 11px 15px;
  background: #fbfbfc;
  border-bottom: 1px solid #eceef1 !important;
  color: #7c828c;
  font-size: 12px;
  line-height: 1.45;
}
body#popupShippingEstimator .seDisplayedAddressInfo {
  color: #232323;
  font-weight: 600;
}

/* heading row */
body#popupShippingEstimator #seProductsHeading,
body#popupShippingEstimator #seTotalHeading {
  padding: 11px 15px;
  background: #96171a;
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: .05em;
  text-transform: uppercase;
  text-align: left;
}
body#popupShippingEstimator #seTotalHeading { text-align: right; white-space: nowrap; width: 92px; }

/* data rows */
body#popupShippingEstimator #shippingEstimatorContent table td {
  padding: 11px 15px;
  border-bottom: 1px solid #eef0f2 !important;
  vertical-align: middle;
  line-height: 1.4;
}
body#popupShippingEstimator #shippingEstimatorContent table tr:last-child td { border-bottom: 0 !important; }
body#popupShippingEstimator #shippingEstimatorContent table tr:has(td.cartTotalDisplay):hover td { background: #faf5f5; }

body#popupShippingEstimator td.cartTotalDisplay {
  text-align: right;
  white-space: nowrap;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: #232323;
}

/* cheapest / selected row */
body#popupShippingEstimator tr:has(td.bold) td { background: #f8efef; }
body#popupShippingEstimator tr:has(td.bold) td:first-child { box-shadow: inset 4px 0 0 #96171a; font-weight: 600; }
body#popupShippingEstimator td.cartTotalDisplay.bold { color: #96171a; font-weight: 700; }

/* ---- footer close -------------------------------------------------- */
body#popupShippingEstimator .shippingEstimatorWrapper > p:last-of-type {
  margin: 0;
  padding: 15px 26px 20px;
  text-align: center;
  background: #fafbfc;
  border-top: 1px solid #eef0f2;
}
body#popupShippingEstimator .shippingEstimatorWrapper > p:last-of-type a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 20px;
  border: 1px solid #d3d7de;
  border-radius: 8px;
  background: #fff;
  color: #4b5563;
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  transition: border-color .15s ease, color .15s ease, background .15s ease;
}
body#popupShippingEstimator .shippingEstimatorWrapper > p:last-of-type a::before {
  content: "\f00d";                            /* fa-close */
  font-family: FontAwesome;
  font-weight: normal;
  font-size: 12px;
}
body#popupShippingEstimator .shippingEstimatorWrapper > p:last-of-type a:hover {
  border-color: #232323;
  color: #232323;
  background: #f3f4f6;
}

/* empty-cart fallback */
body#popupShippingEstimator .cartTotalsDisplay:not(.important) { padding: 16px 26px 24px; color: #6b7280; }

/* ---- dark mode ----------------------------------------------------- */
/* carmo.nl and other stores toggle a dark theme via html[data-theme="dark"].
   Stores without dark mode (e.g. carmoelectronics.co.uk) never match these,
   so the exact same file is safe to ship everywhere. */
[data-theme="dark"] body#popupShippingEstimator { background: #15171c !important; color: #dfe3e9; }
[data-theme="dark"] body#popupShippingEstimator .shippingEstimatorWrapper {
  background: #1e2128;
  box-shadow: 0 18px 50px rgba(0,0,0,.55), 0 0 0 1px #2c313b;
}
[data-theme="dark"] body#popupShippingEstimator h2 { background: #17191f; }
[data-theme="dark"] body#popupShippingEstimator .cartTotalsDisplay.important {
  background: #23262e; border-bottom-color: #2c313b; color: #9aa2ae;
}
[data-theme="dark"] body#popupShippingEstimator label.inputLabel { color: #c3cad4; }
[data-theme="dark"] body#popupShippingEstimator select,
[data-theme="dark"] body#popupShippingEstimator input[type="text"] {
  background-color: #262a32; border-color: #3a4049; color: #eceef2;
}
[data-theme="dark"] body#popupShippingEstimator select {
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='%23aab' d='M1 1l5 5 5-5'/></svg>");
}
[data-theme="dark"] body#popupShippingEstimator #shippingEstimatorContent table { box-shadow: 0 0 0 1px #2c313b; }
[data-theme="dark"] body#popupShippingEstimator .seDisplayedAddressLabel {
  background: #23262e; border-bottom-color: #2c313b !important; color: #9aa2ae;
}
[data-theme="dark"] body#popupShippingEstimator .seDisplayedAddressInfo { color: #eceef2; }
[data-theme="dark"] body#popupShippingEstimator #shippingEstimatorContent table td {
  border-bottom-color: #2c313b !important; color: #dfe3e9;
}
[data-theme="dark"] body#popupShippingEstimator td.cartTotalDisplay { color: #eceef2; }
[data-theme="dark"] body#popupShippingEstimator #shippingEstimatorContent table tr:has(td.cartTotalDisplay):hover td { background: #24282f; }
[data-theme="dark"] body#popupShippingEstimator tr:has(td.bold) td { background: #261314; }
[data-theme="dark"] body#popupShippingEstimator .shippingEstimatorWrapper > p:last-of-type {
  background: #1a1d23; border-top-color: #2c313b;
}
[data-theme="dark"] body#popupShippingEstimator .shippingEstimatorWrapper > p:last-of-type a {
  background: #262a32; border-color: #3a4049; color: #c3cad4;
}
[data-theme="dark"] body#popupShippingEstimator .shippingEstimatorWrapper > p:last-of-type a:hover {
  background: #2f343d; border-color: #4a515c; color: #fff;
}

/* ---- narrow windows ------------------------------------------------ */
@media (max-width: 520px) {
  body#popupShippingEstimator { padding: 14px 10px 26px; }
  body#popupShippingEstimator #shippingEstimatorContent form { padding: 0 18px 20px; }
  body#popupShippingEstimator #shippingEstimatorContent h2 { margin: 0 -18px; padding: 18px 52px 16px 18px; font-size: 17px; }
  body#popupShippingEstimator #shippingEstimatorContent .cartTotalsDisplay.important { margin: 0 -18px 18px; padding: 11px 18px; }
  body#popupShippingEstimator label.inputLabel { display: block; width: auto; margin: 0 0 6px; }
  body#popupShippingEstimator select,
  body#popupShippingEstimator input#state { width: 100%; }
  body#popupShippingEstimator .shippingEstimatorWrapper > p:last-of-type { padding: 14px 18px 18px; }
}
