/**
 * Solera Store Checkout - Aside Cart
 *
 * Site-wide floating cart panel. Self-contained — only depends on main.css
 * for CSS custom properties. Does NOT require components.css.
 *
 * @package SoleraCheckout
 */
/* Hide Astra theme scroll-to-top button — replaced by Solera FAB */
 #ast-scroll-top {
  background-color: transparent !important;
}
/* =====================
   FAB TRIGGER BUTTON
   ===================== */

.solera-aside-fab {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: 9997;
  background: var(--solera-jacarta) !important;
  background-color: var(--solera-jacarta) !important;
  border: 2px solid rgba(255, 255, 255, 0.6) !important;
  border-radius: 50% !important;
  box-shadow: 0 4px 20px rgba(50, 36, 94, 0.35) !important;
  cursor: pointer;
   width: 60px;
  height: 60px;
  padding: 0 !important;
  gap: 0;
  color: var(--solera-white) !important;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: box-shadow 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
  outline: none;
  overflow: visible;
}

.solera-aside-fab:hover {
  background: var(--solera-jacarta) !important;
  background-color: var(--solera-jacarta) !important;
  border: 2px solid rgba(255, 255, 255, 0.9) !important;
  box-shadow: 0 6px 24px rgba(50, 36, 94, 0.45) !important;
  color: var(--solera-white) !important;
  transform: translateY(-2px);
}

.solera-aside-fab:focus-visible {
  outline: 3px solid var(--solera-cobalt-500);
  outline-offset: 3px;
}

.solera-aside-fab-icon {
  width: 2rem;
  height: 2rem;
  flex-shrink: 0;
  display: block;
  color: var(--solera-white);
}

/* "Cart" text label — hidden, icon-only FAB */
.solera-aside-fab-label {
  display: none;
}

/* Circular item-count badge overlaid top-right of the FAB */
.solera-aside-fab-badge {
  position: absolute;
  top: -8px;
  right: -8px;
  min-width: 22px;
  height: 22px;
  background: var(--solera-sun);
  color: var(--solera-shark);
  border-radius: 50px;
  font-size: 11px;
  font-weight: 800;
  line-height: 22px;
  text-align: center;
  padding: 0 5px;
  pointer-events: none;
  box-shadow: 0 1px 4px rgba(0,0,0,0.18);
}

/* Hide FAB while the panel is open */
.solera-aside-open .solera-aside-fab {
  opacity: 0;
  pointer-events: none;
}

/* =====================
   OVERLAY
   ===================== */

.solera-aside-overlay {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background-color: rgba(0, 0, 0, 0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.solera-aside-open .solera-aside-overlay {
  opacity: 1;
  pointer-events: auto;
}

/* =====================
   PANEL
   ===================== */

.solera-aside-panel {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 9999;
  width: 480px;
  max-width: 100vw;
  height: 100vh;
  /* Modern viewport unit fallback */
  height: 100dvh;
  background-color: var(--solera-white);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
}

.solera-aside-open .solera-aside-panel {
  transform: translateX(0);
}

/* Prevent body scroll while panel is open */
.solera-aside-open {
  overflow: hidden;
}

/* =====================
   PANEL — HEADER
   ===================== */

.solera-aside-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--space-md) var(--space-lg);
  border-bottom: 1px solid var(--border-color);
  background-color: var(--solera-jacarta);
  flex-shrink: 0;
  position: relative;
}

/* X close button (left side) */
.solera-aside-close {
  background: none !important;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  cursor: pointer;
  color: rgba(255,255,255,0.75) !important;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50% !important;
  transition: background-color 0.15s ease, color 0.15s ease;
  padding: 0;
  flex-shrink: 0;
}

.solera-aside-close:hover {
  background: rgba(255,255,255,0.12) !important;
  background-color: rgba(255,255,255,0.12) !important;
  color: var(--solera-white) !important;
}

.solera-aside-close:focus-visible {
  outline: 2px solid rgba(255,255,255,0.5);
  outline-offset: 1px;
}

/* Cart icon + title + count (centered) */
.solera-aside-header-title {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--solera-white);
  font-weight: 400;
  font-size: var(--font-size-lg);
  letter-spacing: 0.02em;
}

