/* GRID GENERAL */
/* Base: 1 columna (móvil por defecto) */
.eajpg-products {
  display: grid;
  gap: 20px;
  grid-template-columns: 1fr;
  
  min-height: 900px; /* Esto evita que el footer suba */
  position: relative;
  
}

/* Tablet vertical (≥576px): 2 columnas */
@media (min-width: 576px) {
  .eajpg-products {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Tablet horizontal (≥768px): 3 columnas */
@media (min-width: 768px) {
  .eajpg-products {
    grid-template-columns: repeat(3, 1fr);
  }
}

/* Escritorio (≥1024px): usar dinámico con clase cols-X */
@media (min-width: 1024px) {
  .eajpg-products.cols-1 { grid-template-columns: repeat(1, 1fr); }
  .eajpg-products.cols-2 { grid-template-columns: repeat(2, 1fr); }
  .eajpg-products.cols-3 { grid-template-columns: repeat(3, 1fr); }
  .eajpg-products.cols-4 { grid-template-columns: repeat(4, 1fr); }
  .eajpg-products.cols-5 { grid-template-columns: repeat(5, 1fr); }
  .eajpg-products.cols-6 { grid-template-columns: repeat(6, 1fr); }
}


.eajpg-grid{ margin-bottom:50px; }



.eajpg-product .star-rating {
  float: none !important;
  display: inline-block;
  margin: 0px auto 0px;
  width: 85px;
  height:30px;
  font-size: 18px; /* ajusta según el tamaño deseado */
  line-height: 1;
  color: transparent;
  position: relative;
}

/* Fondo de estrellas vacías: borde negro */
.eajpg-product .star-rating::before {
  content: '★★★★★';
  letter-spacing: 2px;
  color: transparent;
  -webkit-text-stroke: 1px #000; /* Borde negro */
  position: absolute;
  top: 0;
  left: 0;
}

/* Estrellas rellenas: negras */
.eajpg-product .star-rating span::before {
  content: '★★★★★';
  letter-spacing: 2px;
  color: #000;
  position: absolute;
  top: 0;
  left: 0;
  overflow: hidden;
  width: 0;
}

/* Controla cuánto se rellena en función del rating */
.eajpg-product .star-rating span {
  display: block;
  overflow: hidden;
}


/* Centrarlo dentro del contenedor */
.eajpg-product {
    text-align: center;
}

@font-face {
  font-family: 'star';
  src: url('https://fonts.googleapis.com/css?family=Star') format('woff');
}

.woocommerce .star-rating {
    display: inline-block !important;
    opacity: 1 !important;
}


/* TARJETA DEL PRODUCTO */
.eajpg-product {
  min-width: 200px;
  box-sizing: border-box;
  background: #fff;
  border: 1px solid #eee;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  text-align: center;
  padding: 10px;
  position: relative;
}

/* IMAGEN CUADRADA */
.eajpg-product a img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  display: block;
  border-radius: 5px;
}

.eajpg-no-results {
  text-align: center;
  padding: 40px;
  font-size: 18px;
  font-weight: bold;
  color: #555;
}


/* EVITA DISTINTOS ANCHOS POR TEXTO */
.eajpg-title,
.eajpg-price,
.ajax_add_to_cart,
.add_to_cart_button,
.product_type_simple {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* TÍTULO */
.eajpg-title {
  font-size: 16px;
  font-weight: 600;
  text-align: center;
  margin: 10px 0;
}

/* PRECIO */
.eajpg-price {
  font-weight: bold;
  font-size: 15px;
  display: block;
  margin-bottom: 10px;
}

/* BADGE DE OFERTA */
.eajpg-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background-color: #f2c94c;
  color: #fff;
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 20px;
  font-weight: bold;
  z-index: 10;
}

/* BOTÓN DE CARRITO */
.ajax_add_to_cart,
.product_type_simple {
  padding: 10px;
  display: block;
  width: 100%;
  text-decoration: none !important;

  font-weight: bold;
  border: none;
  cursor: pointer;
  transition: background 0.3s ease;
}

.ajax_add_to_cart:hover,
.product_type_simple:hover {
  background: #444;
}

/* PAGINADOR */
.eajpg-pagination {
  text-align: center;
  margin-top: 20px;
}

.eajpg-page-btn {
  background: transparent;
  border: none;
  margin: 0 6px;
  font-size: 16px;
  cursor: pointer;
  color: #000 !important;
  margin-top:50px;
}

.eajpg-page-btn:hover {
  text-decoration: underline;
  color: #fff !important;
  background: #000;
}

.eajpg-page-btn.current {
  background-color: #000;
  color: #fff !important;
  font-weight: bold;
  border-radius: 4px;
  
}


/* LOADING SPINNER */

.eajpg-loading-wrapper {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 1;
}

.eajpg-loading-spinner {
  width: 40px;
  height: 40px;
  border: 4px solid #ccc;
  border-top: 4px solid #666;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

@keyframes spin {
  0%   { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.eajpg-filters {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 20px 0;
  border-bottom: 0px solid #eaeaea;
  font-family: inherit;
  font-size: 14px;
  color: #333;
}

.filter-group {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
}

.filter-group label {
  font-weight: 500;
}

.filter-group input[type="number"] {
  padding: 8px;
  width: 90px;
  border: 1px solid #ccc;
  border-radius: 5px;
  text-align: center;
  font-size: 13px;
}

.filter-group select {
  padding: 8px 12px;
  border: 1px solid #ccc;
  border-radius: 5px;
  font-size: 14px;
  background-color: #fff;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  cursor: pointer;
}

.eajpg-count {
  font-weight: 500;
  margin-left: auto;
  font-size: 13px;
  color: #777;
}


.eajpg-filter-dropdown {
  display: none;
  position: absolute;
  background: #fff;
  border: 1px solid #ccc;
  padding: 15px;
  z-index: 999;
  min-width: 240px;
  top:50px;
  left:0;
  box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.eajpg-filter-toggle {
  cursor: pointer;
  display: inline-block;
  margin-right: 15px;
  font-weight: bold;
  border: 0px solid #ccc;
  padding: 6px 10px;
  color: rgba(18 18 18 / 75%);
}

.eajpg-filters {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0px;
  margin-top: 40px;
  gap: 20px;
  flex-wrap: wrap;
  font-family: 'Assistant' !important;
}

.eajpg-filters-left {
  display: flex;
  align-items: center;
  gap: 15px;
  flex-wrap: wrap;
}

.eajpg-filters-right select {
  padding: 5px 10px;
}

.eajpg-count {
  font-size: 14px;
  color: #777;
}

.eajpg-filters-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

.orderby-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.orderby-wrapper label {
    font-size: 14px;
    color: #666;
    width:110px;
}

.orderby{ border:none !important; font-size:15px; }

.eajpg-price-wrapper {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 15px;
}

.eajpg-price-wrapper input[type="number"] {
  flex: 1;
  width: 100px;
  padding: 8px;
  font-size: 14px;
}

.eajpg-price-wrapper .price-label {
  display: flex;
  align-items: center;
  gap: 5px;
}

.eajpg-filter-group {
  position: relative;
  display: inline-block;
  margin-right: 10px;
}

.eajpg-dropdown-toggle {
  background: #fff;
  border: 0px solid #ccc;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: normal;
  color:black;
  font-size:15px;
}

.eajpg-dropdown-toggle:hover{
  background: #fff;
  border: 0px solid #ccc;
  padding: 8px 12px;
  cursor: pointer;
  font-weight: normal;
  color:black;

}

.eajpg-filter-toggle:focus {
  background: none !important;
  box-shadow: none !important;
  outline: none !important;
}

.eajpg-filter-toggle.active {
  background-color: #fff !important;
  color: #000 !important;
  box-shadow: none !important;
  border-color: #ccc !important;
}

.eajpg-filter-toggle:hover {
  background-color: #f8f8f8 !important;
}

.eajpg-filters button{
    background: none !important;
    color:black !important;
}
.eajpg-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  z-index: 99;
  box-shadow: 0 4px 8px rgba(0,0,0,0.1);
  border: 1px solid #ccc;
  padding: 15px;
  display: none;
  min-width: 220px;
}



.eajpg-filter-group.open .eajpg-dropdown {
  display: block;
  padding: 25px;
    width: 300px;
}

.filter-header a{ float:right; color: black !important;}

.eajpg-price-wrapper {
  display: flex;
  gap: 10px;
  margin-top: 10px;
}

.price-label {
  display: flex;
  align-items: center;
  gap: 5px;
}

.eajpg-dropdown-toggle svg.chevron {
  margin-left: 6px;
  transition: transform 0.2s ease;
  vertical-align: middle;
}

.eajpg-filter-group.open .eajpg-dropdown-toggle svg.chevron {
  transform: rotate(180deg);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}


.related-random-products {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding: 10px 0;
    width: 100%;
}

.related-product-item {
    flex: 0 0 100%;
    width: 200px; /* puedes ajustar este valor */
    background: #fff;
    border: 1px solid #eee;
    padding: 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    max-width:100%;
}

/* Tablet ≥ 576px */
@media (min-width: 576px) {
  .related-product-item {
    flex: 0 0 50%;
    max-width: 50%;
  }
}

/* Tablet grande ≥ 768px */
@media (min-width: 768px) {
  .related-product-item {
    flex: 0 0 33.33%;
    max-width: 33.33%;
  }
}

/* Escritorio ≥ 1024px */
@media (min-width: 1024px) {
  .related-product-item {
    flex: 0 0 25%;
    max-width: 25%;
  }
  
}

.related-product-item a {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    margin-bottom: 10px;
}

.related-product-item a img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.related-product-item h4 {
    font-size: 14px;
    margin: 0 0 8px;
    min-height: 40px; /* Alinea los títulos */
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.related-product-item .price {
    font-weight: bold;
    margin-bottom: 8px;
}

.related-product-item .button {
    margin-top: auto;
}

.related-product-item h4 {
    font-size: 14px;
    margin: 0 0 8px;
    min-height: 40px;
    max-height: 2.8em; /* Aprox. 2 líneas */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.related-carousel-wrapper {
    width: 100%;
    max-width: 100%;
    position: relative;
    overflow: hidden;
}

.related-carousel-wrapper .add_to_cart_button{
    width:100%;
    height:45px;
    color:#fff !important;
    text-decoration: none;
    font-weight: normal;
    background-color: black !important;
}

.related-carousel-wrapper .product_type_simple{
    width:100%;
    height:45px;
    color:#fff !important;
    text-decoration: none;
    font-weight: normal;
    background-color: black !important;
}

.related-carousel-wrapper .add_to_cart_button a{
    
    color:#fff !important;
    text-decoration: none;
    font-weight: normal;
    
}


.related-carousel-wrapper .product_type_simple a{
    color:#fff !important;
    text-decoration: none;
    font-weight: normal;
}


.related-carousel-scroll {
  display: flex;
  overflow-x: auto;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  -ms-overflow-style: none;
  width: 100%;
  box-sizing: border-box;
  padding: 0 50px; /* deja espacio para flechas */
}


.related-product-item {
  flex: 0 0 auto;
  scroll-snap-align: start;
}


.related-carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  background: #000;
  color: #fff;
  border: none;
  padding: 12px 16px;
  cursor: pointer;
  font-size: 20px;
  border-radius: 4px;
  opacity: 0.7;
}

.related-carousel-arrow.left {
  left: 10px;
}

.related-carousel-arrow.right {
  right: 10px;
}










.eajpg-search-container {
  position: relative;
  z-index: 1000;
}

.eajpg-search-toggle {
  background: none !important;
  border: none;
  font-size: 20px;
  color: #BFBFBF !important;
  cursor: pointer;
      width: 54px !important;
    padding-top: 18px;
}

@keyframes slideDownFade {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.eajpg-search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 125px;
  background-color: #111;
  z-index: 9999;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 2rem;
  box-sizing: border-box;
  opacity: 0;
  transform: translateY(-20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.eajpg-search-overlay.open {
  display: flex;
  opacity: 1;
  transform: translateY(0);
  animation: slideDownFade 0.5s ease forwards;
}


.eajpg-search-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 800px;
  position: relative;
}

.eajpg-search-input {
  width:70% !important;
  flex: 1;
  height: 48px;
  padding: 0 48px 0 20px; /* deja espacio para la X */
  font-size: 16px;
  border-radius: 6px;
  border: solid 1px #fff !important;
  outline: none;
  background-color: #111 !important;
  color: #fff !important;
  
}

.eajpg-search-close {
  position: absolute;
  right: 12px;
  font-size: 20px;
  color: #fff !important;
  background: none !important;
  border: none;
  cursor: pointer;
}


/* Resultados */
.eajpg-search-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 800px;
  margin: 0 auto;
  gap: 10px;
  position: relative;
}

.custom-search-results {
  background: #111;
  color: white;
  width: 100%;
  max-width: 600px;
  padding: 1rem;
  border-radius: 4px;
  font-family: 'Inter', sans-serif;
  box-shadow: 0 5px 20px rgba(0,0,0,0.3);
  position: absolute;
  top: 65px; /* justo debajo del input */
  left: 50%;
  transform: translateX(-50%);
  z-index: 100000 !important;
}

.custom-search-results .search-label {
  font-size: 0.75rem;
  color: #aaa;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 10px;
}

.search-product-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.search-product-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  color: white;
  transition: background 0.2s;
}

.search-view-all{ display:none !important;}

.search-product-item:hover {
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 4px;
  color:#fff !important;
}

.search-product-item img {
  width: 48px;
  height: 48px;
  object-fit: contain;
}

.search-product-info {
  font-size: 0.85rem;
  line-height: 1.2;
}

.search-see-all {
  display: block;
  margin-top: 1rem;
  text-align: right;
  color: #ccc;
  font-size: 0.85rem;
  text-decoration: none;
}

.search-see-all:hover {
  color: white;
}
