/* ─── WC Quick Order Cart · cart.css ─────────────────────────────────────── */
:root {
  --wqoc-accent:    #1a1a2e;
  --wqoc-accent-l:  #2d2d4e;
  --wqoc-text:      #1c1c1c;
  --wqoc-muted:     #6b7280;
  --wqoc-border:    #e5e7eb;
  --wqoc-bg:        #ffffff;
  --wqoc-bg-alt:    #f9fafb;
  --wqoc-radius:    10px;
  --wqoc-shadow:    0 8px 40px rgba(0,0,0,.15);
  --wqoc-font:      -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Panel overlay ─────────────────────────────────────────────────────────── */
.wqoc-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 99998;
  opacity: 0;
  visibility: hidden;
  transition: opacity .3s ease, visibility .3s ease;
  backdrop-filter: blur(2px);
}
.wqoc-overlay.is-open { opacity: 1; visibility: visible; }

/* ── Panel ─────────────────────────────────────────────────────────────────── */
.wqoc-panel {
  position: fixed;
  top: 0; right: 0;
  height: 100%;
  width: min(440px, 100vw);
  background: var(--wqoc-bg);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .35s cubic-bezier(.4,0,.2,1);
  box-shadow: var(--wqoc-shadow);
  font-family: var(--wqoc-font);
}
.wqoc-panel.is-open { transform: translateX(0); }

/* ── Header ────────────────────────────────────────────────────────────────── */
.wqoc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--wqoc-border);
  background: var(--wqoc-accent);
  color: #fff;
  flex-shrink: 0;
}
.wqoc-header h2 {
  margin: 0;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -.01em;
  color: #fff;
}
.wqoc-badge {
  background: rgba(255,255,255,.2);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 20px;
  min-width: 22px;
  text-align: center;
  margin-left: 8px;
}
.wqoc-close-btn {
  background: transparent;
  border: none;
  color: rgba(255,255,255,.75);
  font-size: 22px;
  cursor: pointer;
  padding: 4px;
  line-height: 1;
  border-radius: 6px;
  transition: color .2s, background .2s;
}
.wqoc-close-btn:hover { color: #fff; background: rgba(255,255,255,.15); }

/* ── Items area ────────────────────────────────────────────────────────────── */
.wqoc-body {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
  scroll-behavior: smooth;
}

.wqoc-items { list-style: none; margin: 0; padding: 0; }

/* Single row: [ img ] [ name ] [ − n + ] [ price ] [ ✕ ] */
.wqoc-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 0;
  border-bottom: 1px solid var(--wqoc-border);
  transition: opacity .2s;
}
.wqoc-item.is-removing { opacity: .3; pointer-events: none; }

.wqoc-item-img {
  width: 48px; height: 48px;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: 7px;
  border: 1px solid var(--wqoc-border);
  background: var(--wqoc-bg-alt);
}

