/**
 * Sidebar Cart — shortcode for Elementor popup. Luxury, minimal, functional.
 */

.sidebar-cart {
  --sc-border: rgba(0, 0, 0, 0.08);
  --sc-text: #1a1a1a;
  --sc-text-muted: #6b6b6b;
  --sc-radius: 4px;
  display: flex;
  flex-direction: column;
  min-height: 280px;
  max-height: 90vh;
  background: #fff;
  font-family: inherit;
}

/* --- Header --- */
.sidebar-cart__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--sc-border);
  flex-shrink: 0;
}

.sidebar-cart__title {
  margin: 0;
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--sc-text);
}

.sidebar-cart__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: #f0f0f0;
  color: var(--sc-text);
  cursor: pointer;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

.sidebar-cart__close:hover {
  background: #e5e5e5;
}

.sidebar-cart__close:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.15);
}

/* --- Body (scrollable) --- */
.sidebar-cart__body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

/* --- Empty state --- */
.sidebar-cart__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 260px;
  text-align: center;
  padding: 1rem 0;
}

.sidebar-cart__empty-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 80px;
  height: 80px;
  margin-bottom: 1.25rem;
  border-radius: 50%;
  background: #f5f5f5;
  color: var(--sc-text-muted);
}

.sidebar-cart__empty-icon svg {
  display: block;
}

.sidebar-cart__empty-title {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--sc-text);
}

.sidebar-cart__empty-text {
  margin: 0 0 1.5rem;
  font-size: 0.9375rem;
  font-weight: 400;
  line-height: 1.5;
  color: var(--sc-text-muted);
  max-width: 280px;
}

.sidebar-cart__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.3rem 0.8rem !important;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  border-radius: var(--sc-radius);
  cursor: pointer;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease;
  border: none;
  box-sizing: border-box;
}

.sidebar-cart__btn-arrow {
  flex-shrink: 0;
}

.sidebar-cart__btn--primary {
  color: #fff;
  background: #2e2e2e;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
}

.sidebar-cart__btn--primary:hover {
  background: #1a1a1a;
  color: #fff;
}

.sidebar-cart__btn--secondary {
  color: var(--sc-text);
  background: transparent;
  border: 1px solid var(--sc-border);
}

.sidebar-cart__btn--secondary:hover {
  border-color: rgba(0, 0, 0, 0.2);
  background: rgba(0, 0, 0, 0.03);
}

/* --- Items list --- */
.sidebar-cart__items {
  list-style: none;
  margin: 0 0 1rem;
  padding: 0;
}

.sidebar-cart__item {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--sc-border);
}

.sidebar-cart__item:first-child {
  padding-top: 0;
}

.sidebar-cart__item-image {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: var(--sc-radius);
  overflow: hidden;
  background: #fafafa;
}

.sidebar-cart__item-image a,
.sidebar-cart__item-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.sidebar-cart__item-details {
  flex: 1;
  min-width: 0;
}

.sidebar-cart__item-name {
  margin: 0 0 0.35rem;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.3;
}

.sidebar-cart__item-name a {
  color: var(--sc-text);
  text-decoration: none;
}

.sidebar-cart__item-name a:hover {
  text-decoration: underline;
}

.sidebar-cart__item-meta {
  margin: 0 0 0.35rem;
  font-size: 0.8125rem;
  color: var(--sc-text-muted);
}

.sidebar-cart__item-price {
  font-variant-numeric: tabular-nums;
}

.sidebar-cart__item-remove {
  font-size: 0.8125rem;
  color: var(--sc-text-muted);
  text-decoration: none;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}

.sidebar-cart__item-remove:hover:not(:disabled) {
  text-decoration: underline;
  color: var(--sc-text);
}

.sidebar-cart__item-remove:disabled,
.sidebar-cart__item-remove--loading {
  opacity: 0.6;
  cursor: wait;
}

/* --- Footer (when cart has items) --- */
.sidebar-cart__footer {
  padding-top: 1rem;
  border-top: 1px solid var(--sc-border);
  flex-shrink: 0;
}

.sidebar-cart__subtotal {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  font-size: 0.9375rem;
  color: var(--sc-text);
}

.sidebar-cart__subtotal strong {
  font-variant-numeric: tabular-nums;
}

.sidebar-cart__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.sidebar-cart__actions .sidebar-cart__btn {
  flex: 1;
  min-width: 120px;
}

/* No WooCommerce fallback */
.sidebar-cart--no-woo .sidebar-cart__no-woo {
  margin: 0;
  padding: 1rem 1.5rem;
  font-size: 0.9375rem;
  color: var(--sc-text-muted);
}
