
html,
body {
  position: relative;
  height: 100%;
}

body {
  background: #eee;
  font-family: Helvetica Neue, Helvetica, Arial, sans-serif;
  font-size: 14px;
  color: var(--color-primary);
  margin: 0;
  padding: 0;
}

h3.title{
  color: var(--color-primary-dark);
  margin-left: 50px;
}

/*  COVER   */

.cover {
  width: 100%;
  height: 220px;
}

.swiper-slide {
  text-align: center;
  font-size: 18px;
  background: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
}

.cover .swiper-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.cover .autoplay-progress {
  position: absolute;
  right: 16px;
  bottom: 16px;
  z-index: 10;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
  color: var(--swiper-theme-color);
}

.cover .autoplay-progress svg {
  --progress: 0;
  position: absolute;
  left: 0;
  top: 0px;
  z-index: 10;
  width: 100%;
  height: 100%;
  stroke-width: 4px;
  stroke: var(--swiper-theme-color);
  fill: none;
  stroke-dashoffset: calc(125.6px * (1 - var(--progress)));
  stroke-dasharray: 125.6;
  transform: rotate(-90deg);
}

.cover .slide-content {
  position: absolute;
  bottom: 20px; /* Distancia desde la parte inferior */
  left: 20px; /* Distancia desde la izquierda */
  color: white; /* Color del texto */
  text-align: left; /* Alineación del texto */
  background: var(--color-primary-opacity); /* Fondo semi-transparente */
  padding: 10px; /* Espaciado interno */
  border-radius: 5px; /* Bordes redondeados */
}

.cover .slide-content h3, 
.cover .slide-content p {
  margin: 0; /* Agregado */
}

   /*  CATEGORY   */

.category {
  width: 90%;
  height: 170px;
}

/* .category .swiper-wrapper{
  width: 90%;
} */

.category .swiper-slide {
  padding-top: 20px;
  display: flex;
  flex-direction: column;
  height: 120px;
  border-radius: 10px;
}

.svg-info{
  padding-left: 50px;
  fill: var(--color-warning);
}

.category-icons{
  width: 4rem;
  height: 4rempx;
  fill:var(--swiper-theme-color);
}

/*  PRODUCTS   */


.products {
  width: 90%;
  height: auto;
  padding: 20px 0;
}

.products .swiper-slide {
      background: #fff;
      border-radius: 8px;
      overflow: hidden;
      box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
      display: flex;
      flex-direction: column;
      height: auto;
    }

.products .product-image {
      width: 80%;
      aspect-ratio: 1/1; /* Mantiene relación 1:1 (4x4) */
      object-fit: cover;
    }

  .products  .product-info {
      padding: 15px;
      text-align: left;
    }

   .products .product-name {
      font-size: 16px;
      font-weight: 600;
      margin: 0 0 5px 0;
      color: var(--color-primary-dark);
    }

   .products .product-price {
      font-size: 18px;
      font-weight: 700;
      color: var(--color-success);
      margin: 0;
    }

  .products  .swiper-pagination {
      position: relative;
      margin-top: 20px;
    }



/* Contenedor general de productos */
.store-products {
  max-width: 1200px;
  margin: 0 auto;
  padding: 10px 16px 40px;
}

/* Cada categoría */
.category-section {
  display: block;
  width: 100%;
  margin-bottom: 48px;
}

/* Cabecera de categoría */
.category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  padding-bottom: 10px;
  border-bottom: 2px solid #e5e5e5;
}

.category-title {
  padding-left: 20px;
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-primary-opacity);
  margin: 0;
}

.category-count {
  font-size: 0.9rem;
  color: #888;
  white-space: nowrap;
}

/* Grid de productos */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 2fr));
  gap: 18px;
}

/* Tarjeta */
.product-card-wrapper{
  background: #ffffff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.07);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
  display: flex;
  flex-direction: column;
  padding-bottom: 15px;
}

a.product-card {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}

.product-card-wrapper:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.11);
}

.product-image {
  width: 100%;
  height: 160px;
  object-fit: contain;
  background: #f7f7f7;
  padding: 14px;
  align-self: center; 
}

