/* ==========================================================================
   CAPITAL VAPE — DISEÑO 6: CARRITOS INDEPENDIENTES (RETAIL & MAYORISTA)
   PANTALLA APARTE / MODAL CENTRADO EN ESCRITORIO (NO LATERAL DERECHO)
   Diseño de tabla tabular + bloque resumen con WhatsApp oficial (Screens 5 & 6)
   ========================================================================== */

/* Overlay de Fondo con Difuminado Profundo */
.cv-cart-overlay {
  position: fixed !important;
  top: 0 !important;
  left: 0 !important;
  width: 100vw !important;
  height: 100vh !important;
  background: rgba(4, 3, 9, 0.82) !important;
  backdrop-filter: blur(14px) !important;
  -webkit-backdrop-filter: blur(14px) !important;
  z-index: 2150 !important;
  opacity: 0 !important;
  pointer-events: none !important;
  transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
}

.cv-cart-overlay.open {
  opacity: 1 !important;
  pointer-events: auto !important;
}

/* En PC / Escritorio: El carrito es una PANTALLA APARTE centrada (NO a la derecha) */
@media (min-width: 860px) {
  .cv-cart-drawer,
  .cv-cart-drawer.ref-cart-modal-mode {
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    right: auto !important;
    bottom: auto !important;
    transform: translate(-50%, -46%) scale(0.95) !important;
    width: 94% !important;
    max-width: 1080px !important;
    height: auto !important;
    max-height: 88vh !important;
    background: radial-gradient(circle at 10% 12%, rgba(147, 51, 234, 0.16) 0%, rgba(10, 8, 17, 0.98) 75%) !important;
    border-radius: 24px !important;
    border: 1.5px solid rgba(168, 85, 247, 0.45) !important;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.95), 0 0 50px rgba(147, 51, 234, 0.3) !important;
    backdrop-filter: blur(24px) !important;
    -webkit-backdrop-filter: blur(24px) !important;
    z-index: 2200 !important;
    display: flex !important;
    flex-direction: column !important;
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease, visibility 0.25s ease !important;
    overflow: hidden !important;
  }

  .cv-cart-drawer.open,
  .cv-cart-drawer.ref-cart-modal-mode.open {
    transform: translate(-50%, -50%) scale(1) !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  /* Modo Mayorista en PC: Resplandor Dorado */
  body.mode-wholesale .cv-cart-drawer,
  body.mode-wholesale .cv-cart-drawer.ref-cart-modal-mode {
    background: radial-gradient(circle at 90% 12%, rgba(212, 175, 55, 0.18) 0%, rgba(10, 8, 17, 0.98) 75%) !important;
    border-color: rgba(212, 175, 55, 0.5) !important;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.95), 0 0 50px rgba(212, 175, 55, 0.28) !important;
  }
}

/* Encabezado de la Pantalla de Carrito */
.cv-cart-header {
  padding: 18px 26px !important;
  background: rgba(12, 9, 20, 0.96) !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08) !important;
  display: flex !important;
  align-items: center !important;
  justify-content: space-between !important;
}

.cv-cart-title {
  font-family: 'Outfit', sans-serif !important;
  font-size: 1.3rem !important;
  font-weight: 900 !important;
  letter-spacing: 0.06em !important;
  display: flex !important;
  align-items: center !important;
  gap: 12px !important;
  color: #FFFFFF !important;
  text-transform: uppercase;
}

.cv-cart-title .cart-header-icon {
  width: 26px;
  height: 26px;
  object-fit: contain;
}

.cv-cart-close-btn {
  width: 36px !important;
  height: 36px !important;
  border-radius: 50% !important;
  background: rgba(255, 255, 255, 0.08) !important;
  border: 1px solid rgba(255, 255, 255, 0.15) !important;
  color: #FFFFFF !important;
  font-size: 1.4rem !important;
  line-height: 1 !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
}

.cv-cart-close-btn:hover {
  background: rgba(239, 68, 68, 0.2) !important;
  border-color: rgba(239, 68, 68, 0.5) !important;
  color: #EF4444 !important;
  transform: rotate(90deg);
}

/* ==========================================================================
   DISPOSICIÓN DE 2 COLUMNAS (TABLA A LA IZQUIERDA / RESUMEN A LA DERECHA)
   ========================================================================== */
.cart-modal-grid-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 24px;
  padding: 20px 24px 26px;
  overflow: hidden;
  max-height: calc(88vh - 75px);
  box-sizing: border-box;
}

@media (min-width: 860px) {
  .cart-modal-grid-layout .cv-cart-body {
    overflow-y: auto;
    max-height: calc(88vh - 120px);
    padding-right: 12px;
  }

  .cart-modal-grid-layout .cv-cart-body::-webkit-scrollbar {
    width: 6px;
  }
  .cart-modal-grid-layout .cv-cart-body::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.03);
    border-radius: 999px;
  }
  .cart-modal-grid-layout .cv-cart-body::-webkit-scrollbar-thumb {
    background: rgba(147, 51, 234, 0.4);
    border-radius: 999px;
  }
  body.mode-wholesale .cart-modal-grid-layout .cv-cart-body::-webkit-scrollbar-thumb {
    background: rgba(212, 175, 55, 0.4);
  }

  .cart-modal-grid-layout .cv-cart-footer {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    padding: 0;
    border: none;
    background: transparent;
    overflow-y: auto;
    max-height: calc(88vh - 120px);
  }

  .cart-modal-grid-layout.is-empty {
    grid-template-columns: 1fr !important;
  }

  .cart-modal-grid-layout.is-empty .cv-cart-body {
    grid-column: 1 / -1 !important;
    max-height: none !important;
    padding-right: 0 !important;
  }
}

