/* ============================================================
   Silver Oaks — Cart Drawer CSS
   ============================================================ */

/* ---- Overlay --------------------------------------------- */
.so-cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9998;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
  backdrop-filter: blur(2px);
}
.so-cart-open .so-cart-overlay {
  opacity: 1;
  pointer-events: all;
}

/* ---- Drawer ---------------------------------------------- */
.so-cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 800px;
  height: 100dvh;
  background: #fff;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  box-shadow: -16px 0 64px rgba(0,0,0,.12);
  overflow: hidden;
}
.so-cart-open .so-cart-drawer {
  transform: translateX(0);
}

.so-cart-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
}

/* ---- Header ---------------------------------------------- */
.so-cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 32px 20px;
  background: #fff;
  border-bottom: 1px solid var(--so-divider, #EAE8E2);
  flex-shrink: 0;
}

/* header-left: title + count inline via flex row */
.so-cart-header-left {
  display: flex;
  flex-direction: row;
  align-items: baseline;
  gap: 0;
}

.so-cart-title {
  font-family: 'Sumana', serif;
  font-size: 28px;
  font-weight: 400;
  color: #111;
  margin: 0;
  line-height: 1;
}

/* "N COTTAGES SELECTED" label — inline, after title */
.so-cart-count {
  font-family: 'Open Sans', sans-serif;
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #717171;
  margin-left: 12px;
  display: inline;
  line-height: 1;
}

