:root {
    --dark-bg: #1a1a1a;
    --card-bg: #242424;
    --border-color: #333;
    --text-color: #a0a0a0;
    --white: #ffffff;
    --secondary-color: #e63946;
    --success-color: #4CAF50;
    --accent-color: #666;
}

.header {
    background-color: var(--dark-bg);
    position: fixed;
    width: 100%;
    z-index: 1000;
    transition: none;
}

.tienda-container {
    padding-top: 80px; /* Ajusta según la altura de tu header */
    max-width: 1200px;
    margin: 0 auto;
    padding-left: 1rem;
    padding-right: 1rem;
}

.tienda-container h1 {
    text-align: center;
    color: var(--white);
    margin-bottom: 2rem;
    font-size: 2.5rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    position: relative;
}

.tienda-container h1::after {
    content: '';
    display: block;
    width: 60px;
    height: 3px;
    background: var(--accent-color);
    margin: 1rem auto;
}

.tienda-leyenda {
    background: rgba(230, 57, 70, 0.1);
    border-left: 4px solid var(--secondary-color);
    padding: 1rem 1.5rem;
    margin-bottom: 2rem;
    border-radius: 4px;
    display: flex;
    align-items: center;
    gap: 0.8rem;
    color: var(--text-color);
}

.tienda-leyenda i {
    color: var(--secondary-color);
    font-size: 1.2rem;
}

.categorias {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.categoria-btn {
    padding: 0.8rem 1.5rem;
    border: 2px solid var(--secondary-color);
    background: transparent;
    color: var(--secondary-color);
    border-radius: 25px;
    cursor: pointer;
    transition: var(--transition-smooth);
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.categoria-btn:hover,
.categoria-btn.active {
    background: var(--secondary-color);
    color: var(--white);
}

.productos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    padding: 2rem 0;
}

.producto-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease;
}

.producto-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
}

.producto-imagen {
    width: 100%;
    height: 220px;
    overflow: hidden;
    background: var(--primary-color);
    position: relative;
}

.producto-imagen::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(0deg, rgba(0,0,0,0.2) 0%, transparent 100%);
}

.producto-imagen img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: var(--transition-smooth);
}

.producto-card:hover .producto-imagen img {
    transform: scale(1.05);
}

.producto-info {
    background: var(--card-bg);
    padding: 1rem;
    border-radius: 8px;
    margin-top: 1rem;
}

.producto-info h3 {
    color: var(--white);
    margin-bottom: 0.8rem;
    font-size: 1.2rem;
    letter-spacing: 0.5px;
}

.producto-info p {
    color: var(--text-color);
    margin-bottom: 1rem;
    font-size: 0.9rem;
    opacity: 0.9;
}

.producto-precio {
    color: var(--success-color);
    font-size: 1.2rem;
    font-weight: bold;
    margin: 0.5rem 0;
}

.comprar-btn {
    background: var(--secondary-color);
    color: var(--white);
    border: none;
    padding: 0.8rem 1.5rem;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    transition: background-color 0.3s ease;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}

.comprar-btn:hover {
    background: #ff4d5a;
}

.comprar-btn:disabled {
    background: var(--accent-color);
    cursor: not-allowed;
}

.carrito-flotante {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    z-index: 1000;
}

.carrito-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--secondary-color);
    color: var(--white);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    box-shadow: var(--shadow-md);
    transition: var(--transition-smooth);
}

.carrito-btn:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-lg);
    background: #ff4d5a;
}

.carrito-contador {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--secondary-color);
    color: var(--white);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    font-weight: bold;
    border: 2px solid var(--primary-color);
}

/* Estilos específicos para catálogos NAGS */
[data-categoria="NAGS"] .producto-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
}

