/* Estilos para el catálogo - Manteniendo armonía con el sitio principal */

:root {
  --color-primary: #0a0a0a;
  --color-secondary: #f8f5f0;
  --color-accent: #c19a6b;
  --color-light: #ffffff;
  --color-dark: #1a1a1a;
  --color-gray: #8a8a8a;
  --color-light-gray: #e5e5e5;
  --color-success: #10b981;
  --transition-smooth: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.1);
}

/* Tipografía */
body {
  font-family: "Montserrat", sans-serif;
  color: var(--color-primary);
  background-color: var(--color-light);
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: "Cormorant Garamond", serif;
  font-weight: 500;
  letter-spacing: 0.02em;
}

/* Header del catálogo */
.header-catalogo {
  position: sticky;
  top: 0;
  z-index: 100;
  background-color: rgba(255, 255, 255, 0.98);
  border-bottom: 1px solid var(--color-light-gray);
  backdrop-filter: blur(10px);
}

.brand-logo {
  font-family: "Cormorant Garamond", serif;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--color-primary);
  text-decoration: none;
  position: relative;
  display: inline-block;
}

.brand-logo::after {
  content: "";
  position: absolute;
  bottom: -4px;
  left: 50%;
  transform: translateX(-50%);
  width: 60%;
  height: 1px;
  background-color: var(--color-accent);
}

/* Hero del catálogo */
.catalogo-hero {
  background-color: var(--color-secondary);
  border-bottom: 1px solid var(--color-light-gray);
}

/* Indicador del carrito */
.cart-indicator {
  background-color: white;
  border: 1px solid var(--color-accent);
  color: var(--color-accent);
  padding: 0.75rem 1.5rem;
  border-radius: 50px;
  display: inline-flex;
  align-items: center;
  font-weight: 500;
  box-shadow: 0 4px 12px rgba(193, 154, 107, 0.1);
  animation: slideDown 0.3s ease;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Productos */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
  margin-bottom: 4rem;
}

.product-card {
  position: relative;
  overflow: hidden;
  transition: var(--transition-smooth);
  background-color: white;
  border: 1px solid var(--color-light-gray);
  height: 100%;
  display: flex;
  flex-direction: column;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
}

.product-image-container {
  position: relative;
  overflow: hidden;
  height: 350px;
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.product-card:hover .product-image {
  transform: scale(1.05);
}

.product-badge {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background-color: var(--color-accent);
  color: white;
  font-size: 0.7rem;
  padding: 0.25rem 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  z-index: 2;
}

.product-info {
  padding: 1.5rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.product-title {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.5rem;
  font-weight: 500;
  margin-bottom: 0.5rem;
  color: var(--color-primary);
}

.product-category {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-accent);
  margin-bottom: 0.5rem;
}

.product-description {
  font-size: 0.9rem;
  color: var(--color-gray);
  margin-bottom: 1rem;
  line-height: 1.5;
  flex-grow: 1;
}

/* Selectores de talla y color */
.selection-container {
  margin: 1rem 0;
}

.selection-title {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-primary);
  margin-bottom: 0.5rem;
}

.talla-selector,
.color-selector {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.talla-btn,
.color-btn {
  padding: 0.5rem 1rem;
  border: 1px solid var(--color-light-gray);
  background: white;
  cursor: pointer;
  transition: var(--transition-smooth);
  font-size: 0.875rem;
  border-radius: 4px;
}

.talla-btn:hover,
.color-btn:hover {
  border-color: var(--color-accent);
}

.talla-btn.selected {
  background-color: var(--color-accent);
  color: white;
  border-color: var(--color-accent);
}

.color-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.color-preview {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 1px solid var(--color-light-gray);
}

.color-btn.selected {
  background-color: var(--color-accent);
  color: white;
  border-color: var(--color-accent);
}

.color-btn.selected .color-preview {
  border-color: white;
}

/* Información de precio */
.price-container {
  margin: 1rem 0;
}

.price-regular {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-primary);
}

.price-note {
  font-size: 0.75rem;
  color: var(--color-gray);
  margin-top: 0.25rem;
}

