/* ==========================================================================
   EL ESCONDITE GOURMET - TIENDA ONLINE STYLES
   Estilos de catálogo, filtros por chips, buscador reactivo, tarjetas de
   producto con badges de stock y modal accesible de ficha técnica.
   ========================================================================== */

/* --- Cabecera de la Tienda (Mediterráneo Solar - 100% Luminosa) --- */
.shop-header-section {
  background: var(--bg-page);
  color: var(--text-primary);
  padding: 3.5rem var(--container-pad) 2.5rem;
  text-align: center;
  position: relative;
  border-bottom: 1px solid var(--color-border);
}

.shop-header-container {
  max-width: 800px;
  margin: 0 auto;
}

.shop-header-title {
  color: var(--text-primary);
  font-family: var(--font-heading);
  font-size: 2.8rem;
  font-weight: 800;
  margin-bottom: 0.6rem;
  letter-spacing: -0.02em;
}

.shop-header-subtitle {
  color: var(--text-secondary);
  font-size: 1.1rem;
  margin-bottom: 1.5rem;
}

/* Banner de Beneficios en Tienda */
.shop-perks-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 1.8rem;
  border-top: 1px solid var(--color-border);
  padding-top: 1.2rem;
  font-size: 0.88rem;
  color: var(--text-secondary);
  flex-wrap: wrap;
}

.shop-perk-item {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  white-space: nowrap;
  color: var(--text-secondary);
  text-decoration: none;
}

.shop-perk-item i {
  color: var(--color-olive);
}

.shop-perk-item.perk-link {
  color: #25d366;
  font-weight: 600;
  transition: opacity var(--transition-fast);
}

.shop-perk-item.perk-link:hover {
  opacity: 0.85;
  text-decoration: underline;
}

/* --- Controles & Filtros --- */
.shop-main-section {
  padding: 2.5rem var(--container-pad) 5rem;
  max-width: var(--container-max);
  margin: 0 auto;
  width: 100%;
}

.shop-controls-wrapper {
  background: #ffffff;
  padding: 1.5rem;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--color-border);
  margin-bottom: 2rem;
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.shop-search-sort-row {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.search-input-wrapper {
  position: relative;
  flex: 1;
}

.search-input-wrapper i {
  position: absolute;
  left: 1rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 1rem;
}

.shop-search-input {
  width: 100%;
  padding: 0.85rem 1rem 0.85rem 2.8rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: var(--color-surface-soft);
  font-size: 0.95rem;
  outline: none;
  transition: border-color var(--duration-fast) var(--ease-out), background-color var(--duration-fast) var(--ease-out), box-shadow var(--duration-fast) var(--ease-out);
}

.shop-search-input:focus {
  border-color: var(--color-accent);
  background: #ffffff;
  box-shadow: 0 0 0 4px var(--color-accent-bg);
}

.shop-sort-select {
  padding: 0.85rem 2.2rem 0.85rem 1.2rem;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius-pill);
  background: #ffffff;
  font-size: 0.92rem;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  appearance: none;
  background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22292.4%22%20height%3D%22292.4%22%3E%3Cpath%20fill%3D%22%23121212%22%20d%3D%22M287%2069.4a17.6%2017.6%200%200%200-13-5.4H18.4c-5%200-9.3%201.8-12.9%205.4A17.6%2017.6%200%200%200%200%2082.2c0%205%201.8%209.3%205.4%2012.9l128%20127.9c3.6%203.6%207.8%205.4%2012.8%205.4s9.2-1.8%2012.8-5.4L287%2095c3.5-3.5%205.4-7.8%205.4-12.8%200-5-1.9-9.2-5.5-12.8z%22%2F%3E%3C%2Fsvg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem top 50%;
  background-size: 0.7rem auto;
  min-width: 200px;
}

/* Categorías en Chips Deslizables */
.category-chips-scroll {
  display: flex;
  gap: 0.6rem;
  overflow-x: auto;
  padding-bottom: 0.4rem;
  scrollbar-width: thin;
}

.category-chip {
  padding: 0.55rem 1.1rem;
  min-height: 44px;
  border-radius: var(--radius-pill);
  background: var(--color-surface-soft);
  color: var(--text-primary);
  font-size: 0.88rem;
  font-weight: 600;
  white-space: nowrap;
  border: 1.5px solid var(--color-border);
  touch-action: manipulation;
  transition: transform var(--duration-press) var(--ease-out), background-color var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out);
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  cursor: pointer;
  user-select: none;
  flex-shrink: 0;
}


.category-chip:active {
  transform: scale(0.96);
}

.category-chip .chip-name {
  display: inline-block;
  line-height: 1.2;
  white-space: nowrap;
}

.category-chip .chip-count,
.category-chip-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.76rem;
  font-weight: 700;
  line-height: 1;
  padding: 0.2rem 0.55rem;
  border-radius: var(--radius-pill);
  background: rgba(0, 0, 0, 0.08);
  color: inherit;
  min-width: 22px;
  text-align: center;
  margin-left: 0.2rem;
  flex-shrink: 0;
}

.category-chip:hover {
  background: var(--color-beige);
  border-color: var(--color-accent-dark);
}

