* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --color-primary: #2c3e50;
    --color-secondary: #e74c3c;
    --color-accent: #3498db;
    --color-light: #ecf0f1;
    --color-dark: #2c3e50;
    --color-success: #27ae60;
    --color-warning: #f39c12;
    --color-danger: #c0392b;
    --shadow: 0 3px 10px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

body {
    font-family: 'Poppins', Arial, sans-serif;
    background: #f5f5f5;
    color: #333;
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    width: 90%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
}

header {
    background: var(--color-primary);
    color: white;
    padding: 15px 0;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

a {
    text-decoration: none;
}

.header-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo h1 {
    font-size: 1.8rem;
    margin: 0;
    color: white;
}

.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
}

nav ul {
    display: flex;
    list-style: none;
    align-items: center;
}

nav li {
    margin: 0 10px;
    position: relative;
}

nav > ul > li > a {
    color: white;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 4px;
    transition: var(--transition);
    display: flex;
    align-items: center;
}

nav > ul > li > a:hover {
    background: #34495e;
}

.login-btn a {
    background: var(--color-accent);
    padding: 8px 15px;
    border-radius: 20px;
}

.login-btn a:hover {
    background: #2980b9;
}

.producto-info {
    flex-grow: 1;
}
.producto-info h3 {
    margin: 0 0 5px 0;
    font-size: 1.1rem;
}

.producto-info .precio-unitario {
    color: #666;
    font-size: 0.9rem;
}

.contador-cantidad {
    display: flex;
    align-items: center;
    margin: 10px 0;
}
.contador-cantidad button {
    background: #f5f5f5;
    border: 1px solid #ddd;
    width: 30px;
    height: 30px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: bold;
}

.contador-cantidad button:hover {
    background: #e9e9e9;
}
.contador-cantidad input {
    width: 40px;
    height: 30px;
    text-align: center;
    margin: 0 5px;
    border: 1px solid #ddd;
    border-radius: 4px;
}

.producto-total {
    font-weight: bold;
    margin: 10px 0;
    color: var(--color-secondary);
}
.eliminar-producto {
    background: none;
    border: none;
    color: #999;
    cursor: pointer;
    font-size: 1.2rem;
    padding: 5px;
}

.eliminar-producto:hover {
    color: var(--color-danger);
}
.carrito-resumen {
    background: white;
    border-radius: 8px;
    box-shadow: var(--shadow);
    padding: 20px;
}

.resumen-total h3 {
    margin-top: 0;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}
.resumen-linea {
    display: flex;
    justify-content: space-between;
    margin: 10px 0;
}

.resumen-linea.total {
    font-weight: bold;
    font-size: 1.2rem;
    border-top: 1px solid #eee;
    padding-top: 10px;
    color: var(--color-secondary);
}
.carrito-acciones {
    display: flex;
    justify-content: space-between;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.carrito-acciones .btn {
    display: flex;
    align-items: center;
    gap: 8px;
}
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-contenido {
    background: white;
    padding: 25px;
    border-radius: 8px;
    box-shadow: var(--shadow);
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.modal-acciones {
    display: flex;
    justify-content: center;
    gap: 15px;
    margin-top: 20px;
}

#notificacion {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--color-success);
    color: white;
    padding: 15px 20px;
    border-radius: 5px;
    box-shadow: var(--shadow);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1000;
}

#notificacion.mostrar {
    transform: translateX(0);
}

.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    width: 200px;
    border-radius: 5px;
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    z-index: 1000;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    margin: 0;
}

.dropdown-menu a {
    color: var(--color-dark);
    padding: 12px 15px;
    display: block;
    border-bottom: 1px solid #eee;
    transition: var(--transition);
}

.dropdown-menu a:hover {
    background: #f5f5f5;
    color: var(--color-accent);
}

.dropdown-menu li:last-child a {
    border-bottom: none;
}

/* Hero section*/
.hero {
    background-image: linear-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.5)), url("../imagenes/imagenfondo3.JPG");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    height: 60vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    color: white;
    text-align: center;
    padding: 20px;
}

.hero .container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.hero h2 {
    font-size: 2.5rem;
    margin-bottom: 15px;
    text-shadow: 0 0 8px rgba(0, 0, 0, 0.8);
        text-align: center;
}

.hero p {
    font-size: 1.2rem;
    margin-bottom: 25px;
    text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
    max-width: 600px;
    text-align: center;
}

