
quick-add-modal {
  display: block;
  position: fixed;
  inset: 0;
  z-index: -1;          /* cerrado: detrás de todo, nunca bloquea hover de las tarjetas */
  visibility: hidden;
  pointer-events: none;
  transition: visibility 0.25s ease;
}

quick-add-modal.is-open {
  z-index: 1050;        /* abierto: por encima de todo */
  visibility: visible;
  pointer-events: auto;
}

/* ============ OVERLAY ============ */
.quick-add-modal__overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 17, 17, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.25s ease;
}

quick-add-modal.is-open .quick-add-modal__overlay {
  opacity: 1;
}

/* ============ DIALOG ============ */
/* Móvil: sube desde abajo, ancho completo */
.quick-add-modal__dialog {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  width: 100%;
  max-height: 92vh;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  visibility: hidden;         /* oculto junto al custom element padre */
  transform: translateY(15px);
  opacity: 0;
  transition: transform 0.28s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.25s ease, visibility 0.25s ease;
  z-index: 1060;
}

quick-add-modal.is-open .quick-add-modal__dialog {
  visibility: visible;
  transform: translateY(0);
  opacity: 1;
}

/* Desktop: layout horizontal centrado */
@media (min-width: 640px) {
  .quick-add-modal__dialog {
    position: fixed;
    bottom: auto;
    top: 50%;
    left: 50%;
    right: auto;
    width: 90%;
    max-width: 56rem;
    max-height: 88vh;
    flex-direction: column;
    /* centrado en ambos ejes */
    transform: translate(-50%, calc(-50% + 15px)) scale(0.98);
  }

  quick-add-modal.is-open .quick-add-modal__dialog {
    transform: translate(-50%, -50%) scale(1);
  }
}