.product-info {
  padding: 12px 14px 16px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.product-name {
  font-size: 0.95rem;
  font-weight: 600;
  color: #1a1a1a;
  margin: 0 0 8px 0;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.product-brand {
  font-size: 0.72rem;
  font-weight: 500;
  color: #617254;
  background: rgba(97, 114, 84, 0.12);
  padding: 3px 8px;
  border-radius: 20px;
}

.product-model {
  font-size: 0.72rem;
  font-weight: 500;
  color: #555;
  background: #f0f0f0;
  padding: 3px 8px;
  border-radius: 20px;
}

.product-price {
  font-size: 1.1rem;
  font-weight: 700;
  color: #617254;
  margin: auto 0 0 0;
}

.out-of-stock {
  display: inline-block;
  margin-top: 8px;
  font-size: 0.72rem;
  font-weight: 600;
  color: #c0392b;
  background: #fdecea;
  padding: 3px 8px;
  border-radius: 6px;
}


.btn-add-cart {
  background: var(--color-primary-dark);
  color: #eee3e3;
  border: none;
  border-radius: 8px;
  padding: 7px 12px;
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transform: translateY(6px);
  transition: opacity 0.2s, transform 0.2s, background 0.2s;
  z-index: 2;
  margin: 0px 15px;
  display: flex;
  align-items: center;      /* centra verticalmente */
  justify-content: center;  /* centra horizontalmente */
  gap: 6px;   
}
.product-card:hover .btn-add-cart {
  opacity: 1;
  transform: translateY(0);
}
.btn-add-cart:hover {
  background: #333;
}
.btn-add-cart:disabled {
  background: #999;
  cursor: not-allowed;
  opacity: 0.7;
}

.no-products {
  text-align: center;
  color: #777;
  padding: 40px 0;
}




/* ========== Detalle del producto ========== */

.product-detail {
  max-width: 900px;
  margin: 0 auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.detail-image-wrap {
  width: 100%;
  background: #f7f7f7;
  border-radius: 12px;
  overflow: hidden;
  margin: 0 auto;
  padding-right: 25px;
}

.detail-image {
  width: 100%;
  height: auto;
  max-height: 360px;
  object-fit: contain;
  display: block;
  padding: 16px;
}

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

.detail-name {
  font-size: 1.4rem;
  font-weight: 700;
  margin: 0;
  line-height: 1.3;
  color: #1a1a1a;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-price {
  font-size: 1.6rem;
  font-weight: 700;
  color: #617254;
  margin: 4px 0;
}

.detail-description h2 {
  font-size: 1rem;
  margin: 0 0 6px 0;
  color: #333;
}

.detail-description p {
  margin: 0;
  line-height: 1.5;
  color: #444;
  font-size: 0.95rem;
}

.detail-note {
  font-size: 0.8rem;
  color: #888;
  margin: 8px 0 0 0;
  font-style: italic;
}

/* Relacionados */
.related-section {
  max-width: 1100px;
  margin: 32px auto 40px;
  padding: 0 16px;
}

.related-title {
  font-size: 1.2rem;
  margin: 0 0 16px 0;
  padding-bottom: 8px;
  border-bottom: 2px solid #e5e5e5;
}



/* Badge */
.cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background: #e11d48;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  line-height: 1;
}
.cart-btn {
  position: relative;
}

/* Overlay */
.cart-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
  z-index: 998;
}
.cart-overlay.open {
  opacity: 1;
  visibility: visible;
}

/* Panel lateral */

.cart-panel {
  position: fixed;
  top: 0;
  right: 0;
  width: min(380px, 100%);
  height: 100%;
  background: #fff;
  box-shadow: -8px 0 30px rgba(0,0,0,0.15);
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 999;
  display: flex;
  flex-direction: column;
}
.cart-panel.open {
  transform: translateX(0);
}

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem 1.25rem;
  border-bottom: 1px solid #eee;
}
.cart-header h2 {
  margin: 0;
  font-size: 1.15rem;
}
.cart-close {
  background: none;
  border: none;
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
  color: #666;
  padding: 0 4px;
}

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 1rem 1.25rem;
}

.cart-item {
  display: flex;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #f0f0f0;
}
.cart-item-img {
  width: 64px;
  height: 64px;
  object-fit: cover;
  border-radius: 8px;
  background: #f5f5f5;
}
.cart-item-info {
  flex: 1;
  min-width: 0;
}
.cart-item-name {
  font-size: 0.9rem;
  font-weight: 600;
  margin: 0 0 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cart-item-price {
  font-size: 0.85rem;
  color: #555;
  margin: 0 0 6px;
}
.cart-item-qty {
  display: flex;
  align-items: center;
  gap: 8px;
}
.cart-item-qty button {
  width: 26px;
  height: 26px;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}
.cart-item-qty span {
  min-width: 20px;
  text-align: center;
  font-weight: 600;
}
.cart-item-remove {
  background: none;
  border: none;
  color: #e11d48;
  cursor: pointer;
  font-size: 0.8rem;
  margin-top: 4px;
  padding: 0;
}

.cart-empty {
  text-align: center;
  color: #888;
  padding: 2.5rem 1rem;
  font-size: 0.95rem;
}

.cart-footer {
  padding: 1.1rem 1.25rem;
  border-top: 1px solid #eee;
  background: #fafafa;
}
.cart-total {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 1.05rem;
}
.btn-order {
  width: 100%;
  padding: 12px;
  background: #25d366;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-order:hover {
  background: #1da851;
}
.btn-order:disabled {
  background: #aaa;
  cursor: not-allowed;
}

/* Botón Agregar en la tarjeta 
.product-card {
  position: relative;
}
*/