/* Botón de agregar al carrito */
.add-to-cart-btn {
  background-color: var(--color-primary);
  color: white;
  border: none;
  padding: 1rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: var(--transition-smooth);
  width: 100%;
  margin-top: 1rem;
}

.add-to-cart-btn:hover:not(:disabled) {
  background-color: var(--color-accent);
  transform: translateY(-2px);
}

.add-to-cart-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Botones generales */
.btn-primary {
  background-color: var(--color-accent);
  color: white;
  border: none;
  padding: 0.75rem 1.5rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-primary:hover {
  background-color: #b08a5a;
}

.btn-secondary {
  background-color: transparent;
  color: var(--color-primary);
  border: 1px solid var(--color-light-gray);
  padding: 0.75rem 1.5rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: var(--transition-smooth);
}

.btn-secondary:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

.whatsapp-button-small {
  background-color: #25d366;
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 0;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  display: inline-flex;
  align-items: center;
  transition: var(--transition-smooth);
}

.whatsapp-button-small:hover {
  background-color: #128c7e;
  color: white;
}

/* Carrito de compras */
.cart-drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  height: 100vh;
  background-color: white;
  z-index: 10000;
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  box-shadow: -5px 0 25px rgba(0, 0, 0, 0.1);
}

@media (min-width: 768px) {
  .cart-drawer {
    width: 450px;
  }
}

.cart-drawer.active {
  right: 0;
}

.cart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  display: none;
}

.cart-overlay.active {
  display: block;
}

.cart-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--color-light-gray);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.cart-items {
  flex-grow: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

.empty-cart {
  text-align: center;
  padding: 3rem 0;
  color: var(--color-gray);
}

.cart-item {
  display: flex;
  gap: 1rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--color-light-gray);
}

.cart-item:last-child {
  border-bottom: none;
}

.cart-item-image {
  width: 80px;
  height: 80px;
  object-fit: cover;
  flex-shrink: 0;
}

.cart-item-details {
  flex-grow: 1;
}

.cart-item-title {
  font-family: "Cormorant Garamond", serif;
  font-size: 1.1rem;
  margin-bottom: 0.5rem;
}

.cart-item-info {
  font-size: 0.875rem;
  color: var(--color-gray);
  margin-bottom: 0.5rem;
}

.cart-item-price {
  font-weight: 500;
  color: var(--color-primary);
}

.cart-item-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

.quantity-selector {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.quantity-btn {
  width: 24px;
  height: 24px;
  border: 1px solid var(--color-light-gray);
  background: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.quantity-input {
  width: 40px;
  text-align: center;
  border: 1px solid var(--color-light-gray);
  padding: 0.25rem;
}

.remove-item {
  color: #ef4444;
  background: none;
  border: none;
  cursor: pointer;
  font-size: 0.875rem;
}

.cart-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--color-light-gray);
}

.cart-summary {
  margin-bottom: 1.5rem;
}

.summary-row {
  display: flex;
  justify-content: space-between;
  margin-bottom: 0.5rem;
}

.summary-row.total {
  font-weight: 600;
  font-size: 1.1rem;
  margin-top: 0.5rem;
  padding-top: 0.5rem;
  border-top: 1px solid var(--color-light-gray);
}

.cart-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.cart-note {
  margin-top: 1rem;
  padding-top: 1rem;
  border-top: 1px solid var(--color-light-gray);
}

/* Loading spinner */
.loading-spinner {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 0;
}