/* ============ CLOSE ============ */
.quick-add-modal__close {
  position: absolute;
  top: 0.625rem;
  right: 0.625rem;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 0; /* Sharp, como el prototipo */
  width: 2.75rem;
  height: 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  color: #111827;
  cursor: pointer;
  z-index: 10;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.quick-add-modal__close:hover {
  background: var(--color-button, #111827);
  color: #fff;
  border-color: var(--color-button, #111827);
}

.quick-add-modal__close svg {
  width: 1.25rem;
  height: 1.25rem;
}

/* ============ IMAGEN ============ */
.quick-add-modal__media {
  position: relative;
  background: #f5f5f5;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .quick-add-modal__media {
    aspect-ratio: auto;
    height: auto;
    flex: 1;
    max-width: 50%;
    min-width: 0;
    min-height: 0;
    overflow: hidden;
  }
}

.quick-add-modal__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Thumbnails sobre la imagen */
.quick-add-modal__thumbs {
  position: absolute;
  bottom: 0.625rem;
  left: 0.625rem;
  display: flex;
  gap: 0.375rem;
}

.quick-add-modal__thumb {
  width: 2.5rem;
  height: 2.5rem;
  border: 2px solid #fff;
  background-size: cover;
  background-position: center;
  cursor: pointer;
  transition: opacity 0.2s ease, border-color 0.2s ease;
  opacity: 0.8;
  padding: 0;
}

.quick-add-modal__thumb.active {
  opacity: 1;
  border-color: var(--color-button, #111827);
}

.quick-add-modal__thumb:hover {
  opacity: 1;
}

/* ============ WRAPPER DE CONTENIDO (imagen + detalles) ============ */
/* __content ocupa todo el dialog y distribuye imagen y detalles en fila */
.quick-add-modal__content {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow: hidden;
  width: 100%;
  min-height: 0;          /* permite que el contenedor encoja dentro del dialog y active scroll interno */
}

@media (min-width: 640px) {
  .quick-add-modal__content {
    flex-direction: row;
  }
}

/* Panel de detalles (texto) */
.quick-add-modal__details {
  display: flex;
  flex-direction: column;
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
  min-height: 0;
  min-width: 0;
}

@media (min-width: 640px) {
  .quick-add-modal__details {
    padding: 2rem;
    max-width: 50%;
  }
}

/* Categoría (vendor/tipo) */
.quick-add-modal__cat {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: 0.375rem;
}

/* Título */
.quick-add-modal__title {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #111827;
  line-height: 1.2;
  margin: 0 0 0.375rem;
}

@media (min-width: 640px) {
  .quick-add-modal__title {
    font-size: 1.5rem;
  }
}

/* Rating */
.quick-add-modal__rating {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.875rem;
  font-size: 0.75rem;
  color: #6b7280;
}

.quick-add-modal__stars {
  color: #f5a623;
  display: inline-flex;
  gap: 0.125rem;
  font-size: 0.8125rem;
}

/* Precio */
.quick-add-modal__price-row {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid #e5e7eb;
  flex-wrap: wrap;
}

.quick-add-modal__price {
  font-size: 1.25rem;
  font-weight: 700;
  color: #111827;
}

@media (min-width: 640px) {
  .quick-add-modal__price {
    font-size: 1.5rem;
  }
}

.quick-add-modal__price-old {
  font-size: 0.875rem;
  color: #9ca3af;
  text-decoration: line-through;
  font-weight: 400;
}

.quick-add-modal__price-save {
  font-size: 0.6875rem;
  font-weight: 600;
  color: #2e7d32;
  background: #e8f5e9;
  padding: 0.25rem 0.5rem;
}

/* Descripción */
.quick-add-modal__desc {
  font-size: 0.875rem;
  color: #6b7280;
  line-height: 1.6;
  margin-bottom: 1.25rem;
}

@media (min-width: 640px) {
  .quick-add-modal__desc {
    font-size: 0.9375rem;
  }
}

/* ============ VARIANTS & SWATCHES ============ */
quick-add-modal .variant-block,
.quick-add-modal .variant-block {
  margin-bottom: 1.25rem;
}

quick-add-modal .variant-label,
.quick-add-modal .variant-label {
  font-size: 0.75rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  display: flex;
  justify-content: space-between;
  color: #111827;
}

quick-add-modal .variant-label span,
.quick-add-modal .variant-label span {
  color: #6b7280;
  font-weight: 500;
}

quick-add-modal .color-options,
.quick-add-modal .color-options {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

quick-add-modal .color-btn,
.quick-add-modal .color-btn {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  border: 1px solid #e5e7eb;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  box-sizing: border-box;
  background-size: cover;
  background-position: center;
}

quick-add-modal .color-btn--square,
.quick-add-modal .color-btn--square {
  border-radius: 4px;
}

quick-add-modal .color-btn.active,
.quick-add-modal .color-btn.active {
  box-shadow: 0 0 0 2px #ffffff, 0 0 0 4px #111827;
}

quick-add-modal .color-btn:hover,
.quick-add-modal .color-btn:hover {
  transform: scale(1.1);
}

quick-add-modal .variant-options,
.quick-add-modal .variant-options {
  display: flex;
  gap: 0.375rem;
  flex-wrap: wrap;
}

quick-add-modal .variant-btn,
.quick-add-modal .variant-btn {
  padding: 0.5rem 0.75rem;
  border: 1px solid #e5e7eb;
  background: transparent;
  font-size: 0.75rem;
  font-weight: 500;
  color: #111827;
  border-radius: 0; /* Sharp como el prototipo */
  cursor: pointer;
  transition: all 0.15s ease;
  min-height: 2rem;
}

quick-add-modal .variant-btn:hover,
.quick-add-modal .variant-btn:hover {
  border-color: var(--color-button, #111827);
}

quick-add-modal .variant-btn.active,
.quick-add-modal .variant-btn.active {
  background: var(--color-button, #111827);
  color: var(--color-button-text, #fff);
  border-color: var(--color-button, #111827);
}

/* ============ QUANTITY INPUT ============ */
quick-add-modal quantity-input,
.quick-add-modal quantity-input {
  display: inline-flex;
  align-items: center;
  border: 1px solid #e5e7eb;
  border-radius: 0; /* Sharp */
  overflow: hidden;
  height: 2.75rem;
  background: #ffffff;
}

quick-add-modal quantity-input .quantity-btn,
.quick-add-modal quantity-input .quantity-btn {
  width: 2.5rem;
  height: 100%;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.875rem;
  font-weight: 600;
  color: #374151;
  transition: background 0.15s ease;
}

quick-add-modal quantity-input .quantity-btn:hover,
.quick-add-modal quantity-input .quantity-btn:hover {
  background: #f3f4f6;
  color: #111827;
}

quick-add-modal quantity-input .quantity-input,
.quick-add-modal quantity-input .quantity-input {
  width: 2.25rem;
  height: 100%;
  border: none;
  border-left: 1px solid #e5e7eb;
  border-right: 1px solid #e5e7eb;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 500;
  color: #111827;
  outline: none;
  -moz-appearance: textfield;
  display: flex;
  align-items: center;
  justify-content: center;
}

quick-add-modal quantity-input .quantity-input::-webkit-outer-spin-button,
quick-add-modal quantity-input .quantity-input::-webkit-inner-spin-button,
.quick-add-modal quantity-input .quantity-input::-webkit-outer-spin-button,
.quick-add-modal quantity-input .quantity-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* ============ FILA QTY + ADD ============ */
.quick-add-modal__actions {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
}

/* Botón "Agregar al carrito" */
.quick-add-modal__add-btn {
  flex: 1;
  background: var(--color-button, #111827);
  color: var(--color-button-text, #ffffff);
  border: 1px solid var(--color-button, #111827);
  border-radius: 0; /* Sharp */
  padding: 0 1rem;
  height: 2.75rem;
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  position: relative;
  transition: background 0.2s ease, opacity 0.15s ease, transform 0.15s ease;
}

.quick-add-modal__add-btn:hover {
  background: #000000;
  border-color: #000000;
}

.quick-add-modal__add-btn.loading {
  color: transparent;
  pointer-events: none;
}

.quick-add-modal__add-btn .loading__spinner {
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.quick-add-modal__add-btn .loading__spinner .path {
  stroke: var(--color-button-text, #ffffff);
}

/* ============ VER DETALLES ============ */
.quick-add-modal__view-full {
  display: inline-block;
  font-size: 0.8125rem;
  color: #6b7280;
  text-decoration: underline;
  margin-bottom: 1rem;
  transition: color 0.15s ease;
}

.quick-add-modal__view-full:hover {
  color: #111827;
}

/* ============ META INFO (envío / devolución) ============ */
.quick-add-modal__meta {
  margin-top: auto;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  font-size: 0.6875rem;
  color: #6b7280;
}

@media (min-width: 640px) {
  .quick-add-modal__meta {
    font-size: 0.75rem;
  }
}

.quick-add-modal__meta-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
}

.quick-add-modal__meta-item svg {
  color: var(--color-button, #111827);
  flex-shrink: 0;
}