.solera-aside-header-title svg {
  color: var(--solera-white);
  flex-shrink: 0;
}

.solera-aside-header-qty {
  background: var(--solera-sun);
  font-size: var(--font-size-sm);
  font-weight: 700;
  color: var(--solera-shark);
  line-height: 1;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 5px;
  border-radius: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Spacer mirrors close button width to keep title centred */
.solera-aside-header-spacer {
  width: 36px;
  flex-shrink: 0;
}
/* =====================
   PANEL — ITEMS LIST
   ===================== */

.solera-aside-items {
  flex: 1;
  overflow-y: auto;
  padding: var(--space-md) var(--space-lg);
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  /* Custom scrollbar (Webkit) */
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

.solera-aside-items::-webkit-scrollbar {
  width: 4px;
}

.solera-aside-items::-webkit-scrollbar-thumb {
  background-color: var(--border-color);
  border-radius: 2px;
}

.solera-aside-empty {
  text-align: center;
  color: var(--solera-mako-base);
  padding: var(--space-2xl) var(--space-md);
  font-size: var(--font-size-lg);
}

/* =====================
   ITEM CARD
   ===================== */

.solera-aside-item {
  display: grid;
  grid-template-columns: 80px 1fr auto;
  gap: var(--space-md);
  align-items: start;
  padding-bottom: var(--space-md);
  border-bottom: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  transition: background-color 0.15s ease;
}

.solera-aside-item:hover {
  background-color: rgba(50, 36, 94, 0.04);
}

.solera-aside-item:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

/* Bundle parent: remove bottom separator — children attach directly below */
.solera-aside-item--bundle-parent {
  border-bottom: none;
  padding-bottom: var(--space-xs);
}

/* Bundle child rows: indented sub-item with left accent, no separators */
.solera-aside-item--bundled-child {
  border-bottom: none;
  padding-bottom: var(--space-xs);
  padding-left: var(--space-md);
  border-left: 3px solid var(--solera-jacarta);
  margin-left: var(--space-sm);
  opacity: 0.85;
}

/* Restore the separator after the last bundled-child row */
.solera-aside-item--bundle-last-child {
  border-bottom: 1px solid var(--border-color);
  padding-bottom: var(--space-md);
  margin-bottom: var(--space-xs);
}

/* Edge-case: last child is also the last item in the list — no separator needed */
.solera-aside-item--bundle-last-child:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

/* Item image */
.solera-aside-item-image {
  width: 80px;
  flex-shrink: 0;
  border-radius: var(--border-radius);
  background-color: var(--solera-smoke);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  overflow: hidden;
}

.solera-aside-item-image img {
  width: 80px !important;
  height: auto !important;
  max-width: 100% !important;
  display: block;
}

/* Item details column */
.solera-aside-item-details {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.solera-aside-item-name {
  font-weight: 300;
  font-size: var(--font-size-base);
  color: var(--solera-shark);
  line-height: 1.3;
}

.solera-aside-item-meta {
  font-size: 12px;
  color: var(--solera-mako-base);
  line-height: 1.4;
  word-break: break-word;
}

/* Quantity stepper (self-contained copy of components.css stepper) */
.solera-aside-item-details .solera-qty-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-color);
  border-radius: var(--border-radius);
  overflow: hidden;
  width: fit-content;
  margin-top: var(--space-xs);
}

.solera-aside-item-details .solera-qty-btn {
  background: var(--solera-white);
  border: none;
  width: 28px;
  height: 28px;
  cursor: pointer;
  color: var(--solera-shark);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
  transition: background-color 0.15s ease;
  line-height: 1;
}

.solera-aside-item-details .solera-qty-icon {
  width: 16px;
  height: 16px;
  display: block;
  flex-shrink: 0;
}

.solera-aside-item-details .solera-qty-btn:hover {
  background-color: var(--solera-smoke);
}

.solera-aside-item-details .solera-qty-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.solera-aside-item-details .solera-qty-value {
  width: 28px;
  text-align: center;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--solera-shark);
  border-left: 1px solid var(--border-color);
  border-right: 1px solid var(--border-color);
  line-height: 26px;
}

/* Item right column: price + remove button stacked */
.solera-aside-item-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-xs);
}