.wqoc-item-name {
  flex: 1;
  min-width: 0;
  font-size: 13px; font-weight: 500; color: var(--wqoc-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Qty controls — compact inline */
.wqoc-qty-wrap {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  flex-grow: 0;
  width: auto;
  border: 1px solid var(--wqoc-border);
  border-radius: 7px;
  overflow: hidden;
  background: var(--wqoc-bg-alt);
}
.wqoc-qty-btn {
  background: transparent !important;
  border: none !important;
  width: 30px !important; height: 26px !important;
  font-size: 14px !important;
  cursor: pointer !important;
  color: var(--wqoc-text) !important;
  line-height: 1 !important;
  transition: background .15s !important;
  flex-shrink: 0 !important;
  display: flex !important; align-items: center !important; justify-content: center !important;
  padding: 0 !important;
  box-shadow: none !important;
}
.wqoc-qty-btn:hover { background: var(--wqoc-border) !important; }
.wqoc-qty-input {
  width: 50px !important;
  height: 26px !important;
  min-width: 0 !important;
  padding: 0 !important;
  text-align: center !important;
  border: none !important;
  border-left: 1px solid var(--wqoc-border) !important;
  border-right: 1px solid var(--wqoc-border) !important;
  border-radius: 0 !important;
  font-size: 13px; font-weight: 600;
  background: #fff !important;
  color: var(--wqoc-text);
  -moz-appearance: textfield;
  flex-shrink: 0;
  box-shadow: none !important;
  transition: none !important;
}
.wqoc-qty-input::-webkit-inner-spin-button,
.wqoc-qty-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }

.wqoc-item-subtotal {
  flex-shrink: 0;
  font-size: 13px; font-weight: 700; color: var(--wqoc-text); white-space: nowrap;
}

.wqoc-remove-btn {
  flex-shrink: 0;
  background: transparent; border: none;
  font-size: 12px; color: var(--wqoc-muted);
  cursor: pointer; padding: 3px 5px; border-radius: 4px;
  transition: color .15s, background .15s; line-height: 1;
}
.wqoc-remove-btn:hover { color: #e53e3e; background: #fff1f1; }

.wqoc-empty {
  text-align: center;
  padding: 48px 16px;
  color: var(--wqoc-muted);
  font-size: 15px;
}

/* ── Footer ────────────────────────────────────────────────────────────────── */
.wqoc-footer {
  flex-shrink: 0;
  padding: 20px 24px;
  border-top: 1px solid var(--wqoc-border);
  background: var(--wqoc-bg);
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* Totals */
.wqoc-totals { display: flex; justify-content: space-between; align-items: center; }
.wqoc-totals-label { font-size: 14px; color: var(--wqoc-muted); }
.wqoc-totals-value { font-size: 20px; font-weight: 700; color: var(--wqoc-text); }

/* Fields */
.wqoc-fields { display: flex; flex-direction: column; gap: 10px; }
.wqoc-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.wqoc-field label {
  font-size: 12px;
  font-weight: 600;
  color: var(--wqoc-muted);
  text-transform: uppercase;
  letter-spacing: .06em;
}
.wqoc-field input {
  height: 44px;
  border: 1.5px solid var(--wqoc-border);
  border-radius: var(--wqoc-radius);
  padding: 0 14px;
  font-size: 15px;
  color: var(--wqoc-text);
  background: var(--wqoc-bg-alt);
  transition: border-color .2s, box-shadow .2s;
  font-family: var(--wqoc-font);
  width: 100%;
  box-sizing: border-box;
}
.wqoc-field input:focus {
  outline: none;
  border-color: var(--wqoc-accent);
  box-shadow: 0 0 0 3px rgba(26,26,46,.1);
  background: #fff;
}
.wqoc-field input.is-error { border-color: #e53e3e; box-shadow: 0 0 0 3px rgba(229,62,62,.1); }

/* Place order button */
.wqoc-submit-btn {
  width: 100%;
  height: 50px;
  background: var(--wqoc-accent);
  color: #fff;
  border: none;
  border-radius: var(--wqoc-radius);
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  letter-spacing: .02em;
  transition: background .2s, transform .15s;
  font-family: var(--wqoc-font);
  position: relative;
  overflow: hidden;
}
.wqoc-submit-btn:hover { background: var(--wqoc-accent-l); }
.wqoc-submit-btn:active { transform: scale(.98); }
.wqoc-submit-btn:disabled { opacity: .6; cursor: not-allowed; }

.wqoc-submit-btn .wqoc-btn-spinner {
  display: none;
  width: 18px; height: 18px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: wqoc-spin .6s linear infinite;
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
}
.wqoc-submit-btn.is-loading .wqoc-btn-label { opacity: 0; }
.wqoc-submit-btn.is-loading .wqoc-btn-spinner { display: block; }

@keyframes wqoc-spin { to { transform: translate(-50%,-50%) rotate(360deg); } }

/* Notice */
.wqoc-notice {
  padding: 12px 14px;
  border-radius: 8px;
  font-size: 14px;
  line-height: 1.5;
  display: none;
  animation: wqoc-fadein .3s ease;
}
.wqoc-notice.is-visible { display: block; }
.wqoc-notice.is-success { background: #f0fff4; color: #276749; border: 1px solid #9ae6b4; }
.wqoc-notice.is-error   { background: #fff5f5; color: #c53030; border: 1px solid #feb2b2; }

@keyframes wqoc-fadein { from { opacity:0; transform: translateY(4px); } to { opacity:1; transform: none; } }

/* ── Trigger button (floating or inline, configurable) ─────────────────────── */
.wqoc-trigger {
  position: fixed;
  bottom: 28px; right: 28px;
  width: 56px; height: 56px;
  background: var(--wqoc-accent);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 22px;
  cursor: pointer;
  box-shadow: 0 4px 20px rgba(0,0,0,.25);
  display: flex; align-items: center; justify-content: center;
  z-index: 99990;
  transition: transform .2s, box-shadow .2s;
}
.wqoc-trigger:hover { transform: scale(1.08); box-shadow: 0 6px 28px rgba(0,0,0,.3); }
.wqoc-trigger .wqoc-trigger-badge {
  position: absolute;
  top: -4px; right: -4px;
  background: #e53e3e;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  width: 20px; height: 20px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff;
  opacity: 0;
  transform: scale(.5);
  transition: opacity .2s, transform .2s;
}
.wqoc-trigger .wqoc-trigger-badge.is-visible {
  opacity: 1; transform: scale(1);
}

a.cart-contents,
.elementor-menu-cart__toggle,
.woocommerce-mini-cart__buttons a,
.wc-block-mini-cart__button,
a[href*="cart"] .count,
.widget_shopping_cart_content .buttons a {
  /* JS will handle the click; hide original checkout/cart buttons */
}

/* Hide native WC sidebar cart checkout buttons when panel is active */
.wqoc-hide-native .widget_shopping_cart_content .buttons,
.wqoc-hide-native .woocommerce-mini-cart__buttons {
  display: none !important;
}

/* ── Responsive ────────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .wqoc-panel { width: 100vw; }
  .wqoc-item-name { font-size: 12px; }
}
