/* Contenedor principal 100% ancho */
.festababy-amazon-container {
    width: 100%;
    margin: 24px 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, Cantarell, "Open Sans", "Helvetica Neue", sans-serif;
}

.festababy-title {
    font-size: 1.3rem;
    font-weight: 700;
    margin-bottom: 18px;
    border-bottom: 3px solid #ff9900;
    padding-bottom: 6px;
    display: inline-block;
    color: #232f3e;
}

/* Grid dinámico que se adapta al ancho total del contenedor padre */
.festababy-grid {
    display: grid;
    width: 100%;
    gap: 20px;
    box-sizing: border-box;
}

/* 4 o más productos */
.festababy-grid-count-4,
.festababy-grid-many {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

/* 3 productos: 3 columnas iguales al 33.3% cada una */
.festababy-grid-count-3 {
    grid-template-columns: repeat(3, 1fr);
}

/* 2 productos: 2 columnas iguales al 50% cada una */
.festababy-grid-count-2 {
    grid-template-columns: repeat(2, 1fr);
}

/* 1 producto: 1 columna al 100% */
.festababy-grid-count-1 {
    grid-template-columns: 1fr;
}

/* Tarjeta estándar (2, 3 o 4+ productos) */
.festababy-card {
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    padding: 16px;
    background: #ffffff;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
    box-sizing: border-box;
    width: 100%;
}

.festababy-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.08);
}

.festababy-image {
    text-align: center;
    margin-bottom: 14px;
    height: 180px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

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

.festababy-card:hover .festababy-image img {
    transform: scale(1.04);
}

.festababy-product-title {
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.4;
    margin: 0 0 12px 0;
    color: #007185;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 2.8em;
}

.festababy-product-title a:hover {
    color: #c7511f !important;
}

.festababy-pricing {
    margin-top: auto;
    margin-bottom: 14px;
}

.festababy-price-current {
    font-size: 1.35rem;
    font-weight: 700;
    color: #B12704;
}

.festababy-btn {
    display: block;
    text-align: center;
    background: linear-gradient(to bottom, #f7dfa5, #f0c14b);
    color: #111111;
    text-decoration: none;
    padding: 10px 16px;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 700;
    border: 1px solid #a88734;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.15);
    transition: all 0.2s ease;
}

.festababy-btn:hover {
    background: linear-gradient(to bottom, #f5d78e, #eeb933);
    border-color: #9c7e31;
    color: #111111;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

/* ===================================================
   DISEÑO ESPECIAL TARJETA ÚNICA (1 PRODUCTO HORIZONTAL)
   =================================================== */
.festababy-card-single {
    flex-direction: row;
    align-items: center;
    gap: 24px;
    padding: 24px;
    min-height: 200px;
}

.festababy-card-single .festababy-image {
    flex: 0 0 200px;
    width: 200px;
    height: 180px;
    margin-bottom: 0;
}

.festababy-card-single .festababy-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.festababy-card-single .festababy-product-title {
    font-size: 1.1rem;
    height: auto;
    max-height: 3.2em;
    -webkit-line-clamp: 2;
    margin-bottom: 12px;
}

.festababy-card-single .festababy-pricing {
    margin-top: 0;
    margin-bottom: 16px;
}

.festababy-card-single .festababy-btn {
    display: inline-block;
    align-self: flex-start;
    padding: 11px 28px;
    font-size: 0.95rem;
}
.festababy-card-single .festababy-card-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* ===================================================
   RESPONSIVE DESIGN (DISPOSITIVOS MÓVILES)
   =================================================== */
@media (max-width: 768px) {
    .festababy-grid-count-3,
    .festababy-grid-count-2 {
        grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    }
}

@media (max-width: 600px) {
    .festababy-grid {
        grid-template-columns: 1fr !important;
    }

    .festababy-card-single {
        flex-direction: column;
        align-items: center;
        text-align: center;
        padding: 18px;
    }

    .festababy-card-single .festababy-image {
        width: 100%;
        flex: initial;
        margin-bottom: 15px;
    }

    .festababy-card-single .festababy-btn {
        align-self: center;
        width: 100%;
    }
}