﻿/* ==========================================
   VARIEDADES IVETTE - CARRITO BÁSICO
   ========================================== */

/* Botón flotante */

.iv-cart-trigger {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 2000;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 49px;
  padding: 10px 17px;
  border: 0;
  border-radius: 40px;
  background: #e8326e;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  box-shadow: 0 12px 28px rgba(232, 50, 110, 0.24);
  cursor: pointer;
}

.iv-cart-trigger i {
  font-size: 19px;
}

.iv-cart-trigger [data-cart-count] {
  display: grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 5px;
  border-radius: 50%;
  background: #ffffff;
  color: #c51e59;
  font-size: 11px;
}

.iv-cart-trigger:hover {
  background: #c51e59;
}

.iv-cart-toast[hidden] {
  display: none;
}
.iv-cart-toast {
  position: fixed;
  z-index: 2100;
  right: 20px;
  bottom: 150px;
  display: flex;
  align-items: center;
  gap: 14px;
  max-width: calc(100vw - 40px);
  padding: 13px 16px;
  border: 1px solid #f1d8e2;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(37, 25, 33, 0.15);
  color: #2d2530;
  font-size: 13px;
}
.iv-cart-toast button {
  border: 0;
  background: none;
  color: #c51e59;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
}
@media (max-width: 560px) {
  .has-mobile-buy-bar .iv-cart-toast {
    bottom: calc(210px + env(safe-area-inset-bottom));
  }
}

/* ==========================================
   PANEL LATERAL
   ========================================== */

.iv-cart-dialog {
  position: fixed;
  top: 0;
  right: 0;
  left: auto;
  bottom: 0;
  width: min(440px, 100%);
  height: 100dvh;
  max-width: 100%;
  max-height: 100dvh;
  margin: 0 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 18px 0 0 18px;
  background: #ffffff;
  color: #2d2530;
  box-shadow: -15px 0 50px rgba(34, 22, 30, 0.14);
}

.iv-cart-dialog:not([open]) {
  display: none;
}

.iv-cart-dialog[open] {
  display: flex;
  flex-direction: column;
}

.iv-cart-dialog::backdrop {
  background: rgba(24, 17, 25, 0.5);
}

/* Encabezado */

.iv-cart-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
  padding: 22px 24px;
  border-bottom: 1px solid #f1e8ed;
}

.iv-cart-head h2 {
  margin: 0;
  font-size: 21px;
  font-weight: 700;
}

.iv-cart-head button {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #fff1f6;
  color: #bd2f62;
  font-size: 26px;
  line-height: 1;
}

/* Mensajes */

.iv-cart-hint {
  margin: 0;
  padding: 15px 24px;
  background: #fff8fa;
  color: #806878;
  font-size: 11px;
  line-height: 1.6;
}

.iv-cart-message {
  margin: 0;
  padding: 10px 24px 0;
  color: #a12f59;
  font-size: 12px;
}

.iv-cart-message:empty {
  display: none;
}

/* Lista de productos */

.iv-cart-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 24px;
}

.iv-cart-item {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 14px;
  padding: 17px 0;
  border-bottom: 1px solid #f1eaee;
}

.iv-cart-photo {
  display: block;
  align-self: start;
  overflow: hidden;
  border: 1px solid #f2ebef;
  border-radius: 9px;
  background: #ffffff;
}

.iv-cart-photo img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: contain;
}

.iv-cart-info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  min-width: 0;
  gap: 5px;
}

.iv-cart-name {
  color: #332a32;
  font-size: 12px;
  font-weight: 700;
  line-height: 1.5;
}

.iv-cart-code {
  color: #8b7b87;
  font-size: 10px;
}

.iv-cart-price {
  color: #272027;
  font-size: 14px;
  font-weight: 800;
}

/* Cantidades */

.iv-cart-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 7px;
  margin-top: 6px;
}

.iv-cart-controls button:not(.iv-cart-remove) {
  display: grid;
  place-items: center;
  width: 29px;
  height: 29px;
  border: 1px solid #eadde4;
  border-radius: 6px;
  background: #ffffff;
  color: #b52e60;
}

.iv-cart-controls button:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.iv-cart-qty {
  min-width: 20px;
  text-align: center;
  font-size: 12px;
  font-weight: 700;
}

.iv-cart-remove {
  margin-left: 4px;
  padding: 5px 0;
  border: 0;
  background: transparent;
  color: #a36b82;
  font-size: 11px;
  text-decoration: underline;
}

/* Pie del carrito */

.iv-cart-foot {
  padding: 20px 24px 25px;
  border-top: 1px solid #f1e8ed;
  background: #ffffff;
}

.iv-cart-foot > div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 15px;
}

