/* --- ESTILOS GENERALES Y RESET --- */
body, html {
    margin: 0;
    padding: 0;
    font-family: Arial, sans-serif;
    background-color: #F6F6F6; /* Color de fondo claro de la imagen */
    color: #4A4A4A;
    height: 100%;
    overflow-x: hidden; 
    overflow-y: auto;
}

/* --- SECCIÓN SUPERIOR (HEADER) FIJA --- */
.header-fijo {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 120px; /* Altura estimada del header completo */
    background-color:#f2ece8; /* color del backgroung BEIGE */
    padding-top: 10px;
    z-index: 1000; /* Siempre encima */
}

.contenedor-superior {
    display: flex;
    justify-content: space-between; /* Usuario a la izq, links a la der */
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 30px;
}

/* Info Usuario */
.usuario-info {
    font-size: 1.1rem;
}
.saludo {
    color: #8A8A8A; /* Gris claro */
    margin-right: 5px;
}
.nombre-completo {
    font-weight: bold;
    color: #4A4A4A; /* Gris oscuro */
}

/* Links Navegación */
.nav-links {
    display: flex;
    gap: 30px;
}
.nav-item {
    text-decoration: none;
    color: #4A4A4A;
    font-size: 1rem;
    transition: color 0.3s;
}
.nav-item:hover {
    color: #2DD78B; /* Color coral al pasar el mouse */
}
.nav-item.salir {
    color: #d9534f; /* Color rojo sutil para salir */
    font-size: 0.9rem;
}

/* Barra de Búsqueda */
.contenedor-busqueda {
    display: flex;
    justify-content: center;
    margin-top: 10px;
    padding: 0 20px;
}
.search-form {
    position: relative;
    width: 100%;
    max-width: 600px;
}
.search-input {
    width: 100%;
    padding: 15px 50px 15px 25px;
    font-size: 1.1rem;
    color: #8A8A8A;
    background-color: #FFFFFF;
    border: none;
    border-radius: 50px; /* Bordes muy redondeados */
    box-shadow: 0 2px 10px rgba(0,0,0,0.05); /* Sombra suave */
    box-sizing: border-box;
}
.search-input::placeholder {
    color: #CCCCCC;
}
.search-input:focus {
    outline: none;
    box-shadow: 0 2px 15px rgba(236, 154, 134, 0.2); /* Sombra coral suave */
}
.search-button {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    font-size: 1.3rem;
    color: #4A4A4A;
}

/* --- SECCIÓN INFERIOR (CONTENIDO) DESPLAZABLE --- */
.contenido-desplazable {
    margin-top: 120px; /* Ajustado al nuevo alto del header */
    height: calc(100vh - 120px); 
    overflow-y: auto;
    padding-bottom: 50px;
}

.contenedor-principal {
    max-width: 1200px;
    margin: 40px auto; /* Reducimos el margen de 120px a 40px porque ya tenemos el margen del padre */
    padding: 20px;
    font-family: 'Segoe UI', sans-serif;
}

/* Título 'Secciones' */
.titulo-secciones-wrapper {
    margin-top: 20px;
    margin-bottom: 40px;
    text-align: center; /* Centrado como en la imagen */
}
.titulo-secciones {
    display: inline-block;
    color: #C85665; /* Color coral de la imagen */
    font-size: 2.5rem; /* Tamaño grande */
    font-weight: normal; /* No es bold */
    background-color: #FFFFFF; /* Fondo blanco */
    padding: 10px 60px;
    margin: 0;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.03);
}

/* Grilla de Categorías */
.grilla-categorias {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); /* Responsivo automático */
    gap: 30px;
}

/* Tarjeta de Categoría */
.categoria-card {
    position: relative;
    background-color: #FFFFFF;
    border-radius: 15px; /* Bordes redondeados */
    overflow: hidden; /* Para que la etiqueta no se salga */
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.categoria-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 25px rgba(0,0,0,0.1);
}

.categoria-img {
    width: 100%;
    height: 250px; /* Altura fija para que todas las tarjetas sean iguales */
    object-fit: cover; /* Ajusta la imagen sin deformarla */
    display: block;
}

