/* ==========================================================
   Samaia Cart
   Colours come from Settings → Samaia Cart (CSS variables);
   the Elementor widget can restyle the button per instance.
   ========================================================== */
:root {
  --sc-accent: #1F2421; --sc-accent-text: #F3F1EA; --sc-bg: #F3F1EA; --sc-text: #1F2421; --sc-muted: #E3E1DA;
  --sc-line: color-mix(in srgb, var(--sc-text) 20%, transparent);
  --sc-soft: color-mix(in srgb, var(--sc-text) 64%, transparent);
  --sc-width: 440px;
  --sc-ease: cubic-bezier(.76, 0, .24, 1);
}

/* ---------- Button ---------- */
.samaia-cart-btn {
  display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 12px 0 16px; margin: 0;
  background: var(--sc-bg); color: var(--sc-text); border: 0; border-radius: 0; box-shadow: 0 0 0 1px var(--sc-line);
  font-family: var(--sc-font, inherit); font-size: 13.5px; font-weight: 700; line-height: 1; letter-spacing: .01em; text-transform: none;
  cursor: pointer; transition: background .3s, color .3s, box-shadow .3s; -webkit-tap-highlight-color: transparent;
}
.samaia-cart-btn:hover { background: #fff; color: var(--sc-text); }
.samaia-cart-btn:focus-visible { outline: 2px solid var(--sc-text); outline-offset: 3px; }
.samaia-cart-btn__icon { width: 20px; height: 20px; flex: none; }
.samaia-cart-btn__count {
  min-width: 22px; height: 22px; padding: 0 6px; display: inline-grid; place-items: center;
  border: 1.5px solid currentColor; font-size: 11.5px; font-variant-numeric: tabular-nums; line-height: 1;
  transition: background .3s, color .3s;
}
.samaia-cart-btn.has-items .samaia-cart-btn__count { background: var(--sc-accent); color: var(--sc-accent-text); border-color: var(--sc-accent); }
.samaia-cart-btn--count-bubble .samaia-cart-btn__count { border-radius: 99px; min-width: 20px; height: 20px; font-size: 11px; }
.samaia-cart-btn--count-text .samaia-cart-btn__count { border: 0; min-width: 0; padding: 0; background: none !important; color: inherit !important; }
.samaia-cart-btn--count-text .samaia-cart-btn__count::before { content: "("; }
.samaia-cart-btn--count-text .samaia-cart-btn__count::after { content: ")"; }
.samaia-cart-btn.hide-empty:not(.has-items) .samaia-cart-btn__count { display: none; }
.samaia-cart-btn__total { font-weight: 600; font-variant-numeric: tabular-nums; white-space: nowrap; }
.samaia-cart-btn.is-bump .samaia-cart-btn__count { animation: samaia-cart-bump .55s var(--sc-ease); }
@keyframes samaia-cart-bump { 35% { transform: scale(1.3); } }

/* floating button */
.samaia-cart-float { position: fixed; z-index: 9990; }
.samaia-cart-float--bottom-right { right: 20px; bottom: calc(20px + env(safe-area-inset-bottom)); }
.samaia-cart-float--bottom-left { left: 20px; bottom: calc(20px + env(safe-area-inset-bottom)); }
.samaia-cart-float--top-right { right: 20px; top: 20px; }
.samaia-cart-float--top-left { left: 20px; top: 20px; }
body.admin-bar .samaia-cart-float--top-right, body.admin-bar .samaia-cart-float--top-left { top: 52px; }
.samaia-cart-float .samaia-cart-btn { height: 54px; width: 54px; padding: 0; justify-content: center; position: relative; box-shadow: 0 6px 24px rgba(0, 0, 0, .14), 0 0 0 1px var(--sc-line); }
.samaia-cart-float .samaia-cart-btn__icon { width: 22px; height: 22px; }
.samaia-cart-float .samaia-cart-btn__count { position: absolute; top: -6px; right: -6px; }

/* ---------- Drawer ---------- */
html.samaia-cart-lock, html.samaia-cart-lock body { overflow: hidden; }
.samaia-cart [hidden], .samaia-cart-veil[hidden] { display: none !important; }
.samaia-cart-veil { position: fixed; inset: 0; z-index: 99990; background: rgba(20, 22, 21, .4); opacity: 0; transition: opacity .45s; }
.samaia-cart-veil.is-on { opacity: 1; }
.samaia-cart {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 99991; width: min(var(--sc-width), 100vw);
  display: flex; flex-direction: column; background: var(--sc-bg); color: var(--sc-text);
  font-family: var(--sc-font, inherit); font-size: 14px; line-height: 1.45; text-align: start;
  transform: translateX(101%); transition: transform .65s var(--sc-ease), visibility 0s .65s; visibility: hidden;
  box-shadow: -20px 0 60px rgba(0, 0, 0, .08);
}
.samaia-cart.is-open { transform: translateX(0); visibility: visible; transition: transform .65s var(--sc-ease), visibility 0s; }
[dir="rtl"] .samaia-cart, .rtl .samaia-cart { right: auto; left: 0; transform: translateX(-101%); box-shadow: 20px 0 60px rgba(0, 0, 0, .08); }
[dir="rtl"] .samaia-cart.is-open, .rtl .samaia-cart.is-open { transform: translateX(0); }
body.admin-bar .samaia-cart { top: 32px; }
@media (max-width: 782px) { body.admin-bar .samaia-cart { top: 46px; } }
.samaia-cart *, .samaia-cart *::before, .samaia-cart *::after { box-sizing: border-box; }
.samaia-cart button { font: inherit; color: inherit; background: none; border: 0; padding: 0; margin: 0; cursor: pointer; text-transform: none; letter-spacing: inherit; min-height: 0; box-shadow: none; border-radius: 0; }
.samaia-cart a { color: inherit; text-decoration: none; box-shadow: none; }

.samaia-cart__head { display: flex; justify-content: space-between; align-items: center; padding: 22px 24px; border-bottom: 1px solid var(--sc-line); }
.samaia-cart__head h2 { margin: 0; padding: 0; font-family: inherit; font-size: 24px; font-weight: 400; letter-spacing: -.015em; line-height: 1.1; color: inherit; }
.samaia-cart__head h2 span { font-size: 13px; font-weight: 600; color: var(--sc-soft); margin-inline-start: 6px; }
.samaia-cart__close { font-size: 12px !important; font-weight: 700 !important; border-bottom: 1px solid currentColor !important; padding-bottom: 2px !important; }

.samaia-cart__notice {
  margin: 0; padding: 0 24px; max-height: 0; overflow: hidden; background: var(--sc-muted);
  font-size: 12.5px; font-weight: 600; line-height: 1.45; transition: max-height .4s var(--sc-ease), padding .4s var(--sc-ease);
}
.samaia-cart__notice.is-on { max-height: 140px; padding: 12px 24px; }
.samaia-cart__notice.is-error { background: #F4DFE1; color: #67031B; }
.samaia-cart__notice button { margin-inline-start: 6px !important; font-weight: 700 !important; border-bottom: 1px solid currentColor !important; }

.samaia-cart__body { flex: 1; overflow-y: auto; overscroll-behavior: contain; }
.samaia-cart__items { list-style: none; margin: 0; padding: 0 24px; }
.samaia-cart-item { display: grid; grid-template-columns: 78px 1fr auto; gap: 14px; padding: 18px 0; margin: 0; border-bottom: 1px solid var(--sc-line); transition: opacity .3s; }
.samaia-cart-item::before { display: none; }
.samaia-cart-item.is-updating .samaia-cart-item__side b { opacity: .45; }
.samaia-cart-item.is-removing { opacity: .35; pointer-events: none; }
.samaia-cart-item img { width: 78px; height: auto; aspect-ratio: 4 / 5; object-fit: cover; background: var(--sc-muted); margin: 0; border-radius: 0; }
.samaia-cart-item__info { min-width: 0; }
.samaia-cart-item h3 { margin: 0 0 4px; padding: 0; font-family: inherit; font-size: 14px; font-weight: 700; line-height: 1.25; letter-spacing: 0; color: inherit; }
.samaia-cart-item h3 a:hover { text-decoration: underline; text-underline-offset: 3px; }
.samaia-cart-item p { margin: 0 0 2px; font-size: 12px; color: var(--sc-soft); line-height: 1.45; }
.samaia-cart-item__side { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 10px; }
.samaia-cart-item__side b { font-size: 15px; white-space: nowrap; font-variant-numeric: tabular-nums; transition: opacity .2s; }
.samaia-cart-item__remove { font-size: 11.5px !important; font-weight: 600 !important; color: var(--sc-soft) !important; border-bottom: 1px solid currentColor !important; }
.samaia-cart-item__remove:hover { color: var(--sc-text) !important; }

.samaia-cart-qty { display: inline-grid; grid-template-columns: 30px 38px 30px; height: 34px; margin-top: 10px; border: 1px solid var(--sc-line); }
.samaia-cart-qty button { font-size: 16px !important; display: grid !important; place-items: center; }
.samaia-cart-qty button:hover:not([disabled]) { background: var(--sc-muted) !important; }
.samaia-cart-qty button[disabled] { opacity: .3; cursor: default; }
.samaia-cart-qty input {
  width: 100% !important; height: 100% !important; border: 0 !important; background: transparent !important; box-shadow: none !important;
  text-align: center; font: inherit; font-size: 13px; font-weight: 700; color: inherit; padding: 0 !important; margin: 0; border-radius: 0;
  -moz-appearance: textfield;
}
.samaia-cart-qty input::-webkit-outer-spin-button, .samaia-cart-qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.samaia-cart-qty--fixed { display: inline-block; height: auto; border: 0; font-size: 12px; color: var(--sc-soft); }

.samaia-cart__empty { padding: 48px 24px; }
.samaia-cart__empty p { margin: 0 0 14px; font-size: 22px; font-weight: 700; letter-spacing: -.01em; }
.samaia-cart__empty a { font-size: 13px; font-weight: 700; border-bottom: 1px solid currentColor; padding-bottom: 2px; }

.samaia-cart__foot { padding: 18px 24px calc(22px + env(safe-area-inset-bottom)); border-top: 1px solid var(--sc-line); background: var(--sc-bg); }
.samaia-cart__row { display: flex; justify-content: space-between; align-items: baseline; margin: 0; font-size: 15px; }
.samaia-cart__row b { font-size: 21px; font-variant-numeric: tabular-nums; }
.samaia-cart__row--disc { font-size: 13px; color: var(--sc-soft); margin-bottom: 6px; }
.samaia-cart__note { margin: 4px 0 16px; font-size: 12px; color: var(--sc-soft); }
.samaia-cart__checkout { display: grid !important; place-items: center; height: 54px; background: var(--sc-accent); color: var(--sc-accent-text) !important; font-size: 14px; font-weight: 700; letter-spacing: .01em; transition: opacity .3s; }
.samaia-cart__checkout:hover { opacity: .88; }
.samaia-cart__view { display: block; width: max-content; margin: 14px auto 0; font-size: 12.5px; font-weight: 700; border-bottom: 1px solid currentColor; }

.samaia-cart__loading { position: absolute; left: 0; right: 0; top: 0; height: 2px; overflow: hidden; pointer-events: none; opacity: 0; transition: opacity .2s; }
.samaia-cart__loading::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; background: var(--sc-accent); animation: samaia-cart-load 1s var(--sc-ease) infinite; }
.samaia-cart.is-busy .samaia-cart__loading { opacity: 1; }
@keyframes samaia-cart-load { from { left: -40%; } to { left: 100%; } }

/* WooCommerce product-page button while adding */
.single_add_to_cart_button.is-loading { opacity: .6; pointer-events: none; }

@media (max-width: 600px) {
  .samaia-cart { width: 100vw; }
  .samaia-cart__head, .samaia-cart__items, .samaia-cart__foot { padding-left: 5vw; padding-right: 5vw; }
  .samaia-cart-btn { height: 40px; padding: 0 10px 0 13px; }
}
@media (prefers-reduced-motion: reduce) {
  .samaia-cart, .samaia-cart-veil, .samaia-cart__notice { transition-duration: .01ms !important; }
}