.iv-cart-foot > div span {
  font-size: 13px;
  font-weight: 600;
}

.iv-cart-foot > div strong {
  font-size: 19px;
  font-weight: 800;
}

.iv-cart-foot p {
  margin: 10px 0 17px;
  color: #877683;
  font-size: 11px;
  line-height: 1.6;
}

.iv-cart-foot > button {
  width: 100%;
  min-height: 45px;
  border: 1px solid #e8326e;
  border-radius: 9px;
  background: #ffffff;
  color: #c51e59;
  font-size: 13px;
  font-weight: 700;
}

.iv-cart-foot > [data-cart-checkout] {
  margin-bottom: 10px;
  border-color: #e8326e;
  background: #e8326e;
  color: #fff;
}

.iv-cart-foot > [data-cart-checkout]:disabled {
  opacity: .48;
  cursor: not-allowed;
}

/* ==========================================
   BOTÓN EN TARJETAS DE CATEGORÍAS
   ========================================== */

.ivette-catalog .catalog-card__add-cart {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 40px;
  margin-top: 12px;
  padding: 9px 12px;
  border: 1px solid #e8326e;
  border-radius: 7px;
  background: #ffffff;
  color: #c51e59;
  font-size: 11px;
  font-weight: 700;
  transition:
    background 0.2s ease,
    color 0.2s ease;
}

.ivette-catalog .catalog-card__add-cart:not(:disabled):hover {
  background: #e8326e;
  color: #ffffff;
}

.ivette-catalog .catalog-card__add-cart:disabled {
  border-color: #ebe5e9;
  background: #f8f6f7;
  color: #a8a0a7;
  cursor: not-allowed;
}

/* ==========================================
   MÓVILES
   ========================================== */

@media (max-width: 700px) {
  .iv-cart-trigger {
    right: 12px;
    bottom: 12px;
    min-height: 45px;
    padding: 9px 13px;
  }

  .iv-cart-dialog {
    width: 100%;
    border-radius: 0;
  }

  .iv-cart-head,
  .iv-cart-foot {
    padding-inline: 17px;
  }

  .iv-cart-list {
    padding-inline: 17px;
  }

  .iv-cart-hint {
    padding-inline: 17px;
  }

  .iv-cart-message {
    padding-inline: 17px;
  }

  .ivette-catalog .catalog-card__add-cart {
    min-height: 40px;
    padding: 8px 5px;
    font-size: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .iv-cart-trigger,
  .ivette-catalog .catalog-card__add-cart {
    transition: none;
  }
}

/* ==========================================
   IVETTE - MODALIDADES DEL CARRITO
   ========================================== */

.iv-cart-delivery {
  padding: 18px 24px;
  border-bottom: 1px solid #f1e8ed;
  background: #fffafc;
}

.iv-cart-delivery > p {
  margin: 0 0 12px;
  color: #332832;
  font-size: 13px;
  font-weight: 700;
}

.iv-cart-delivery-options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
}

.iv-cart-delivery-options label {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 9px;
  border: 1px solid #eedde5;
  border-radius: 8px;
  background: #ffffff;
  color: #4d3e48;
  font-size: 12px;
  cursor: pointer;
}

.iv-cart-delivery-options label:has(input:checked) {
  border-color: #e8326e;
  background: #fff1f6;
  color: #b7235a;
  font-weight: 700;
}

.iv-cart-delivery-options input {
  accent-color: #e8326e;
}

.iv-cart-store-choice {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-top: 13px;
  color: #51414c;
  font-size: 12px;
  font-weight: 600;
}

.iv-cart-store-choice[hidden] {
  display: none !important;
}

.iv-cart-store-choice select {
  width: 100%;
  min-height: 43px;
  padding: 9px 12px;
  border: 1px solid #e9dce3;
  border-radius: 7px;
  background: #ffffff;
  color: #302730;
  font-size: 13px;
}

.iv-cart-store-choice select:focus-visible {
  outline: 2px solid #e8326e;
  outline-offset: 2px;
}

.iv-cart-delivery [data-cart-stock-note] {
  display: block;
  margin-top: 10px;
  color: #897181;
  font-size: 11px;
  line-height: 1.5;
}

.iv-cart-availability {
  font-size: 10px;
  color: #23804d;
  line-height: 1.5;
}

.iv-cart-availability.is-invalid {
  color: #b12e45;
  font-weight: 600;
}

.iv-cart-item.is-invalid {
  background: #fff9f9;
  border-radius: 8px;
}

@media (max-width: 700px) {
  .iv-cart-delivery {
    padding: 15px 17px;
  }

  .iv-cart-delivery-options label {
    font-size: 11px;
    padding: 8px 5px;
  }
}