.spinner {
  width: 50px;
  height: 50px;
  border: 3px solid var(--color-light-gray);
  border-top-color: var(--color-accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
  margin: 0 auto;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* Mensaje sin productos */
.no-products-message {
  grid-column: 1 / -1;
  text-align: center;
  padding: 4rem 0;
}

/* Footer del catálogo */
.catalogo-footer {
  background-color: var(--color-primary);
  color: white;
  margin-top: 4rem;
}

.footer-link {
  color: var(--color-light-gray);
  text-decoration: none;
  transition: var(--transition-smooth);
}

.footer-link:hover {
  color: var(--color-accent);
}

/* Responsive */
@media (max-width: 768px) {
  .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  }

  .product-image-container {
    height: 300px;
  }

  .cart-drawer {
    width: 100%;
  }
}

@media (max-width: 640px) {
  .products-grid {
    grid-template-columns: 1fr;
  }

  .product-image-container {
    height: 350px;
  }

  .cart-actions {
    flex-direction: column;
  }

  .cart-item {
    flex-direction: column;
  }

  .cart-item-image {
    width: 100%;
    height: 200px;
  }
}

/* Asegurar que el contador del carrito sea visible */
#cart-count {
  position: absolute;
  top: -8px;
  right: -8px;
  background-color: #ef4444 !important; /* Rojo vibrante */
  color: white !important;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex !important;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: bold;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
  animation: pulse 2s infinite;
}

/* Animación para llamar la atención cuando cambia */
@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

/* Asegurar que el botón del carrito tenga posición relativa */
#cart-icon {
  position: relative !important;
}

/* ============================================
   MEJORAS PARA EL CARRITO EN MÓVIL
   ============================================ */

