:root {
  --color-primario: #ff91b7;
  --color-secundario: #007aff;
  --color-texto: #333333;
  --color-fondo: #f9f9f9;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial,
    sans-serif;
}

body {
  padding-top: 80px;
  background-color: #f9f9f9;
}

.cpt-body {
  background-color: #f5f5f7;
  color: #1d1d1f;
}

/* Categorías */
.cpt-categories-section {
  background-color: #ffffff;
  width: 100%;
  padding: 5px 26px;
  background-color: transparent;
  overflow-x: hidden;
  scroll-snap-type: x mandatory;
}

.cpt-categories-scroll {
  display: flex;
  gap: 20px;
  padding: 0 16px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
}

.cpt-categories-scroll::-webkit-scrollbar {
  display: none;
}

.cpt-category-btn {
  white-space: nowrap;
  padding: 10px 20px;
  border: 1px solid #e5e5e7;
  border-radius: 20px;
  background-color: transparent;
  color: #424245;
  font-size: 14px;
  font-weight: 400;
  cursor: pointer;
  transition: all 0.2s ease;
  flex-shrink: 0;
  font-family:
    -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  scroll-snap-align: start;
  text-decoration: none;
}

.cpt-category-btn:hover {
  border-color: #007aff;
  color: #007aff;
}

.cpt-category-btn.active {
  border-color: var(--color-primario);
  background-color: var(--color-primario);
  color: white;
}

/* Responsive categorías */
@media (max-width: 480px) {
  .cpt-categories-scroll {
    padding: 0 12px;
    gap: 10px;
  }

  .cpt-category-btn {
    padding: 8px 16px;
    font-size: 13px;
  }
}

/* Sección de ofertas */
.ofertas {
  padding: 10px 26px;
  max-width: 100vw;
  margin: 20px auto;
}

/* Header de ofertas */
.ofertas-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.ofertas-header h2 {
  font-size: 16px;
  font-weight: bold;
  color: #333;
}

.ofertas-header .ver-mas {
  font-size: 14px;
  color: var(--color-primario);
  text-decoration: none;
  user-select: none;
  -webkit-user-drag: none;
}

/* Card */
.oferta-card {
  display: flex;
  align-items: center;
  background: #fafafa;
  border-radius: 12px;
  padding: 20px;
  gap: 22px;
  height: 160px; /* Altura fija para la card */
  min-height: 160px;
  max-height: 160px;
}
.oferta-card:nth-child(2) {
  padding-top: -50px;
}

.oferta-link {
  text-decoration: none;
}

.oferta-card img.oferta-img {
  width: 100px;
  height: auto;
  border-radius: 8px;
}

.oferta-img-wrapper {
  background-color: #f5f5f5;
  padding: 5px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  user-select: none;
  -webkit-user-drag: none;
  width: 100px; /* Ancho fijo */
  height: 100px; /* Alto fijo */
  flex-shrink: 0; /* Evita que se reduzca */
  overflow: hidden;
}

.oferta-img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain; /* Mantiene proporción sin distorsionar */
  border-radius: 6px;
}

/* Info */
.oferta-info h3 {
  font-size: 14px;
  font-weight: bold;
  color: #333;
  margin-bottom: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2; /* Máximo 2 líneas */
  -webkit-box-orient: vertical;
  line-height: 1.3;
}
.oferta-info .descripcion {
  font-size: 12px;
  color: #7c7c7c;
  margin-bottom: 10px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap; /* Una sola línea */
}

/* Precios */
.precios {
  display: flex;
  align-items: center;
  gap: 10px;
}

.oferta-cta {
  display: none;
}

.precio-old {
  font-size: 12px;
  color: var(--color-primario);
  text-decoration: line-through;
}

.precio-new {
  font-size: 16px;
  font-weight: bold;
  color: #000000;
}

/* Responsivo ofertas en móviles */

