/* PsicoBene Partner Display Public/Frontend Styles */

.ppd-product-grid {
    display: grid; /* <-- CAMBIO CLAVE: Usamos Grid */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* <-- CAMBIO CLAVE: Columnas responsivas */
    gap: 20px;
    margin: 20px 0;
    justify-content: center;
}

.ppd-product-card {
    /* Elimina flex: 1 1 300px; y max-width: 380px; aquí si estaban antes. Grid lo gestiona. */
    border: 1px solid #e2e2e2;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    display: flex; /* Mantenemos flexbox para el contenido interno de la tarjeta (vertical) */
    flex-direction: column;
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    background-color: #fff;
}

.ppd-product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

.ppd-product-image {
    width: 100%;
    height: 200px;
    object-fit: contain;
    display: block;
}

.ppd-product-content {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.ppd-product-title {
    margin: 0 0 10px;
    font-size: 1.2rem;
    line-height: 1.4;
    color: #333;
}

.ppd-product-excerpt {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #666;
    margin-bottom: 15px;
    flex-grow: 1;
}

.ppd-product-button {
    display: inline-block;
    background: #005e9e;
    color: #fff;
    padding: 10px 16px;
    border-radius: 4px;
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.2s ease-in-out;
    align-self: flex-start;
    white-space: nowrap;
}

.ppd-product-button:hover,
.ppd-product-button:focus {
    background-color: #004c80;
    color: #fff;
    text-decoration: none;
}

/* El media query para .ppd-product-card ya no es tan crítico con Grid,
   pero puedes mantenerlo si quieres un comportamiento específico en móviles.
   Con auto-fit y minmax, las tarjetas se harán de 100% de ancho automáticamente
   si 280px * 2 + gap es mayor que el ancho de la pantalla.
*/
/* @media (max-width: 768px) {
    .ppd-product-card {
        flex: 1 1 100%;
        max-width: none;
    }
} */

.ppd-product-grid::after {
    content: "";
    display: table;
    clear: both;
}


/* ... (estilos existentes) ... */

.ppd-global-section {
    text-align: center;
    margin-bottom: 30px;
    padding: 20px; /* Añadido para dar espacio */
    background-color: #f9f9f9; /* Fondo suave */
    border-radius: 8px;
    border: 1px solid #eee; /* Borde sutil */
}

.ppd-global-title {
    font-size: 2.2rem;
    color: #333;
    margin-top: 0;
    margin-bottom: 15px;
    line-height: 1.2;
}

.ppd-global-description {
    font-size: 1.1rem;
    color: #666;
    line-height: 1.6;
    max-width: 800px; /* Limitar el ancho para legibilidad */
    margin: 0 auto; /* Centrar la descripción */
}

.ppd-global-description p:last-child {
    margin-bottom: 0; /* Eliminar margen inferior del último párrafo */
}

/* ... (existing styles, including .ppd-product-grid, .ppd-product-card, .ppd-product-image, etc.) ... */

/* Estilos para el excerpt que ahora puede contener HTML */
.ppd-product-excerpt {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #666;
    margin-bottom: 15px;
    flex-grow: 1; /* Permite que el extracto crezca para llenar espacio */
}

/* Ejemplos de estilos para HTML dentro de .ppd-product-excerpt */
.ppd-product-excerpt p {
    margin-top: 0;
    margin-bottom: 0.5em; /* Margen entre párrafos dentro del excerpt */
}
.ppd-product-excerpt strong {
    font-weight: bold;
    color: #333;
}
.ppd-product-excerpt em {
    font-style: italic;
}
.ppd-product-excerpt a {
    color: #005e9e;
    text-decoration: underline;
}
.ppd-product-excerpt a:hover {
    text-decoration: none;
}
/* Si utilizas clases personalizadas en el HTML del excerpt (ej. <p class="mi-clase">), estilizalas aquí: */
.ppd-product-excerpt .tu-clase-personalizada {
    background-color: #e6f7ff;
    padding: 2px 4px;
    border-radius: 3px;
    font-style: normal;
    font-weight: 500;
}
/* PsicoBene Partner Display Public/Frontend Styles */

/* Contenedor principal de la cuadrícula de productos */
.ppd-product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); /* Columnas responsivas */
    gap: 25px; /* Espacio entre las tarjetas */
    margin: 20px 0;
    justify-content: center; /* Centrar el grid si no llena el ancho completo */
    align-items: stretch; /* Asegura que todas las tarjetas tengan la misma altura si el contenido lo permite */
}

/* Estilos para cada tarjeta de producto (similares a WooCommerce) */
.ppd-product-card {
    border: 1px solid #e0e0e0; /* Borde suave */
    border-radius: 8px; /* Esquinas redondeadas */
    overflow: hidden; /* Asegura que la imagen no se desborde */
    box-shadow: 0 4px 8px rgba(0,0,0,0.08); /* Sombra sutil */
    display: flex;
    flex-direction: column; /* Contenido apilado verticalmente */
    background-color: #fff; /* Fondo blanco */
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
}

.ppd-product-card:hover {
    transform: translateY(-5px); /* Efecto de elevación al pasar el ratón */
    box-shadow: 0 8px 16px rgba(0,0,0,0.15); /* Sombra más pronunciada al pasar el ratón */
}

/* Enlace de la imagen (para que toda la imagen sea clicable) */
.ppd-product-image-link {
    display: block; /* Ocupa todo el ancho */
    overflow: hidden; /* Importante para el borde-radius del padre si la imagen es cuadrada */
    position: relative; /* Para posibles overlays o efectos futuros */
}