.btn {
    display: inline-block;
    background: var(--color-secondary);
    color: white;
    padding: 12px 25px;
    text-decoration: none;
    border-radius: 5px;
    font-weight: bold;
    transition: var(--transition);
    border: none;
    cursor: pointer;
    text-align: center;
}

.btn:hover {
    background: var(--color-danger);
    transform: translateY(-2px);
}

.btn-agregar {
    background: var(--color-success);
    margin-top: 10px;
}

.btn-agregar:hover {
    background: #219652;
}

.btn-eliminar {
    background: var(--color-danger);
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 3px;
    cursor: pointer;
}

.btn-eliminar:hover {
    background: #a33226;
}

/* Productos destacado*/
.destacados {
    padding: 40px 0;
    background: var(--color-light);
}

.destacados h2 {
    text-align: center;
    margin-bottom: 30px;
    color: var(--color-dark);
    font-size: 2rem;
    position: relative;
    padding-bottom: 15px;
}

.destacados h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 80px;
    height: 3px;
    background: var(--color-secondary);
}

.productos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 25px;
}

.producto {
    background: white;
    padding: 20px;
    text-align: center;
    border-radius: 8px;
    box-shadow: var(--shadow);
    transition: var(--transition);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.producto:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.15);
}

.producto img {
    max-width: 100%;
    height: 180px;
    object-fit: contain;
    margin-bottom: 15px;
    border-radius: 5px;
}

.producto h3 {
    margin-bottom: 10px;
    color: var(--color-dark);
    font-size: 1.2rem;
}

.producto p {
    margin-bottom: 15px;
    color: #666;
}

.precio {
    color: var(--color-secondary);
    font-weight: bold;
    font-size: 1.3rem;
    margin: 10px 0;
}

footer {
    background: var(--color-primary);
    color: white;
    text-align: center;
    padding: 20px 0;
    margin-top: auto;
}
.dropdown {
    position: relative;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: white;
    width: 200px;
    border-radius: 5px;
    box-shadow: var(--shadow);
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: var(--transition);
    z-index: 1000;
    display: block;
}

.dropdown:hover .dropdown-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.dropdown-menu li {
    margin: 0;
    display: block;
    width: 100%;
}

.dropdown-menu a {
    color: var(--color-dark);
    padding: 12px 15px;
    display: block;
    border-bottom: 1px solid #eee;
    transition: var(--transition);
}

.dropdown-menu a:hover {
    background: #f5f5f5;
    color: var(--color-accent);
}

.dropdown-menu li:last-child a {
    border-bottom: none;
}

.user-menu {
    position: relative;
    display: block;
}

.user-menu > div {
    position: relative;
}

.user-menu > div > a {
    color: white;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 4px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 5px;
    background: var(--color-success);
    cursor: pointer;
}

.user-menu > div > a:hover {
    background: #219652;
}

.user-menu #user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    width: 200px;
    border-radius: 5px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    margin-top: 5px;
    z-index: 9999;
    list-style: none;
    padding: 0;
}

.user-menu #user-dropdown li {
    margin: 0;
    list-style: none;
}

.user-menu #user-dropdown a {
    color: var(--color-dark);
    padding: 12px 15px;
    display: block;
    border-bottom: 1px solid #eee;
    transition: var(--transition);
    text-decoration: none;
}

.user-menu #user-dropdown a:hover {
    background: #f5f5f5;
    color: var(--color-accent);
}

.user-menu #user-dropdown li:last-child a {
    border-bottom: none;
    color: var(--color-danger);
}

.user-menu #user-dropdown li:last-child a:hover {
    background: rgba(192, 57, 43, 0.1);
}
@media (max-width: 768px) {
    .user-menu #user-dropdown {
        position: static;
        width: 100%;
        box-shadow: none;
        border-top: 1px solid #eee;
        margin-top: 10px;
    }
    
    .user-menu {
        width: 100%;
    }
    
    .user-menu > div > a {
        width: 100%;
        justify-content: center;
    }
}
.notificacion {
    position: fixed;
    top: 20px;
    right: 20px;
    background: var(--color-success);
    color: white;
    padding: 15px 20px;
    border-radius: 5px;
    box-shadow: var(--shadow);
    transform: translateX(100%);
    transition: transform 0.3s ease;
    z-index: 1000;
}

.notificacion.mostrar {
    transform: translateX(0);
}