[data-categoria="NAGS"] .producto-imagen {
    background: var(--card-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
}

[data-categoria="NAGS"] .producto-imagen img {
    max-height: 180px;
    width: auto;
    object-fit: contain;
}

[data-categoria="NAGS"] .producto-info h3 {
    font-size: 1.1rem;
    color: var(--white);
    margin-bottom: 0.5rem;
}

[data-categoria="NAGS"] .producto-info p {
    color: var(--text-color);
    font-size: 0.9rem;
    margin-bottom: 1rem;
}

[data-categoria="NAGS"] .comprar-btn {
    background: var(--secondary-color);
    box-shadow: var(--shadow-md);
}

[data-categoria="NAGS"] .comprar-btn:hover {
    background: #ff4d5a;
    box-shadow: var(--shadow-lg);
}

/* Media Queries para móvil */
@media (max-width: 768px) {
    .tienda-container {
        margin: 80px auto 1rem;
        padding: 0 0.5rem;
    }
    
    .tienda-container h1 {
        font-size: 1.8rem;
        margin-bottom: 1.5rem;
    }
    
    .categorias {
        gap: 0.5rem;
        margin-bottom: 1.5rem;
        padding: 0 0.5rem;
    }
    
    .categoria-btn {
        padding: 0.4rem 1rem;
        font-size: 0.9rem;
        border-radius: 20px;
    }
    
    .productos-grid {
        grid-template-columns: 1fr;
    }
    
    .producto-card {
        margin-bottom: 1rem;
    }
    
    .producto-info {
        padding: 1rem;
    }
    
    .producto-info h3 {
        font-size: 1rem;
    }
    
    .producto-info p {
        font-size: 0.8rem;
    }
    
    .producto-precio {
        font-size: 1.1rem;
    }
    
    .comprar-btn {
        padding: 0.6rem 0.4rem;
        font-size: 0.9rem;
    }
    
    .carrito-flotante {
        bottom: 1.5rem;
        right: 1.5rem;
    }
    
    .carrito-btn {
        width: 55px;
        height: 55px;
        font-size: 1.3rem;
    }
}

@media (max-width: 600px) {
    .tienda-container {
        margin-top: 90px;
        padding: 0 0.3rem;
    }
    
    .tienda-container h1 {
        font-size: 1.5rem;
        margin-bottom: 1rem;
    }
    
    .categorias {
        flex-direction: column;
        align-items: center;
        gap: 0.5rem;
    }
    
    .categoria-btn {
        width: 100%;
        max-width: 200px;
        padding: 0.5rem 1rem;
    }
    
    .productos-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.5rem;
        padding: 0.3rem;
    }
    
    .producto-card {
        margin: 0;
        padding: 0.5rem;
    }

    .producto-imagen {
        height: 130px;
        margin-bottom: 0.3rem;
    }
    
    .producto-info {
        padding: 0.3rem;
    }

    .producto-info h3 {
        font-size: 0.75rem;
        margin-bottom: 0.2rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        line-height: 1.2;
    }

    .producto-info p {
        font-size: 0.7rem;
        margin-bottom: 0.2rem;
        line-height: 1.2;
    }

    .producto-precio {
        font-size: 0.9rem;
        margin: 0.2rem 0;
    }

    .comprar-btn {
        padding: 0.4rem;
        font-size: 0.7rem;
        height: auto;
        line-height: 1;
    }
    
    .carrito-flotante {
        bottom: 1rem;
        right: 1rem;
    }
    
    .carrito-btn {
        width: 50px;
        height: 50px;
        font-size: 1.2rem;
    }
}

@media (max-width: 480px) {
    .tienda-container {
        margin: 60px auto 1rem;
        padding: 0 0.2rem;
    }
    
    .tienda-container h1 {
        font-size: 1.3rem;
    }
    
    .productos-grid {
        gap: 0.4rem;
        padding: 0.2rem;
    }
    
    .producto-card {
        padding: 0.4rem;
    }

    .producto-imagen {
        height: 120px;
    }
    
    .producto-info {
        padding: 0.2rem;
    }
    
    .producto-info h3 {
        font-size: 0.7rem;
    }
    
    .producto-info p {
        font-size: 0.65rem;
    }
    
    .producto-precio {
        font-size: 0.85rem;
    }
    
    .comprar-btn {
        padding: 0.3rem;
        font-size: 0.65rem;
    }
    
    .icon-libro {
        font-size: 1em;
    }
}

/* Modal del carrito */
.carrito-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.8);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1100;
}

.carrito-modal.active {
    display: flex;
}

.carrito-modal-content {
    background: var(--card-bg);
    padding: 2rem;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--border-color);
}

.carrito-modal h3 {
    color: var(--white);
    margin-bottom: 1.5rem;
    font-size: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
}

.carrito-lista {
    margin-bottom: 2rem;
}

.carrito-lista li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-color);
}

.carrito-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
    margin-bottom: 1.5rem;
    border-top: 2px solid var(--border-color);
}

.carrito-total span {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--success-color);
}

