body {
    font-family: 'Arial', sans-serif;
    background-color: #f5f5f5;
    color: #333;
    display: flex;
    flex-direction: column;
    min-height: 100vh; /* Asegura que el body ocupe toda la altura de la pantalla */
}

/* Contenedor principal */
.container {
    display: flex;
    flex: 1; /* Hace que ocupe el espacio restante */
    width: 100%;
    align-items: flex-start;
    flex-wrap: wrap; /* Permite que el contenido se ajuste al tamaño de la pantalla */
}

/* Sidebar */
.sidebar {
    width: 10% auto; /* El sidebar ocupa el 20% del ancho en pantallas grandes */
    background-color: #264f77;
    border-right: 2px solid #4A90E2;
    border-top: 2px solid #4A90E2;
    border-bottom: 2px solid #4A90E2;
    padding: 10px 10px 10px 5px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: auto;
    margin: 20px 0px 20px 0px;
    border-radius: 10px;
    min-width: 200px; /* Asegura que el sidebar no se haga demasiado pequeño */
}

.sidebar-btn {
    background-color: #52afec;
    color: rgb(255, 255, 255);
    border: 2px solid #3A68A2;
    padding: 10px;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 17px;
    cursor: pointer;
    border-radius: 8px;
    transition: background 0.3s ease, transform 0.3s ease;
    text-decoration: none;
    width: auto;
}

.sidebar-btn:hover {
    background: #6387c7;
    transform: translateX(5px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
}


/* Botón activo con color diferente */
.sidebar-btn.active {
    background: #295a8a;
    border: 1px solid #F0F8FF;
    transform: none;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.3);
    transform: translateX(5px); /* Desplazamiento a la izquierda */
}


/* Contenedor de productos */
.products-container {
    flex: 1; /* Expande el contenedor para llenar el espacio restante */
    padding: 10px;
    display: grid;
    grid-template-columns: repeat(auto-fill, 280px); /* Cada tarjeta tiene un ancho fijo de 300px */
    grid-gap: 15px; /* Espacio entre las tarjetas */
    margin: 0 auto;
    width: calc(100% - 200px); /* Ajusta el ancho para que no se solape con el sidebar */
    justify-content: center; /* Alinea las tarjetas al centro */
}



/* Tarjetas de productos */
.product-card {
    text-decoration: none;
    color: inherit;
    border: 1px solid #ddd;
    border-radius: 10px;
    background-color: #ffffff;
    display: flex;
    flex-direction: column;
    text-align: center;
    width: auto;
    height: auto;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    margin: 10px; /* Espaciado entre tarjetas */
    overflow: hidden; /* Evita que los elementos sobresalgan */
    justify-content: space-between; /* Distribuye el contenido dentro de la tarjeta */
}


.product-card:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}


.product-card img {
    width: 100%;
    height: 200px;
    object-fit: contain;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
}


.product-card h3 {
    margin: 15px 0px 5px 0px;
    font-size: 20px;
    color: #2c3e50;
}


.product-card p.Descripcion {
    margin: 3px 5px;
    font-size: 14px;
    color: #7f8c8d; 
    font-weight: 500;
    line-height: 1.4;
}

.product-card p.Precio {
    font-size: 20px;
    color: #e74c3c; 
    font-weight: bold;
    line-height: 1.6;
    margin-top: 0px;
    margin-bottom: 3px;
}

