/* ============================================================
   WC Rental — Floating Cart  (floating-cart.css)
   ============================================================ */
:root {
  --wcr-primary:           #111827;
  --wcr-primary-text:      #ffffff;
  --wcr-radius:            12px;
  --wcr-radius-sm:         8px;
  --wcr-border:            #e5e7eb;
  --wcr-text:              #111827;
  --wcr-muted:             #6b7280;
  --wcr-bg:                #f9fafb;
  /* Cart-specific (overridden by inline CSS from settings) */
  --wcr-cart-icon-bg:      var(--wcr-primary);
  --wcr-cart-icon-color:   var(--wcr-primary-text);
  --wcr-cart-badge-bg:     #2563eb;
  --wcr-cart-badge-text:   #ffffff;
  --wcr-cart-panel-bg:     #ffffff;
  --wcr-cart-panel-border: var(--wcr-border);
  --wcr-cart-panel-text:   var(--wcr-text);
  --wcr-cart-panel-muted:  var(--wcr-muted);
  --wcr-cart-period-bg:    var(--wcr-primary);
  --wcr-cart-period-text:  var(--wcr-primary-text);
  --wcr-cart-footer-bg:    var(--wcr-bg);
  --wcr-cart-btn-bg:       var(--wcr-primary);
  --wcr-cart-btn-text:     var(--wcr-primary-text);
}

/* ── Trigger ── */
.wcr-cart-trigger {
  position: fixed;
  bottom: 1.5em;
  right: 1.5em;
  z-index: 9980;
  width: 52px;
  height: 52px;
  background: var(--wcr-cart-icon-bg);
  color: var(--wcr-cart-icon-color);
  border: none;
  border-radius: 50%;            /* perfect circle */
  box-shadow: 0 4px 18px rgba(0,0,0,.22);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform .15s, opacity .15s;
  padding: 0;
  flex-shrink: 0;
}
.wcr-cart-trigger:hover  { transform: scale(1.07); }
.wcr-cart-trigger.wcr-bounce { animation: wcrBounce .45s ease; }
@keyframes wcrBounce { 0%,100%{transform:scale(1)} 50%{transform:scale(1.18)} }
.wcr-cart-trigger svg { width: 22px; height: 22px; }

.wcr-cart-count {
  position: absolute;
  top: -3px; right: -3px;
  background: var(--wcr-cart-badge-bg);
  color: var(--wcr-cart-badge-text);
  font-size: .65em;
  font-weight: 800;
  width: 20px; height: 20px;
  border-radius: 50%;           /* perfect circle */
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid #fff;
  line-height: 1;
  padding: 0;
}

/* ── Panel ── */
.wcr-cart-panel {
  position: fixed;
  bottom: 0; right: 0;
  width: 340px;
  max-height: 92vh;
  background: var(--wcr-cart-panel-bg);
  box-shadow: -4px 0 40px rgba(0,0,0,.14);
  border-radius: var(--wcr-radius) 0 0 0;
  z-index: 9981;
  display: flex;
  flex-direction: column;
  transform: translateX(110%);
  transition: transform .25s cubic-bezier(.22,.68,0,1.2);
}
.wcr-cart-panel.is-open { transform: translateX(0); }

.wcr-cart-panel-inner {
  display: flex;
  flex-direction: column;
  max-height: 92vh;
  overflow: hidden;
}

/* Head */
.wcr-cart-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .9em 1.1em;
  border-bottom: 1px solid var(--wcr-cart-panel-border);
  flex-shrink: 0;
}
.wcr-cart-panel-title {
  font-size: .82em;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--wcr-cart-panel-text);
}
.wcr-cart-panel-close {
  background: none;
  border: 1.5px solid var(--wcr-cart-panel-border);
  font-size: .82em;
  cursor: pointer;
  color: var(--wcr-cart-panel-muted);
  width: 26px; height: 26px;
  border-radius: 6px;
  display: flex; align-items: center; justify-content: center;
  padding: 0; line-height: 1;
  transition: background .12s, color .12s;
}
.wcr-cart-panel-close:hover { background: var(--wcr-cart-footer-bg); color: var(--wcr-cart-panel-text); }

