:root {
    /* Variables para los colores */
    --black: #000000;
    --white: #ffffff;
    --dark-purple: #3c122c;
    --medium-purple: #762ba3;
    --light-purple: #ae40f0;
    --yellow: #ffc800;
    --pink: #fc5185;
    --light-pink: #ffeffe;
    --green: #00b090;
    --background-gray: #eee;
}

/* Reset y estilos base */
* {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Nunito Sans', sans-serif;
    background-color: var(--background-gray);
}

a {
    text-decoration: none;
}

.container {
    max-width: 1440px;
    padding: 0 20px;
    margin: 0 auto;
}

/* Estilos para secciones comunes */
.introduccion {
    width: 100%;
    padding: 20px;
    text-align: center;
}

.introduccion p {
    font-size: 1.5rem;
}

/* Estilos para el encabezado de página */
.page-header {
    text-align: center;
    padding: 40px 20px;
    margin-bottom: 30px;
    background: linear-gradient(135deg, var(--medium-purple) 0%, var(--dark-purple) 100%);
    color: var(--white);
    position: relative;
    overflow: hidden;
}

.page-header::after {
    content: "";
    position: absolute;
    bottom: -50px;
    left: 0;
    right: 0;
    height: 50px;
    background: var(--background-gray);
    clip-path: ellipse(75% 100% at center top);
}

.page-header h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    position: relative;
    z-index: 1;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.subtitle {
    font-size: 1.3rem;
    font-weight: 500;
    opacity: 0.9;
    position: relative;
    z-index: 1;
}

.page-header::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-image: radial-gradient(circle, rgba(255,255,255,0.1) 1px, transparent 1px);
    background-size: 15px 15px;
    opacity: 0.4;
}

/* Estilos para productos - versión antigua (compatibilidad) */
.productos, .p_acero {
    display: flex;
    overflow: auto;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    padding: 20px 0;
}

.productos div, .p_acero div {
    margin: 10px;
    text-align: center;
}

.p_acero img {
    width: 170px;
    height: 170px;
}

/* Estilos modernos para tarjetas de productos */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 30px;
    padding: 20px;
    max-width: 1440px;
    margin: 0 auto;
}

.product-card {
    background-color: var(--white);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 12px rgba(0, 0, 0, 0.15);
}

.product-image {
    width: 100%;
    height: 200px;
    object-fit: contain;
    background-color: var(--light-pink);
    padding: 10px;
}

.product-info {
    padding: 15px;
    text-align: center;
}

.product-title {
    color: var(--dark-purple);
    font-weight: 700;
    margin-bottom: 10px;
    font-size: 1.2rem;
}

.product-description, .product-code {
    color: var(--black);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.product-code {
    color: var(--green);
    font-weight: 600;
}

/* Estilos responsivos */
@media (max-width: 768px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 20px;
    }
    
    .page-header {
        padding: 30px 15px;
    }
    
    .page-header h2 {
        font-size: 2rem;
    }
    
    .subtitle {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: 1fr;
    }
    
    .introduccion p {
        font-size: 1rem;
    }
    
    .productos, .productos2, .productos3 {
        flex-direction: column;
    }
    
    .page-header::after {
        bottom: -30px;
        height: 30px;
    }
}

/* Botón flotante "Volver arriba" */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--medium-purple);
    color: var(--white);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 999;
}

.back-to-top:hover {
    background-color: var(--dark-purple);
    transform: translateY(-3px);
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top i {
    font-size: 24px;
}