/* TOR Delivery - region popup, region chip and cart map */

/* ---------- region popup ---------- */
.tor-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  background: rgba(20, 28, 20, 0.72);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.tor-modal-box {
  background: #fff;
  border-radius: 10px;
  padding: 28px 30px;
  max-width: 440px;
  width: 100%;
  text-align: center;
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.3);
}

.tor-modal-box h2 {
  margin: 0 0 10px;
  font-size: 24px;
  line-height: 1.2;
}

.tor-modal-box p {
  margin: 0 0 0px;
  font-size: 15px;
  line-height: 1.5;
}

.tor-modal-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.tor-modal .tor-btn {
  display: inline-block;
  min-width: 130px;
  padding: 14px 26px;
  border-radius: 6px;
  background: #6aa84f;
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-decoration: none;
  transition: background 0.15s ease;
}

.tor-modal .tor-btn:hover,
.tor-modal .tor-btn:focus {
  background: #558b3d;
  color: #fff;
}

.tor-modal-note {
  margin: 16px 0 0;
  font-size: 13px;
  opacity: 0.65;
}

p.tor-modal-note {
  margin-top: 20px;
}

/* ---------- region bar ---------- */
.tor-region-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  margin: 0 0 0 !important;
  padding: 9px 16px;
  border-radius: 0 !important;
  background-color: #476214;
  color: #ffffff;
  font-size: 14px;
}

.tor-region-bar-main {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  justify-content: center;
}

.tor-region-bar-note {
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
  opacity: 0.85;
}

.tor-region-bar a {
  display: inline-block;
  margin-left: 6px;
  padding: 4px 14px;
  border-radius: 999px;
  background: #ffffff;
  color: #476214 !important;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.3;
  text-decoration: none !important;
  white-space: nowrap;
}

.tor-region-bar a:hover,
.tor-region-bar a:focus {
  background: #eef3e4;
  color: #476214 !important;
}

/* ---------- cart icon in the menu ---------- */
.tor-menu-cart > a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: relative;
}

.tor-menu-cart .tor-cart-icon {
  display: block;
}

.tor-menu-cart .tor-cart-count {
  position: absolute;
  top: -8px;
  right: -10px;
  min-width: 17px;
  height: 17px;
  padding: 0 4px;
  border-radius: 999px;
  background: #476214;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  line-height: 17px;
  text-align: center;
}

/* ---------- delivery lines in the cart ---------- */

/* Delivery is a charge, not a product: no unit price, no quantity selector
   and no remove button. The image cell stays in the flow (its picture is
   hidden by the inline CSS) so the row keeps all three columns. */
.wc-block-cart-items__row[data-cart-item-key^="tor_delivery_"] .wc-block-cart-item__quantity,
.wc-block-cart-items__row[data-cart-item-key^="tor_delivery_"] .wc-block-cart-item__prices {
  display: none;
}

.wc-block-cart-items__row[data-cart-item-key^="tor_delivery_"] .wc-block-components-product-name {
  font-weight: 700;
}

.wc-block-cart-items__row[data-cart-item-key^="tor_delivery_"] .wc-block-components-product-metadata {
  display: none;
}

/* Same idea in the checkout order summary. */
.wc-block-components-order-summary-item[data-cart-item-key^="tor_delivery_"] .wc-block-components-order-summary-item__image,
.wc-block-components-order-summary-item[data-cart-item-key^="tor_delivery_"] .wc-block-components-order-summary-item__quantity {
  display: none;
}

.wc-block-components-order-summary-item[data-cart-item-key^="tor_delivery_"] .wc-block-components-product-name {
  font-weight: 700;
}

/* ---------- zip checker ---------- */
.tor-zip-check {
  margin: 0 0 14px;
}

.tor-zip-check label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
}

.tor-zip-row {
  display: flex;
  gap: 8px;
  max-width: 380px;
}

.tor-zip-row input {
  flex: 1;
  padding: 9px 12px;
  border: 1px solid #cfcabb;
  border-radius: 6px;
  font-size: 14px;
}

