/**
 * Galería Pro - Frontend Styles
 * Estilos para la galería de productos
 */

/* ===== Contenedor Principal ===== */
.gpa-wrapper {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    box-sizing: border-box;
}

.gpa-wrapper *,
.gpa-wrapper *::before,
.gpa-wrapper *::after {
    box-sizing: inherit;
}

/* ===== Grid de Productos ===== */
.gpa-grid {
    display: grid;
    gap: 25px;
    grid-template-columns: repeat(3, 1fr);
}

.gpa-grid[data-columns="2"] { grid-template-columns: repeat(2, 1fr); }
.gpa-grid[data-columns="3"] { grid-template-columns: repeat(3, 1fr); }
.gpa-grid[data-columns="4"] { grid-template-columns: repeat(4, 1fr); }
.gpa-grid[data-columns="5"] { grid-template-columns: repeat(5, 1fr); }

/* ===== Tarjeta de Producto ===== */
.gpa-card {
    background: #ffffff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.gpa-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
}

.gpa-card-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* ===== Imagen del Producto ===== */
.gpa-card-img {
    width: 100%;
    display: block;
    background: #f9f9f9;
    transition: opacity 0.3s ease;
}

.gpa-card-img:hover {
    opacity: 0.95;
}

.gpa-placeholder {
    width: 100%;
    height: 300px;
    background: linear-gradient(135deg, #f5f5f5 25%, #e8e8e8 50%, #f5f5f5 75%);
    background-size: 200% 200%;
    animation: placeholderShimmer 1.5s ease infinite;
}

@keyframes placeholderShimmer {
    0% { background-position: -200% 0; }
    100% { background-position: 200% 0; }
}

/* ===== Cuerpo de la Tarjeta ===== */
.gpa-card-body {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.gpa-card-title {
    font-size: 1.1rem;
    margin: 0 0 10px;
    font-weight: 600;
    line-height: 1.3;
}

.gpa-card-title a {
    text-decoration: none;
    color: inherit;
    transition: color 0.2s ease;
}

.gpa-card-title a:hover {
    color: #2271b1;
}

.gpa-card-desc {
    font-size: 0.95rem;
    color: #666666;
    margin-bottom: 15px;
    line-height: 1.5;
    flex-grow: 1;
}

/* ===== Footer de la Tarjeta ===== */
.gpa-card-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
    margin-top: auto;
    gap: 10px;
}

.gpa-price {
    font-weight: 700;
    font-size: 1.15rem;
    color: #222222;
}

.gpa-btn {
    background: #2271b1;
    color: #ffffff !important;
    text-decoration: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 0.95rem;
    font-weight: 600;
    transition: all 0.25s ease;
    display: inline-block;
    text-align: center;
    white-space: nowrap;
}

.gpa-btn:hover {
    background: #135e96;
    color: #ffffff !important;
    transform: translateY(-2px);
}

.gpa-btn:active {
    transform: translateY(0);
}

/* ===== Mensajes ===== */
.gpa-no-products {
    text-align: center;
    padding: 40px 20px;
    color: #666666;
    font-size: 1.1rem;
    background: #f9f9f9;
    border-radius: 8px;
    grid-column: 1 / -1;
}

/* ===== Responsive ===== */
@media (max-width: 1024px) {
    .gpa-grid[data-columns="5"] { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 768px) {
    .gpa-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px;
    }
    .gpa-card-title { font-size: 1rem; }
    .gpa-card-desc { font-size: 0.9rem; }
    .gpa-card-footer { flex-wrap: wrap; }
    .gpa-btn { flex: 1; }
}

@media (max-width: 480px) {
    .gpa-wrapper { padding: 0 15px; }
    .gpa-grid {
        grid-template-columns: 1fr !important;
        gap: 15px;
    }
    .gpa-card-footer {
        flex-direction: column;
        align-items: stretch;
        gap: 12px;
    }
    .gpa-btn {
        width: 100%;
        padding: 12px;
    }
    .gpa-price {
        text-align: center;
        font-size: 1.2rem;
    }
}

/* ===== Accesibilidad ===== */
.gpa-card:focus-within,
.gpa-btn:focus,
.gpa-card-link:focus {
    outline: 2px solid #2271b1;
    outline-offset: 2px;
}

/* ===== Animaciones suaves (respetar preferencias del usuario) ===== */
@media (prefers-reduced-motion: reduce) {
    .gpa-card,
    .gpa-btn,
    .gpa-card-img {
        transition: none !important;
        animation: none !important;
    }
}

/* ===== Utilidades ===== */
.gpa-hidden { display: none !important; }
.gpa-sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}