/*
 * CWS Roy Product Responsive Fix v1.2.8 - Elementor Pro side-cart polish.
 * Styling ONLY: no cart AJAX, links, WooCommerce events or product data changes.
 * Limited to Elementor's side-cart widget in the site header.
 */
body #masthead .elementor-widget-woocommerce-menu-cart.elementor-menu-cart--cart-type-side-cart {
  --cws-cart-wine: #970817;
  --cws-cart-wine-dark: #750712;
  --cws-cart-forest: #183b30;
  --cws-cart-muted: #717c76;
  --cws-cart-border: #eae2db;
  --cws-cart-warm: #faf8f5;
}

/* Restyle the slide-out surface without changing Elementor's open/close state. */
body #masthead .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__main {
  box-sizing: border-box;
  width: min(430px, 100vw) !important;
  max-width: 100vw !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: #fff !important;
  color: var(--cws-cart-forest) !important;
  box-shadow: -14px 0 44px rgba(25, 27, 24, .19) !important;
  overflow: hidden !important;
}
body #masthead .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__main,
body #masthead .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__main * {
  box-sizing: border-box;
}

/* Native drawer header; close control remains the original Elementor button. */
body #masthead .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__main::before {
  content: "Your Cart";
  display: block;
  flex: 0 0 auto;
  padding: 22px 75px 20px 25px;
  min-height: 76px;
  border-bottom: 1px solid var(--cws-cart-border);
  color: var(--cws-cart-forest);
  background: #fff;
  font-family: Lato, Arial, sans-serif;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.5;
  letter-spacing: -.025em;
  text-align: left;
}
body #masthead .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__close-button {
  position: absolute !important;
  top: 19px !important;
  right: 22px !important;
  left: auto !important;
  z-index: 2;
  display: block !important;
  width: 38px !important;
  height: 38px !important;
  margin: 0 !important;
  border: 1px solid #ecdfd7;
  border-radius: 50%;
  background: #fff9f6;
  transition: background-color 160ms ease, border-color 160ms ease;
}
body #masthead .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__close-button:hover {
  border-color: #dab7b1;
  background: #fceee9;
}
body #masthead .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__close-button::before,
body #masthead .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__close-button::after {
  left: calc(50% - 9px) !important;
  top: 50% !important;
  width: 18px !important;
  height: 2px !important;
  margin-top: -1px !important;
  background: var(--cws-cart-wine) !important;
}

/* Scroll only the list; keep subtotal and actions visible at drawer bottom. */
body #masthead .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__main .widget_shopping_cart_content {
  display: flex !important;
  flex: 1 1 auto !important;
  flex-direction: column !important;
  height: auto !important;
  min-height: 0 !important;
  overflow: hidden;
  background: #fff;
}
body #masthead .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__products {
  flex: 1 1 auto !important;
  min-height: 0 !important;
  max-height: none !important;
  margin: 0 !important;
  padding: 8px 24px 14px !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  scrollbar-width: thin;
  scrollbar-color: #d8c7bc transparent;
}

/* Align image, product title, selected size, item price and remove icon. */
body #masthead .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__product {
  display: grid !important;
  grid-template-columns: 90px minmax(0, 1fr) !important;
  grid-template-rows: auto 1fr !important;
  align-items: start;
  column-gap: 14px !important;
  row-gap: 7px !important;
  position: relative;
  width: 100%;
  min-height: 125px;
  margin: 0 !important;
  padding: 20px 35px 20px 0 !important;
  border: 0 !important;
  border-bottom: 1px solid var(--cws-cart-border) !important;
  background: #fff;
}
body #masthead .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__product:last-child {
  border-bottom: 0 !important;
}
body #masthead .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__product-image {
  grid-column: 1 !important;
  grid-row: 1 / 3 !important;
  width: 90px !important;
  min-width: 0 !important;
  align-self: start;
}
body #masthead .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__product-image img {
  width: 90px !important;
  height: 112px !important;
  max-width: 100% !important;
  object-fit: contain !important;
  border: 1px solid #eee6de;
  border-radius: 9px;
  background: #fff;
}
body #masthead .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__product-name {
  grid-column: 2 !important;
  grid-row: 1 !important;
  min-width: 0;
  margin: 0 !important;
  padding: 1px 0 0 !important;
  color: var(--cws-cart-forest) !important;
  font-family: Lato, Arial, sans-serif;
  font-size: 15px !important;
  font-weight: 800 !important;
  line-height: 1.45 !important;
  overflow-wrap: anywhere;
}
body #masthead .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__product-name a {
  color: var(--cws-cart-forest) !important;
  font-weight: 800 !important;
  text-decoration: none !important;
}
body #masthead .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__product-name a:hover {
  color: var(--cws-cart-wine) !important;
}
body #masthead .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__product .variation {
  display: grid !important;
  grid-template-columns: max-content minmax(0, 1fr) !important;
  gap: 2px 6px !important;
  margin: 7px 0 0 !important;
  color: var(--cws-cart-muted) !important;
  font-size: 12px !important;
  line-height: 1.5 !important;
}
body #masthead .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__product .variation dt,
body #masthead .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__product .variation dd {
  margin: 0 !important;
  font-size: inherit !important;
  font-weight: 500 !important;
  line-height: inherit !important;
}
body #masthead .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__product-price {
  grid-column: 2 !important;
  grid-row: 2 !important;
  min-width: 0;
  align-self: start !important;
  margin: 0 !important;
  padding: 0 !important;
  color: #6b756e !important;
  font-size: 13px !important;
  font-weight: 500 !important;
  line-height: 1.6 !important;
}
body #masthead .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__product-price :is(.amount, .woocommerce-Price-amount) {
  color: var(--cws-cart-forest) !important;
  font-size: 15px !important;
  font-weight: 800 !important;
  opacity: 1 !important;
}
body #masthead .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__product-remove {
  position: absolute !important;
  inset-inline-end: 0 !important;
  top: 21px !important;
  bottom: auto !important;
  width: 32px !important;
  height: 32px !important;
  border: 1px solid #e7cecd !important;
  border-radius: 50% !important;
  background: #fff8f7;
}
body #masthead .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__product-remove::before,
body #masthead .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__product-remove::after {
  height: 2px !important;
  margin-top: -1px !important;
  background: var(--cws-cart-wine) !important;
}
body #masthead .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__product-remove:hover {
  border-color: var(--cws-cart-wine) !important;
  background: #fff0ef;
}