.category-chip.active {
  background: var(--color-primary);
  color: #ffffff;
  border-color: var(--color-primary);
}

.category-chip.active .chip-count {
  background: rgba(0, 0, 0, 0.22);
  color: #ffffff;
}

/* Chips especiales (Valencianos, Sin gluten, Veganos): mismo estilo sobrio que el resto;
   solo el icono lleva el color de la casa para distinguirlos */
.category-chip-valencia i,
.category-chip-glutenfree i,
.category-chip-vegan i {
  color: var(--color-primary);
}

.category-chip-valencia.active i,
.category-chip-glutenfree.active i,
.category-chip-vegan.active i {
  color: #ffffff;
}

.badge-valencia {
  background: #ffffff !important;
  border: 1px solid rgba(0, 0, 0, 0.15) !important;
  padding: 0.15rem 0.25rem !important;
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  border-radius: 4px !important;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.18) !important;
}

.senyera-icon-img {
  width: 20px;
  height: 13.5px;
  border-radius: 2px;
  object-fit: cover;
  vertical-align: middle;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
  display: inline-block;
}

.senyera-badge-img {
  width: 22px;
  height: 14.5px;
  border-radius: 2px;
  object-fit: cover;
  display: block;
}

/* Encabezado del Listado */
.shop-results-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  font-size: 0.95rem;
  color: var(--text-secondary);
}

/* Grid de Productos */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 1.8rem;
}

/* Tarjeta de Producto (Emil Kowalski - GPU Driven Motion) */
.product-card {
  background: #ffffff;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
  transition: transform var(--duration-normal) var(--ease-out), box-shadow var(--duration-normal) var(--ease-out), border-color var(--duration-normal) var(--ease-out);
  display: flex;
  flex-direction: column;
  position: relative;
}

@media (hover: hover) and (pointer: fine) {
  .product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: rgba(188, 90, 54, 0.35);
    will-change: transform;
  }

  .product-card:hover .product-card-img {
    transform: scale(1.04);
    filter: drop-shadow(0 6px 12px rgba(0, 0, 0, 0.12));
  }
}

.product-card-img-wrap {
  position: relative;
  width: 100%;
  height: 260px;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 1rem;
  overflow: hidden;
  border-bottom: 1px solid var(--color-border-subtle);
  cursor: pointer;
}

.product-card-img {
  width: 100%;
  height: 100%;
  max-height: 230px;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 3px 6px rgba(0, 0, 0, 0.08));
  transition: transform var(--duration-normal) var(--ease-out), filter var(--duration-normal) var(--ease-out);
}

/* Badges de Stock y Categoría */
.product-stock-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.3rem 0.7rem;
  border-radius: var(--radius-pill);
  z-index: 2;
  text-transform: uppercase;
}

.badge-out-of-stock {
  background: var(--color-dark);
  color: #ffffff;
}

.badge-low-stock {
  background: var(--color-danger-bg);
  color: var(--color-danger);
  border: 1px solid rgba(224, 79, 95, 0.3);
}

.product-card-body {
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-card-category {
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--color-accent-dark);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-bottom: 0.35rem;
}

.product-card-title {
  font-size: 1.1rem;
  font-weight: 700;
  line-height: 1.3;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  cursor: pointer;
  transition: color 0.2s ease;
}

.product-card-title:hover {
  color: var(--color-terracotta-dark, #8c3a27);
}

.product-card-desc {
  font-size: 0.88rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1.2rem;
  flex: 1;
}

.btn-view-details {
  background: none;
  border: none;
  color: var(--color-accent-dark);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0;
  text-align: left;
  cursor: pointer;
  margin-bottom: 1rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

.btn-view-details:hover {
  text-decoration: underline;
}

/* Enlace híbrido de la tarjeta a /producto/<slug> (el clic normal abre el modal rápido) */
.btn-view-details { text-decoration: none; cursor: pointer; }
.product-card-img-wrap { text-decoration: none; color: inherit; }
.product-card-title a { color: inherit; text-decoration: none; }
.product-card-title a:hover { color: var(--color-terracotta-dark, #8c3a27); }

/* Enlace "Ver ficha completa" dentro del modal rápido */
.dialog-full-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  margin-top: 0.4rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--color-accent-dark);
  text-decoration: none;
}
.dialog-full-link:hover { text-decoration: underline; }

.product-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--color-border-subtle);
  padding-top: 1rem;
  margin-top: auto;
}

.price-container {
  display: flex;
  flex-direction: column;
}

.product-card-price {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--color-primary);
  line-height: 1;
}

.product-price-tax {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 500;
  margin-top: 0.15rem;
}

/* Insignias de Dieta y Restricción de Edad */
.product-card-tags-overlay {
  position: absolute;
  top: 10px;
  left: 10px;
  display: flex;
  flex-direction: column;
  gap: 4px;
  z-index: 2;
}