.notificacion.error {
    background: var(--color-danger);
}

/* Versión celu*/
@media (max-width: 480px) {
    .container {
        width: 95%;
        padding: 0 10px;
    }
    
    .header-container {
        flex-direction: column;
        text-align: center;
    }
    
    .logo h1 {
        margin-bottom: 10px;
        font-size: 1.5rem;
    }
    
    .menu-toggle {
        display: block;
        position: absolute;
        top: 15px;
        right: 15px;
    }
    
    nav ul {
        flex-direction: column;
        display: none;
        width: 100%;
        margin-top: 15px;
    }
    
    nav ul.active {
        display: flex;
    }
    
    nav li {
        margin: 5px 0;
        width: 100%;
        text-align: left;
    }
    
    .login-btn {
        margin-top: 10px;
    }
    
    .hero {
        height: 50vh;
        padding: 15px;
    }
    
    .hero h2 {
        font-size: 1.8rem;
    }
    
    .hero p {
        font-size: 1rem;
    }
    
    .productos-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    .dropdown-menu {
        position: static;
        width: 100%;
        opacity: 1;
        visibility: visible;
        transform: none;
        box-shadow: none;
        display: none;
        margin-top: 5px;
    }
    
    .dropdown-menu li {
        display: block;
        width: 100%;
    }
}

/* Versión tablets*/
@media (min-width: 481px) and (max-width: 768px) {
    .container {
        width: 90%;
    }
    
    .header-container {
        flex-direction: column;
        text-align: center;
    }
    
    .logo h1 {
        margin-bottom: 15px;
    }
    
    .menu-toggle {
        display: block;
        position: absolute;
        top: 15px;
        right: 15px;
    }
    
    nav ul {
        flex-direction: column;
        display: none;
        width: 100%;
        margin-top: 15px;
    }
    
    nav ul.active {
        display: flex;
    }
    
    nav li {
        margin: 8px 0;
    }
    
    .tabla-carrito {
        display: block;
        overflow-x: auto;
    }
    
    .carrito-acciones {
        flex-direction: column;
    }
    
    .carrito-acciones .btn {
        width: 100%;
        margin-bottom: 10px;
    }
    .dropdown-menu {
        left: 50%;
        transform: translateX(-50%) translateY(10px);
    }
    .dropdown-menu li {
        display: block;
        width: 100%;
    }
    
    .dropdown:hover .dropdown-menu {
        transform: translateX(-50%) translateY(0);
    }
    
    .hero {
        height: 55vh;
    }
    
    .hero h2 {
        font-size: 2rem;
    }
    
    .productos-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

/* Versión escritorio*/
@media (min-width: 769px) {
    .container {
        width: 90%;
        max-width: 1200px;
    }
    
    .header-container {
        flex-direction: row;
        justify-content: space-between;
    }
    
    .menu-toggle {
        display: none;
    }
    
    nav ul {
        display: flex;
        flex-direction: row;
    }
    
    .productos-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    
}

/*Estilo del catalogo*/
#filtros {
display: flex;
justify-content: center;
gap: 1rem;
margin: 20px 0;
flex-wrap: wrap;
}

#filtros label {
font-weight: bold;
}

#filtros select {
padding: 5px;
border-radius: 5px;
border: 1px solid #ccc;
}

.tabla-productos table {
width: 90%;
margin: 0 auto;
border-collapse: collapse;
}

.tabla-productos th, .tabla-productos td {
border: 1px solid #ccc;
padding: 10px;
text-align: center;
}

.tabla-productos th {
background-color: #f4f4f4;
}


/* Imágenes del catálogop*/
.img-producto {
width: 80%;               
max-width: 150px;         
height: auto;             
object-fit: contain;      
border-radius: 8px;
transition: transform 0.3s ease;
}

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

/* responsive del catálogo*/
@media (max-width: 768px) {
.img-producto {
width: 70%;
max-width: 120px;
}

.tabla-productos table {
font-size: 0.9rem;
}
}

@media (max-width: 480px) {
.img-producto {
width: 60%;
max-width: 100px;
}

.tabla-productos table {
width: 100%;
font-size: 0.85rem;
}

#filtros {
flex-direction: column;
align-items: center;
}
}