/* Visible, compact subtotal and checkout CTA. */
body #masthead .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__subtotal {
  display: flex !important;
  flex: 0 0 auto !important;
  justify-content: space-between !important;
  align-items: center !important;
  flex-wrap: wrap;
  gap: 5px 14px !important;
  margin: auto 0 0 !important;
  padding: 20px 24px 8px !important;
  border: 0 !important;
  border-top: 1px solid var(--cws-cart-border) !important;
  color: var(--cws-cart-forest) !important;
  background: var(--cws-cart-warm) !important;
  font-family: Lato, Arial, sans-serif;
  font-size: 16px !important;
  font-weight: 650 !important;
  line-height: 1.5 !important;
  text-align: left !important;
}
body #masthead .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__subtotal strong {
  color: #4f6056 !important;
  font-size: 15px !important;
  font-weight: 700 !important;
}
body #masthead .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__subtotal :is(.amount, .woocommerce-Price-amount) {
  color: var(--cws-cart-forest) !important;
  font-size: 20px !important;
  font-weight: 800 !important;
  white-space: nowrap;
}
body #masthead .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__footer-buttons {
  display: grid !important;
  flex: 0 0 auto !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  gap: 10px !important;
  align-items: stretch;
  width: 100%;
  margin: 0 !important;
  padding: 14px 24px 26px !important;
  border: 0 !important;
  background: var(--cws-cart-warm) !important;
}
body #masthead .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__footer-buttons .elementor-button {
  display: flex !important;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 48px !important;
  height: auto !important;
  margin: 0 !important;
  padding: 11px 8px !important;
  border: 1px solid transparent !important;
  border-radius: 10px !important;
  box-shadow: none !important;
  font-family: Lato, Arial, sans-serif !important;
  font-size: 13px !important;
  font-weight: 800 !important;
  line-height: 1.35 !important;
  text-align: center !important;
  text-decoration: none !important;
  text-transform: none !important;
  white-space: normal;
  transition: background-color 150ms ease, color 150ms ease;
}
body #masthead .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__footer-buttons .elementor-button--view-cart {
  border-color: var(--cws-cart-wine) !important;
  background: #fff !important;
  color: var(--cws-cart-wine) !important;
}
body #masthead .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__footer-buttons .elementor-button--view-cart:hover {
  background: #fff1ef !important;
  color: var(--cws-cart-wine-dark) !important;
}
body #masthead .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__footer-buttons .elementor-button--checkout {
  border-color: var(--cws-cart-wine) !important;
  background: var(--cws-cart-wine) !important;
  color: #fff !important;
}
body #masthead .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__footer-buttons .elementor-button--checkout:hover {
  border-color: var(--cws-cart-wine-dark) !important;
  background: var(--cws-cart-wine-dark) !important;
  color: #fff !important;
}
body #masthead .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__footer-buttons .elementor-button:focus-visible,
body #masthead .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__close-button:focus-visible {
  outline: 3px solid #d7af77 !important;
  outline-offset: 2px;
}

/* Preserve Elementor's existing empty-cart message behavior. */
body #masthead .elementor-menu-cart--cart-type-side-cart .woocommerce-mini-cart__empty-message {
  margin: 0 !important;
  padding: 50px 24px !important;
  color: var(--cws-cart-muted) !important;
  font-size: 15px !important;
  line-height: 1.6 !important;
  text-align: center !important;
}
@media (max-width: 767px) {
  body #masthead .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__main {
    width: min(420px, 100vw) !important;
  }
  body #masthead .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__main::before {
    min-height: 70px;
    padding: 19px 70px 18px 19px;
    font-size: 20px;
  }
  body #masthead .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__close-button {
    top: 16px !important;
    right: 17px !important;
  }
  body #masthead .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__products {
    padding-inline: 17px !important;
  }
  body #masthead .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__product {
    grid-template-columns: 78px minmax(0, 1fr) !important;
    gap: 6px 12px !important;
    padding: 16px 36px 16px 0 !important;
    min-height: 110px;
  }
  body #masthead .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__product-image,
  body #masthead .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__product-image img {
    width: 78px !important;
  }
  body #masthead .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__product-image img {
    height: 100px !important;
  }
  body #masthead .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__product-name {
    font-size: 14px !important;
  }
  body #masthead .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__subtotal {
    padding: 17px 17px 6px !important;
  }
  body #masthead .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__footer-buttons {
    padding: 12px 17px max(18px, env(safe-area-inset-bottom)) !important;
  }
  body #masthead .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__footer-buttons .elementor-button {
    min-height: 46px !important;
  }
}
@media (max-width: 340px) {
  body #masthead .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__footer-buttons {
    grid-template-columns: 1fr !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  body #masthead .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__footer-buttons .elementor-button,
  body #masthead .elementor-menu-cart--cart-type-side-cart .elementor-menu-cart__close-button {
    transition: none !important;
  }
}