.badge-tag {
  font-size: 0.72rem;
  font-weight: 700;
  padding: 0.22rem 0.4rem;
  min-width: 26px;
  height: 22px;
  border-radius: 4px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.badge-tag i {
  font-size: 0.8rem;
}

.badge-age {
  background: rgba(24, 24, 27, 0.88);
  color: #f4f4f5;
  border: 1px solid rgba(255, 255, 255, 0.2);
  letter-spacing: 0.5px;
}

.badge-vegan {
  background: rgba(20, 83, 45, 0.9);
  color: #dcfce7;
  border: 1px solid rgba(34, 197, 94, 0.3);
}

.badge-gluten-free {
  background: rgba(180, 83, 9, 0.92);
  color: #fef3c7;
  border: 1px solid rgba(245, 158, 11, 0.35);
}

.modal-legal-warning {
  background: #fdfaf6;
  border-left: 3px solid var(--color-accent-dark);
  padding: 0.65rem 0.85rem;
  border-radius: 4px;
  font-size: 0.8rem;
  color: #5c4320;
  line-height: 1.4;
  margin-top: 0.8rem;
}

/* Modal Detalle de Producto (<dialog>) */
.product-dialog-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: minmax(0, 1fr);
  max-height: 88vh;
  overflow: hidden;
  position: relative;
}

.dialog-img-side {
  background: #ffffff;
  height: 100%;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  border-right: 1px solid var(--color-border-subtle);
}

.dialog-img-side img {
  width: 100%;
  height: 100%;
  max-height: 420px;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 6px 14px rgba(0, 0, 0, 0.1));
}

.dialog-info-side {
  padding: 2.5rem 2.25rem 2.5rem 2.5rem;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  min-height: 0;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: #d4c2b0 transparent;
  overscroll-behavior-y: contain;
}

/* Scrollbar artesanal y minimalista en la ficha de producto */
.dialog-info-side::-webkit-scrollbar {
  width: 6px;
}

.dialog-info-side::-webkit-scrollbar-track {
  background: transparent;
  margin: 12px 0;
}

.dialog-info-side::-webkit-scrollbar-thumb {
  background: #d4c2b0;
  border-radius: var(--radius-pill);
  transition: background-color 0.2s ease;
}

