/* ============================================
   ASTROGNOMO · Cart + Checkout · Estilos
   Heredamos paleta dorada/cosmos del styles.css
   ============================================ */

:root {
  --c-bg: #0B0A14;
  --c-bg-2: #14122A;
  --c-gold: #E8C988;
  --c-gold-2: #C9A35C;
  --c-text: #F5F1E6;
  --c-muted: #A39FB3;
  --c-line: rgba(232,201,136,.18);
  --c-danger: #E86F6F;
}

/* ─── NAV: carrito al lado del CTA ──────────────────────────── */
.nav__actions {
  display: flex;
  align-items: center;
  gap: 12px;
}
.nav__cart {
  position: relative;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(232,201,136,.12);
  border: 1px solid var(--c-line);
  color: var(--c-gold);
  font-size: 18px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all .25s;
}
.nav__cart:hover { background: var(--c-gold); color: var(--c-bg); transform: translateY(-1px); }
.nav__cart-count {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--c-gold);
  color: var(--c-bg);
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 9px;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

/* ─── PRODUCT CARD: precio + botón ──────────────────────────── */
.product-card__buy {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--c-line);
}
.product-card__price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 12px;
}
.product-card__price {
  font-family: 'Cormorant Garamond', serif;
  font-size: 28px;
  font-weight: 600;
  color: var(--c-gold);
}
.product-card__stock {
  font-size: 12px;
  color: var(--c-muted);
  letter-spacing: .5px;
}
.product-card__stock.is-out { color: var(--c-danger); }
.product-card__add {
  width: 100%;
  justify-content: center;
}
.product-card__add:disabled {
  opacity: .5;
  cursor: not-allowed;
  filter: grayscale(.6);
}

/* ─── FAB carrito flotante ──────────────────────────────────── */
.cart-fab {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--c-gold);
  color: var(--c-bg);
  border: none;
  font-size: 26px;
  cursor: pointer;
  box-shadow: 0 8px 32px rgba(232,201,136,.35);
  z-index: 90;
  display: none;
  align-items: center;
  justify-content: center;
  transition: transform .25s, box-shadow .25s;
}
.cart-fab.is-active { display: inline-flex; }
.cart-fab:hover { transform: translateY(-3px) scale(1.05); box-shadow: 0 12px 40px rgba(232,201,136,.5); }
.cart-fab__count {
  position: absolute;
  top: -2px; right: -2px;
  background: var(--c-bg);
  color: var(--c-gold);
  font-size: 12px;
  font-weight: 700;
  min-width: 22px;
  height: 22px;
  border-radius: 11px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--c-gold);
}

/* ─── DRAWER del carrito ────────────────────────────────────── */
.cart-drawer {
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
}
.cart-drawer.is-open { pointer-events: auto; }
.cart-drawer__overlay {
  position: absolute;
  inset: 0;
  background: rgba(11,10,20,.7);
  backdrop-filter: blur(6px);
  opacity: 0;
  transition: opacity .3s;
}
.cart-drawer.is-open .cart-drawer__overlay { opacity: 1; }
.cart-drawer__panel {
  position: absolute;
  right: 0; top: 0;
  width: 100%;
  max-width: 440px;
  height: 100%;
  background: var(--c-bg-2);
  border-left: 1px solid var(--c-line);
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform .35s cubic-bezier(.2,.8,.2,1);
  box-shadow: -16px 0 48px rgba(0,0,0,.5);
}
.cart-drawer.is-open .cart-drawer__panel { transform: translateX(0); }
.cart-drawer__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 24px;
  border-bottom: 1px solid var(--c-line);
}
.cart-drawer__header h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--c-gold);
  margin: 0;
}
.cart-drawer__close {
  background: none;
  border: none;
  color: var(--c-text);
  font-size: 20px;
  cursor: pointer;
  width: 36px; height: 36px;
  border-radius: 50%;
  transition: background .2s;
}
.cart-drawer__close:hover { background: rgba(255,255,255,.08); }
.cart-drawer__body {
  flex: 1;
  overflow-y: auto;
  padding: 20px 24px;
}
.cart-drawer__empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--c-muted);
  line-height: 1.6;
}
.cart-drawer__footer {
  border-top: 1px solid var(--c-line);
  padding: 20px 24px;
  background: rgba(11,10,20,.6);
}
.cart-drawer__totals { margin-bottom: 16px; }
.cart-row {
  display: flex;
  justify-content: space-between;
  padding: 6px 0;
  font-size: 14px;
  color: var(--c-text);
}
.cart-row--muted { color: var(--c-muted); font-size: 13px; }
.cart-row--total {
  border-top: 1px solid var(--c-line);
  margin-top: 8px;
  padding-top: 12px;
  font-family: 'Cormorant Garamond', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--c-gold);
}
.cart-drawer__checkout { width: 100%; justify-content: center; }
.cart-drawer__safe {
  margin-top: 12px;
  text-align: center;
  font-size: 11px;
  color: var(--c-muted);
  letter-spacing: 1px;
}

