/* BeYou cart drawer — styles. Loaded by beyou-cart.php */
.byc, .byc * { box-sizing: border-box; }
.byc a, .byc a:hover, .byc a:focus, .byc a:visited { text-decoration: none !important; }

.byc {
  --navy: #20324E;
  --caramel: #C4A96A;
  --out: cubic-bezier(0.22, 1, 0.36, 1);
  --sheet: cubic-bezier(0.32, 0.72, 0, 1);
  position: fixed; inset: 0;
  z-index: 100002;                       /* above header + theme side cart */
  visibility: hidden;
  pointer-events: none;
  font-family: 'DM Sans', sans-serif;
  -webkit-font-smoothing: antialiased;
  transition: visibility 0s linear 0.5s;
}
.byc.is-open { visibility: visible; pointer-events: auto; transition-delay: 0s; }

.byc-scrim {
  position: absolute; inset: 0;
  background: rgba(8,12,20,0.46);
  -webkit-backdrop-filter: blur(6px) saturate(1.4);
  backdrop-filter: blur(6px) saturate(1.4);
  opacity: 0;
  transition: opacity 0.35s ease;
}
.byc.is-open .byc-scrim { opacity: 1; }

/* ── PANEL: floating glass drawer (desktop) ── */
.byc-panel {
  position: absolute;
  top: 12px; right: 12px; bottom: 12px;
  width: min(440px, calc(100vw - 24px));
  display: flex; flex-direction: column;
  border-radius: 26px;
  background: rgba(255,255,255,0.90);
  -webkit-backdrop-filter: blur(40px) saturate(2) brightness(1.05);
  backdrop-filter: blur(40px) saturate(2) brightness(1.05);
  border: 1px solid rgba(255,255,255,0.9);
  border-top-color: rgba(255,255,255,0.98);
  box-shadow: 0 4px 8px rgba(32,50,78,0.06), 0 30px 80px rgba(32,50,78,0.22), inset 0 1.5px 0 rgba(255,255,255,0.95);
  overflow: hidden;
  transform: translateX(calc(100% + 24px));
  transition: transform 0.5s var(--sheet);
}
.byc.is-open .byc-panel { transform: none; }

.byc-grab { display: none; }

/* ── HEAD ── */
.byc-head {
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 20px 20px 14px;
}
.byc-head-l { display: flex; align-items: baseline; gap: 10px; min-width: 0; }
.byc-title {
  margin: 0; padding: 0;
  font-family: 'Oswald', sans-serif;
  font-size: 24px; font-weight: 500; line-height: 1.1; letter-spacing: 0.01em;
  color: var(--navy);
}
.byc-count { font-size: 13px; font-weight: 500; color: rgba(32,50,78,0.55); }
.byc-x {
  -webkit-appearance: none; appearance: none;
  flex-shrink: 0;
  width: 36px; height: 36px; min-width: 0; min-height: 0; margin: 0; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%;
  background: rgba(32,50,78,0.07); color: var(--navy);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.1s ease-out;
  -webkit-tap-highlight-color: transparent;
}
.byc-x:hover { background: rgba(32,50,78,0.13); }
.byc-x:active { transform: scale(0.9); }

/* ── FREE SHIPPING ── */
.byc-ship {
  flex-shrink: 0;
  margin: 0 20px 6px;
  padding: 13px 14px 14px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(232,213,196,0.34), rgba(250,249,247,0.9));
  border: 1px solid rgba(32,50,78,0.07);
}
.byc-ship[hidden] { display: none; }
.byc-ship-txt { margin: 0 0 10px; padding: 0; font-size: 13px; font-weight: 500; line-height: 1.35; color: var(--navy); display: flex; align-items: center; gap: 7px; }
.byc-ship-txt svg { flex-shrink: 0; color: var(--caramel); }
.byc-track { height: 6px; border-radius: 3px; background: rgba(32,50,78,0.10); overflow: hidden; }
.byc-fill {
  display: block; width: 100%; height: 100%;
  border-radius: 3px;
  background: var(--navy);
  transform: scaleX(0); transform-origin: left center;
  transition: transform 0.9s var(--out), background 0.4s ease;
}
.byc-ship.is-done .byc-fill { background: linear-gradient(90deg, var(--navy), var(--caramel)); }