.so-cart-close {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid var(--so-light-gray, #E1E6E9);
  border-radius: 50%;
  cursor: pointer;
  color: var(--so-text, #151515);
  transition: background 0.2s, border-color 0.2s;
  flex-shrink: 0;
}
.so-cart-close:hover {
  background: var(--so-light-gray, #E1E6E9);
}

/* ---- Hold Banner ----------------------------------------- */
.so-hold-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 40px;
  background: var(--so-light-gray, #E1E6E9);
  font-family: 'Open Sans', sans-serif;
  font-size: 12px;
  color: var(--so-text, #151515);
  border-bottom: 1px solid rgba(0,0,0,.05);
  flex-shrink: 0;
}
.so-hold-banner.urgent {
  background: #fef3e2;
  color: #c0392b;
}
#so-hold-timer { font-variant-numeric: tabular-nums; font-weight: 700; }

/* ---- Cart List ------------------------------------------- */
.so-cart-list {
  flex: 1;
  overflow-y: auto;
  padding: 24px 40px;
  display: flex;
  flex-direction: column;
  gap: 0;
  scroll-behavior: smooth;
}
.so-cart-list::-webkit-scrollbar { width: 4px; }
.so-cart-list::-webkit-scrollbar-thumb { background: var(--so-light-gray, #E1E6E9); border-radius: 2px; }

/* ---- Empty state ----------------------------------------- */
.so-cart-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  color: var(--so-muted, #B4B4B4);
  padding: 60px 0;
}
.so-cart-empty svg { opacity: .35; }
.so-cart-empty p {
  margin: 0;
  font-family: 'Open Sans', sans-serif;
  font-size: 16px;
  color: #717171;
}
.so-cart-empty-hint {
  font-size: 13px !important;
  color: #B4B4B4 !important;
}

/* ---- Cart Item ------------------------------------------- */
.so-cart-item {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: 20px;
  align-items: start;
  padding: 20px 0;
  border-bottom: 1px solid var(--so-divider, #EAE8E2);
}
.so-cart-item:last-child { border-bottom: none; }

/* thumbnail: 80x80, cover, radius 2px */
.so-cart-item-img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 2px;
  background: var(--so-light-gray, #E1E6E9);
  display: block;
}
.so-cart-item-img-placeholder {
  width: 80px;
  height: 80px;
  background: var(--so-light-gray, #E1E6E9);
  border-radius: 2px;
}

/* details column */
.so-cart-item-details {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

/* cottage name: Open Sans 14px 600, uppercase, #151515, letter-spacing 0.05em */
.so-cart-item-name {
  font-family: 'Open Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  color: #151515;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin: 0;
}

/* dates row: 13px #717171 */
.so-cart-item-dates {
  font-family: 'Open Sans', sans-serif;
  font-size: 13px;
  color: #717171;
}

/* "3 nights · 4 guests": 13px #717171 */
.so-cart-item-guests {
  font-family: 'Open Sans', sans-serif;
  font-size: 13px;
  color: #717171;
}

/* "Edit  Remove" inline action row */
.so-cart-item-actions {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 16px;
  margin-top: 4px;
}
.so-cart-item-edit,
.so-cart-item-remove {
  background: none;
  border: none;
  cursor: pointer;
  color: #B4B4B4;
  font-size: 12px;
  font-family: 'Open Sans', sans-serif;
  padding: 0;
  transition: color 0.2s;
}
.so-cart-item-edit:hover,
.so-cart-item-remove:hover { color: #151515; }

/* right column: price + per-night note */
.so-cart-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}

/* "$2,850": Open Sans 20px 700, #151515 */
.so-cart-item-price {
  font-family: 'Open Sans', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #151515;
  white-space: nowrap;
}

/* "($950 / night)": 13px #717171 */
.so-cart-item-price-sub {
  font-family: 'Open Sans', sans-serif;
  font-size: 13px;
  color: #717171;
  white-space: nowrap;
}

.so-cart-item-price-loading {
  font-size: 12px;
  color: #B4B4B4;
  display: flex;
  align-items: center;
  gap: 6px;
}

/* ---- Checkout Panel -------------------------------------- */
.so-cart-checkout-panel {
  border-top: 1px solid var(--so-divider, #EAE8E2);
  padding: 28px 40px 32px;
  background: #fff;
  flex-shrink: 0;
  position: relative;
}

.so-cart-loading-overlay[hidden] { display: none !important; }

.so-cart-loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.85);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-family: 'Open Sans', sans-serif;
  font-size: 14px;
  color: #717171;
  z-index: 1;
}

/* price breakdown rows */
.so-price-breakdown {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-bottom: 24px;
}

/* Subtotal, Cleaning & Resort Fees, Taxes: 15px, space-between */
.so-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-family: 'Open Sans', sans-serif;
  font-size: 15px;
  color: var(--so-text, #151515);
}

/* TOTAL AMOUNT DUE: 17px 700, border-top 1px solid #151515, padding-top 14px, margin-top 8px */
.so-price-total {
  font-size: 17px;
  font-weight: 700;
  color: #151515;
  border-top: 1px solid #151515;
  padding-top: 14px;
  margin-top: 8px;
}

.so-cart-cta-wrap {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* checkout button: height 64px, 13px uppercase, letter-spacing 0.2em, #000 bg */
.so-btn-checkout {
  width: 100%;
  height: 64px;
  background: #000;
  color: #fff;
  font-family: 'Open Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  border: none;
  cursor: pointer;
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.so-btn-checkout:hover:not(:disabled) { background: #262626; }
.so-btn-checkout:disabled {
  background: var(--so-light-gray, #E1E6E9);
  color: #B4B4B4;
  cursor: not-allowed;
}

/* "You won't be charged yet": 13px, #B4B4B4, centered */
.so-cart-notice {
  font-family: 'Open Sans', sans-serif;
  font-size: 13px;
  color: #B4B4B4;
  text-align: center;
  margin: 0;
}

/* ---- Cart FAB (sticky floating button) ------------------- */
.so-cart-fab {
  position: fixed;
  bottom: 32px;
  right: 32px;
  width: 60px;
  height: 60px;
  background: var(--so-black, #000);
  color: #fff;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9000;
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
  transition: background 0.2s, transform 0.2s;
}
.so-cart-fab:hover {
  background: #262626;
  transform: scale(1.05);
}

.so-fab-count {
  position: absolute;
  top: -4px;
  right: -4px;
  width: 22px;
  height: 22px;
  background: var(--so-accent, #DDAA8B);
  color: #fff;
  border-radius: 50%;
  font-family: 'Open Sans', sans-serif;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ---- Mobile -------------------------------------------- */
@media (max-width: 600px) {
  .so-cart-drawer { max-width: 100%; }
  .so-cart-header { padding: 20px 20px 16px; }
  .so-hold-banner { padding: 12px 20px; }
  .so-cart-list { padding: 16px 20px; }
  .so-cart-checkout-panel { padding: 20px 20px 24px; }
  .so-cart-item { grid-template-columns: 64px 1fr auto; gap: 12px; }
  .so-cart-item-img,
  .so-cart-item-img-placeholder { width: 64px; height: 64px; }
  .so-cart-item-name { font-size: 12px; }
  .so-cart-item-price { font-size: 16px; }
  .so-cart-fab { bottom: 20px; right: 20px; width: 52px; height: 52px; }
}

/* --------------------------------------------------------------------------
   FAB retired: the theme navbar BOOK NOW button is repurposed as the cart
   trigger at runtime (cart.js replaceNavBookNow). Keep the node dead.
   -------------------------------------------------------------------------- */
#so-cart-fab { display: none !important; }

/* Navbar cart trigger (former BOOK NOW button, content swapped by JS)
   Figma nav-link Cart Option: CART label + 24x24 count bubble, gap 8 */
.so-nav-cart {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  gap: 8px;
  line-height: 1;
  border: none !important; /* theme outline style draws a white border; drop it */
  padding: 8px 16px !important;
}

.so-cart-item-price-unavail {
  font-family: 'Open Sans', sans-serif;
  font-size: 12px;
  line-height: 1.4;
  color: #717171;
  text-align: right;
}

/* Desktop/Label/M-Sb, inherits the navbar's white */
.so-nav-cart-label {
  font-family: 'Open Sans', sans-serif;
  font-size: 14px;
  font-weight: 600;
  line-height: 20px;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

/* 24x24 bubble: red + white number when filled */
.so-nav-cart-count {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #E53935;
  color: #FFFFFF;
  font-family: 'Open Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

/* Empty state per Figma: plain grey zero, no bubble */
.so-nav-cart-count--empty {
  background: transparent;
  color: #ACB7BE;
}

/* --------------------------------------------------------------------------
   Edit dates modal (cart item Edit button)
   -------------------------------------------------------------------------- */
#so-edit-modal { display: none; }
#so-edit-modal.so-edit-open { display: block; }

.so-edit-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 10000;
}

.so-edit-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 10001;
  width: min(400px, calc(100vw - 32px));
  max-height: calc(100vh - 48px);
  overflow-y: auto;
  background: #fff;
  padding: 28px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

.so-edit-close {
  position: absolute;
  top: 10px;
  right: 14px;
  background: none;
  border: none;
  font-size: 26px;
  line-height: 1;
  color: #151515;
  cursor: pointer;
  padding: 4px;
}

.so-edit-title {
  font-family: 'Sumana', serif;
  font-size: 20px;
  font-weight: 400;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: #151515;
  margin: 0 0 16px;
  padding-right: 28px;
}

.so-edit-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.so-edit-month {
  font-family: 'Open Sans', sans-serif;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.2em;
  color: #151515;
}

.so-edit-nav-btn {
  background: none;
  border: none;
  width: 32px;
  height: 32px;
  font-size: 15px;
  color: #151515;
  cursor: pointer;
  padding: 0;
}

.so-edit-nav-btn:disabled { opacity: 0.25; cursor: default; }

.so-edit-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 2px;
}

.so-edit-dow {
  font-family: 'Open Sans', sans-serif;
  font-size: 9px;
  letter-spacing: 0.08em;
  color: #B4B4B4;
  text-align: center;
  padding: 4px 0 8px;
  text-transform: uppercase;
}

.so-edit-day {
  background: none;
  border: none;
  cursor: pointer;
  font-family: 'Open Sans', sans-serif;
  font-size: 13px;
  color: #151515;
  padding: 8px 0;
  text-align: center;
  line-height: 1;
  transition: background 0.1s;
}

.so-edit-day:hover:not([disabled]):not(.so-edit-ci):not(.so-edit-co) {
  background: rgba(221, 170, 139, 0.15);
}

.so-edit-day.so-edit-past { color: #B4B4B4; cursor: default; }

.so-edit-day.so-edit-ci,
.so-edit-day.so-edit-co {
  background: #151515;
  color: #fff;
  font-weight: 600;
}

.so-edit-day.so-edit-range { background: rgba(221, 170, 139, 0.3); }

.so-edit-msg {
  font-family: 'Open Sans', sans-serif;
  font-size: 13px;
  line-height: 1.5;
  color: #B0472F;
  margin: 12px 0 0;
  min-height: 20px;
}

.so-edit-price {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-height: 36px;
  margin: 4px 0 16px;
  font-family: 'Open Sans', sans-serif;
  font-size: 14px;
  color: #717171;
}

.so-edit-price-total {
  font-family: 'Sumana', serif;
  font-size: 26px;
  color: #151515;
}

.so-edit-price-detail,
.so-edit-price-hint { font-size: 13px; color: #717171; }

.so-edit-actions {
  display: flex;
  justify-content: flex-end;
  gap: 12px;
}

.so-edit-cancel {
  background: none;
  border: none;
  font-family: 'Open Sans', sans-serif;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #717171;
  cursor: pointer;
  padding: 14px 8px;
}

.so-edit-confirm {
  background: #000;
  color: #fff;
  border: none;
  font-family: 'Open Sans', sans-serif;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 14px 28px;
  cursor: pointer;
  transition: background 0.2s;
}

.so-edit-confirm:hover:not(:disabled) { background: #262626; }
.so-edit-confirm:disabled { opacity: 0.4; cursor: not-allowed; }
