/* Estilos para el carrusel de banners promocionales */
.promo-banner-container {
  width: 100%;
  position: relative;
  overflow: hidden;
  margin-bottom: 16px;
  background-color: white;
}

.promo-banner-carousel {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
}

.promo-banner {
  min-width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  height: 200px;
  overflow: hidden;
  background-color: white;
}

.promo-banner img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  border-radius: var(--card-radius);
}

.promo-banner a {
  display: block;
  width: 100%;
  height: 100%;
  text-align: center;
  text-decoration: none;
  transition: transform 0.3s ease;
}

.promo-banner a img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

:root {
  --primary: #6f6af4;
  --primary-hover: #49468b;
  --primary-light: rgba(52, 131, 250, 0.1);
  --bg-primary: #ffffff;
  --bg-secondary: #f5f5f5;
  --bg-card: #ffffff;
  --text-primary: #333333;
  --text-secondary: #666666;
  --text-muted: #999999;
  --border-color: #e6e6e6;
  --shadow-color: rgba(0, 0, 0, 0.1);
  --accent-color: #00a650;
  --accent-secondary: #ff4757;
  --card-radius: 8px;
  --button-radius: 6px;
  --transition-fast: 0.2s ease;
  --transition-normal: 0.3s ease;
  --font-weight-normal: 400;
  --font-weight-medium: 500;
  --font-weight-bold: 600;
  --font-weight-extra-bold: 700;
  --discount-color: #00a650;
  --heart-color: #ff4757;
  --heart-color-active: #ff0033;
  --bg-primary-rgb: 255, 255, 255;
}