/* Vista tarjetas para celu*/
@media (max-width: 600px) {
.tabla-productos thead {
display: none;
}

.tabla-productos tr {
display: block;
background: white;
margin: 10px auto;
border-radius: 10px;
box-shadow: var(--shadow);
padding: 15px;
width: 90%;
}

.tabla-productos td {
display: flex;
justify-content: space-between;
align-items: center;
padding: 8px 0;
border: none;
border-bottom: 1px solid #eee;
}

.tabla-productos td:last-child {
border-bottom: none;
}

.tabla-productos td::before {
content: attr(data-label);
font-weight: bold;
color: var(--color-primary);
flex-basis: 40%;
text-align: left;
}

.tabla-productos td:first-child {
justify-content: center;
}

.tabla-productos .img-producto {
width: 60%;
max-width: 100px;
}
}

/*Botón volver*/
.btn-volver {
position: fixed;
top: 18px;
left: 20px; 
z-index: 9999;
display: flex;
align-items: center;
justify-content: center;
background: transparent;
border: none;
}

.btn-volver img {
width: 25px;
height: 25px;
filter: brightness(0) invert(1);
transition: transform 0.3s ease;
}

body.login-page .btn-volver img {
filter: brightness(0);
}
.btn-volver:hover img {
transform: scale(1.1);
}
.logo h1 {
margin-left: 80px; 
}

/* Enlace del carrito */
.carrito-link {
position: relative;
display: inline-flex;
align-items: center;  
gap: 8px;
color: white;
text-decoration: none;
padding: 6px 10px;
}

.carrito-link .icono-carrito,
.carrito-link img.icono-carrito {
width: 22px;
height: 22px;
display: inline-block;
vertical-align: middle;
filter: brightness(0) invert(1);
transition: transform 0.15s ease;
}

.carrito-count {
    position: absolute;
    top: -6px;
    right: -10px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    font-size: 12px;
    line-height: 1;
    border-radius: 50%;
    background: var(--color-secondary);
    color: #fff;
    font-weight: 700;
    box-sizing: border-box;
    text-align: center;
    padding: 0;
}

@media (max-width:480px){
.carrito-count { width: 22px; height: 22px; font-size: 13px; right: -10px; }
.carrito-link .icono-carrito { width: 26px; height: 26px; }
}


.user-menu {
    position: relative;
    display: block;
}

.user-menu > div > a {
    color: white;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 4px;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 5px;
    background: var(--color-success);
    cursor: pointer;
}

.user-menu > div > a:hover {
    background: #219652;
}

.user-menu #user-dropdown {
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    width: 200px;
    border-radius: 5px;
    box-shadow: var(--shadow);
    display: none;
    z-index: 1000;
    margin-top: 5px;
}

.user-menu #user-dropdown li {
    margin: 0;
    list-style: none;
}

.user-menu #user-dropdown a {
    color: var(--color-dark);
    padding: 12px 15px;
    display: block;
    border-bottom: 1px solid #eee;
    transition: var(--transition);
    text-decoration: none;
}

.user-menu #user-dropdown a:hover {
    background: #f5f5f5;
    color: var(--color-accent);
}

.user-menu #user-dropdown li:last-child a {
    border-bottom: none;
    color: var(--color-danger);
}

.user-menu #user-dropdown li:last-child a:hover {
    background: rgba(192, 57, 43, 0.1);
}

@media (max-width: 768px) {
    .user-menu #user-dropdown {
        position: static;
        width: 100%;
        box-shadow: none;
        border-top: 1px solid #eee;
        margin-top: 10px;
    }
    
    .user-menu {
        width: 100%;
    }
    
    .user-menu > div > a {
        width: 100%;
        justify-content: center;
    }

/*arreglo del login*/
.user-menu #user-dropdown {
    display: none; 
}
.user-menu #user-dropdown.mostrar {
    display: block; 
}
/* icono de salir */
.user-simple {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--color-success);
    padding: 8px 12px;
    border-radius: 20px;
}

.user-simple .user-name {
    color: white;
    font-weight: 500;
}

.user-simple a {
    color: white;
    font-size: 1.3rem;
    transition: transform 0.2s ease;
}

.user-simple a:hover {
    transform: scale(1.1);
    color: var(--color-danger);
}
/*iconos sector compra*/
.icono-titulo {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    margin-right: 8px;
    filter: brightness(0.3);
    }
.icono-comprar {
    width: 20px;
    height: 20px;
    vertical-align: middle;
    margin-right: 8px;
    filter: brightness(0) invert(1); 
    }



}