.dialog-info-side::-webkit-scrollbar-thumb:hover {
  background: var(--color-terracotta-dark, #8c3a27);
}

.dialog-info-side::-webkit-scrollbar-button {
  display: none;
  width: 0;
  height: 0;
}

.btn-close-dialog {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid var(--color-border-subtle, #ede6dd);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  color: var(--text-secondary);
  cursor: pointer;
  z-index: 20;
  touch-action: manipulation;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  transition: transform var(--duration-press) var(--ease-out), background-color var(--duration-fast) var(--ease-out), color var(--duration-fast) var(--ease-out), border-color var(--duration-fast) var(--ease-out);
}


@media (hover: hover) and (pointer: fine) {
  .btn-close-dialog:hover {
    background: #ffffff;
    color: var(--color-terracotta-dark, #8c3a27);
    border-color: #d4c2b0;
    transform: scale(1.06);
  }
}

.btn-close-dialog:active {
  transform: scale(0.92);
}

.dialog-category {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-accent-dark);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.4rem;
}

.dialog-title {
  font-size: 1.6rem;
  line-height: 1.25;
  margin-bottom: 0.8rem;
}

.dialog-price {
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 1.2rem;
}

.dialog-desc-full {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.7;
  white-space: pre-line;
  margin-bottom: 2rem;
  flex: 1;
}

.dialog-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* Estado Vacío de Búsqueda */
.shop-empty-state {
  text-align: center;
  padding: 4rem 1rem;
  background: #ffffff;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
}

.shop-empty-state i {
  font-size: 3.5rem;
  color: var(--color-accent);
  margin-bottom: 1rem;
}

/* Responsive */
@media (max-width: 768px) {
  .shop-search-sort-row {
    flex-direction: column;
    align-items: stretch;
  }

  .search-input-wrapper {
    width: 100%;
  }

  .shop-sort-select {
    width: 100%;
  }

  dialog {
    width: 94%;
    max-height: 92vh;
    border-radius: var(--radius-lg);
    margin: auto;
  }

  .product-dialog-content {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
    max-height: 92vh;
    height: auto;
  }

  .dialog-img-side {
    height: 200px;
    min-height: 200px;
    padding: 1.25rem;
    border-right: none;
    border-bottom: 1px solid var(--color-border-subtle);
  }

  .dialog-img-side img {
    max-height: 175px;
  }

  .dialog-info-side {
    padding: 1.25rem 1.25rem 0 1.25rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .dialog-title {
    font-size: 1.35rem;
    line-height: 1.3;
    margin-bottom: 0.5rem;
  }

  .dialog-price {
    font-size: 1.45rem;
    margin-bottom: 0.8rem;
  }

  .dialog-desc-full {
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
  }

  .dialog-actions {
    position: sticky;
    bottom: 0;
    margin: 1.25rem -1.25rem 0 -1.25rem;
    padding: 0.85rem 1.25rem max(0.85rem, calc(0.5rem + env(safe-area-inset-bottom, 0px)));
    background: #ffffff;
    border-top: 1px solid var(--color-border-subtle, #ede6dd);
    box-shadow: 0 -4px 14px rgba(0, 0, 0, 0.05);
    z-index: 10;
  }

  .dialog-actions .btn {
    min-height: 48px;
    font-size: 0.98rem;
    touch-action: manipulation;
  }
}

@media (max-width: 640px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.85rem;
  }

  .product-card-img-wrap {
    height: 155px;
    padding: 0.75rem 0.5rem;
  }

  .product-card-body {
    padding: 0.85rem 0.75rem;
  }

  .product-card-title {
    font-size: 0.92rem;
    line-height: 1.25;
  }

  /* En dos columnas no caben precio y botón en la misma línea: botón debajo, a todo el ancho */
  .product-card-footer {
    padding-top: 0.5rem;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
  }

  .product-card-price {
    font-size: 1.05rem;
  }

  .product-card-footer .btn {
    width: 100%;
    justify-content: center;
    min-height: 40px;
    padding: 0.5rem 0.85rem;
    font-size: 0.82rem;
    touch-action: manipulation;
  }

  .btn-view-details {
    padding: 0.35rem 0;
    min-height: 40px;
    font-size: 0.8rem;
    display: inline-flex;
    align-items: center;
  }

  .category-chips-scroll {
    gap: 0.5rem;
    padding-bottom: 0.4rem;
    -webkit-overflow-scrolling: touch;
  }

  .category-chip {
    padding: 0.5rem 0.85rem;
    font-size: 0.82rem;
  }

  /* Cestas Gourmet & Configurador Móvil */
  .cb-basket-grid {
    grid-template-columns: 1fr;
    gap: 1.25rem;
  }

  .cb-status-bar {
    padding: 0.85rem 1rem;
    gap: 0.75rem;
  }

  .cb-meters-row {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .cb-meter-price {
    grid-column: span 2;
    justify-content: center;
  }

  .cb-picker-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.75rem;
  }

  .cb-picker-item-img-wrap {
    height: 150px;
    padding: 6px;
  }

  .cb-picker-item-img {
    max-height: 130px;
  }

  .cb-picker-item-title {
    font-size: 0.8rem;
  }

  .cb-picker-btn-add {
    min-height: 42px;
    padding: 0.45rem 0.65rem;
    touch-action: manipulation;
  }

  .cb-slot-btn-remove {
    min-width: 44px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    touch-action: manipulation;
  }

  .cb-btn-select-basket {
    min-height: 44px;
    touch-action: manipulation;
  }

  .cb-btn-change-format {
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    touch-action: manipulation;
  }

  .cb-step3-form-card,
  .cb-step3-summary-card {
    padding: 1.25rem 1rem;
  }
}

/* Modal Informativo: Cestas a Medida */
.custom-basket-modal {
  border: none;
  border-radius: var(--radius-lg);
  padding: 0;
  max-width: 680px;
  width: 92%;
  background: var(--bg-surface, #ffffff);
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.22);
  margin: auto;
}

.custom-basket-modal::backdrop {
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(4px);
}

.custom-basket-modal-content {
  padding: 2.5rem 2rem 2rem;
  position: relative;
  text-align: center;
}

.basket-modal-badge {
  width: 56px;
  height: 56px;
  margin: 0 auto 1rem;
  background: var(--color-surface-soft, #f8f6f0);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  color: var(--color-terracotta, #c2410c);
  border: 1px solid var(--color-border);
}

.basket-modal-header h3 {
  font-size: 1.5rem;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
}

.basket-modal-subtitle {
  font-size: 0.95rem;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 1.8rem;
  max-width: 520px;
  margin-left: auto;
  margin-right: auto;
}

.basket-steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  text-align: left;
  margin-bottom: 2rem;
}

@media (max-width: 640px) {
  .basket-steps-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
}

.basket-step-card {
  background: var(--bg-page, #faf8f3);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.2rem;
  position: relative;
  transition: transform var(--duration-fast, 150ms) ease, border-color var(--duration-fast, 150ms) ease;
}

.basket-step-card:hover {
  transform: translateY(-2px);
  border-color: var(--color-accent);
}

.basket-step-num {
  display: inline-flex;
  width: 28px;
  height: 28px;
  background: var(--color-terracotta, #c2410c);
  color: #ffffff;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.85rem;
  margin-bottom: 0.6rem;
}

.basket-step-card h4 {
  font-size: 0.98rem;
  margin-bottom: 0.4rem;
  color: var(--text-primary);
}

.basket-step-card p {
  font-size: 0.85rem;
  color: var(--text-secondary);
  line-height: 1.45;
  margin: 0;
}

.basket-modal-footer {
  display: flex;
  justify-content: center;
}

/* ==========================================================================
   CONFIGURADOR DE CESTAS A MEDIDA (WIZARD & SLOTS)
   ========================================================================== */

/* --- Selector de Vista Superior (Catálogo vs Cesta a Medida) --- */
.shop-view-switcher {
  display: inline-flex;
  background: #f1ede7;
  padding: 5px;
  border-radius: var(--radius-pill);
  gap: 6px;
  margin-top: 1.5rem;
  border: 1px solid rgba(0, 0, 0, 0.06);
}

.shop-view-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: transparent;
  border: none;
  padding: 0.65rem 1.4rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text-secondary);
  border-radius: var(--radius-pill);
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
  white-space: nowrap;
}

.shop-view-tab-btn:hover {
  color: var(--text-primary);
}

.shop-view-tab-btn.active {
  background: #ffffff;
  color: var(--color-terracotta-dark, #8c3a27);
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.08);
}

.view-tab-badge {
  background: var(--color-terracotta, #c2410c);
  color: #ffffff;
  font-size: 0.68rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: var(--radius-pill);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

/* --- Sección del Configurador --- */
.custom-basket-section {
  padding: 2.5rem var(--container-pad) 5rem;
  max-width: var(--container-max);
  margin: 0 auto;
  width: 100%;
}

.custom-basket-container {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

/* Cabecera & Stepper */
.cb-header-card {
  background: linear-gradient(135deg, #fffcf8 0%, #fbf6ef 100%);
  border: 1px solid #ebd9c8;
  border-radius: var(--radius-lg);
  padding: 2.5rem 1.8rem;
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.cb-header-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(194, 65, 12, 0.1);
  color: var(--color-terracotta-dark, #8c3a27);
  font-weight: 700;
  font-size: 0.82rem;
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  margin-bottom: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cb-header-title {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 0.6rem;
  letter-spacing: -0.02em;
}

.cb-header-desc {
  max-width: 720px;
  margin: 0 auto 1.8rem;
  color: var(--text-secondary);
  font-size: 1.02rem;
  line-height: 1.55;
}

.cb-stepper {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.8rem;
  flex-wrap: wrap;
}

.cb-step {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: #ffffff;
  border: 1px solid var(--color-border);
  padding: 0.5rem 1.1rem;
  border-radius: var(--radius-pill);
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s ease;
}

.cb-step:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.cb-step.active {
  background: var(--color-terracotta-dark, #8c3a27);
  color: #ffffff;
  border-color: var(--color-terracotta-dark, #8c3a27);
  box-shadow: 0 4px 12px rgba(140, 58, 39, 0.25);
}

.cb-step-num {
  display: inline-flex;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.08);
  color: inherit;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
}

.cb-step.active .cb-step-num {
  background: #ffffff;
  color: var(--color-terracotta-dark, #8c3a27);
}

.cb-step-divider {
  width: 24px;
  height: 2px;
  background: var(--color-border);
}

/* Paneles de Paso */
.cb-step-panel {
  display: flex;
  flex-direction: column;
  gap: 1.8rem;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

.cb-panel-header {
  text-align: center;
  max-width: 780px;
  margin: 0 auto;
}

.cb-panel-title {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.cb-panel-subtitle {
  color: var(--text-secondary);
  font-size: 0.98rem;
  line-height: 1.5;
}

/* Cuadrícula de Formatos de Packaging (Paso 1) */
.cb-basket-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1.5rem;
}

.cb-basket-card {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.cb-basket-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
  border-color: var(--color-terracotta-dark, #8c3a27);
}

.cb-basket-img-wrap {
  width: 100%;
  height: 230px;
  background: #faf8f5;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px;
  border-bottom: 1px solid var(--color-border-subtle);
}

.cb-basket-img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.08));
  transition: transform 0.35s ease;
}

.cb-basket-card:hover .cb-basket-img {
  transform: scale(1.04);
}

.cb-basket-body {
  padding: 1.15rem 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.cb-basket-card-title {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  margin-bottom: 0.5rem;
  line-height: 1.3;
}

.cb-basket-measures {
  display: block;
  color: var(--text-muted);
  font-size: 0.8rem;
  margin: -0.25rem 0 0.6rem;
}

.cb-capacity-pills {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
  margin-bottom: 0.75rem;
}

.cb-capacity-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-right: 0.6rem;
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
}

.cb-capacity-pill i {
  color: var(--color-terracotta-dark, #8c3a27);
}

/* La botella de Font Awesome viene inclinada: se endereza */
.cb-ico-bottle {
  transform: rotate(-45deg);
}

.cb-basket-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid var(--color-border);
  padding-top: 0.85rem;
  margin-top: auto;
}

.cb-basket-price-group {
  display: flex;
  flex-direction: column;
}

.cb-basket-price-label {
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.cb-basket-price-val {
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--color-terracotta-dark, #8c3a27);
}

.cb-btn-select-basket {
  background: var(--color-terracotta-dark, #8c3a27);
  color: #ffffff;
  border: none;
  padding: 0.55rem 1rem;
  font-size: 0.85rem;
  font-weight: 700;
  border-radius: var(--radius-md);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
}

.cb-btn-select-basket:hover {
  background: #712f1f;
  transform: translateX(2px);
}

/* Barra de Estado (Paso 2) */
.cb-status-bar {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 0.9rem 1.25rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.2rem;
  flex-wrap: wrap;
}

.cb-status-basket-info {
  display: flex;
  align-items: center;
  gap: 0.85rem;
}

.cb-status-basket-thumb {
  width: 52px;
  height: 52px;
  border-radius: var(--radius-md);
  object-fit: contain;
  background: #faf8f5;
  padding: 3px;
  border: 1px solid var(--color-border);
}

.cb-status-label {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.cb-status-title {
  display: block;
  font-size: 1.05rem;
  color: var(--text-primary);
  font-weight: 700;
}

.cb-btn-change-format {
  background: none;
  border: none;
  color: var(--color-terracotta-dark, #8c3a27);
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  margin-top: 2px;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  text-decoration: underline;
}

.cb-meters-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.cb-meter-item {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: #fbf8f4;
  border: 1px solid #ebd9c8;
  padding: 0.45rem 0.85rem;
  border-radius: var(--radius-md);
}

.cb-meter-icon {
  width: 20px;
  color: var(--color-terracotta-dark, #8c3a27);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
}

.cb-meter-name {
  display: block;
  font-size: 0.72rem;
  color: var(--text-muted);
  text-transform: uppercase;
}

.cb-meter-val {
  font-size: 0.95rem;
  font-weight: 800;
  color: var(--text-primary);
}

.cb-meter-price .cb-meter-val.price-val {
  color: var(--color-terracotta-dark, #8c3a27);
  font-size: 1.1rem;
}

/* Layout del Configurador (Paso 2) */
.cb-builder-layout {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 1.35rem;
  align-items: start;
}

/* Las columnas nunca se ensanchan por su contenido (filas de filtros con scroll, rejilla de productos) */
.cb-builder-layout > * {
  min-width: 0;
}

@media (max-width: 980px) {
  .cb-builder-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .cb-slots-tray {
    position: static !important;
    top: auto !important;
    margin-bottom: 1.5rem;
  }
}

/* Bandeja de Slots (Izquierda) */
.cb-slots-tray {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.15rem;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 90px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.cb-tray-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.75rem;
}

.cb-tray-header h4 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.cb-tray-badge {
  font-size: 0.75rem;
  font-weight: 700;
  background: #f1ede7;
  color: var(--text-secondary);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.cb-tray-packaging-item {
  background: #fdfbf8;
  border: 1px solid #ebd9c8;
  border-radius: var(--radius-md);
  padding: 0.7rem 0.85rem;
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.cb-tray-pack-img {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: contain;
  background: #ffffff;
  padding: 2px;
  border: 1px solid var(--color-border);
}

.cb-tray-pack-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
}

.cb-tray-pack-price {
  margin-left: auto;
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--color-terracotta-dark, #8c3a27);
}

.cb-tray-group-title {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.cb-slots-list {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
}

/* Tarjetas de Slot (Vacías y Rellenas) */
.cb-slot-card {
  border-radius: var(--radius-md);
  padding: 0.55rem 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.65rem;
  transition: all 0.2s ease;
}

.cb-slot-card.empty {
  border: 2px dashed #d5c8be;
  background: #fcfbf9;
  cursor: pointer;
  color: var(--text-muted);
}

.cb-slot-card.empty:hover {
  border-color: var(--color-terracotta-dark, #8c3a27);
  background: #fbf5ee;
  color: var(--color-terracotta-dark, #8c3a27);
}

.cb-slot-empty-icon {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px dashed currentColor;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.8rem;
}

.cb-slot-empty-text {
  font-size: 0.8rem;
  font-weight: 600;
}

.cb-slot-card.filled {
  border: 1px solid var(--color-border);
  background: #ffffff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.03);
}

.cb-slot-filled-img {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-sm);
  object-fit: contain;
  background: #ffffff;
  padding: 2px;
  border: 1px solid var(--color-border);
}

.cb-slot-filled-info {
  flex: 1;
  min-width: 0;
}

.cb-slot-filled-title {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cb-slot-filled-price {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--color-terracotta-dark, #8c3a27);
}

.cb-slot-btn-remove {
  background: none;
  border: none;
  color: #9ca3af;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.2s ease;
}

.cb-slot-btn-remove:hover {
  color: #ef4444;
}

.cb-tray-footer {
  border-top: 1px solid var(--color-border);
  padding-top: 1rem;
}

.cb-tray-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 0.5rem;
}

/* Selector de Catálogo (Derecha) */
.cb-catalog-picker {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}

.cb-picker-tabs {
  display: flex;
  gap: 0.8rem;
  border-bottom: 2px solid #f1ede7;
  padding-bottom: 0.6rem;
  overflow-x: auto;
}

.cb-picker-tab {
  background: none;
  border: none;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--text-secondary);
  padding: 0.6rem 1rem;
  cursor: pointer;
  border-bottom: 3px solid transparent;
  margin-bottom: -0.6rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.cb-picker-tab.active {
  color: var(--color-terracotta-dark, #8c3a27);
  border-bottom-color: var(--color-terracotta-dark, #8c3a27);
}

.cb-picker-controls {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.cb-picker-search-wrap {
  position: relative;
}

.cb-picker-search-wrap i {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
}

.cb-picker-search {
  width: 100%;
  padding: 0.7rem 1rem 0.7rem 2.4rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
}

.cb-picker-search:focus {
  outline: none;
  border-color: var(--color-terracotta-dark, #8c3a27);
  box-shadow: 0 0 0 3px rgba(140, 58, 39, 0.1);
}

.cb-picker-subfilters {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  padding-bottom: 4px;
}

.cb-subfilter-btn {
  background: #f8f6f2;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-pill);
  padding: 0.35rem 0.85rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s ease;
}

.cb-subfilter-btn.active, .cb-subfilter-btn:hover {
  background: var(--color-terracotta-dark, #8c3a27);
  color: #ffffff;
  border-color: var(--color-terracotta-dark, #8c3a27);
}

/* Grid de Productos Disponibles en Picker */
.cb-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(185px, 1fr));
  gap: 1rem;
  max-height: 650px;
  overflow-y: auto;
  padding-right: 4px;
}

.cb-picker-item-card {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: #ffffff;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.cb-picker-item-card:hover {
  transform: translateY(-2px);
  border-color: var(--color-terracotta-dark, #8c3a27);
  box-shadow: var(--shadow-sm);
}

.cb-picker-item-img-wrap {
  width: 100%;
  height: 210px;
  background: #ffffff;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
  border-bottom: 1px solid #f1ede7;
  cursor: pointer;
}

.cb-picker-item-img {
  max-width: 100%;
  max-height: 190px;
  width: auto;
  height: auto;
  object-fit: contain;
  object-position: center;
  filter: drop-shadow(0 2px 5px rgba(0, 0, 0, 0.08));
  transition: transform 0.25s ease;
}

.cb-picker-item-card:hover .cb-picker-item-img {
  transform: scale(1.05);
}

.cb-picker-item-body {
  padding: 0.75rem 0.85rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.35rem;
}

.cb-picker-item-cat {
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cb-picker-item-title {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.2em;
  cursor: pointer;
  transition: color 0.2s ease;
}

.cb-picker-item-title:hover {
  color: var(--color-terracotta-dark, #8c3a27);
}

.cb-picker-item-footer {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid #f1ede7;
  padding-top: 0.5rem;
}

.cb-picker-item-price {
  font-size: 0.98rem;
  font-weight: 800;
  color: var(--color-terracotta-dark, #8c3a27);
}

.cb-picker-btn-add {
  background: #fbf5ee;
  border: 1px solid #ebd9c8;
  color: var(--color-terracotta-dark, #8c3a27);
  font-weight: 700;
  font-size: 0.78rem;
  padding: 0.35rem 0.7rem;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  transition: all 0.15s ease;
}

.cb-picker-btn-add:hover:not(:disabled) {
  background: var(--color-terracotta-dark, #8c3a27);
  color: #ffffff;
  border-color: var(--color-terracotta-dark, #8c3a27);
  transform: translateY(-1px);
}

/* Layout del Paso 3 (Dedicatoria y Resumen) */
.cb-step3-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 880px) {
  .cb-step3-layout {
    grid-template-columns: 1fr;
  }
}

.cb-step3-form-card, .cb-step3-summary-card {
  background: #ffffff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: 1.8rem;
  box-shadow: var(--shadow-sm);
}

.cb-gift-card-preview {
  background: #fffcf7;
  border: 1px solid #ebd9c8;
  border-radius: var(--radius-md);
  padding: 1.4rem;
  margin-bottom: 1.5rem;
}

.cb-gift-card-header {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.6rem;
}

.cb-gift-card-header i {
  color: var(--color-terracotta-dark, #8c3a27);
  font-size: 1.1rem;
}

.cb-gift-card-header h4 {
  font-family: var(--font-heading);
  font-size: 1.15rem;
  margin: 0;
  color: var(--text-primary);
}

.cb-gift-card-badge {
  margin-left: auto;
  font-size: 0.72rem;
  font-weight: 700;
  background: #dcfce7;
  color: #166534;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

.cb-gift-card-expl {
  font-size: 0.88rem;
  color: var(--text-secondary);
  margin-bottom: 0.8rem;
}

.cb-gift-textarea {
  width: 100%;
  border: 1px solid #d5c8be;
  border-radius: var(--radius-md);
  padding: 0.8rem;
  font-size: 0.95rem;
  line-height: 1.45;
  font-family: inherit;
  resize: vertical;
}

.cb-gift-textarea:focus {
  outline: none;
  border-color: var(--color-terracotta-dark, #8c3a27);
  box-shadow: 0 0 0 3px rgba(140, 58, 39, 0.1);
}

.cb-gift-chars {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-align: right;
  margin-top: 4px;
}

.cb-step3-actions {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

/* Tarjeta Resumen Final Paso 3 */
.cb-summary-header {
  border-bottom: 1px solid var(--color-border);
  padding-bottom: 0.8rem;
  margin-bottom: 1rem;
}

.cb-summary-header h4 {
  font-family: var(--font-heading);
  font-size: 1.25rem;
  color: var(--text-primary);
  margin: 0;
}

.cb-summary-items-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
  margin-bottom: 1.5rem;
}

.cb-summary-row {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.cb-summary-row-img {
  width: 48px;
  height: 48px;
  border-radius: var(--radius-sm);
  object-fit: contain;
  background: #ffffff;
  padding: 2px;
  border: 1px solid var(--color-border);
}

.cb-summary-row-info {
  flex: 1;
}

.cb-summary-row-title {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text-primary);
  display: block;
}

.cb-summary-row-tag {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.cb-summary-row-price {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--color-terracotta-dark, #8c3a27);
}

.cb-summary-total-box {
  background: #fbf5ee;
  border: 1px solid #ebd9c8;
  border-radius: var(--radius-md);
  padding: 1.1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.cb-summary-total-label {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}

.cb-summary-total-price {
  font-size: 1.6rem;
  font-weight: 800;
  color: var(--color-terracotta-dark, #8c3a27);
}

/* ==========================================================================
   ESTILOS DE CESTA A MEDIDA EN DRAWER DEL CARRITO
   ========================================================================== */
.cart-custom-basket-card {
  background: #fdfbf8;
  border: 1px solid #ebd9c8;
  border-radius: var(--radius-md);
  padding: 1.1rem;
  margin-bottom: 1.2rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.custom-basket-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid #f1ede7;
  padding-bottom: 0.6rem;
  margin-bottom: 0.6rem;
}

.custom-basket-header-left {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.custom-basket-card-icon {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(194, 65, 12, 0.12);
  color: var(--color-terracotta-dark, #8c3a27);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}

.custom-basket-card-title {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text-primary);
  margin: 0;
}

.custom-basket-items-count {
  font-size: 0.72rem;
  color: var(--text-muted);
}

.btn-remove-basket {
  background: none;
  border: none;
  color: #9ca3af;
  font-size: 0.95rem;
  cursor: pointer;
  padding: 4px;
  border-radius: 4px;
  transition: color 0.15s ease;
}

.btn-remove-basket:hover {
  color: #ef4444;
}

.custom-basket-gift-tag {
  background: #fff8f0;
  border: 1px dashed #ebd9c8;
  border-radius: var(--radius-sm);
  padding: 0.4rem 0.6rem;
  font-size: 0.78rem;
  color: #7c2d12;
  margin-bottom: 0.6rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.custom-basket-components-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin-bottom: 0.8rem;
}

.custom-basket-comp-row {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.custom-basket-comp-img {
  width: 32px;
  height: 32px;
  border-radius: 4px;
  object-fit: contain;
  background: #ffffff;
  padding: 1px;
  border: 1px solid var(--color-border);
}

.custom-basket-comp-info {
  flex: 1;
  min-width: 0;
}

.custom-basket-comp-name {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.custom-basket-packaging-tag {
  font-size: 0.65rem;
  color: var(--color-terracotta-dark, #8c3a27);
  font-weight: 600;
}

.custom-basket-comp-price {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-primary);
}

.custom-basket-card-footer {
  border-top: 1px solid #f1ede7;
  padding-top: 0.6rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.custom-basket-total-lbl {
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--text-secondary);
}

.custom-basket-total-num {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--color-terracotta-dark, #8c3a27);
}



/* Ficha de producto agotado */
#modalBtnAddCart.is-out-of-stock,
#modalBtnAddCart:disabled {
  background: #d9d4cf;
  color: #6b625e;
  box-shadow: none;
  cursor: not-allowed;
  transform: none;
}

/* Selector Catálogo / Cesta a medida en móvil: ocupa el ancho disponible sin desbordar */
@media (max-width: 520px) {
  .shop-view-switcher {
    display: flex;
    width: 100%;
  }

  .shop-view-tab-btn {
    flex: 1 1 0;
    min-width: 0;
    justify-content: center;
    text-align: center;
    white-space: normal;
    font-size: 0.85rem;
    padding-left: 0.5rem;
    padding-right: 0.5rem;
  }
}

/* "Ver más productos": la tienda pinta el catálogo por tandas (js/tienda.js) */
.shop-load-more {
  display: flex;
  justify-content: center;
  margin: 2.5rem 0 1rem;
}

.shop-load-more[hidden] {
  display: none;
}

.shop-load-more .btn {
  min-height: 48px;
  padding: 0.75rem 1.75rem;
}

/* Segunda fila de filtros: subcategorías de la categoría elegida (p. ej. D.O. bajo Vinos) */
.category-subchips { margin-top: 0.5rem; }
.category-subchips[hidden] { display: none; }
.category-subchip { min-height: 44px; padding: 0.4rem 0.9rem; font-size: 0.82rem; }

/* Subcategorías de color del vino: Tinto y Blanco, con su color */
.category-subchip-tinto { background: #f8e8ec; border-color: #881337; color: #881337; }
.category-subchip-tinto i { color: #881337; }
.category-subchip-tinto .chip-count { background: #881337; color: #fff; }
.category-subchip-tinto:hover { background: #f2d3db; }
.category-subchip-tinto.active { background: #881337; border-color: #881337; color: #fff; }
.category-subchip-tinto.active i { color: #fff; }
.category-subchip-tinto.active .chip-count { background: #fff; color: #881337; }
.category-subchip-blanco { background: #fcf5d3; border-color: #b8921c; color: #6b5200; }
.category-subchip-blanco i { color: #b8921c; }
.category-subchip-blanco .chip-count { background: #b8921c; color: #fff; }
.category-subchip-blanco:hover { background: #f8ecb0; }
.category-subchip-blanco.active { background: #e9c94a; border-color: #b8921c; color: #3d2e00; }
.category-subchip-blanco.active i { color: #3d2e00; }
.category-subchip-blanco.active .chip-count { background: #3d2e00; color: #f8ecb0; }
.category-subchip-rosado { background: #fde8ee; border-color: #d4608a; color: #8c2f55; }
.category-subchip-rosado i { color: #d4608a; }
.category-subchip-rosado.active { background: #e88aa8; border-color: #d4608a; color: #4a1027; }