/* Period bar */
.wcr-cart-period-bar {
  display: flex;
  align-items: center;
  gap: .5em;
  padding: .55em 1.1em;
  background: var(--wcr-cart-period-bg);
  color: var(--wcr-cart-period-text);
  font-size: .8em;
  flex-wrap: wrap;
  flex-shrink: 0;
}
.wcr-cpb-pickup-label { color: rgba(255,255,255,.6); font-weight: 600; }
.wcr-cpb-start, .wcr-cpb-end { font-weight: 700; }
.wcr-cart-period-bar svg { width: 14px; height: 14px; color: rgba(255,255,255,.5); flex-shrink: 0; }
.wcr-cpb-edit-btn {
  margin-left: auto;
  background: rgba(255,255,255,.12);
  border: none;
  border-radius: 5px;
  padding: .25em .4em;
  cursor: pointer;
  color: #fff;
  display: flex; align-items: center;
  transition: background .12s;
}
.wcr-cpb-edit-btn svg { width: 13px; height: 13px; }
.wcr-cpb-edit-btn:hover { background: rgba(255,255,255,.22); }

/* Items */
.wcr-cart-items {
  flex: 1;
  overflow-y: auto;
  padding: .4em 0;
}
.wcr-cart-loading {
  display: flex; align-items: center; justify-content: center; padding: 2.5em;
}
.wcr-spinner {
  width: 22px; height: 22px;
  border: 2.5px solid var(--wcr-cart-panel-border);
  border-top-color: var(--wcr-cart-icon-bg);
  border-radius: 50%;
  animation: wcrSpin .65s linear infinite;
  display: inline-block;
}
@keyframes wcrSpin { to { transform: rotate(360deg); } }
.wcr-cart-empty { text-align: center; padding: 2.5em 1em; font-size: .88em; color: var(--wcr-cart-panel-muted); }

.wcr-ci {
  display: grid;
  grid-template-columns: 52px 1fr auto;
  gap: .55em;
  align-items: center;
  padding: .6em 1.1em;
  border-bottom: 1px solid var(--wcr-cart-panel-border);
}
.wcr-ci-thumb img { width: 52px; height: 52px; object-fit: cover; border-radius: 7px; border: 1px solid var(--wcr-cart-panel-border); display: block; }
.wcr-ci-info { min-width: 0; }
.wcr-ci-name { font-size: .83em; font-weight: 700; color: var(--wcr-cart-panel-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-bottom: .18em; }
.wcr-ci-avail { font-size: .7em; color: #22c55e; font-weight: 600; }
.wcr-ci-avail::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: #22c55e; display: inline-block; margin-right: .25em; vertical-align: middle; }
.wcr-ci-controls { display: flex; flex-direction: column; align-items: flex-end; gap: .35em; }
.wcr-ci-price { font-size: .85em; font-weight: 700; color: var(--wcr-cart-panel-text); white-space: nowrap; }
.wcr-ci-qty {
  display: flex; align-items: center; gap: 0;
  border: 1.5px solid var(--wcr-cart-panel-border); border-radius: 6px; overflow: hidden;
}
.wcr-ci-qty-btn { background: none; border: none; padding: .18em .42em; cursor: pointer; font-size: .85em; color: var(--wcr-cart-panel-text); transition: background .1s; line-height: 1; }
.wcr-ci-qty-btn:hover { background: var(--wcr-cart-footer-bg); }
.wcr-ci-qty-val { font-size: .8em; font-weight: 700; padding: .18em .3em; min-width: 20px; text-align: center; }
.wcr-ci-remove { background: none; border: none; color: #dc2626; font-size: .7em; cursor: pointer; opacity: .6; padding: 0; transition: opacity .1s; line-height: 1; }
.wcr-ci-remove:hover { opacity: 1; }

/* Footer */
.wcr-cart-panel-foot {
  padding: .75em 1.1em;
  border-top: 1px solid var(--wcr-cart-panel-border);
  flex-shrink: 0;
  background: var(--wcr-cart-footer-bg);
}
.wcr-cart-subtotal { display: flex; justify-content: space-between; font-size: .85em; margin-bottom: .6em; color: var(--wcr-cart-panel-muted); }
.wcr-cart-subtotal strong { color: var(--wcr-cart-panel-text); }
.wcr-cart-view-btn {
  display: block;
  width: 100%;
  text-align: center;
  padding: .65em 1em;
  background: var(--wcr-cart-btn-bg);
  color: var(--wcr-cart-btn-text);
  border: none;
  border-radius: var(--wcr-radius-sm);
  font-weight: 700;
  font-size: .88em;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: .05em;
  cursor: pointer;
  transition: opacity .15s;
  font-family: inherit;
}
.wcr-cart-view-btn:hover { opacity: .85; color: var(--wcr-cart-btn-text); }

/* Time picker panel inside cart */
.wcr-cart-times-panel {
  padding: 1em 1.1em;
  border-top: 1px solid var(--wcr-cart-panel-border);
  flex-shrink: 0;
  background: var(--wcr-cart-panel-bg);
}
.wcr-ctp-title {
  font-size: .82em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--wcr-cart-panel-muted);
  margin: 0 0 .9em;
}
.wcr-ctp-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .75em;
  margin-bottom: .65em;
}
.wcr-ctp-label {
  font-size: .85em;
  font-weight: 600;
  color: var(--wcr-cart-panel-text);
  flex-shrink: 0;
}
.wcr-ctp-input {
  border: 1.5px solid var(--wcr-cart-panel-border);
  border-radius: 6px;
  padding: .38em .65em;
  font-size: .88em;
  font-weight: 600;
  color: var(--wcr-cart-panel-text);
  width: 130px;
}
.wcr-ctp-input:focus { outline: none; border-color: var(--wcr-cart-icon-bg); }
.wcr-ctp-confirm {
  display: block;
  width: 100%;
  padding: .65em;
  background: var(--wcr-cart-btn-bg);
  color: var(--wcr-cart-btn-text);
  border: none;
  border-radius: var(--wcr-radius-sm);
  font-size: .88em;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  cursor: pointer;
  margin-top: .35em;
  margin-bottom: .4em;
  font-family: inherit;
  transition: opacity .15s;
}
.wcr-ctp-confirm:hover { opacity: .85; }
.wcr-ctp-confirm:disabled { opacity: .5; cursor: wait; }
.wcr-ctp-skip {
  display: block;
  width: 100%;
  background: none;
  border: none;
  font-size: .78em;
  color: var(--wcr-cart-panel-muted);
  cursor: pointer;
  text-align: center;
  text-decoration: underline;
  padding: 0;
  font-family: inherit;
}
.wcr-ctp-skip:hover { color: var(--wcr-cart-panel-text); }

/* Backdrop */
.wcr-cart-backdrop {
  display: none;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.3);
  z-index: 9979;
}
.wcr-cart-backdrop.is-visible { display: block; }