/* ─── CART ITEM ─────────────────────────────────────────────── */
.cart-item {
  display: grid;
  grid-template-columns: 70px 1fr auto;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--c-line);
  align-items: flex-start;
}
.cart-item:last-child { border-bottom: none; }
.cart-item img {
  width: 70px;
  height: 70px;
  border-radius: 8px;
  object-fit: cover;
  background: rgba(255,255,255,.04);
}
.cart-item__placeholder {
  width: 70px; height: 70px;
  border-radius: 8px;
  background: rgba(232,201,136,.1);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--c-gold);
  font-size: 24px;
}
.cart-item__info h3 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--c-text);
  margin: 0 0 4px;
}
.cart-item__price {
  font-size: 13px;
  color: var(--c-muted);
  margin: 0 0 8px;
}
.cart-item__qty {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--c-line);
  border-radius: 999px;
  padding: 2px;
}
.cart-item__qty button {
  width: 26px; height: 26px;
  border: none;
  background: transparent;
  color: var(--c-gold);
  cursor: pointer;
  font-size: 16px;
  border-radius: 50%;
  transition: background .2s;
}
.cart-item__qty button:hover { background: rgba(232,201,136,.15); }
.cart-item__qty span {
  min-width: 22px;
  text-align: center;
  font-size: 14px;
  color: var(--c-text);
}
.cart-item__right {
  text-align: right;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
}
.cart-item__remove {
  background: none;
  border: none;
  color: var(--c-muted);
  font-size: 14px;
  cursor: pointer;
  padding: 2px 6px;
  border-radius: 4px;
  transition: color .2s;
}
.cart-item__remove:hover { color: var(--c-danger); }
.cart-item__subtotal {
  margin: 0;
  font-family: 'Cormorant Garamond', serif;
  font-size: 18px;
  font-weight: 600;
  color: var(--c-gold);
}

/* ─── CHECKOUT MODAL ────────────────────────────────────────── */
.checkout-modal {
  position: fixed;
  inset: 0;
  z-index: 110;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.checkout-modal.is-open { pointer-events: auto; }
.checkout-modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(11,10,20,.85);
  backdrop-filter: blur(8px);
  opacity: 0;
  transition: opacity .3s;
}
.checkout-modal.is-open .checkout-modal__overlay { opacity: 1; }
.checkout-modal__panel {
  position: relative;
  max-width: 640px;
  width: 100%;
  max-height: 92vh;
  overflow-y: auto;
  background: var(--c-bg-2);
  border: 1px solid var(--c-line);
  border-radius: 16px;
  padding: 36px 32px;
  transform: translateY(20px) scale(.98);
  opacity: 0;
  transition: all .3s cubic-bezier(.2,.8,.2,1);
  box-shadow: 0 24px 80px rgba(0,0,0,.6);
}
.checkout-modal.is-open .checkout-modal__panel {
  transform: translateY(0) scale(1);
  opacity: 1;
}
.checkout-modal__close {
  position: absolute;
  top: 16px; right: 16px;
  background: none;
  border: none;
  color: var(--c-text);
  font-size: 18px;
  cursor: pointer;
  width: 36px; height: 36px;
  border-radius: 50%;
  transition: background .2s;
}
.checkout-modal__close:hover { background: rgba(255,255,255,.08); }
.checkout-modal__header { margin-bottom: 24px; }
.checkout-modal__header h2 {
  font-family: 'Cormorant Garamond', serif;
  font-size: 32px;
  font-weight: 600;
  color: var(--c-gold);
  margin: 6px 0 8px;
}
.checkout-modal__sub {
  color: var(--c-muted);
  font-size: 14px;
  margin: 0;
}

