/* ============================================================
   BIBLIOTÉRICO — Cart Stylesheet
   ============================================================ */

.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 200;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(4px);
}
.cart-overlay.open { opacity: 1; pointer-events: all; }

.cart-drawer {
  position: fixed;
  top: 0; right: 0;
  width: min(420px, 95vw);
  height: 100vh;
  background: var(--deep);
  border-left: 1px solid var(--border);
  z-index: 201;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.4s cubic-bezier(0.4,0,0.2,1);
}
.cart-drawer.open { transform: translateX(0); }

.cart-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.cart-header h3 {
  font-family: var(--font-heading);
  font-size: 1rem;
  letter-spacing: 0.05em;
  color: var(--white);
}
.cart-header button {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: var(--radius);
  transition: color var(--transition);
}
.cart-header button:hover { color: var(--white); }

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 1rem;
  color: var(--text-muted);
}
.cart-empty span {
  font-size: 2.5rem;
  color: var(--mist);
}
.cart-empty p {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}

.cart-item {
  background: var(--void);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.cart-item-cover {
  width: 50px;
  height: 66px;
  border-radius: 3px;
  overflow: hidden;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.4rem;
}
.cart-item-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-title {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: var(--white);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cart-item-author { font-size: 0.75rem; color: var(--text-muted); font-style: italic; margin-bottom: 8px; }
.cart-item-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}
.qty-btn {
  background: var(--veil);
  border: 1px solid var(--border);
  color: var(--moon);
  width: 26px;
  height: 26px;
  border-radius: 3px;
  cursor: pointer;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.qty-btn:hover { border-color: var(--moon); }
.qty-num {
  font-family: var(--font-heading);
  font-size: 0.85rem;
  color: var(--white);
  min-width: 20px;
  text-align: center;
}
.cart-item-price {
  font-family: var(--font-heading);
  font-size: 0.95rem;
  color: var(--gold);
  white-space: nowrap;
  flex-shrink: 0;
}
.cart-item-remove {
  background: none;
  border: none;
  color: var(--mist);
  cursor: pointer;
  font-size: 0.9rem;
  padding: 2px;
  transition: color var(--transition);
}
.cart-item-remove:hover { color: #e74c3c; }

.cart-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.cart-total span:first-child {
  font-family: var(--font-heading);
  font-size: 0.8rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.cart-total span:last-child {
  font-family: var(--font-display);
  font-size: 1.3rem;
  color: var(--gold);
}

.btn-checkout {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: var(--void);
  border: 1px solid var(--border);
  color: var(--white);
  font-family: var(--font-heading);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  padding: 14px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  width: 100%;
  text-transform: uppercase;
}
.btn-checkout:hover {
  border-color: var(--moon);
  background: rgba(167,139,250,0.1);
}
.btn-checkout.btn-mp {
  border-color: rgba(0,174,240,0.3);
  color: #00aef0;
}
.btn-checkout.btn-mp:hover {
  border-color: #00aef0;
  background: rgba(0,174,240,0.08);
}

/* Checkout modal */
.checkout-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.8);
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(8px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}
.checkout-modal-overlay.open { opacity: 1; pointer-events: all; }
.checkout-modal {
  background: var(--deep);
  border: 1px solid var(--border-gold);
  border-radius: 10px;
  padding: 2.5rem;
  max-width: 480px;
  width: 90%;
  position: relative;
}
.checkout-modal h3 {
  font-family: var(--font-display);
  font-size: 1.4rem;
  color: var(--gold);
  margin-bottom: 0.5rem;
  text-align: center;
}
.checkout-modal p {
  color: var(--text-muted);
  font-style: italic;
  text-align: center;
  margin-bottom: 2rem;
  font-size: 0.95rem;
}
.checkout-form { display: flex; flex-direction: column; gap: 12px; }
.checkout-form input {
  background: var(--void);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 1rem;
  padding: 12px 16px;
  border-radius: var(--radius);
  outline: none;
  transition: border-color var(--transition);
}
.checkout-form input:focus { border-color: var(--moon); }
.checkout-form input::placeholder { color: var(--text-muted); font-style: italic; }
.checkout-form-row { display: grid; grid-template-columns: 2fr 1fr; gap: 10px; }
.checkout-pay-btn {
  background: linear-gradient(135deg, var(--gold) 0%, #b8902a 100%);
  color: var(--ink);
  border: none;
  font-family: var(--font-heading);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 15px;
  border-radius: var(--radius);
  cursor: pointer;
  width: 100%;
  margin-top: 8px;
  transition: all var(--transition);
}
.checkout-pay-btn:hover { transform: translateY(-2px); box-shadow: 0 8px 25px rgba(212,175,55,0.4); }
.checkout-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
}
.checkout-provider-badge {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 10px;
  font-family: var(--font-heading);
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  color: var(--text-muted);
}
.security-note {
  text-align: center;
  font-size: 0.75rem;
  color: var(--mist);
  margin-top: 8px;
}