.tor-zip-button {
  padding: 9px 18px;
  border: 0;
  border-radius: 6px;
  background: #6aa84f;
  color: #fff;
  font-weight: 600;
  cursor: pointer;
}

.tor-zip-button:hover {
  background: #558b3d;
}

.tor-zip-result {
  margin: 8px 0 0;
  font-size: 13px;
  line-height: 1.4;
}

.tor-zip-result.is-ok {
  color: #2e7d32;
  font-weight: 600;
}

.tor-zip-result.is-warn {
  color: #c0392b;
  font-weight: 600;
}

/* ---------- cart totals ---------- */

/* The totals column is pinned by JS, so it must not stretch to the full
   height of the cart layout (that is what blocked the pinning). */
.wc-block-cart__sidebar {
  align-self: flex-start;
}

/* The zero-cost shipping rate is only a WooCommerce formality, so hide the
   "Free" badge on the shipping option and the row in the order summary. */
.wp-block-woocommerce-checkout-shipping-methods-block .wc-block-components-radio-control__secondary-label {
  display: none;
}

.wc-block-checkout__shipping-option--free {
  display: none;
}

.wp-block-woocommerce-cart .wc-block-components-totals-shipping,
.wp-block-woocommerce-checkout .wc-block-components-totals-shipping {
  display: none;
}

/* Delivery is charged on its own lines: drop the shipping placeholder. */
.wp-block-woocommerce-cart .wc-block-components-totals-footer-item-shipping {
  display: none;
}

/* Empty description holders inside the totals rows. */
.wp-block-woocommerce-cart .wc-block-components-totals-item__description:empty {
  display: none;
}

/* Empty wrappers left behind by the upsell slot and the payment area. */
.wp-block-woocommerce-cart .slot-wrapper:not(:has(.cuw-offer)) {
  display: none;
}

.wp-block-woocommerce-cart .wc-block-cart__payment-options:empty {
  display: none;
}

.wp-block-woocommerce-cart .wc-block-components-totals-wrapper:not(:has(*)) {
  display: none;
}

/* ---------- Versapay card form ---------- */

/* Versapay injects its card fields in an iframe with a fixed 500px height.
   The fields and the "Save Payment Method to Wallet" checkbox end at ~310px,
   so the rest is empty white space under the form. */
#versapay-container {
  width: 100% !important;
}

#versapay-container iframe {
  display: block;
  width: 100% !important;
  max-width: 499px !important;
  height: 350px !important;
}

/* On narrow screens the fields stack and the form needs the full height. */
@media (max-width: 600px) {
  #versapay-container iframe {
    height: 500px !important;
  }
}

/* ---------- cart map ---------- */
.tor-map-block {
  margin-top: 24px;
}

.tor-map-block h3 {
  margin: 0 0 10px;
  font-size: 18px;
}

.tor-map {
  width: 100%;
  height: 340px;
  border-radius: 8px;
  border: 1px solid #e0ddd4;
  z-index: 0;
}

@media (max-width: 780px) {
  .tor-map {
    height: 260px;
  }
}

.tor-map-open {
  margin-top: 10px;
  padding: 8px 16px;
  border: 1px solid #6aa84f;
  background: #fff;
  color: #4a7c34;
  border-radius: 999px;
  font-size: 13px;
  cursor: pointer;
}

.tor-map-open:hover {
  background: #f2f7ee;
}

.tor-map-note {
  margin: 8px 0 0;
  font-size: 12px;
  opacity: 0.75;
}

/* ---------- map pop-out ---------- */
.tor-map-overlay {
  position: fixed;
  inset: 0;
  z-index: 100001;
  background: rgba(15, 20, 15, 0.9);
  padding: 40px 24px;
}

.tor-map-overlay[hidden] {
  display: none;
}

.tor-map-large {
  width: 100%;
  height: 100%;
  border-radius: 8px;
}

.tor-map-close {
  position: absolute;
  top: 10px;
  right: 18px;
  z-index: 2;
  background: none;
  border: 0;
  color: #fff;
  font-size: 38px;
  line-height: 1;
  cursor: pointer;
}

body.tor-map-locked {
  overflow: hidden;
}