/* ─── CHECKOUT FORM ─────────────────────────────────────────── */
.checkout-form__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-bottom: 20px;
}
.checkout-form__full { grid-column: 1 / -1; }
.checkout-form label {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  color: var(--c-muted);
  letter-spacing: .3px;
}
.checkout-form input,
.checkout-form select,
.checkout-form textarea {
  background: rgba(255,255,255,.04);
  border: 1px solid var(--c-line);
  border-radius: 8px;
  padding: 11px 14px;
  color: var(--c-text);
  font-family: inherit;
  font-size: 14px;
  transition: border-color .2s, background .2s;
}
.checkout-form input:focus,
.checkout-form select:focus,
.checkout-form textarea:focus {
  outline: none;
  border-color: var(--c-gold);
  background: rgba(255,255,255,.06);
}
.checkout-form textarea { resize: vertical; min-height: 60px; }
.checkout-form__summary {
  background: rgba(232,201,136,.06);
  border: 1px solid var(--c-line);
  border-radius: 10px;
  padding: 16px;
  margin-bottom: 18px;
}
.checkout-form__legal {
  font-size: 12px;
  color: var(--c-muted);
  margin: 10px 0 0;
  line-height: 1.5;
}
.checkout-form__submit {
  width: 100%;
  justify-content: center;
}
.checkout-form__submit:disabled { opacity: .6; cursor: wait; }
.checkout-form__error {
  margin-top: 12px;
  text-align: center;
  color: var(--c-danger);
  font-size: 13px;
  min-height: 18px;
}

/* ─── FOOTER NEWSLETTER ─────────────────────────────────────── */
.footer__news-copy { font-size: 13px; color: var(--c-muted); margin: 0 0 10px; }
.footer__news-form {
  display: flex;
  gap: 8px;
  max-width: 320px;
}
.footer__news-form input {
  flex: 1;
  background: rgba(255,255,255,.04);
  border: 1px solid var(--c-line);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--c-text);
  font-size: 13px;
}
.footer__news-form input:focus { outline: none; border-color: var(--c-gold); }
.footer__news-form .btn { padding: 10px 16px; font-size: 13px; }
.footer__news-msg { margin: 8px 0 0; font-size: 12px; min-height: 16px; }
.footer__bottom {
  display: flex;
  justify-content: space-between;
  padding: 20px 0;
  border-top: 1px solid var(--c-line);
  margin-top: 30px;
  color: var(--c-muted);
  font-size: 12px;
  flex-wrap: wrap;
  gap: 10px;
}
.footer__legal a { color: var(--c-muted); text-decoration: none; transition: color .2s; }
.footer__legal a:hover { color: var(--c-gold); }

/* ─── TOAST ─────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 100px;
  left: 50%;
  transform: translateX(-50%) translateY(10px);
  background: var(--c-bg-2);
  color: var(--c-gold);
  border: 1px solid var(--c-gold);
  padding: 12px 22px;
  border-radius: 999px;
  font-size: 14px;
  box-shadow: 0 10px 40px rgba(0,0,0,.4);
  opacity: 0;
  pointer-events: none;
  transition: all .35s cubic-bezier(.2,.8,.2,1);
  z-index: 200;
}
.toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ─── RESPONSIVE ────────────────────────────────────────────── */
@media (max-width: 640px) {
  .nav__cta { display: none; }
  .checkout-form__grid { grid-template-columns: 1fr; }
  .checkout-modal__panel { padding: 28px 22px; }
  .cart-drawer__panel { max-width: 100%; }
  .cart-fab { bottom: 16px; right: 16px; width: 54px; height: 54px; }
}