@media (max-width: 480px) {
  .oferta-img-wrapper {
    background-color: #f5f5f5;
    padding: 5px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    user-select: none;
    -webkit-user-drag: none;
    width: 100px; /* Ancho fijo */
    height: 100px; /* Alto fijo */
    flex-shrink: 0; /* Evita que se reduzca */
  }

  .oferta-img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Mantiene proporción sin distorsionar */
    border-radius: 6px;
  }
}
@media (max-width: 480px) {
  .oferta-card {
    background-color: white;
    padding: 1.3rem;
    align-items: center;
    box-shadow: 0px 4px 13px -3px rgba(0, 0, 0, 0.1);
  }

  .oferta-card img {
    width: 100%;
    max-width: 220px;
    margin: 0 auto 12px auto;
    display: block;
  }

  .oferta-info {
    flex: 1;
    min-width: 0; /* Permite que el texto se ajuste */
  }

  .oferta-info h3 {
    font-size: 14px;
    font-weight: bold;
    color: #333;
    margin-bottom: 6px;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2; /* Máximo 2 líneas */
    -webkit-box-orient: vertical;
    line-height: 1.3;
  }

  .oferta-info .descripcion {
    font-size: 11px;
  }

  .precio-old {
    font-size: 12px;
  }

  .precio-new {
    font-size: 16px;
  }
}

/* Responsivo ofertas en tablets */
@media (max-width: 768px) {
  .oferta-card {
    padding: 16px;
    gap: 16px;
  }

  .oferta-card img {
    width: 120px;
  }

  .oferta-info h3 {
    font-size: 15px;
  }
}

/* Productos Populares */
.productos-populares {
  padding: 10px 26px;
  margin: 20px auto;
}

.productos-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 15px;
}

.productos-header h2 {
  font-size: 16px;
  font-weight: bold;
  color: #333;
}

.productos-header .ver-mas {
  font-size: 14px;
  color: var(--color-primario);
  text-decoration: none;
  user-select: none;
  -webkit-user-drag: none;
}

.productos-scroll-nav {
  display: none;
}

/* Scroll horizontal */
.productos-scroll {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 8px;
  scroll-snap-type: x mandatory;
}
.productos-scroll::-webkit-scrollbar {
  display: none;
}

/* Card */
/* Card */
.producto-card {
  width: 211px;
  height: 286px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0px 4px 12px rgba(0, 0, 0, 0.05);
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  scroll-snap-align: start;
}

/* Imagen */
.producto-img-wrapper {
  background-color: #f9f9f9;
  border-radius: 12px;
  width: calc(100% - 35px);
  height: 192px;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 12px auto 9px auto; /* margen superior/inferior */
  position: relative; /* Agregar esto para que el badge se posicione correctamente */
}

.producto-img {
  max-width: 192px;
  max-height: 192px;
  object-fit: contain;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.producto-img.img-loaded {
  opacity: 1;
}

/* Info */
.producto-info {
  display: flex;
  flex-direction: column;
  justify-content: space-evenly;
  padding: 0 25px 14px;
  flex: 1;
  text-decoration: none;
  margin-top: 1.2em;
}

.producto-info h3 {
  font-size: 13px;
  font-weight: bold;
  color: #333;
  margin-bottom: 4px;
  text-align: left;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.producto-info .categoria {
  font-size: 12px;
  color: #7c7c7c;
  margin-bottom: 9px;
  text-align: left;
  text-decoration: none;
}

/* Footer */
.producto-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.producto-footer .precio {
  font-size: 14px;
  font-weight: bold;
  color: #000;
}

.btn-favorito {
  border: none;
  background: none;
  cursor: pointer;
  width: 30px;
  color: #aaa;
  transition: color 0.2s;
  z-index: 999;
  padding-bottom: 5px;
  margin-right: 10px;
}
.btn-favorito:hover {
  color: #ff5a8b;
}

.btn-favorito img {
  width: 30px;
}

/* Responsive */
@media (max-width: 480px) {
  .producto-card {
    width: 230px;
    height: 310px;
    border-radius: 25px;
  }

  .producto-img-wrapper {
    height: 200px;
  }

  .producto-img {
    max-width: 250px;
  }
}

/*  Navbar */
/* Bottom Navbar */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 3.5rem;
  background: #f9f9f9;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 10px 0;
  z-index: 1000;
  box-sizing: border-box;
}

.nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: #888;
  font-size: 12px;
  flex: 1;
}