@media (max-width: 640px) {
  /* Carrito en móvil - Ocupa toda la pantalla pero con proporciones */
  .cart-drawer {
    width: 100%;
    max-width: 100%;
    border-radius: 0;
  }

  /* Header más compacto */
  .cart-header {
    padding: 1rem;
  }

  .cart-header h2 {
    font-size: 1.5rem;
  }

  /* Contenido del carrito con scroll suave */
  .cart-items {
    padding: 1rem;
    max-height: 60vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  /* Items del carrito más compactos */
  .cart-item {
    padding: 0.75rem 0;
    gap: 0.75rem;
  }

  /* Imagen más pequeña en móvil */
  .cart-item-image {
    width: 70px;
    height: 70px;
    object-fit: cover;
  }

  /* Detalles del producto más compactos */
  .cart-item-details {
    flex: 1;
    min-width: 0; /* Para que el texto no desborde */
  }

  .cart-item-title {
    font-size: 1rem;
    margin-bottom: 0.25rem;
  }

  .cart-item-info {
    font-size: 0.8rem;
    margin-bottom: 0.25rem;
  }

  .cart-item-price {
    font-size: 0.9rem;
  }

  /* Acciones del carrito más compactas */
  .cart-item-actions {
    margin-top: 0.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .quantity-selector {
    order: 1;
  }

  .quantity-btn {
    width: 28px;
    height: 28px;
    font-size: 0.875rem;
  }

  .quantity-input {
    width: 36px;
    height: 28px;
    font-size: 0.875rem;
  }

  .remove-item {
    order: 2;
    font-size: 0.8rem;
    padding: 0.25rem 0.5rem;
  }

  /* Footer del carrito más compacto */
  .cart-footer {
    padding: 1rem;
    border-top: 1px solid var(--color-light-gray);
    background: white;
    position: sticky;
    bottom: 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  }

  .cart-summary {
    margin-bottom: 1rem;
  }

  .summary-row {
    font-size: 0.9rem;
    margin-bottom: 0.375rem;
  }

  .summary-row.total {
    font-size: 1rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
  }

  /* Botones en columna para móvil */
  .cart-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .btn-secondary,
  .btn-primary {
    padding: 0.75rem;
    font-size: 0.875rem;
    width: 100%;
    text-align: center;
  }

  .cart-note {
    font-size: 0.75rem;
    margin-top: 0.75rem;
    padding-top: 0.75rem;
  }

  /* Carrito vacío más compacto */
  .empty-cart {
    padding: 2rem 0;
  }

  .empty-cart i {
    font-size: 2.5rem;
  }

  .empty-cart h3 {
    font-size: 1.1rem;
  }
}

/* Para tablets (tamaño intermedio) */
@media (min-width: 641px) and (max-width: 1024px) {
  .cart-drawer {
    width: 400px;
  }

  .cart-item-image {
    width: 80px;
    height: 80px;
  }
}

/* ============================================
   MEJORAS DE USABILIDAD PARA MÓVIL
   ============================================ */

/* Mejorar el scroll en móvil */
.cart-items {
  scrollbar-width: thin;
  scrollbar-color: var(--color-accent) var(--color-light-gray);
}

.cart-items::-webkit-scrollbar {
  width: 4px;
}

.cart-items::-webkit-scrollbar-track {
  background: var(--color-light-gray);
}

.cart-items::-webkit-scrollbar-thumb {
  background-color: var(--color-accent);
  border-radius: 2px;
}

/* Asegurar que los botones sean táctiles */
.quantity-btn,
.remove-item,
.add-to-cart-btn,
.btn-primary,
.btn-secondary {
  min-height: 44px; /* Tamaño mínimo recomendado para toques */
  touch-action: manipulation; /* Mejora la respuesta táctil */
}

/* Prevenir zoom en inputs en iOS */
@media (max-width: 768px) {
  input,
  select,
  textarea {
    font-size: 16px !important; /* Previene zoom en iOS */
  }

  .quantity-input {
    font-size: 16px !important;
  }
}

/* Animación suave para el carrito */
.cart-drawer {
  transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.cart-overlay {
  transition: opacity 0.3s ease;
}

/* ============================================
   ESTILOS PARA EL INDICADOR DEL CARRITO EN MÓVIL
   ============================================ */

@media (max-width: 768px) {
  .cart-indicator {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
    margin-top: 0.5rem;
  }

  #view-cart-btn {
    font-size: 0.8rem;
    margin-left: 0.5rem;
    padding: 0.25rem 0.5rem;
    background: rgba(193, 154, 107, 0.1);
    border-radius: 4px;
  }
}

/* ============================================
   FIX: EVITAR QUE LOS ITEMS TAPEN EL FOOTER DEL CARRITO
   ============================================ */

/* Contenedor principal del carrito */
.cart-drawer {
  display: flex;
  flex-direction: column;
  height: 100vh;
  max-height: 100vh;
}

/* Header fijo arriba */
.cart-header {
  flex-shrink: 0;
  position: sticky;
  top: 0;
  background: white;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

/* Items del carrito con scroll independiente */
.cart-items {
  flex: 1;
  overflow-y: auto;
  min-height: 0; /* IMPORTANTE: Permite que crezca/shrink */
  padding: 1rem;
  -webkit-overflow-scrolling: touch;
}

/* Footer fijo abajo */
.cart-footer {
  flex-shrink: 0;
  position: sticky;
  bottom: 0;
  background: white;
  z-index: 10;
  box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
  border-top: 2px solid var(--color-accent);
}

/* Asegurar que el carrito vacío no desborde */
.empty-cart {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
}

/* ============================================
   MEJORAS ESPECÍFICAS PARA MÓVIL
   ============================================ */

@media (max-width: 640px) {
  /* Asegurar que el carrito ocupe toda la pantalla correctamente */
  .cart-drawer {
    position: fixed;
    top: 0;
    right: -100%;
    width: 100%;
    height: 100%;
    z-index: 10000;
    transition: right 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    flex-direction: column;
  }

  .cart-drawer.active {
    right: 0;
  }

  /* Header compacto en móvil */
  .cart-header {
    padding: 0.75rem 1rem;
  }

  .cart-header h2 {
    font-size: 1.25rem;
  }

  /* Items con altura calculada automáticamente */
  .cart-items {
    padding: 0.75rem;
    max-height: calc(100vh - 140px); /* Resta header + footer */
    min-height: 200px; /* Altura mínima */
  }

  /* Footer en móvil */
  .cart-footer {
    padding: 0.75rem;
    border-top: 1px solid var(--color-light-gray);
  }

  .cart-summary {
    margin-bottom: 0.75rem;
  }

  .summary-row {
    font-size: 0.85rem;
    margin-bottom: 0.25rem;
  }

  .summary-row.total {
    font-size: 1rem;
    margin-top: 0.5rem;
    padding-top: 0.5rem;
  }

  /* Botones en móvil */
  .cart-actions {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
  }

  .btn-secondary,
  .btn-primary {
    padding: 0.75rem;
    font-size: 0.875rem;
    min-height: 44px;
  }
}

/* ============================================
   OVERLAY CORRECTO PARA MÓVIL
   ============================================ */

.cart-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 9999;
  display: none;
  backdrop-filter: blur(3px);
}

.cart-overlay.active {
  display: block;
}

/* ============================================
   SCROLLBAR PERSONALIZADA
   ============================================ */

.cart-items::-webkit-scrollbar {
  width: 6px;
}

.cart-items::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}

.cart-items::-webkit-scrollbar-thumb {
  background: var(--color-accent);
  border-radius: 3px;
}

.cart-items::-webkit-scrollbar-thumb:hover {
  background: #b08a5a;
}

/* ============================================
   ANIMACIONES MEJORADAS
   ============================================ */

@keyframes slideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes slideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.cart-drawer.active {
  animation: slideIn 0.3s ease-out;
}

.cart-overlay.active {
  animation: fadeIn 0.3s ease-out;
}

/* ============================================
   PREVENIR PROBLEMAS DE DISEÑO
   ============================================ */

/* Asegurar que el body no haga scroll cuando el carrito está abierto */
body.cart-open {
  overflow: hidden;
  position: fixed;
  width: 100%;
  height: 100%;
}

/* Prevenir que los items sean demasiado grandes */
.cart-item {
  max-height: 150px; /* Altura máxima por item */
  overflow: hidden;
}

/* Asegurar que el contenedor de items no crezca indefinidamente */
.cart-items {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* En móvil, ajustar la altura dinámicamente */
@media (max-width: 640px) {
  .cart-items {
    flex: 1 1 auto;
    height: calc(100vh - 120px - 200px); /* Altura dinámica */
  }

  .cart-footer {
    height: 200px; /* Altura fija para el footer */
    overflow-y: auto;
  }
}

/* ============================================
   FIX: BOTONES DE CANTIDAD Y ELIMINAR EN MÓVIL
   ============================================ */

@media (max-width: 640px) {
  /* Contenedor de acciones del item del carrito */
  .cart-item-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.75rem;
    flex-wrap: nowrap; /* Evitar que se rompa */
    width: 100%;
  }

  /* Selector de cantidad - más grande y claro */
  .quantity-selector {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    background: #f8f8f8;
    border-radius: 8px;
    padding: 0.25rem;
    flex-shrink: 0;
    border: 1px solid #e0e0e0;
  }

  /* Botones de + y - */
  .quantity-btn {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px !important;
    min-height: 36px !important;
    border: 2px solid var(--color-accent) !important;
    background: white !important;
    color: var(--color-accent) !important;
    font-weight: bold;
    font-size: 1.2rem !important;
    border-radius: 6px;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer;
    transition: all 0.2s;
  }

  .quantity-btn:hover {
    background: var(--color-accent) !important;
    color: white !important;
  }

  /* Input de cantidad */
  .quantity-input {
    width: 50px !important;
    height: 36px !important;
    text-align: center;
    border: 2px solid #e0e0e0 !important;
    border-radius: 6px;
    font-size: 1rem !important;
    font-weight: 600;
    background: white;
    -moz-appearance: textfield; /* Firefox */
    appearance: textfield;
  }

  .quantity-input::-webkit-outer-spin-button,
  .quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none; /* Safari y Chrome */
    appearance: none;
    margin: 0;
  }

  /* Botón Eliminar - más visible */
  .remove-item {
    background: #ef4444 !important;
    color: white !important;
    border: none !important;
    padding: 0.5rem 1rem !important;
    border-radius: 6px;
    font-size: 0.875rem !important;
    font-weight: 500;
    cursor: pointer;
    display: flex !important;
    align-items: center !important;
    gap: 0.5rem;
    transition: all 0.2s;
    flex-shrink: 0;
    min-height: 36px;
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.2);
  }

  .remove-item:hover {
    background: #dc2626 !important;
    transform: translateY(-1px);
  }

  .remove-item i {
    font-size: 0.875rem;
  }

  /* Asegurar que los botones sean visibles */
  button {
    -webkit-tap-highlight-color: transparent; /* Eliminar highlight en iOS */
  }

  button:active {
    transform: scale(0.98);
  }
}