/* ── BODY ── */
.byc-body {
  flex: 1; min-height: 0;
  overflow-y: auto; -webkit-overflow-scrolling: touch; overscroll-behavior: contain;
  padding: 0 20px;
}
.byc-body::-webkit-scrollbar { width: 3px; }
.byc-body::-webkit-scrollbar-thumb { background: #D8DCE8; border-radius: 10px; }
.byc-list { list-style: none; margin: 0; padding: 0; }

/* item */
.byc-item {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 14px;
  margin: 0; padding: 16px 0;
  border-bottom: 1px solid rgba(32,50,78,0.07);
  overflow: hidden;
  transition: height 0.38s var(--out), opacity 0.3s ease, padding 0.38s var(--out), border-color 0.3s ease;
}
.byc-item:last-child { border-bottom-color: transparent; }
.byc-item.fresh { animation: bycUp 0.6s var(--out) calc(var(--i, 0) * 55ms + 0.18s) both; }
@keyframes bycUp { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
.byc-item.is-removing { opacity: 0; height: 0 !important; padding-top: 0; padding-bottom: 0; border-color: transparent; }

.byc-img {
  display: block; width: 84px; aspect-ratio: 4 / 5;
  border-radius: 14px; overflow: hidden;
  background: #F1EEE8;
  box-shadow: 0 2px 8px rgba(32,50,78,0.08);
}
.byc-img img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center top; }

.byc-info { min-width: 0; display: flex; flex-direction: column; }
.byc-name {
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  font-size: 14px; font-weight: 600; line-height: 1.3; letter-spacing: -0.005em;
  color: var(--navy) !important;
}
.byc-meta { margin: 4px 0 0; padding: 0; font-size: 12.5px; line-height: 1.3; color: rgba(32,50,78,0.58); }
.byc-price { display: flex; align-items: center; flex-wrap: wrap; gap: 4px 8px; margin-top: 8px; }
.byc-price b { font-size: 14.5px; font-weight: 700; color: var(--navy); letter-spacing: -0.01em; }
.byc-price s { font-size: 12px; color: rgba(32,50,78,0.40); }
.byc-off { font-size: 11px; font-weight: 600; color: rgba(32,50,78,0.75); background: rgba(32,50,78,0.07); padding: 2px 7px; border-radius: 100px; }

.byc-row2 { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 10px; }
.byc-qty { display: inline-flex; align-items: center; height: 36px; border-radius: 11px; background: rgba(32,50,78,0.06); }
.byc-qty button {
  -webkit-appearance: none; appearance: none;
  width: 34px; height: 36px; min-width: 0; min-height: 0; margin: 0; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 11px; background: transparent; color: var(--navy);
  cursor: pointer; transition: background 0.15s ease, transform 0.1s ease-out, opacity 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}
.byc-qty button:hover { background: rgba(32,50,78,0.07); }
.byc-qty button:active { transform: scale(0.88); }
.byc-qty button:disabled { opacity: 0.3; cursor: not-allowed; transform: none; background: transparent; }
.byc-qn { min-width: 26px; text-align: center; font-size: 14px; font-weight: 600; color: var(--navy); font-variant-numeric: tabular-nums; }
.byc-rm {
  -webkit-appearance: none; appearance: none;
  width: 36px; height: 36px; min-width: 0; min-height: 0; margin: 0; padding: 0;
  display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%; background: transparent; color: rgba(32,50,78,0.50);
  cursor: pointer; transition: background 0.2s ease, color 0.2s ease, transform 0.1s ease-out;
  -webkit-tap-highlight-color: transparent;
}
.byc-rm:hover { background: rgba(32,50,78,0.07); color: var(--navy); }
.byc-rm:active { transform: scale(0.88); }
.byc-item.is-busy .byc-info { opacity: 0.6; transition: opacity 0.2s ease; }

/* skeleton */
.byc-sk { display: grid; grid-template-columns: 84px 1fr; gap: 14px; padding: 16px 0; }
.byc-sk i, .byc-sk em { display: block; border-radius: 10px; background: linear-gradient(90deg, rgba(32,50,78,0.06) 25%, rgba(255,255,255,0.8) 50%, rgba(32,50,78,0.06) 75%); background-size: 200% 100%; animation: bycShimmer 1.6s ease-in-out infinite; }
.byc-sk i { aspect-ratio: 4 / 5; border-radius: 14px; }
.byc-sk em { height: 14px; margin-bottom: 10px; }
.byc-sk em:nth-child(2) { width: 60%; }
.byc-sk em:nth-child(3) { width: 40%; height: 18px; }
@keyframes bycShimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }

/* empty */
.byc-empty { display: none; flex-direction: column; align-items: center; text-align: center; padding: 48px 12px 40px; }
.byc-empty-ico { width: 84px; height: 84px; margin-bottom: 18px; display: flex; align-items: center; justify-content: center; border-radius: 50%; background: rgba(32,50,78,0.05); color: rgba(32,50,78,0.55); }
.byc-empty-t { margin: 0 0 6px; font-family: 'Oswald', sans-serif; font-size: 22px; font-weight: 400; letter-spacing: 0.01em; color: var(--navy); }
.byc-empty-d { margin: 0 0 22px; font-size: 14px; line-height: 1.5; color: rgba(32,50,78,0.58); }
.byc-panel.is-empty .byc-empty { display: flex; }
.byc-panel.is-empty .byc-list, .byc-panel.is-empty .byc-foot, .byc-panel.is-empty .byc-ship { display: none; }

/* buttons */
.byc-btn {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; max-width: 100%; height: 52px; padding: 0 22px;
  border-radius: 14px; border: 0;
  background: var(--navy); color: #fff !important;
  font-family: 'DM Sans', sans-serif; font-size: 13.5px; font-weight: 600; letter-spacing: 0.03em; line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(32,50,78,0.26);
  transition: background 0.25s ease, transform 0.1s ease-out, box-shadow 0.25s ease;
  -webkit-tap-highlight-color: transparent;
}
.byc-empty .byc-btn { width: auto; }
.byc-btn:hover { background: #2c4470; color: #fff !important; }
.byc-btn:active { transform: scale(0.97); }
.byc-btn svg { flex-shrink: 0; }

/* ── FOOT ── */
.byc-foot {
  flex-shrink: 0;
  padding: 16px 20px calc(18px + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid rgba(32,50,78,0.08);
  background: rgba(255,255,255,0.65);
}
.byc-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.byc-row[hidden] { display: none; }
.byc-lbl { font-size: 14px; font-weight: 500; color: rgba(32,50,78,0.72); }
.byc-val { font-family: 'Oswald', sans-serif; font-size: 26px; font-weight: 500; letter-spacing: -0.01em; color: var(--navy); font-variant-numeric: tabular-nums; }
.byc-val-s { font-size: 14px; font-weight: 600; color: var(--navy); }
.byc-note { margin: 4px 0 14px; padding: 0; font-size: 12px; line-height: 1.4; color: rgba(32,50,78,0.52); }
.byc-link { display: block; text-align: center; padding: 14px 0 0; color: var(--navy) !important; font-size: 13px; font-weight: 600; -webkit-tap-highlight-color: transparent; transition: opacity 0.1s ease-out; }
.byc-link span { padding-bottom: 3px; background: linear-gradient(currentColor, currentColor) left bottom / 100% 1px no-repeat; transition: background-size 0.3s var(--out); }
@media (hover: hover) { .byc-link:hover span { background-size: 100% 2px; } }
.byc-link:active { opacity: 0.55; }

.byc-x:focus-visible, .byc-btn:focus-visible, .byc-link:focus-visible, .byc-qty button:focus-visible, .byc-rm:focus-visible, .byc-name:focus-visible { outline: 2px solid var(--caramel); outline-offset: 2px; }

/* ── MOBILE: bottom sheet (same family as the size guide) ── */
@media (max-width: 640px) {
  .byc-panel {
    top: auto; left: 0; right: 0; bottom: 0;
    width: auto; max-height: 88vh; max-height: 88dvh;
    border-radius: 24px 24px 0 0;
    transform: translateY(100%);
    transition: transform 0.46s var(--sheet);
  }
  .byc-grab { display: flex; align-items: center; justify-content: center; height: 24px; flex-shrink: 0; touch-action: none; cursor: grab; }
  .byc-grab::before { content: ''; width: 36px; height: 4px; border-radius: 100px; background: #DDE1E9; }
  .byc-head { padding-top: 4px; touch-action: none; }
  .byc-body { min-height: 180px; }
}

/* ── ACCESSIBILITY ── */
@media (prefers-reduced-motion: reduce) {
  .byc-panel { transition: transform 0.18s ease, opacity 0.18s ease; }
  .byc-item.fresh { animation: none; }
  .byc-fill { transition: none; }
  .byc-sk i, .byc-sk em { animation: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .byc-panel { background: #fff; -webkit-backdrop-filter: none; backdrop-filter: none; }
  .byc-scrim { -webkit-backdrop-filter: none; backdrop-filter: none; }
}

/* the theme's own side cart must never show on top of this one */
html.byc-on .cart-widget-side { display: none !important; }

/* ── Theme-proofing: Woodmart styles every <button>, so these must win ── */
.byc button.byc-x,
.byc button.byc-rm {
  -webkit-appearance: none !important; appearance: none !important;
  display: flex !important; align-items: center !important; justify-content: center !important;
  width: 36px !important; height: 36px !important; min-width: 0 !important; min-height: 0 !important;
  margin: 0 !important; padding: 0 !important;
  border: 0 !important; border-radius: 50% !important;
  box-shadow: none !important; text-transform: none !important; letter-spacing: 0 !important; line-height: 1 !important;
  cursor: pointer;
}
.byc button.byc-x { background: rgba(32,50,78,0.07) !important; color: #20324E !important; }
.byc button.byc-x:hover { background: rgba(32,50,78,0.13) !important; color: #20324E !important; }
.byc button.byc-rm { background: transparent !important; color: rgba(32,50,78,0.55) !important; }
.byc button.byc-rm:hover { background: rgba(32,50,78,0.07) !important; color: #20324E !important; }
.byc .byc-qty button { color: #20324E !important; box-shadow: none !important; text-transform: none !important; }
.byc button svg { display: block !important; fill: none !important; stroke: currentColor !important; }

/* ── Footer must always show when the cart has items (v1.0.1)
   Footer is a <div> now, and these rules beat any theme / snippet rule that hides or moves it. ── */
.byc .byc-panel:not(.is-empty) .byc-foot {
  display: block !important; visibility: visible !important; opacity: 1 !important;
  position: static !important; transform: none !important;
  height: auto !important; max-height: none !important; overflow: visible !important;
  flex: 0 0 auto !important; clip: auto !important;
}
.byc .byc-panel:not(.is-empty) .byc-foot .byc-row:not([hidden]) { display: flex !important; }
.byc .byc-panel:not(.is-empty) .byc-foot .byc-btn { display: flex !important; }
.byc .byc-panel:not(.is-empty) .byc-foot .byc-link { display: block !important; }