/* Botón "Ver Más" */
.product-card button {
    display: block;
    width: 100%;
    text-align: center;
    background-color: #007BFF;
    color: white;
    font-size: 16px;
    font-weight: bold;
    padding: 10px 0;
    border: none;
    border-radius: 0 0 10px 10px;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.product-card button:hover {
    background-color: #0056b3;
}

/* Responsivo para pantallas pequeñas */
@media (max-width: 652px) {
    .container {
        flex-direction: column;
        align-items: center; /* Alinear el contenido en la columna */
    }

    .sidebar {
        display: none; /* Oculta el sidebar */
    }

    /* Mostrar un select en lugar del sidebar */
    .select-container {
        display: block;
        width: 80%;
        max-width: 400px;
        margin: 20px auto;
        padding: 10px;
        background-color: #264f77;
        border-radius: 10px;
        border: 3px solid #3e79b4;
        color: rgb(0, 0, 0);
        font-size: 16px;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    }

    /* Estilo para el select dentro del select-container */
    .select-container select {
        width: 100%;
        padding: 10px;
        background-color: #3e79b4;
        color: white;
        border: none;
        border-radius: 5px;
        font-size: 16px;
    }

    /* Estilos para las opciones dentro del select */
    .select-container select option {
        background-color: #316294;
        color: white;
        font-size: 16px;
        padding: 10px;
        border-bottom: 1px solid black; /* Línea negra entre las opciones */
    }

    /* Efecto hover sobre las opciones */
    .select-container select option:hover {
        background-color: #52afec;
    }

    .products-container {
        grid-template-columns: repeat(auto-fill, 300px); /* Ajustar a una sola columna */
        grid-gap: 10px; /* Reduce el espacio entre las tarjetas */
        padding: 10px;
        margin: 0 auto;
        justify-content: center; /* Centra las tarjetas */
    }

    .product-card {
        height: auto;
        padding: 10px; /* Agregar espacio dentro de las tarjetas */
        transition: transform 0.3s ease, box-shadow 0.3s ease;
    }

    .product-card img {
        height: 200px; 
    }

    .product-card button {
        width: 100%; /* Los botones ocupan todo el ancho */
        margin-bottom: 0; /* Eliminar el margen inferior innecesario */
    }
}
.popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(10, 10, 10, 0.6);
    backdrop-filter: blur(6px);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1002;
    animation: fadeIn 0.4s ease-in-out;
}

.popup-content {
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(15px);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 20px;
    padding: 25px;
    width: 55%;
    height: auto;
    max-height: 85%;
    box-shadow: 0 8px 32px rgba(0,0,0,0.25);
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    animation: scaleIn 0.4s ease-in-out;
}

.close-btn {
    position: absolute;
    top: 15px; 
    right: 20px;
    font-size: 26px;
    color: #fff;
    cursor: pointer;
    transition: transform 0.2s;
}
.close-btn:hover {
    transform: rotate(90deg);
    color: #ff6b6b;
}

.muestra-consulta {
    width: 80%;
    margin-bottom: 10px;
    padding: 12px;
    border-radius: 15px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.2);
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
}
.muestra-consulta img {
    max-width: 60%;      /* más chica */
    max-height: 180px;   /* antes 250px */
    object-fit: contain;
    border-radius: 10px;
}

.muestra-consulta h3 {
    margin-bottom: 8px;
    font-size: 18px;
    font-weight: 600;
    color: #fff;
    text-align: center;
    text-shadow: 1px 1px 4px rgba(0,0,0,0.5);
}

#consultaForm {
    width: 80%;
    display: flex;
    flex-direction: column;
    gap: 15px;
    margin-top: 5px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    color: #eee;
    font-weight: 600;
    font-size: 14px;
}
.form-group textarea {
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 12px;
    padding: 12px;
    font-size: 15px;
    max-height: 160px;
    background: rgba(255,255,255,0.12);
    color: #fff;
    outline: none;
    resize: vertical;
    transition: all 0.3s ease-in-out;
    box-shadow: inset 2px 2px 6px rgba(0,0,0,0.3);
}

.form-group textarea:focus {
    border-color: #8685ef;
    box-shadow: 0 0 12px rgba(134,133,239,0.6), inset 2px 2px 6px rgba(0,0,0,0.4);
}