/* ============================================
   MEJORAS PARA TABLETS
   ============================================ */

@media (min-width: 641px) and (max-width: 1024px) {
  .quantity-btn {
    width: 32px !important;
    height: 32px !important;
  }

  .quantity-input {
    width: 45px !important;
    height: 32px !important;
  }

  .remove-item {
    padding: 0.375rem 0.75rem !important;
    font-size: 0.875rem !important;
  }
}

/* ============================================
   ESTILOS BASE PARA LOS BOTONES (IMPORTANTE)
   ============================================ */

/* Asegurar que los botones tengan estilos base */
.quantity-btn,
.remove-item {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  cursor: pointer !important;
  border: none !important;
  outline: none !important;
  user-select: none !important;
}

/* Prevenir que los botones se desborden */
.cart-item {
  overflow: visible !important;
}

/* Asegurar visibilidad del texto */
.cart-item-info {
  font-size: 0.875rem !important;
  color: #666 !important;
  margin-bottom: 0.5rem !important;
}

/* Mejorar contraste del precio */
.cart-item-price {
  font-size: 1.125rem !important;
  font-weight: 600 !important;
  color: var(--color-primary) !important;
}

/* Ocultar texto "Eliminar" en pantallas muy pequeñas, mostrar solo icono */
@media (max-width: 380px) {
  .remove-text {
    display: none !important;
  }

  .remove-item {
    padding: 0.5rem !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
  }

  .remove-item i {
    margin-right: 0 !important;
    font-size: 1rem !important;
  }
}