.dark {
  --primary: #6f6af4;
  --primary-hover: #49468b;
  --primary-light: rgba(74, 144, 226, 0.15);
  --bg-primary: #121212;
  --bg-secondary: #1e1e1e;
  --bg-card: #2d2d2d;
  --text-primary: #f5f5f5;
  --text-secondary: #b3b3b3;
  --text-muted: #808080;
  --border-color: #3d3d3d;
  --shadow-color: rgba(0, 0, 0, 0.3);
  --accent-color: #00c853;
  --accent-secondary: #ff6b6b;
  --discount-color: #00c853;
  --heart-color: #ff6b6b;
  --heart-color-active: #ff3366;
  --bg-primary-rgb: 18, 18, 18;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  transition: background-color 0.3s ease, color 0.3s ease;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Montserrat", Arial, sans-serif;
  background-color: var(--bg-secondary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  -webkit-user-select: none;
  -ms-user-select: none;
  user-select: none;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

/* Navbar */
.navbar {
  background-color: rgba(var(--bg-primary-rgb), 0.8);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 0;
  top: env(safe-area-inset-top, 0);
  z-index: 1000;
  padding: 12px 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.navbar-left,
.navbar-right {
  display: flex;
  align-items: center;
}

.navbar-right {
  gap: 16px;
}

.navbar img {
  height: 36px;
  width: auto;
  transition: transform var(--transition-fast);
}

.theme-toggle {
  background-color: transparent;
  border: none;
  cursor: pointer;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  border-radius: 50%;
  transition: all var(--transition-normal);
}

.theme-toggle img {
  width: 24px;
  height: 24px;
}

.theme-toggle:hover {
  background-color: var(--bg-secondary);
}

.cart-icon,
.favorite-icon {
  position: relative;
  background-color: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  border-radius: 50%;
  transition: all var(--transition-normal);
  display: flex;
  align-items: center;
  justify-content: center;
}

.cart-icon img,
.favorite-icon img {
  width: 24px;
  height: 24px;
}

.cart-count,
.favorite-count {
  position: absolute;
  top: -5px;
  right: -5px;
  background-color: var(--accent-secondary);
  color: white;
  border-radius: 50%;
  width: 20px;
  height: 20px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 11px;
  font-weight: var(--font-weight-bold);
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* Phone Banner */
.phone-banner {
  background-color: var(--primary);
  color: white;
  padding: 10px 16px;
  text-align: center;
  font-weight: var(--font-weight-medium);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.phone-banner a {
  color: white;
  text-decoration: none;
  font-weight: var(--font-weight-bold);
}

.phone-banner .phone-icon {
  font-size: 16px;
}

.whatsapp-icon {
  width: 24px;
  height: 24px;
  vertical-align: middle;
  margin-right: 6px;
}

/* Consulting Banner */
.consulting-banner {
  background-color: var(--bg-primary);
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
}

.consulting-content {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.consulting-content h3 {
  font-size: 16px;
  font-weight: var(--font-weight-medium);
  color: var(--text-primary);
  text-align: center;
}

.consulting-info {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.consulting-hours {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary);
}

.consulting-icon {
  width: 20px;
  height: 20px;
}

.consulting-payment {
  display: flex;
  gap: 8px;
}

.payment-icon {
  width: 32px;
  height: 20px;
  object-fit: contain;
}

/* Credit Banner */
.credit-banner {
  background-color: #f0edff;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.03);
}

.credit-content {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  font-weight: var(--font-weight-bold);
  color: var(--primary);
  font-size: 16px;
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  padding: 4px 0;
}

@keyframes shimmer {
  0% {
    transform: translateX(-100%);
  }
  100% {
    transform: translateX(100%);
  }
}

.credit-icon {
  width: 28px;
  height: 28px;
  filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
  transition: transform 0.3s ease;
}

.credit-content:hover .credit-icon {
  transform: scale(1.1);
}

.dark .credit-banner {
  background-color: #2d2a4a;
}

/* Filter Bar */
.filter-bar {
  display: flex;
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 16px;
}

.filter-button {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px;
  background: transparent;
  border: none;
  color: var(--primary);
  font-size: 14px;
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.filter-button:first-child {
  border-right: 1px solid var(--border-color);
}

.filter-button:hover {
  background-color: var(--bg-secondary);
}

.filter-icon {
  width: 18px;
  height: 18px;
}

.filter-button .icon {
  font-size: 16px;
}

/* Container */
.container {
  padding: 0 0 20px 0;
  max-width: 1200px;
  margin: 0 auto;
  flex: 1;
}

/* Products Grid */
.products-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  width: 100%;
  padding: 12px;
}

@media (min-width: 576px) and (max-width: 991px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;
  }
}

@media (min-width: 992px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
}

.product-card {
  background-color: var(--bg-card);
  border-radius: var(--card-radius);
  overflow: hidden;
  box-shadow: 0 1px 3px var(--shadow-color);
  width: 100%;
  height: 100%;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  position: relative;
  border: 1px solid var(--border-color);
}

.product-card:hover {
  box-shadow: 0 2px 8px var(--shadow-color);
}

.product-image {
  position: relative;
  width: 100%;
  height: 160px;
  background-color: white;
  overflow: hidden;
  border-bottom: 1px solid var(--border-color);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px;
}

.product-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.product-card:hover .product-image img {
  transform: scale(1.05);
}

.product-favorite {
  position: absolute;
  top: 8px;
  right: 8px;
  background-color: rgba(255, 255, 255, 0.8);
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
  z-index: 2;
  border: none;
}

.product-favorite:hover {
  transform: scale(1.1);
}

.favorite-icon-img {
  width: 20px;
  height: 20px;
}

.product-favorite.active .favorite-icon-img {
  filter: brightness(1.1);
}

.product-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  background-color: var(--accent-secondary);
  color: white;
  font-size: 12px;
  font-weight: var(--font-weight-bold);
  padding: 3px 8px;
  border-radius: 4px;
  z-index: 2;
}

.skeleton {
  background: linear-gradient(90deg, #e0e0e0 25%, #f0f0f0 50%, #e0e0e0 75%);
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
}

@keyframes skeleton-loading {
  0% {
    background-position: 200% 0;
  }
  100% {
    background-position: -200% 0;
  }
}

.product-info {
  padding: 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-grow: 1;
}

.product-info h3 {
  font-size: 13px;
  color: var(--text-primary);
  font-weight: var(--font-weight-normal);
  margin-bottom: 8px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.3;
  height: 34px;
}

.product-brand {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 4px;
}

.verified-icon {
  color: var(--primary);
  font-size: 14px;
}

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

.old-price {
  font-size: 12px;
  color: var(--text-muted);
  text-decoration: line-through;
  margin-bottom: 2px;
}

.price-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

.price {
  font-size: 18px;
  color: var(--text-primary);
  font-weight: var(--font-weight-bold);
}

.discount {
  font-size: 12px;
  color: var(--discount-color);
  font-weight: var(--font-weight-medium);
}

.installments {
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 4px;
}

.shipping-info {
  font-size: 12px;
  color: var(--accent-color);
  font-weight: var(--font-weight-medium);
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.shipping-icon {
  width: 16px;
  height: 16px;
}

.seller-info {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Info Section */
.info-section {
  padding: 20px;
  background-color: var(--bg-primary);
  text-align: center;
  margin-top: 20px;
  border-top: 1px solid var(--border-color);
}

.info-carousel-container {
  max-width: 900px;
  margin: 0 auto;
  position: relative;
  overflow: hidden;
  border-radius: var(--card-radius);
}

.info-carousel {
  display: flex;
  transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
  width: 100%;
}

.info-section .info-card {
  background-color: #f0edff;
  color: var(--primary);
  border-radius: var(--card-radius);
  padding: 20px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  font-size: 16px;
  font-weight: var(--font-weight-medium);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: 100%;
  margin: 0 10px;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
  flex-shrink: 0;
}

@media (min-width: 992px) {
  .info-carousel-container {
    overflow: visible;
  }

  .info-carousel {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    transform: none !important; /* Anular cualquier transformación del carrusel */
  }

  .info-section .info-card {
    min-width: auto;
    margin: 0;
  }

  .carousel-dots#carouselDots {
    display: none; /* Ocultar los puntos en pantallas grandes */
  }

  .info-carousel-container .carousel-nav {
    display: none; /* Ocultar los botones de navegación en pantallas grandes */
  }
}

.info-icon {
  width: 32px;
  height: 32px;
  margin-bottom: 8px;
}

.info-card i {
  font-size: 24px;
  color: var(--primary);
}

.dark .info-section .info-card {
  background-color: #2d2a4a;
  color: white;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.carousel-dots {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition-normal);
  opacity: 0.5;
}

.dot.active {
  background-color: var(--primary);
  opacity: 1;
  transform: scale(1.2);
}

/* Footer */
.footer {
  background-color: transparent;
  padding: 20px;
  text-align: center;
  margin-top: auto;
  position: relative;
  overflow: hidden;
  padding-bottom: calc(20px + env(safe-area-inset-bottom, 0px));
}

.footer::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url("./images/footer.gif") repeat-x center;
  background-size: cover;
  z-index: -1;
  animation: fadeLoop 6s infinite;
}

@keyframes fadeLoop {
  0% {
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  90% {
    opacity: 0;
  }
  100% {
    opacity: 1;
  }
}

.footer p {
  margin: 6px 0;
  font-size: 14px;
  color: #ffffff;
  position: relative;
  z-index: 1;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  font-weight: var(--font-weight-medium);
}

.footer a {
  color: #ffffff;
  text-decoration: none;
  font-weight: var(--font-weight-bold);
  background-color: rgba(111, 106, 244, 0.7);
  padding: 3px 8px;
  border-radius: 4px;
  transition: all var(--transition-normal);
}

.footer a:hover {
  background-color: var(--primary);
}

/* Modal */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Product Detail Modal */
.product-detail-modal {
  background-color: var(--bg-card);
  border-radius: var(--card-radius) var(--card-radius) 0 0;
  width: 100%;
  max-width: 100%;
  height: 100vh;
  height: calc(100vh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  max-height: 100vh;
  position: relative;
  box-shadow: 0 -10px 30px var(--shadow-color);
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-top: env(safe-area-inset-top);
  margin-bottom: env(safe-area-inset-bottom);
}

.modal-overlay.active .product-detail-modal {
  transform: translateY(0);
}

.close-modal {
  position: fixed;
  top: 16px;
  top: calc(16px + env(safe-area-inset-top));
  right: 16px;
  background-color: var(--bg-secondary);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  font-size: 20px;
  color: var(--text-primary);
  transition: all var(--transition-normal);
  z-index: 10;
  box-shadow: 0 2px 8px var(--shadow-color);
}

.close-modal:hover {
  background-color: var(--border-color);
}

.product-detail-content {
  display: flex;
  flex-direction: column;
  padding: 16px;
  height: calc(100vh - 80px - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  max-width: 1200px;
  margin: 0 auto;
  width: 100%;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--primary) var(--bg-secondary);
}

.product-detail-content::-webkit-scrollbar {
  width: 6px;
}

.product-detail-content::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 10px;
}

.product-detail-content::-webkit-scrollbar-thumb {
  background-color: var(--primary);
  border-radius: 10px;
}

.product-detail-image {
  width: 100%;
  height: 35vh;
  border-radius: var(--card-radius);
  overflow: hidden;
  margin-bottom: 20px;
  background-color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.product-detail-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.product-detail-info {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.product-detail-info h2 {
  font-size: 20px;
  color: var(--text-primary);
  font-weight: var(--font-weight-medium);
  line-height: 1.3;
}

.product-detail-brand {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  color: var(--text-secondary);
}

.product-detail-price-container {
  display: flex;
  flex-direction: column;
  margin: 12px 0;
}

.product-detail-price-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.product-detail-price {
  font-size: 26px;
  color: var(--text-primary);
  font-weight: var(--font-weight-bold);
}

.product-detail-discount {
  font-size: 14px;
  color: var(--discount-color);
  font-weight: var(--font-weight-medium);
}

.product-detail-installments {
  font-size: 14px;
  color: var(--text-secondary);
  margin-top: 6px;
}

.product-detail-shipping {
  font-size: 14px;
  color: var(--accent-color);
  font-weight: var(--font-weight-medium);
  margin: 12px 0;
  display: flex;
  align-items: center;
  gap: 6px;
}

.product-detail-description {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: 16px 0;
  padding: 16px 0;
  border-top: 1px solid var(--border-color);
  border-bottom: 1px solid var(--border-color);
}

.product-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 12px 0;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background-color: var(--primary-light);
  color: var(--primary);
  padding: 6px 12px;
  border-radius: 16px;
  font-size: 12px;
  font-weight: var(--font-weight-medium);
}

.check-icon {
  color: var(--accent-color);
}

/* Estilos para métodos de pago en detalle de producto */
.payment-methods {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 12px 0;
  font-size: 14px;
  color: var(--text-secondary);
}

.payment-methods .payment-icon {
  width: 32px;
  height: 20px;
  object-fit: contain;
}

/* Product Detail Favorite Button */
.product-detail-favorite {
  background-color: #f0edff;
  border: none;
  border-radius: 50%;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  position: absolute;
  top: 10px;
  right: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 5;
}

.product-detail-favorite:hover {
  transform: scale(1.1);
  background-color: #e6e1ff;
}

.product-detail-favorite .favorite-icon-img {
  width: 24px;
  height: 24px;
}

.dark .product-detail-favorite {
  background-color: #2d2a4a;
}

.fixed-add-to-cart {
  position: fixed;
  bottom: 0;
  bottom: env(safe-area-inset-bottom, 0);
  left: 0;
  width: 100%;
  background-color: var(--bg-card);
  padding: 12px 16px;
  box-shadow: 0 -4px 12px var(--shadow-color);
  z-index: 2001;
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-top: 1px solid var(--border-color);
  height: 80px;
}

.fixed-add-to-cart .quantity-input {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--bg-secondary);
  border-radius: var(--button-radius);
  padding: 6px 10px;
  box-shadow: 0 2px 8px var(--shadow-color);
}

.fixed-add-to-cart .quantity-input button {
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 6px;
  width: 36px;
  height: 36px;
  font-size: 18px;
  font-weight: bold;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.fixed-add-to-cart .quantity-input button:hover {
  background-color: var(--primary-hover);
}

.fixed-add-to-cart .quantity-input input {
  width: 50px;
  height: 36px;
  text-align: center;
  border: 1px solid var(--border-color);
  border-radius: 6px;
  font-size: 16px;
  font-weight: var(--font-weight-bold);
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

.add-to-cart-button {
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: var(--button-radius);
  padding: 12px 20px;
  font-size: 16px;
  font-weight: var(--font-weight-bold);
  cursor: pointer;
  transition: all var(--transition-normal);
  flex-grow: 1;
  max-width: 60%;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.add-to-cart-button:hover {
  background-color: var(--primary-hover);
}

.add-to-cart-button::before {
  font-size: 18px;
}

/* Cart Modal */
.cart-modal {
  background-color: var(--bg-card);
  border-radius: var(--card-radius);
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  max-height: calc(90vh - env(safe-area-inset-top) - env(safe-area-inset-bottom));
  overflow-y: auto;
  padding: 20px;
  position: relative;
  box-shadow: 0 10px 30px var(--shadow-color);
  transform: scale(0.95);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  margin: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}

.modal-overlay.active .cart-modal {
  transform: scale(1);
}

.cart-modal h2 {
  font-size: 22px;
  color: var(--text-primary);
  margin-bottom: 20px;
  text-align: center;
  font-weight: var(--font-weight-bold);
}

.cart-items {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
  max-height: 50vh;
  overflow-y: auto;
  padding-right: 5px;
}

.cart-items::-webkit-scrollbar {
  width: 4px;
}

.cart-items::-webkit-scrollbar-track {
  background: var(--bg-secondary);
  border-radius: 10px;
}

.cart-items::-webkit-scrollbar-thumb {
  background-color: var(--primary);
  border-radius: 10px;
}

.cart-item {
  display: flex;
  align-items: center;
  padding: 12px;
  border-radius: var(--card-radius);
  background-color: var(--bg-secondary);
  position: relative;
  margin-bottom: 8px;
  transition: all var(--transition-normal);
  box-shadow: 0 1px 3px var(--shadow-color);
}

.cart-item-image {
  width: 60px;
  height: 60px;
  border-radius: 6px;
  overflow: hidden;
  margin-right: 12px;
  background-color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4px;
}

.cart-item-image img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.cart-item-info {
  flex-grow: 1;
}

.cart-item-info h3 {
  font-size: 14px;
  color: var(--text-primary);
  margin-bottom: 4px;
  font-weight: var(--font-weight-medium);
}

.cart-item-info .price {
  font-size: 14px;
  color: var(--primary);
  font-weight: var(--font-weight-bold);
}

.cart-item-quantity {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: 8px;
}

.cart-item-quantity button {
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 4px;
  width: 24px;
  height: 24px;
  display: flex;
  justify-content: center;
  align-items: center;
  font-size: 14px;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.cart-item-quantity button:hover {
  background-color: var(--primary-hover);
}

.cart-item-quantity span {
  font-size: 14px;
  width: 24px;
  text-align: center;
  font-weight: var(--font-weight-medium);
}

.remove-item {
  position: absolute;
  top: 8px;
  right: 8px;
  background-color: transparent;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition-normal);
}

.remove-item:hover {
  color: var(--accent-secondary);
}

.cart-summary {
  border-top: 1px solid var(--border-color);
  padding-top: 16px;
  margin-top: 12px;
}

.cart-summary .subtotal,
.cart-summary .shipping,
.cart-summary .total {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 14px;
  color: var(--text-primary);
}

.cart-summary .total {
  font-weight: var(--font-weight-bold);
  font-size: 18px;
  color: var(--primary);
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--border-color);
}

.cart-actions {
  display: flex;
  gap: 12px;
  margin-top: 20px;
}

.cart-actions button {
  flex: 1;
  padding: 14px;
  border: none;
  border-radius: var(--button-radius);
  font-size: 14px;
  font-weight: var(--font-weight-bold);
  cursor: pointer;
  transition: all var(--transition-normal);
  box-shadow: 0 2px 8px var(--shadow-color);
}

.continue-shopping {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

.continue-shopping:hover {
  background-color: var(--border-color);
}

.checkout {
  background-color: var(--primary);
  color: white;
}

.checkout:hover {
  background-color: var(--primary-hover);
}

.empty-cart-message {
  text-align: center;
  padding: 30px 0;
  color: var(--text-muted);
  font-size: 16px;
  line-height: 1.5;
}

.empty-cart-message p:first-child {
  font-size: 18px;
  margin-bottom: 8px;
  color: var(--text-primary);
  font-weight: var(--font-weight-medium);
}

/* Filter Modal */
.filter-modal {
  background-color: var(--bg-card);
  border-radius: var(--card-radius) var(--card-radius) 0 0;
  width: 100%;
  max-width: 100%;
  height: 70vh;
  position: relative;
  box-shadow: 0 -10px 30px var(--shadow-color);
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-bottom: env(safe-area-inset-bottom);
}

.modal-overlay.active .filter-modal {
  transform: translateY(0);
}

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

.filter-header h2 {
  font-size: 18px;
  font-weight: var(--font-weight-medium);
}

.filter-content {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
}

.filter-group {
  margin-bottom: 20px;
}

.filter-group-title {
  font-size: 16px;
  font-weight: var(--font-weight-medium);
  margin-bottom: 12px;
  color: var(--text-primary);
}

.filter-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-option input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary);
}

.filter-option label {
  font-size: 14px;
  color: var(--text-secondary);
}

.filter-actions {
  display: flex;
  gap: 12px;
  padding: 16px;
  border-top: 1px solid var(--border-color);
}

.filter-actions button {
  flex: 1;
  padding: 12px;
  border: none;
  border-radius: var(--button-radius);
  font-size: 14px;
  font-weight: var(--font-weight-bold);
  cursor: pointer;
  transition: all var(--transition-normal);
  box-shadow: 0 2px 8px var(--shadow-color);
}

.filter-clear {
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

.filter-apply {
  background-color: var(--primary);
  color: white;
}

.filter-apply:hover {
  background-color: var(--primary-hover);
}

/* Sort Modal */
.sort-modal {
  background-color: var(--bg-card);
  border-radius: var(--card-radius) var(--card-radius) 0 0;
  width: 100%;
  max-width: 100%;
  position: relative;
  box-shadow: 0 -10px 30px var(--shadow-color);
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin-bottom: env(safe-area-inset-bottom);
}

.modal-overlay.active .sort-modal {
  transform: translateY(0);
}

.sort-header {
  padding: 16px;
  border-bottom: 1px solid var(--border-color);
  text-align: center;
}

.sort-header h2 {
  font-size: 18px;
  font-weight: var(--font-weight-medium);
}

.sort-options {
  padding: 8px 0;
}

.sort-option {
  padding: 14px 16px;
  font-size: 14px;
  color: var(--text-primary);
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.sort-option:hover {
  background-color: var(--bg-secondary);
}

.sort-option.active {
  color: var(--primary);
  font-weight: var(--font-weight-medium);
}

.sort-option.active::before {
  content: "✓";
  color: var(--primary);
  font-weight: bold;
}

/* Responsive Styles */
@media (min-width: 768px) {
  .product-detail-content {
    flex-direction: row;
    gap: 30px;
    align-items: flex-start;
    padding: 20px;
  }

  .product-detail-image {
    width: 45%;
    height: 50vh;
    position: sticky;
    top: 20px;
  }

  .product-detail-info {
    width: 55%;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 0 16px 0;
  }

  .product-image {
    height: 140px;
  }

  .product-info {
    padding: 8px;
  }

  .product-info h3 {
    font-size: 12px;
    height: 32px;
  }

  .price {
    font-size: 16px;
  }

  .fixed-add-to-cart {
    padding: 10px 12px;
    height: 70px;
  }

  .fixed-add-to-cart .quantity-input button {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }

  .fixed-add-to-cart .quantity-input input {
    width: 40px;
    height: 32px;
    font-size: 14px;
  }

  .add-to-cart-button {
    height: 42px;
    font-size: 14px;
    padding: 8px 16px;
  }
}

/* Animations */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.product-card {
  animation: fadeIn 0.3s ease forwards;
}

/* Staggered animation for product cards */
.products-grid .product-card:nth-child(1) {
  animation-delay: 0.05s;
}
.products-grid .product-card:nth-child(2) {
  animation-delay: 0.1s;
}
.products-grid .product-card:nth-child(3) {
  animation-delay: 0.15s;
}
.products-grid .product-card:nth-child(4) {
  animation-delay: 0.2s;
}
.products-grid .product-card:nth-child(5) {
  animation-delay: 0.25s;
}
.products-grid .product-card:nth-child(6) {
  animation-delay: 0.3s;
}

/* Buscador */
.search-container {
  padding: 10px 12px;
  background-color: var(--bg-primary);
  border-bottom: 1px solid var(--border-color);
}

.search-bar {
  display: flex;
  align-items: center;
  background-color: var(--bg-secondary);
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.search-bar input {
  flex: 1;
  padding: 12px 16px;
  border: none;
  outline: none;
  font-size: 14px;
  color: var(--text-primary);
  background-color: transparent;
}

.search-bar button {
  background-color: var(--primary);
  color: white;
  border: none;
  padding: 8px 16px;
  cursor: pointer;
  transition: background-color 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.search-icon {
  width: 24px;
  height: 24px;
}

.search-bar button:hover {
  background-color: var(--primary-hover);
}

.search-results {
  margin-top: 8px;
  background-color: var(--bg-primary);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  max-height: 300px;
  overflow-y: auto;
  display: none;
  position: absolute;
  width: calc(100% - 24px);
  z-index: 100;
}

.search-result-item {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.search-result-item:hover {
  background-color: var(--bg-secondary);
}

.search-result-item:last-child {
  border-bottom: none;
}

.no-search-results {
  padding: 16px;
  text-align: center;
  color: var(--text-secondary);
}

/* Detalle de producto en popup */
.product-detail-popup {
  max-width: 600px;
  max-height: 80vh;
  width: 90%;
  padding: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.product-detail-content-popup {
  padding: 20px;
  overflow-y: auto;
  max-height: calc(80vh - 80px);
}

.product-detail-popup .close-modal {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 10;
  background-color: var(--bg-secondary);
  width: 30px;
  height: 30px;
  font-size: 16px;
}

.product-detail-image-popup {
  width: 100%;
  height: 200px;
  background-color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 16px;
  border-radius: 8px;
  overflow: hidden;
}

.product-detail-image-popup img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.product-detail-info-popup {
  position: relative;
  padding-top: 10px;
}

.product-detail-info-popup h2 {
  font-size: 18px;
  margin-bottom: 8px;
  color: var(--text-primary);
  font-weight: var(--font-weight-medium);
}

.product-detail-actions {
  display: flex;
  padding: 16px;
  border-top: 1px solid var(--border-color);
  gap: 12px;
  align-items: center;
}

.product-detail-actions .quantity-input {
  display: flex;
  align-items: center;
  gap: 8px;
  background-color: var(--bg-secondary);
  border-radius: var(--button-radius);
  padding: 4px 8px;
}

.product-detail-actions .quantity-input button {
  background-color: var(--primary);
  color: white;
  border: none;
  border-radius: 4px;
  width: 32px;
  height: 32px;
  font-size: 16px;
  font-weight: bold;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  transition: all var(--transition-normal);
}

.product-detail-actions .quantity-input input {
  width: 40px;
  height: 32px;
  text-align: center;
  border: 1px solid var(--border-color);
  border-radius: 4px;
  font-size: 14px;
  font-weight: var(--font-weight-bold);
  background-color: var(--bg-secondary);
  color: var(--text-primary);
}

.product-detail-actions .add-to-cart-button {
  flex: 1;
  height: 40px;
  font-size: 14px;
}

/* Badges de categoría */
/* Modificar los estilos de los badges de categoría para asegurar consistencia en todos los dispositivos */
.category-badges-container {
  padding: 12px 16px;
  background-color: var(--bg-primary);
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none; /* Firefox */
  border-bottom: 1px solid var(--border-color);
  position: relative;
  z-index: 10; /* Asegurar que esté por encima de otros elementos */
  -webkit-appearance: none; /* Prevenir estilos nativos en iOS */
}

.category-badges {
  display: flex;
  gap: 8px;
  padding-bottom: 4px;
  justify-content: center;
  flex-wrap: nowrap; /* Evitar que los badges se envuelvan */
}

.category-badge {
  background-color: var(--bg-secondary);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: var(--font-weight-medium);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 5px;
  height: 28px;
  -webkit-appearance: none; /* Prevenir estilos nativos en iOS */
  -webkit-tap-highlight-color: transparent; /* Eliminar el resaltado al tocar en iOS */
}

/* Asegurar que los badges se muestren correctamente en iOS */
@supports (-webkit-touch-callout: none) {
  .category-badges-container {
    display: block;
    overflow-x: auto;
  }

  .category-badges {
    display: inline-flex;
    width: max-content;
  }
}

.category-badge img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.category-badge:hover {
  background-color: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary);
}

.category-badge.active {
  background-color: var(--primary);
  color: white;
  border-color: var(--primary);
}

.category-badge.all-badge {
  background-color: var(--accent-color);
  color: white;
  border-color: var(--accent-color);
}

.category-badge.all-badge:hover {
  background-color: #008c42;
  border-color: #008c42;
}

.dark .category-badge {
  background-color: var(--bg-card);
}

.dark .category-badge:hover {
  background-color: var(--primary-light);
}

@media (max-width: 480px) {
  .category-badges-container {
    padding: 8px 12px;
  }

  .category-badge {
    padding: 3px 8px;
    font-size: 11px;
    height: 24px;
  }

  .category-badge img {
    width: 14px;
    height: 14px;
  }
}