@media (max-width: 859px) {
  .cv-cart-drawer,
  .cv-cart-drawer.ref-cart-modal-mode {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    height: 100dvh !important;
    max-height: 100dvh !important;
    transform: translateX(100%) !important;
    border-radius: 0 !important;
    border: none !important;
    box-shadow: -10px 0 40px rgba(0, 0, 0, 0.95) !important;
    z-index: 2200 !important;
    display: flex !important;
    flex-direction: column !important;
    overflow: hidden !important;
    background: #090710 !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .cv-cart-drawer.open,
  .cv-cart-drawer.ref-cart-modal-mode.open {
    transform: translateX(0) !important;
    opacity: 1 !important;
    visibility: visible !important;
    pointer-events: auto !important;
  }

  .cart-modal-grid-layout {
    display: flex !important;
    flex-direction: column !important;
    gap: 14px !important;
    padding: 12px 12px 36px !important;
    height: calc(100dvh - 65px) !important;
    max-height: calc(100dvh - 65px) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch !important;
    box-sizing: border-box !important;
    width: 100% !important;
  }

  .cart-modal-grid-layout .cv-cart-body {
    overflow: visible !important;
    max-height: none !important;
    padding: 0 !important;
    width: 100% !important;
  }

  .cart-modal-grid-layout .cv-cart-footer {
    overflow: visible !important;
    max-height: none !important;
    padding: 0 !important;
    width: 100% !important;
  }

  .ref-cart-table-head {
    display: none !important;
  }

  .ref-cart-row {
    display: flex !important;
    flex-direction: column !important;
    gap: 10px !important;
    padding: 12px !important;
  }
}

/* Encabezado de Columnas de la Tabla */
.ref-cart-table-head {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.2fr 40px;
  align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  font-family: 'Outfit', sans-serif;
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  color: rgba(255, 255, 255, 0.6);
  text-transform: uppercase;
}

/* Fila de Producto en la Tabla */
.ref-cart-row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.2fr 40px;
  align-items: center;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 12px;
  padding: 12px 14px;
  margin-bottom: 8px;
  transition: all 0.2s ease;
}

.ref-cart-row:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
}

.ref-cart-col-prod {
  display: flex;
  align-items: center;
  gap: 12px;
}

.ref-cart-thumb {
  width: 44px;
  height: 44px;
  object-fit: contain;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 8px;
  padding: 2px;
}

.ref-cart-prod-info strong {
  display: block;
  font-family: 'Outfit', sans-serif;
  font-size: 0.92rem;
  color: #FFFFFF;
}

.ref-cart-prod-info small {
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.6);
}

.ref-cart-col-price,
.ref-cart-col-sub {
  font-family: 'Outfit', sans-serif;
  font-size: 0.95rem;
  font-weight: 800;
  color: #FFFFFF;
}

.ref-cart-col-sub {
  color: #C084FC;
}

.ref-cart-row.ws-row .ref-cart-col-sub {
  color: #FACC15;
}

/* Botón de Borrar */
.ref-btn-del {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 1.1rem;
  cursor: pointer;
  transition: color 0.2s;
}

.ref-btn-del:hover {
  color: #EF4444;
}

/* ==========================================================================
   TARJETA RESUMEN LATERAL (DISEÑOS 5 Y 6)
   ========================================================================== */
.ref-cart-summary-card {
  background: rgba(14, 9, 22, 0.88);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 18px;
  padding: 22px 20px;
  display: flex;
  flex-direction: column;
  gap: 14px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.6);
}

.ref-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  color: rgba(255, 255, 255, 0.75);
}

.ref-summary-row strong {
  font-family: 'Outfit', sans-serif;
  font-size: 1.05rem;
  color: #FFFFFF;
}

.ref-summary-row.total-row {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 14px;
  margin-top: 4px;
}

.ref-summary-row.total-row strong.total-price {
  font-size: 1.35rem;
  font-weight: 900;
  color: #FFFFFF;
}

.ref-summary-row.total-row strong.gold-total {
  color: #FACC15;
}

/* Botón Morado de Realizar Pedido (Retail) */
.ref-btn-order-purple {
  width: 100%;
  padding: 14px 20px;
  border-radius: 12px;
  background: linear-gradient(135deg, #7928CA 0%, #9333EA 100%);
  border: 1px solid rgba(192, 132, 252, 0.6);
  color: #FFFFFF;
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(147, 51, 234, 0.45);
  transition: all 0.2s ease;
}

.ref-btn-order-purple:hover {
  background: linear-gradient(135deg, #9333EA 0%, #A855F7 100%);
  box-shadow: 0 12px 35px rgba(147, 51, 234, 0.65);
  transform: translateY(-2px);
}

/* Botón Dorado de Realizar Pedido (Mayorista) */
.ref-btn-order-gold {
  width: 100%;
  padding: 14px 20px;
  border-radius: 12px;
  background: linear-gradient(135deg, #D4AF37 0%, #B45309 100%);
  border: 1px solid rgba(250, 204, 21, 0.6);
  color: #07040A;
  font-family: 'Outfit', sans-serif;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.08em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 8px 25px rgba(212, 175, 55, 0.45);
  transition: all 0.2s ease;
}

.ref-btn-order-gold:hover {
  background: linear-gradient(135deg, #FACC15 0%, #D4AF37 100%);
  box-shadow: 0 12px 35px rgba(212, 175, 55, 0.65);
  transform: translateY(-2px);
}

/* Pie de Contacto Oficial */
.ref-cart-lines-footer {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.6);
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 10px;
  text-align: center;
}

.ref-line-item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.ref-line-item.gold-line {
  color: #D4AF37;
  font-weight: 700;
}

.ref-min-notice {
  font-size: 0.74rem;
  color: #F59E0B;
  font-weight: 700;
}