.nav-icon {
  width: 22px;
  height: 22px;
  margin-bottom: 4px;
}

.nav-item.active {
  color: var(--color-primario); /* rosa para item activo */
  font-weight: 600;
}

/* Carrito con badge */
.cart-icon {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
}

.cart-icon .badge {
  position: absolute;
  top: -6px;
  right: -10px;
  background: var(--color-primario);
  color: #fff;
  font-size: 10px;
  font-weight: bold;
  border-radius: 50%;
  padding: 2px 5px;
  line-height: 1;
}

/* Carrusel de ofertas */
.ofertas-carousel {
  position: relative;
  overflow: hidden;
  width: 100%;
  margin-top: 10px;
  height: 180px; /* Altura fija */
}

.ofertas-track {
  display: flex;
  transition: transform 0.5s ease;
}

.oferta-link {
  flex: 0 0 100%;
  text-decoration: none;
  color: inherit;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  margin-top: 10px;
  gap: 6px;
}

.dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #ddd;
  transition: background-color 0.3s ease;
}

.dot.active {
  background-color: var(--color-primario);
}

/* Aplica a la versión de la card de esta página */
.producto-card .producto-footer {
  position: relative; /* clave: sirve como base para el botón */
}

.producto-card .btn-favorito {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(255, 255, 255, 0.8);
  border: none;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.3s ease;
  box-shadow: rgba(99, 99, 99, 0.2) 0px 2px 8px 0px;
}

.producto-card .btn-favorito:hover {
  background: rgba(255, 255, 255, 1);
}

.btn-favorito svg {
  width: 20px;
  height: 20px;
  color: #b4b4b4;
  pointer-events: none; /* asegura que el clic llega al botón, no al svg */
}

.btn-favorito svg path {
  fill: none;
  stroke: #8d8d8d;
  stroke-width: 2;
}

.producto-img-wrapper {
  position: relative;
}

.producto-img-wrapper .btn-favorito {
  position: absolute;
  top: 14px;
  right: 2px;
  background: rgba(255, 255, 255, 0.9);
  border-radius: 50%;
  padding: 6px;
  border: none;
  cursor: pointer;
  z-index: 5;
}

.btn-favorito.active svg path {
  fill: var(--color-primario);
  stroke: var(--color-primario);
}

.btn-favorito:not(.active) svg path {
  fill: none;
  stroke: #c4c3c3;
  stroke-width: 1.8;
}

/* Estilos para precios con oferta */
.precios-oferta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: -0.6em;
}

.precio-original {
  text-decoration: line-through;
  color: var(--color-primario);
  font-size: 0.9em;
}

.precio-oferta {
  color: #000;
  font-weight: bold;
  font-size: 1em;
}

.precio-oferta2 {
  color: var(--color-secundario) !important;
  font-weight: bold;
  font-size: 0.8em;
}

.badge-oferta {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--color-secundario);
  color: white;
  padding: 4px 8px;
  border-radius: 8px;
  font-size: 11px;
  font-weight: bold;
  z-index: 2;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Para la sección de ofertas */
.oferta-card .precio-old {
  text-decoration: line-through;
  color: var(--color-primario);
  font-size: 0.9em;
}

.oferta-card .precio-new {
  color: #000;
  font-weight: bold;
  font-size: 1em;
}

.badge-agotado {
  position: absolute;
  top: 10px;
  left: 10px;
  background: linear-gradient(135deg, #6c757d 0%, #495057 100%);
  color: white;
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  z-index: 2;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

/* Badge mas compacto solo en oferta-card */
.oferta-card .badge-agotado {
  top: 8px;
  left: 8px;
  padding: 4px 8px;
  font-size: 10px;
  letter-spacing: 0.3px;
  border-radius: 12px;
}
