/* ==========================================================================
   UI COMPONENTS - CART DRAWER, TOASTS, VINTAGE STAMPS & CONTROLS
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. SLIDE-OUT CART DRAWER
   -------------------------------------------------------------------------- */
.cart-drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(6px);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}

.cart-drawer-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.cart-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  max-width: 440px;
  background: #191412;
  border-left: 1px solid var(--border-gold);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform var(--transition-normal);
  box-shadow: -10px 0 30px rgba(0, 0, 0, 0.8);
}

.cart-drawer-backdrop.open .cart-drawer {
  transform: translateX(0);
}

.cart-drawer-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-subtle);
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #14100e;
}

.cart-drawer-header h3 {
  font-size: 1.15rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--parchment);
}

.cart-drawer-items {
  flex-grow: 1;
  overflow-y: auto;
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.cart-item {
  display: flex;
  gap: 1rem;
  padding-bottom: 1.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  position: relative;
}

.cart-item-img {
  width: 65px;
  height: 95px;
  border-radius: 3px;
  object-fit: cover;
  box-shadow: 2px 4px 10px rgba(0, 0, 0, 0.5);
}

.cart-item-info {
  flex-grow: 1;
}

.cart-item-title {
  font-family: var(--font-display);
  font-size: 0.9rem;
  margin-bottom: 0.2rem;
  color: var(--parchment);
}

.cart-item-type {
  font-size: 0.75rem;
  color: var(--brass-light);
  margin-bottom: 0.5rem;
}

.cart-item-price {
  font-weight: 700;
  color: var(--gold-foil);
  font-size: 0.95rem;
}

.cart-qty-ctrl {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  margin-top: 0.5rem;
}

.qty-btn {
  background: none;
  border: none;
  color: var(--parchment);
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.qty-val {
  padding: 0 0.5rem;
  font-size: 0.8rem;
  font-weight: 600;
}

.cart-item-remove {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  position: absolute;
  top: 0;
  right: 0;
  transition: color var(--transition-fast);
}

.cart-item-remove:hover {
  color: #ff6b6b;
}

.cart-drawer-footer {
  padding: 1.5rem;
  background: #14100e;
  border-top: 1px solid var(--border-subtle);
}

.cart-summary-line {
  display: flex;
  justify-content: space-between;
  font-size: 0.9rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
}

.cart-summary-line.total {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--parchment);
  font-family: var(--font-display);
  border-top: 1px dashed var(--border-subtle);
  padding-top: 0.75rem;
  margin-top: 0.75rem;
  margin-bottom: 1.25rem;
}

/* --------------------------------------------------------------------------
   2. VINTAGE LIBRARY CHECKOUT CARD SLIP & WAX SEALS
   -------------------------------------------------------------------------- */
.library-slip-card {
  background: #f7eedb;
  color: #2b2118;
  padding: 1.5rem;
  border-radius: var(--radius-sm);
  border: 1px solid #d4c4a5;
  box-shadow: inset 0 0 15px rgba(0, 0, 0, 0.08), 0 8px 20px rgba(0, 0, 0, 0.4);
  position: relative;
  font-family: 'Courier New', Courier, monospace;
}

.library-slip-card::before {
  content: 'ARCHIVAL LENDING RECORD';
  display: block;
  text-align: center;
  font-weight: 700;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  border-bottom: 2px solid #2b2118;
  padding-bottom: 0.4rem;
  margin-bottom: 0.8rem;
}

.stamp-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.78rem;
}

.stamp-table th, .stamp-table td {
  padding: 0.4rem;
  border-bottom: 1px solid rgba(43, 33, 24, 0.15);
  text-align: left;
}

.stamp-date {
  color: #8b2635;
  font-weight: bold;
  transform: rotate(-3deg);
  display: inline-block;
  border: 1px solid #8b2635;
  padding: 1px 4px;
  border-radius: 2px;
}

.wax-seal-badge {
  width: 58px;
  height: 58px;
  background: radial-gradient(circle at 35% 35%, #962837, #53111b);
  border-radius: 50%;
  border: 2px solid #aa3344;
  box-shadow: 2px 4px 10px rgba(0,0,0,0.5), inset 0 0 6px rgba(0,0,0,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #f7d58b;
  font-size: 1.25rem;
  transform: rotate(-10deg);
  position: relative;
}

.wax-seal-badge::after {
  content: '';
  position: absolute;
  inset: 3px;
  border: 1px dashed rgba(247, 213, 139, 0.4);
  border-radius: 50%;
}

/* --------------------------------------------------------------------------
   3. TOAST NOTIFICATIONS
   -------------------------------------------------------------------------- */
#toast-container {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  pointer-events: none;
}

.toast {
  background: #1e1815;
  border: 1px solid var(--gold-foil);
  color: var(--parchment);
  padding: 0.85rem 1.35rem;
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg), 0 0 15px rgba(212, 175, 55, 0.25);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.85rem;
  pointer-events: auto;
  transform: translateY(20px);
  opacity: 0;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.toast.show {
  transform: translateY(0);
  opacity: 1;
}

.toast i {
  color: var(--gold-foil);
  font-size: 1.1rem;
}

/* --------------------------------------------------------------------------
   4. FORM CONTROLS, SEARCH & FILTER SIDEBAR
   -------------------------------------------------------------------------- */
.filter-group {
  margin-bottom: 2rem;
}

.filter-title {
  font-family: var(--font-display);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--parchment);
  margin-bottom: 1rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--border-subtle);
}

.filter-options {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.custom-checkbox {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  font-size: 0.875rem;
  color: var(--text-muted);
  cursor: pointer;
  user-select: none;
}

.custom-checkbox input {
  display: none;
}

.checkbox-mark {
  width: 16px;
  height: 16px;
  border: 1px solid var(--border-subtle);
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-secondary);
  transition: all var(--transition-fast);
}

.custom-checkbox input:checked + .checkbox-mark {
  background: var(--gold-foil);
  border-color: var(--gold-foil);
  color: #120f0e;
}

.custom-checkbox input:checked + .checkbox-mark::after {
  content: '✓';
  font-size: 10px;
  font-weight: 900;
}

.view-toggle-group {
  display: flex;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.view-toggle-btn {
  background: var(--bg-card);
  border: none;
  color: var(--text-muted);
  padding: 0.5rem 0.85rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-family: var(--font-display);
  transition: all var(--transition-fast);
}

.view-toggle-btn.active {
  background: var(--gold-foil);
  color: #120f0e;
  font-weight: 600;
}