/* Imagen del producto */
.ppd-product-image {
    width: 100%;
    height: 220px; /* Altura fija para imágenes */
    object-fit: cover; /* Recorta la imagen para cubrir el espacio (como en WooCommerce) */
    background-color: #f9f9f9; /* Color de fondo si la imagen no cubre completamente */
    display: block;
    transition: transform 0.3s ease-in-out;
}

.ppd-product-card:hover .ppd-product-image {
    transform: scale(1.05); /* Ligeramente más grande al pasar el ratón */
}


/* Contenido textual de la tarjeta */
.ppd-product-content {
    padding: 15px 20px; /* Padding interno */
    flex-grow: 1; /* Permite que el contenido crezca para empujar el footer hacia abajo */
    display: flex;
    flex-direction: column;
}

/* Categoría del producto */
.ppd-product-category {
    font-size: 0.8rem;
    color: #6a6a6a;
    text-transform: uppercase;
    font-weight: 600;
    margin: 0 0 8px;
    letter-spacing: 0.5px;
}

/* Título del producto */
.ppd-product-title {
    font-size: 1.3rem;
    line-height: 1.3;
    color: #333;
    margin: 0 0 10px;
    font-weight: 600;
}

.ppd-product-title a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease-in-out;
}

.ppd-product-title a:hover {
    color: #005e9e; /* Color de hover similar al botón */
}

/* Descripción/extracto del producto */
.ppd-product-excerpt {
    font-size: 0.95rem;
    line-height: 1.5;
    color: #555;
    margin-bottom: 15px; /* Espacio antes del footer */
    flex-grow: 1; /* Permite que el extracto ocupe el espacio restante */
}

/* Estilos para HTML dentro del excerpt */
.ppd-product-excerpt p {
    margin-top: 0;
    margin-bottom: 0.5em;
}
.ppd-product-excerpt strong {
    font-weight: bold;
    color: #222;
}
.ppd-product-excerpt em {
    font-style: italic;
}
.ppd-product-excerpt a {
    color: #005e9e;
    text-decoration: underline;
}
.ppd-product-excerpt a:hover {
    text-decoration: none;
}
/* Si utilizas clases personalizadas en el HTML del excerpt, estilizalas aquí: */
.ppd-product-excerpt .mi-clase-personalizada {
    background-color: #ffe0b2;
    padding: 2px 5px;
    border-radius: 4px;
    font-style: normal;
    font-weight: 500;
    color: #a0522d;
}

/* Sección de precio y botón (footer de la tarjeta) */
.ppd-product-footer {
    display: flex;
    justify-content: space-between; /* Alinea precio a la izquierda, botón a la derecha */
    align-items: center; /* Centrar verticalmente */
    padding: 15px 20px;
    border-top: 1px solid #eee;
    background-color: #fcfcfc;
}

/* Contenedor del precio */
.ppd-product-price {
    font-size: 1.25rem; /* Tamaño de fuente del precio */
    font-weight: 700; /* Negrita */
    color: #0073aa; /* Color del precio */
    white-space: nowrap; /* Evitar que el precio se rompa en varias líneas */
}

.ppd-price-label {
    font-size: 0.85em; /* Etiqueta "Price:" más pequeña */
    color: #555;
    font-weight: normal;
    margin-right: 5px;
}
.ppd-price-value {
    color: #005e9e;
}


/* Botón "Learn more" */
.ppd-product-button {
    display: inline-block;
    background: #005e9e; /* Color principal de PsicoBene */
    color: #fff;
    padding: 10px 18px; /* Padding ajustado */
    border-radius: 5px; /* Bordes ligeramente más redondeados */
    text-decoration: none;
    font-weight: 600;
    transition: background-color 0.2s ease-in-out, transform 0.1s ease-in-out;
    white-space: nowrap;
    line-height: 1; /* Asegurar altura consistente */
    border: none; /* Sin borde por defecto */
    cursor: pointer;
}

.ppd-product-button:hover,
.ppd-product-button:focus {
    background-color: #004c80; /* Color más oscuro al pasar el ratón */
    color: #fff;
    text-decoration: none;
    transform: translateY(-1px); /* Pequeño efecto de "presión" */
}


/* Estilos para la sección global de título y descripción */
.ppd-global-section {
    text-align: center;
    margin-bottom: 40px; /* Más espacio debajo de la sección global */
    padding: 30px 20px;
    background-color: #fdfdfd;
    border-radius: 10px;
    border: 1px solid #f0f0f0;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.ppd-global-title {
    font-size: 2.5rem;
    color: #222;
    margin-top: 0;
    margin-bottom: 20px;
    line-height: 1.1;
    font-weight: 700;
}

.ppd-global-description {
    font-size: 1.15rem;
    color: #555;
    line-height: 1.7;
    max-width: 900px;
    margin: 0 auto;
}

.ppd-global-description p:last-child {
    margin-bottom: 0;
}

/* Media Queries para responsividad */
@media (max-width: 768px) {
    .ppd-product-grid {
        grid-template-columns: 1fr; /* Una columna en pantallas pequeñas */
        gap: 20px;
    }
    .ppd-global-title {
        font-size: 2rem;
    }
    .ppd-global-description {
        font-size: 1rem;
    }
    .ppd-product-image {
        height: 180px;
    }
    .ppd-product-title {
        font-size: 1.15rem;
    }
    .ppd-product-excerpt {
        font-size: 0.9rem;
    }
    .ppd-product-price {
        font-size: 1rem;
    }
    .ppd-product-button {
        padding: 8px 15px;
        font-size: 0.9rem;
    }
}

@media (max-width: 480px) {
    .ppd-global-section {
        padding: 20px 15px;
    }
    .ppd-product-content, .ppd-product-footer {
        padding: 12px 15px;
    }
    .ppd-product-price {
        font-size: 1rem;
    }
    .ppd-product-button {
        font-size: 0.85rem;
    }
}