/* Mostrar texto "Eliminar" en pantallas medianas */
@media (min-width: 381px) and (max-width: 640px) {
  .remove-text {
    display: inline !important;
    font-size: 0.875rem !important;
  }
}

/* --- BARRA DE HERRAMIENTAS --- */
.toolbar-catalogo {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0;
  margin-bottom: 2rem;
  border-bottom: 1px solid var(--color-light-gray);
}

/*
.btn-filter {
  background: white;
  border: 1px solid var(--color-primary);
  color: var(--color-primary);
  padding: 0.75rem 1.5rem;
  font-family: "Montserrat", sans-serif;
  font-weight: 500;
  text-transform: uppercase;
  font-size: 0.8rem;
  letter-spacing: 1px;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: all 0.3s ease;
}*/

.btn-filter:hover {
  background: var(--color-primary);
  color: white;
}

.results-count {
  font-size: 0.9rem;
  color: var(--color-gray);
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
}

/* --- DRAWER DE FILTROS --- */
.filter-drawer {
  position: fixed;
  top: 0;
  left: -100%; /* Oculto a la izquierda */
  width: 100%;
  max-width: 400px;
  height: 100vh;
  background: white;
  z-index: 10000;
  transition: left 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  box-shadow: 5px 0 25px rgba(0, 0, 0, 0.1);
}

.filter-drawer.active {
  left: 0;
}

.filter-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0, 0, 0, 0.5);
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s;
  backdrop-filter: blur(2px);
}

.filter-overlay.active {
  opacity: 1;
  visibility: visible;
}

.filter-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--color-light-gray);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.filter-header h3 {
  margin: 0;
  font-size: 1.5rem;
  font-family: "Cormorant Garamond", serif;
}

.close-btn {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  padding: 5px;
}

.filter-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.5rem;
}

/* --- GRUPOS DE FILTROS --- */
.filter-group {
  margin-bottom: 2rem;
  border-bottom: 1px solid #f5f5f5;
  padding-bottom: 1.5rem;
}

.filter-group:last-child {
  border-bottom: none;
}

