.pfg-container {
    margin: 40px auto;
    max-width: 1200px;
    padding: 0 20px;
    font-family: 'Segoe UI', sans-serif;
}

.pfg-header {
    text-align: center;
    margin-bottom: 40px;
}

.pfg-title {
    font-size: 28px;
    font-weight: 700;
    color: #0073aa;
    margin-bottom: 10px;
}

.pfg-description {
    font-size: 16px;
    color: #555;
    max-width: 700px;
    margin: 0 auto;
}

.pfg-toolbar {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.pfg-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.pfg-filter {
    background: #eee;
    padding: 10px 20px;
    border-radius: 30px;
    border: 1px solid #ccc;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
}

.pfg-filter.active,
.pfg-filter:hover {
    background: #0073aa;
    color: #fff;
    border-color: #0073aa;
}

#pfg-category-filter,
#pfg-orderby,
#pfg-search {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 8px;
    min-width: 200px;
    font-size: 14px;
}

.products {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 25px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.products li.product {
    background: #fff;
    border: 1px solid #e5e5e5;
    padding: 15px;
    text-align: center;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
}

.products li.product .woocommerce-LoopProduct-link {
    display: block;
    height: 220px;
    overflow: hidden;
    margin-bottom: 15px;
}

.products li.product img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.products li.product:hover img {
    transform: scale(1.05);
}

.products li.product h2,
.products li.product .woocommerce-loop-product__title {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin: 10px 0 5px;
}

.products li.product .price {
    color: #0073aa;
    font-weight: bold;
    font-size: 15px;
    margin-bottom: 10px;
}

.products li.product a.button {
    background: #0073aa;
    color: #fff;
    border-radius: 20px;
    padding: 8px 18px;
    font-size: 14px;
    border: none;
    margin-top: auto;
    transition: background 0.3s;
}

.products li.product a.button:hover {
    background: #005d8f;
}

.pfg-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    background: #ff5a5f;
    color: #fff;
    font-size: 12px;
    font-weight: bold;
    border-radius: 4px;
    z-index: 5;
}

.pfg-badge.new {
    background: #2ecc71;
}

.stock {
    display: block;
    margin-top: 10px;
    font-weight: bold;
    font-size: 13px;
}

.stock.in-stock {
    color: #2ecc71;
}

.stock.out-of-stock {
    color: #e74c3c;
}

.pfg-loader {
    text-align: center;
    font-style: italic;
    margin: 20px 0;
}

#pfg-load-more {
    display: block;
    margin: 30px auto;
    padding: 12px 25px;
    background: #0073aa;
    color: white;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
}

#pfg-load-more:hover {
    background: #005d8f;
}

@media (max-width: 768px) {
    .pfg-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    #pfg-category-filter,
    #pfg-orderby,
    #pfg-search {
        width: 100%;
    }

    .pfg-filters {
        justify-content: center;
    }
}



/* === Fix visual 4:3 para tarjetas de producto === */
.products {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}

.products li.product {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(0,0,0,.06);
  overflow: hidden;
}

/* Imagen 4:3 sin deformación */
.products li.product img {
  width: 100%;
  height: auto !important;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  transition: transform .25s ease;
}

.products li.product:hover img { transform: scale(1.03); }

/* Márgenes internos del contenido */
.products li.product .woocommerce-loop-product__title,
.products li.product .price,
.products li.product .star-rating,
.products li.product .stock,
.products li.product .button {
  margin-left: 16px;
  margin-right: 16px;
}

/* Título a 2 líneas máximo para uniformidad */
.products li.product .woocommerce-loop-product__title {
  font-size: 16px;
  line-height: 1.35;
  margin-top: 12px;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.7em;
}

/* Botón al fondo de la tarjeta */
.products li.product .button {
  margin-top: auto;
  margin-bottom: 16px;
  border-radius: 10px;
  padding: 10px 16px;
}

.products li.product .stock { font-weight: 600; margin-top: 8px; }

@media (max-width: 480px) {
  .products { grid-template-columns: 1fr 1fr; gap: 14px; }
}