/* Etiqueta oscura inferior */
.categoria-label-wrapper {
    position: absolute;
    bottom: 20px;
    left: 20px;
    right: 20px;
    display: flex;
    justify-content: center;
}
.categoria-label {
    background-color: #333333; /* Gris casi negro de la imagen */
    color: #FFFFFF;
    padding: 10px 30px;
    font-size: 1.2rem;
    border-radius: 20px; /* Bordes muy redondeados */
    white-space: nowrap; /* No rompe el texto */
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.sin-datos {
    grid-column: 1 / -1;
    text-align: center;
    padding: 50px;
    color: #8A8A8A;
    font-style: italic;
}

  /* Estilos específicos para la rejilla de resultados mixtos */
        .grid-resultados {
            display: grid;
            grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
            gap: 20px;
            padding: 20px;
        }

    .acciones-card {
        display: flex;
        justify-content: space-between; /* Separa los botones a los extremos */
        align-items: center;
        margin-top: 15px;
        gap: 10px;
        padding-top: 10px;
        border-top: 1px solid #eee; /* Una línea sutil para separar del texto */
    }
        .card-busqueda {
            position: relative; /* Necesario para posicionar el icono de editar */
            background: #FFFFFF;
            border-radius: 12px;
            padding: 20px;
            box-shadow: 0 4px 15px rgba(0,0,0,0.05);
            display: flex;
            flex-direction: column;
            justify-content: space-between;
            border-top: 4px solid #ccc; 
            transition: transform 0.3s;
        }

        .card-busqueda:hover { transform: translateY(-5px); }

        /* Colores temáticos por tipo de hallazgo */
        .tipo-catalogo { border-top-color: #EC9A86; } /* Coral */
        .tipo-receta { border-top-color: #A3C9A8; }   /* Verde suave */
        .tipo-padecimiento { border-top-color: #9DBAD5; } /* Azul suave */

        .badge-tipo {
            font-size: 0.75rem;
            text-transform: uppercase;
            padding: 4px 10px;
            border-radius: 20px;
            background: #f0f0f0;
            color: #666;
            display: inline-block;
            margin-bottom: 10px;
        }

        .titulo-resultado {
            font-size: 1.2rem;
            color: #333;
            margin: 0 0 15px 0;
            font-weight: bold;
        }

        .btn-detalle {
            text-align: center;
            padding: 10px;
            background: #4A4A4A;
            color: #fff;
            text-decoration: none;
            border-radius: 25px;
            font-size: 0.9rem;
            transition: background 0.3s;
        }

        .btn-detalle:hover { background: #EC9A86; }

        .no-results {
            text-align: center;
            padding: 100px 20px;
            color: #8A8A8A;
        }
        
        /* Icono de edición flotante */
      .btn-editar-flotante 
        {
        position: absolute;
        top: 10px;
        right: 10px;
        background: rgba(142, 68, 173, 0.1);
        color: #8e44ad;
        width: 30px;
        height: 30px;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        transition: 0.3s;
        }
    .btn-editar-flotante:hover 
       {
        background: #8e44ad;
        color: white;
        }
       .grupo-botones-horizontal {
        display: flex;
        gap: 10px; /* Aumentamos el espacio entre botones */
        justify-content: center; /* Los centramos en la tarjeta */
        align-items: center;
        margin-top: 15px;
        }
        
        .btn-detalle-chico, .btn-carrito-chico 
        {
            flex: 1;
            padding: 8px 4px;
            font-size: 0.8rem; /* Un poco más pequeña por el ancho reducido */
            border-radius: 6px;
            text-align: center;
            text-decoration: none;
            font-weight: 600;
            display: flex;
            justify-content: center;
            align-items: center;
            gap: 5px;
            transition: 0.3s;
            border: none;
            cursor: pointer;
            white-space: nowrap;
        }

.btn-detalle-chico { background: #555; color: white; }
.btn-carrito-chico { background: #58a36d; color: white; }
.seccion-categorias-moderna {
        max-width: 1200px;
        margin: 40px auto;
        padding: 0 20px;
        text-align: center;
    }

    .titulo-principal-catalogo {
        font-size: 2.2rem;
        font-weight: 800;
        text-transform: uppercase;
        margin-bottom: 50px;
        letter-spacing: -1px;
        color: #111;
    }

    /* Grilla minimalista basada en tu diseño de recetas */
    .grilla-productos-flotantes {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
        gap: 40px 20px;
        justify-items: center;
    }

    .item-producto-link {
        text-decoration: none;
        color: #222;
        display: flex;
        flex-direction: column;
        align-items: center;
        transition: transform 0.3s ease, opacity 0.2s ease;
        width: 100%;
    }

    .item-producto-link:hover {
        transform: translateY(-5px);
        opacity: 0.8;
    }

    .contenedor-img-flotante {
        width: 150px;
        height: 150px;
        display: flex;
        align-items: center;
        justify-content: center;
        margin-bottom: 15px;
    }

    .contenedor-img-flotante img {
        max-width: 95%;
        max-height: 95%;
        object-fit: contain;
        /* Efecto de profundidad para que la foto "flote" */
        filter: drop-shadow(0 10px 15px rgba(0,0,0,0.08));
    }

    .nombre-producto-txt {
        font-size: 0.95rem;
        font-weight: 600;
        line-height: 1.2;
        text-align: center;
        max-width: 150px;
    }
    
/* --- RESPONSIVIDAD BÁSICA PARA MÓVILES --- */
@media (max-width: 768px) {
    .header-fijo {
        position: relative; 
        height: auto;
    }
    .contenido-desplazable {
        -webkit-overflow-scrolling: touch;
        margin-top: 20px; /* Reducimos el margen si el header ya no es fijo */
        height: auto;     /* Dejamos que crezca según el contenido */
        overflow-y: visible; /* Liberamos el scroll */
       
    }
    .contenedor-superior {
        flex-direction: column; /* Apila elementos */
        gap: 15px;
        padding: 0 20px;
    }
    .nav-links {
        gap: 15px;
        flex-wrap: wrap;
        justify-content: center;
    }
    .titulo-secciones {
        font-size: 2.5rem;
        padding: 10px 30px;
    }
    .grilla-categorias {
        grid-template-columns: 1fr; /* Una columna por fila */
    }
    .cart-container {
    position: relative;
    display: flex;
    align-items: center;
}

.cart-link {
    font-size: 1.4rem; /* Un poco más grande para que resalte */
    position: relative;
}

.cart-badge {
    position: absolute;
    top: -8px;
    right: -10px;
    background-color: #C85665; /* El color coral de tu marca */
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 2px 6px;
    border-radius: 50%;
    min-width: 15px;
    text-align: center;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}


    
}