/* Animaciones */
@keyframes fadeIn {
    from {opacity: 0;}
    to {opacity: 1;}
}
@keyframes scaleIn {
    from {transform: scale(0.8);}
    to {transform: scale(1);}
}
/* Título elegante */
.popup-title {
    font-size: 25px;
    font-weight: 700;
    color: #fff;
    margin-bottom: 19px;
    text-align: center;
    text-shadow: 0 0 8px rgba(255,255,255,0.4);
    border-bottom: 2px solid rgba(255,255,255,0.25);
    padding-bottom: 10px;
    width: 80%;
}

/* Mejor textarea */
.form-group textarea {
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 12px;
    padding: 12px;
    font-size: 15px;
    background: rgba(255,255,255,0.1);
    color: #fff;
    outline: none;
    resize: none;
    transition: all 0.3s ease-in-out;
    box-shadow: inset 2px 2px 6px rgba(0,0,0,0.3);
}
.form-group textarea:focus {
    border-color: #8685ef;
    box-shadow: 0 0 12px rgba(134,133,239,0.6), inset 2px 2px 6px rgba(0,0,0,0.4);
}
.form-group textarea::placeholder {
    color: rgba(255,255,255,0.6);  /* más claro y suave */
    font-style: italic;            /* opcional, le da un toque elegante */
}
.error-message{
    color: rgba(255,255,255,0.6);  /* más claro y suave */
}

/* Botón gradiente elegante */
.btn-gradient {
    background: linear-gradient(135deg, #8685ef, #6ac1ff);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-weight: 600;
    font-size: 16px;
    padding: 12px 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}
.btn-gradient:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(134,133,239,0.6);
}
.btn-gradient:active {
    transform: scale(0.97);
    box-shadow: 0 2px 10px rgba(0,0,0,0.5);
}
.error-message {
    color: #ff6b6b;
    font-weight: 600;
    text-align: center;
    margin: 15px 0;
}

.botones-no-auth {
    display: flex;
    gap: 15px;
    justify-content: center;
    margin-top: 20px;
}

.btn-cancel {
    background: rgba(255,255,255,0.2);
    border: 1px solid rgba(255,255,255,0.3);
    border-radius: 12px;
    color: #fff;
    font-weight: 600;
    font-size: 15px;
    padding: 10px 20px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.btn-cancel:hover {
    background: rgba(255,255,255,0.3);
    transform: scale(1.05);
}
/*Estilos responsivos de la consulta*/
@media (max-width: 1080px){
    .popup-content{
        width: 75%;
    }
}
/* Para pantallas medianas, ajustar a dos columnas */
@media (max-width: 1195px) and (min-width: 900px) {
    .products-container {
        grid-template-columns: repeat(2, 300px); /* Dos columnas de 300px */
        justify-content: start; /* Alinea las tarjetas a la izquierda */
    }

    .product-card {
        max-width: 100%; /* Las tarjetas ocupan el ancho máximo de la cuadrícula */
    }
}

/* Para pantallas medianas, ajustar a una columna */
@media (max-width: 900px) and (min-width: 753px) {
    .products-container {
        grid-template-columns: repeat(1, 400px); /* Una columna de 300px */
        justify-content: center; /* Alinea las tarjetas a la izquierda */
    }

    .product-card {
        max-width: 100%; /* Las tarjetas ocupan el ancho máximo de la cuadrícula */
    }
}

@media (max-width:1300px) and (min-width:900px){
    .products-container{
        grid-template-columns: repeat(auto-fill, 200px); 
        justify-content: center;
    }
}

/* Para pantallas grandes, ocultamos el select */
@media (min-width: 652px) {
    .select-container {
        display: none; /* Oculta el select en pantallas grandes */
    }

    .container {
        flex-direction: row; /* Asegura que el contenedor principal se muestre en fila */
    }

    .products-container {
        grid-gap: 10px; /* Reduce el espacio entre las tarjetas */
    }
}

/* Ajuste para cuando hay solo una tarjeta de producto */
.products-container.single-product {
    justify-content: start; /* Alinea la tarjeta de producto a la izquierda */
}