.carrito-pagar-btn {
    width: 100%;
    padding: 1rem;
    background: var(--secondary-color);
    color: var(--white);
    border: none;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: bold;
    cursor: pointer;
    transition: var(--transition-smooth);
    text-transform: uppercase;
    letter-spacing: 1px;
}

.carrito-pagar-btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    background: #ff4d5a;
}

/* Animaciones */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

.carrito-modal-content {
    animation: fadeIn 0.3s ease-out;
}

/* Mejoras para dispositivos táctiles */
@media (hover: none) and (pointer: coarse) {
    .producto-card:hover {
        transform: none;
    }
    
    .producto-card:active {
        transform: scale(0.98);
    }
    
    .comprar-btn:hover,
    .comprar-btn:focus {
        transform: none;
    }
    
    .comprar-btn:active {
        transform: scale(0.95);
    }
    
    .carrito-btn:hover {
        transform: none;
    }
    
    .carrito-btn:active {
        transform: scale(0.9);
    }
}

/* Optimización para pantallas de alta densidad */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .producto-imagen img {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Mejoras de accesibilidad */
@media (prefers-reduced-motion: reduce) {
    .producto-card,
    .comprar-btn,
    .carrito-btn,
    .carrito-modal-content {
        transition: none;
    }
    
    .producto-card:hover {
        transform: none;
    }
    
    .comprar-btn:hover,
    .comprar-btn:focus {
        transform: none;
    }
}

/* Soporte para modo oscuro del sistema */
@media (prefers-color-scheme: dark) {
    .producto-card {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .producto-info h3 {
        color: #e2e8f0;
    }
    
    .producto-info p {
        color: #a0aec0;
    }
    
    .carrito-modal-content {
        background: #2d3748;
        color: #e2e8f0;
    }
    
    .carrito-lista li {
        border-bottom-color: #4a5568;
    }
    
    .carrito-total {
        background: #4a5568;
        color: #e2e8f0;
    }
}

.icon-libro {
    font-size: 1.2rem;
}

.cerrar-carrito {
    position: absolute;
    top: 15px;
    right: 15px;
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 24px;
    cursor: pointer;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition-smooth);
}

.cerrar-carrito:hover {
    color: var(--secondary-color);
    transform: scale(1.1);
}

/* Trust Section Styles */
.trust-section {
    margin: 1.5rem auto 2.5rem;
    max-width: 1000px;
    background: transparent;
}

.trust-badges {
    display: flex;
    justify-content: center;
    margin-bottom: 2rem;
}

.payment-method {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1rem 2rem;
    background: var(--card-bg);
    border-radius: 50px;
    border: 1px solid var(--border-color);
}

.payment-badge {
    height: 30px;
    object-fit: contain;
}

.secure-payment {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--success-color);
    font-weight: 500;
}

.secure-payment i {
    font-size: 1.1rem;
}

.benefits-container {
    display: flex;
    justify-content: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.benefit-item {
    flex: 1;
    min-width: 280px;
    max-width: 320px;
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.benefit-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.benefit-item i {
    font-size: 1.5rem;
    color: var(--secondary-color);
    background: rgba(230, 57, 70, 0.1);
    padding: 1rem;
    border-radius: 12px;
    min-width: 3.5rem;
    height: 3.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.benefit-text {
    flex: 1;
}

.benefit-text h4 {
    color: var(--white);
    margin-bottom: 0.3rem;
    font-size: 1.1rem;
    font-weight: 600;
}

.benefit-text p {
    color: var(--text-color);
    font-size: 0.9rem;
    line-height: 1.4;
    opacity: 0.9;
}

/* Media Queries for Trust Section */
@media (max-width: 768px) {
    .trust-section {
        margin: 1rem 0 2rem;
        padding: 0 1rem;
    }

    .payment-method {
        padding: 0.8rem 1.5rem;
    }

    .benefits-container {
        gap: 1rem;
    }

    .benefit-item {
        min-width: calc(50% - 1rem);
        padding: 1rem;
    }

    .benefit-item i {
        font-size: 1.2rem;
        padding: 0.8rem;
        min-width: 3rem;
        height: 3rem;
    }
}

@media (max-width: 480px) {
    .payment-method {
        flex-direction: column;
        gap: 0.8rem;
        padding: 1rem;
    }

    .benefit-item {
        min-width: 100%;
    }
}