.solera-aside-item-price {
  font-weight: 300;
  font-size: var(--font-size-base);
  color: var(--solera-shark);
  white-space: nowrap;
}

/* Sale price block — shown in item details when a sale price is active */
.solera-item-price-block {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: var(--font-size-base);
  color: var(--solera-shark);
  flex-wrap: wrap;
  font-weight: 300;
}

.solera-price-regular {
  text-decoration: line-through;
  color: var(--solera-mako-base);
}

.solera-item-price-block > span {
  color: var(--solera-jacarta);
  font-weight: 600;
}

/* Remove (×) button */
.solera-aside-remove {
  background: none !important;
  background-color: transparent !important;
  border: none !important;
  box-shadow: none !important;
  cursor: pointer;
  color: var(--solera-silver);
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 0 !important;
  padding: 0;
  transition: color 0.15s ease;
  flex-shrink: 0;
}

.solera-aside-remove:hover {
  background: none !important;
  background-color: transparent !important;
  color: var(--solera-shark);
}

.solera-aside-remove:focus-visible {
  outline: 2px solid var(--solera-cobalt-500);
  outline-offset: 1px;
}

/* Locked state while a request is in flight */
.solera-aside-item--locked .solera-qty-btn,
.solera-aside-item--locked .solera-aside-remove {
  opacity: 0.4;
  pointer-events: none;
}

/* =====================
   PANEL — FOOTER
   ===================== */

.solera-aside-footer {
  border-top: 1px solid var(--border-color);
  padding: var(--space-md) var(--space-lg) var(--space-lg);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  background-color: var(--solera-smoke);
}

/* Totals block: Subtotal / Total */
.solera-aside-totals {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* "Taxes are calculated at checkout" notice */
.solera-aside-tax-note {
  font-size: var(--font-size-base);
  color: #e05252;
  font-style: italic;
  font-weight: 500;
  margin: 0 0 6px;
  padding: 0;
}

.solera-aside-totals-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
}

.solera-aside-totals-label {
  font-size: var(--font-size-base);
  color: var(--solera-mako-base);
  font-weight: 500;
}

.solera-aside-totals-value {
  font-size: var(--font-size-base);
  color: var(--solera-shark);
}

/* Total row — bold, slightly larger, thick black separator */
.solera-aside-totals-row--total {
  border-top: 2px solid var(--solera-shark);
  margin-top: 2px;
  padding-top: 8px;
}

.solera-aside-totals-row--total .solera-aside-totals-label,
.solera-aside-totals-row--total .solera-aside-totals-value {
  font-weight: 700;
  font-size: var(--font-size-base);
  color: var(--solera-shark);
}

.solera-aside-cta {
  display: block;
  width: 100%;
  padding: 14px var(--space-lg);
  background-color: var(--solera-jacarta);
  color: var(--solera-white) !important;
  text-align: center;
  text-decoration: none;
  font-weight: 700;
  font-size: var(--font-size-base);
  border-radius: 10px;
  border: none;
  transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.15s ease;
  letter-spacing: 0.05em;
  box-shadow: 0 3px 12px rgba(50, 36, 94, 0.3);
}

.solera-aside-cta:hover,
.solera-aside-cta:focus {
  background-color: var(--solera-jacarta);
  color: var(--solera-white) !important;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 5px 16px rgba(50, 36, 94, 0.4);
}

/* =====================
   RESPONSIVE
   ===================== */

@media (max-width: 480px) {
  .solera-aside-panel {
    width: 100vw;
  }

  .solera-aside-fab {
    bottom: 20px;
    right: 16px;
    width: 54px;
    height: 54px;
  }
}

/* =====================
   WORDPRESS ADMIN BAR
   ===================== */

/* Desktop admin bar: 32px tall */
body.admin-bar .solera-aside-panel {
  top: 32px;
  height: calc(100vh - 32px);
  height: calc(100dvh - 32px);
}

/* Mobile admin bar: 46px tall (WP hides it below 600px, shows at 46px up to 782px) */
@media screen and (max-width: 782px) {
  body.admin-bar .solera-aside-panel {
    top: 46px;
    height: calc(100vh - 46px);
    height: calc(100dvh - 46px);
  }
}