.filter-title {
  font-weight: 600;
  margin-bottom: 1rem;
  display: block;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Checkboxes estilizados */
.filter-option {
  display: flex;
  align-items: center;
  margin-bottom: 0.8rem;
  cursor: pointer;
  font-size: 0.9rem;
  color: #555;
}

.filter-option input {
  margin-right: 10px;
  accent-color: var(--color-accent); /* Color del check nativo */
  width: 18px;
  height: 18px;
}

/* Filtro de Colores (Círculos) */
.color-filter-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.color-check {
  cursor: pointer;
  position: relative;
}

.color-check input {
  display: none; /* Ocultar input real */
}

.color-circle {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid #ddd;
  display: block;
  transition: transform 0.2s;
  position: relative;
}

/* Estado seleccionado del color */
.color-check input:checked + .color-circle {
  transform: scale(1.1);
  box-shadow:
    0 0 0 2px white,
    0 0 0 4px var(--color-accent);
  border-color: transparent;
}

/* Tooltip simple para el nombre del color */
.color-check:hover::after {
  content: attr(title);
  position: absolute;
  bottom: 100%;
  left: 50%;
  transform: translateX(-50%);
  background: #333;
  color: white;
  font-size: 0.7rem;
  padding: 4px 8px;
  border-radius: 4px;
  white-space: nowrap;
  margin-bottom: 5px;
  opacity: 0.9;
  pointer-events: none;
}

/* Footer del Drawer */
.filter-footer {
  padding: 1.5rem;
  border-top: 1px solid var(--color-light-gray);
  display: flex;
  gap: 1rem;
  background: white;
}

.filter-footer button {
  flex: 1;
  padding: 1rem;
}

/* --- CONTROLES DE IMAGEN (CARRUSEL) --- */
.product-image-container {
  position: relative; /* Necesario para posicionar las flechas */
}

/* Botones Flechas (Anterior/Siguiente) */
.img-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255, 255, 255, 0.8);
  border: none;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0; /* Ocultos por defecto */
  transition: all 0.3s ease;
  z-index: 10;
  color: var(--color-primary);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.img-nav-btn:hover {
  background: white;
  color: var(--color-accent);
}

.img-nav-btn.prev {
  left: 10px;
}
.img-nav-btn.next {
  right: 10px;
}

/* Botón Zoom (Fullscreen) */
.img-zoom-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transition: all 0.3s ease;
  z-index: 10;
  color: var(--color-primary);
}

.img-zoom-btn:hover {
  background: var(--color-primary);
  color: white;
}

/* Mostrar controles al hacer hover sobre la tarjeta */
.product-image-container:hover .img-nav-btn,
.product-image-container:hover .img-zoom-btn {
  opacity: 1;
}

/* En móvil, los controles siempre visibles o más fáciles de acceder */
@media (max-width: 768px) {
  .img-nav-btn,
  .img-zoom-btn {
    opacity: 1; /* Siempre visibles en táctil */
    background: rgba(255, 255, 255, 0.9);
  }
}

/* --- MODAL FULLSCREEN (LIGHTBOX) --- */
.image-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  z-index: 20000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  backdrop-filter: blur(5px);
}

.image-modal.active {
  opacity: 1;
  visibility: visible;
}

.image-modal img {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: 4px;
  box-shadow: 0 0 20px rgba(0, 0, 0, 0.5);
}

.modal-close-btn {
  position: absolute;
  top: 20px;
  right: 20px;
  background: none;
  border: none;
  color: white;
  font-size: 2rem;
  cursor: pointer;
  z-index: 20001;
}

/* Estilizando el buscador para que se vea "Editorial" */
.toolbar-catalogo input {
  -webkit-appearance: none; /* Quita estilos por defecto de iOS */
  border-radius: 0; /* Bordes cuadrados elegantes */
}

.toolbar-catalogo input:focus {
  border-color: #000; /* Negro sólido al escribir */
}

/* Ajuste del botón de filtro para que no se vea como un botón tosco */
.btn-filter {
  background: none;
  border: none;
  padding: 8px 0;
  cursor: pointer;
  font-family: "Montserrat", sans-serif;
  font-weight: 500;
}