@media (max-width: 768px) {
  /* Push cart trigger above the global date bar on mobile */
  .wcr-cart-trigger { bottom: 7em; }
}
@media (max-width: 380px) {
  .wcr-cart-panel { width: 100%; border-radius: 0; }
  .wcr-cart-trigger { bottom: 7em; right: 1em; }
}

/* ── Overnight row in time picker ── */
.wcr-ctp-overnight {
  margin: 14px 0 4px;
  padding: 12px 14px;
  background: #f8f6f1;
  border: 1px solid #e8e0d0;
  border-radius: 8px;
}
.wcr-ctp-ovn-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 14px;
  color: #333;
  margin: 0;
}
.wcr-ctp-ovn-label input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: #1a1a2e;
  cursor: pointer;
  flex-shrink: 0;
}
.wcr-ctp-ovn-text {
  flex: 1;
  font-weight: 500;
}
.wcr-ctp-ovn-price {
  font-weight: 700;
  color: #1a1a2e;
  white-space: nowrap;
  font-size: 13px;
}
.wcr-ctp-ovn-free {
  color: #2e7d32;
}

/* ── Cart fee rows (delivery, overnight, etc.) ── */
.wcr-cart-fee-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 8px 16px;
  border-top: 1px dashed #e8e0d0;
  font-size: 13px;
  color: #555;
}
.wcr-cart-fee-name {
  font-style: italic;
}
.wcr-cart-fee-price {
  font-weight: 600;
  color: #333;
}

/* ── Cart item options dropdown ── */
.wcr-ci-opts-wrap {
    margin-top: 4px;
}
.wcr-ci-opts-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    padding: 0;
    font-size: 11px;
    font-weight: 600;
    color: #64748b;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: .04em;
    transition: color .12s;
}
.wcr-ci-opts-toggle:hover { color: #1e293b; }
.wcr-ci-opts-chevron {
    transition: transform .2s;
    flex-shrink: 0;
}
.wcr-ci-opts-list {
    list-style: none;
    margin: 5px 0 0;
    padding: 0;
}
.wcr-ci-opts-list li {
    font-size: 11px;
    color: #475569;
    padding: 2px 0;
    border-bottom: 1px solid #f1f5f9;
    line-height: 1.4;
}
.wcr-ci-opts-list li:last-child { border-bottom: none; }
