/* ======== LOGIN SCREEN ======== */

.login-body {
    background: #f4f6fb;
    height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.login-card {
    background: white;
    width: 100%;
    max-width: 360px;
    padding: 30px 24px;
    border-radius: 20px;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    text-align: center;
}

.login-logo {
    font-size: 40px;
    margin-bottom: 10px;
}

.login-title {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 8px;
}

.login-subtitle {
    font-size: 14px;
    color: #6b7280;
    margin-bottom: 24px;
}

.login-form input {
    width: 100%;
    padding: 14px;
    margin-bottom: 16px;
}    
    
html {
    /* Ajustamos el corte a 65px (aprox el centro de la zona de avatares con notch) */
    background: linear-gradient(
        to bottom, 
        #cba254 -50px, 
        #cba254 40px, 
        #f4f6fb 60px
    ) !important;
    background-attachment: fixed !important;
    background-color: #cba254 !important;
    height: 100% !important;
}

body, .app-body {
    background: transparent !important;
    margin: 0 !important;
    padding: 0 !important;
}

.container {
    max-width: 480px;
    margin: auto;
    padding: 20px;
}

h1 {
    text-align: center;
    font-size: 28px;
    color: #333;
    margin-bottom: 20px;
}

/* ==== INPUT Y BOTÓN ==== */

.add-ingredient-box input {
    flex: 1;
    padding: 16px 14px;
    border-radius: 12px;
    border: 1px solid #ccc;
    font-size: 18px;
    transition: 0.2s;
}

.add-ingredient-box input:focus {
    border-color: #008cff;
    outline: none;
    box-shadow: 0 0 8px rgba(0,140,255,0.2);
}

.add-ingredient-box button {
    padding: 16px 20px;
    background: #008cff;
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: 0.2s;
}

.add-ingredient-box button:hover {
    background: #006bb3;
}

/* ==== LISTA DE INGREDIENTES ==== */
.ingredient-list {
    list-style: none;
    padding: 0;
    margin: 10px 0 25px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ingredient-list li {
    background: #e4f1ff;
    padding: 10px 14px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    font-size: 16px;
}

.ingredient-list li .delete-btn {
    margin-left: 8px;
    border: none;
    background: #ff5f5f;
    color: white;
    border-radius: 50%;
    padding: 3px 7px;
    cursor: pointer;
    transition: 0.2s;
}

.ingredient-list li .delete-btn:hover {
    background: #d43f3a;
}

/* ==== BOTÓN BUSCAR ==== */
.search-button {
    width: 100%;
    padding: 18px;
    background: #00b347;
    color: white;
    border: none;
    border-radius: 14px;
    font-size: 20px;
    cursor: pointer;
    transition: 0.2s;
}

.search-button:hover:enabled {
    background: #009e39;
}

.search-button:disabled {
    background: #a1d9a3;
    cursor: not-allowed;
}

/* ==== AUTOCOMPLETADO ==== */
.autocomplete-box {
    background: white;
    border: 1px solid #ccc;
    border-radius: 12px;
    margin-top: -5px;
    position: absolute;
    width: calc(100% - 20px);
    max-height: 220px;
    overflow-y: auto;
    display: none;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.autocomplete-item {
    padding: 12px 14px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: 0.1s;
}

.autocomplete-item:hover {
    background: #e8f3ff;
}

.autocomplete-group-title {
    font-weight: bold;
    background: #f0f0f0;
    padding: 10px 14px;
    border-bottom: 1px solid #ccc;
}

/* ==== RESPONSIVE MOBILE ==== */
@media (max-width: 480px) {
    h1 {
        font-size: 30px;
    }
    .add-ingredient-box input {
        font-size: 18px;
        padding: 16px 14px;
    }
    .add-ingredient-box button {
        font-size: 18px;
        padding: 16px 18px;
    }
    .ingredient-list li {
        font-size: 16px;
        padding: 10px 14px;
    }
    .search-button {
        font-size: 20px;
        padding: 18px;
    }
    .autocomplete-item {
        font-size: 16px;
        padding: 12px 14px;
    }
    .autocomplete-group-title {
        font-size: 16px;
        padding: 10px 14px;
    }
}

.login-form input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.btn-login {
    width: 100%;
    background: #3b82f6;
    color: white;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-login:hover {
    background: #2563eb;
}

.login-footer {
    margin-top: 20px;
    font-size: 13px;
    color: #9ca3af;
}
.login-error {
    background: #fee2e2;
    color: #dc2626;
    padding: 10px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 20px;
    border: 1px solid #fecaca;
    font-weight: 500;
}

.login-logo-img {
    width: 120px; /* Ajusta según el tamaño de tu logo */
    height: auto;
    margin-bottom: 15px;
}

/* ========== APP MOBILE ========== */

/* -------- HEADER -------- */

/* HEADER SUPERIOR (BARRA DE TÍTULO) */




/* Para que los iconos y el título se vean bien sobre el fondo */
.contenedor-miembros {
    z-index: 1001;
}

.app-container {
    padding: 10px;
    padding-bottom: 90px;
}

/* -------- GROUP SELECTOR -------- */


.group-card select {
    width: 100%;
    margin-top: 10px;
    padding: 14px;
    border-radius: 12px;
    border: 1px solid #d0d5e2;
    font-size: 16px;
    background: #fafafa;
}

/* -------- LISTA DE INGREDIENTES -------- */


.ingredient-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ingredient-list li {
    background: #f2fff4;
    border-color: #d5f7da;
    padding: 14px 16px;
    margin-bottom: 10px;
    border-radius: 14px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 3px 10px rgba(0,0,0,0.06);
}

.delete-btn {
    background: #ef4444;
    border: none;
    color: white;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 16px;
    cursor: pointer;
}

/* -------- BOTÓN VACIAR -------- */

.danger-btn {
    width: 100%;
    padding: 16px;
    margin-top: 20px;
    border: none;
    background: #dc2626;
    border-radius: 14px;
    color: white;
    font-size: 18px;
    font-weight: bold;
}



/* -------- MODAL -------- */

.modal.hidden {
    display: none;
}
/* -------- AUTOCOMPLETADO -------- */

.autocomplete-box {
    border: 1px solid #ccc;
    background: white;
    border-radius: 12px;
    margin-top: 8px;
    max-height: 240px;
    overflow-y: auto;
    display: none;
}

.autocomplete-item {
    padding: 12px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
}

.autocomplete-item:hover {
    background: #f4f9ff;
}


/* =========================================
   GRUPO EN UNA LÍNEA
========================================= */


.group-row .group-label {
    font-size: 15px;
    font-weight: 600;
    color: #475569;
}

.group-row select {
    flex: 1;
    padding: 10px;
    border-radius: 10px;
    border: 1px solid #cbd5e1;
    font-size: 15px;
    background: #fff;
}

/* =========================================
   TÍTULO + BOTÓN (+) EN LÍNEA
========================================= */
/* CONTENEDOR DE TÍTULO DE LISTA + BOTÓN AÑADIR */
.list-header {
    display: flex;
    align-items: center;
    justify-content: space-between; /* Título a la izquierda, botón a la derecha */
    gap: 12px;
    margin: 20px 0 12px 0;
    position: relative; /* Importante para el autocompletado */
}

.list-title {
    font-size: 18px;
    font-weight: 600;
}

.add-inline-btn {
    background: #2563eb;
    color: white;
    border: none;
    width: 40px;
    height: 40px;
    font-size: 26px;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
}

.add-inline-btn:hover {
    background: #1d4ed8;
}

/* Eliminar FAB flotante */
.fab-btn {
    display: none !important;
}
/* Caja de autocompletado */
.autocomplete-box {
    position: absolute;
    left: 0;
    right: 0;
    top: 48px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #d8e3ef;
    box-shadow: 0 6px 18px rgba(0,0,0,0.08);
    max-height: 260px;
    overflow-y: auto;
    display: none;
    z-index: 999;
    padding-bottom: 6px;
}

/* Grupo */


/* Item */
.autocomplete-item {
    padding: 10px 12px;
    font-size: 15px;
    cursor: pointer;
    color: #222;
    border-bottom: 1px solid #f3f3f3;
    transition: background 0.15s;
}

.autocomplete-item:hover {
    background: #eaf3ff;
}
/* Hacer que el modal sea posicionable */
.modal-content {
    position: relative;
    padding-bottom: 180px; /* espacio para autocomplete */
}
/* AUTOCOMPLETADO – pegado abajo dentro del modal */
.autocomplete-box {
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 8px); /* justo debajo del input */

    background: #fff;
    border: 1px solid #dcdcdc;
    border-radius: 12px;
    overflow-y: auto;

    max-height: 40vh; /* visible sobre el teclado */
    display: none;
    z-index: 5000;

    box-shadow: 0 6px 14px rgba(0,0,0,0.15);
}

/* Estilo de items */
.autocomplete-item {
    padding: 12px 16px;
    border-bottom: 1px solid #f3f3f3;
    font-size: 16px;
    cursor: pointer;
}
.autocomplete-item:hover {
    background:#f0f6ff;
}

.autocomplete-group-title {
    font-weight: bold;
    padding: 8px 16px;
    background:#eef2f7;
}
.ingredient-list { list-style:none; padding:0; margin:0; }

.ingredient-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #f7fbff;
    border: 1px solid #e3f0ff;
    padding: 8px 12px;
    border-radius: 12px;
    margin-bottom: 8px;
}

.ingredient-left {
    display:flex;
    align-items:center;
    gap: 10px;
}



.ingredient-icon-img {
    width: 28px;
    height: 28px;
    object-fit: contain;
    display:block;
}

.ingredient-text {
    font-size: 15px;
    color: #111827;
}

.delete-btn {
    background: transparent;
    border: none;
    font-size: 16px;
    cursor: pointer;
    opacity: 0.7;
}
.delete-btn:hover { opacity: 1; }

/* lo de cesta.php */
/* Ajustes específicos de esta página */


.add-inline-btn {
    background:#2563eb;
    color:white;
    border:none;
    width:42px;
    height:42px;
    font-size:24px;
    border-radius:10px;
    cursor:pointer;
    box-shadow:0 2px 6px rgba(0,0,0,0.15);
}
.add-inline-btn:hover { background:#1d4ed8; }

.group-inline {
    display:flex;
    justify-content:space-between;
    align-items:center;
    margin-top:10px;
    margin-bottom:20px;
}
.group-inline label { font-weight:bold; }

.inline-input {
    flex: 1;
    font-size: 16px;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 10px;
}

.autocomplete-box {
    position:absolute;
    top:52px;
    left:0;
    right:60px; /* para no tapar el botón ＋ */
    background:white;
    border:1px solid #ccc;
    border-radius:10px;
    max-height:240px;
    overflow:auto;
    display:none;
    z-index:20;
}
.autocomplete-item { padding:10px; cursor:pointer; border-bottom:1px solid #eee; }
.autocomplete-item:hover { background:#eef7ff; }
.autocomplete-group-title { font-weight:bold; background:#f1f1f1; padding:8px; }

/* Lista de ingredientes (chips) */
.ingredient-list { list-style:none; padding:0; margin:0; }

/* CHIP MUY COMPACTO */

.ingredient-item {
    display: flex;
    align-items: center;
    justify-content: space-between;

    background: #f2fff4;             /* tu color */
    border: 1px solid #d5f7da;       /* tu borde */
    border-radius: 14px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.06);

    height: 42px;                    /* altura final COMPACTA */
    padding: 0 12px;                 /* ⬅ SIN padding vertical */
    margin-bottom: 10px;

    overflow: visible;                /* ⬅ PERMITIR que el icono sobresalga */
    box-sizing: border-box;          /* para que height funcione siempre */
   
}

/* Contenedor de icono + texto */
.ingredient-left {
    display: flex;
    align-items: center;
    gap: 10px;                     /* MÁS SEPARACIÓN icono-texto */
}
/* CONTENEDOR DEL ICONO: pequeño y recorta el exceso */
.ingredient-icon-wrapper {
    width: 36px;     
    height: 36px;
    overflow: hidden;   /* mantiene redondeado sin deformar */
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;     /* evita que se aplasten en móviles */
}


.ingredient-icon-emoji { font-size: 20px; width: 28px; height: 28px; display:inline-flex; align-items:center; justify-content:center; }


/* ICONO “GRANDE” sin que el chip crezca */
.ingredient-icon-img {
    width: 36px;
    height: 36px;
    border-radius: 50%; /* icono redondito */
    object-fit: cover;  /* rellena sin deformar */
    display: block;
}


.ingredient-text { font-size: 15px; color: #111827; }
.delete-btn { background: transparent; border: none; font-size: 16px; cursor: pointer; opacity: 0.7; }
.delete-btn:hover { opacity: 1; }

/* selector de grupo */
#grupo_id { padding: 8px 10px; font-size: 16px; min-width: 180px; border-radius: 8px; }
.danger-btn { background:#ef4444; color:white; border:none; padding:10px 14px; border-radius:8px; cursor:pointer; }

/* Cuando el chip está comprado */
.ingredient-item.comprado {
    opacity: 0.5 !important;
    background: #e5e7eb !important; 
    border-color: #d1d5db;
}

.ingredient-item.comprado .ingredient-text {
    text-decoration: line-through !important;
    color: #6b7280 !important;
}

.ingredient-item.comprado .ingredient-icon-img {
    filter: grayscale(100%);
}

/* Ajuste para que el botón de borrar no herede el tachado */
.delete-btn {
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
}


/* Estilo base para ambos botones para que midan lo mismo */
.btn-limpiar, .danger-btn {
    border: none;
    padding: 10px 14px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: background 0.2s, transform 0.1s;
    margin: 5px; /* Espacio entre ellos */
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

/* Color Naranja para Limpiar Comprados */
.btn-limpiar {
    background-color: #f59e0b; /* Ambar/Naranja */
    color: white;
}

.btn-limpiar:hover {
    background-color: #d97706;
}

/* Color Rojo para Vaciar (el que ya tenías) */
.danger-btn {
    background-color: #ef4444;
    color: white;
}

.danger-btn:hover {
    background-color: #dc2626;
}

/* Efecto al pulsar */
.btn-limpiar:active, .danger-btn:active {
    transform: scale(0.96);
}

/* Contenedor para centrarlos (opcional) */
.actions-container {
    display: flex;
    justify-content: space-around;
    margin-top: 20px;
}
/* Aseguramos que los miembros tengan su posición correcta */
.contenedor-miembros {
    position: absolute;
    top: 28px;
    right: 20px;
    display: flex;
    flex-direction: row-reverse;
    gap: 8px;
    z-index: 1001; /* Mantener por encima del gradiente */
}

.mini-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background-color: #d4a017; /* Ocre */
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: bold;
    border: 2px solid #fff;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
    overflow: hidden;
}

.mini-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.install-container {
    position: fixed;
    bottom: 20px;
    left: 20px;
    right: 20px;
    z-index: 9999;
    animation: slideUp 0.5s ease-out;
}

.install-card {
    background: #ffffff;
    border-radius: 15px;
    padding: 15px;
    display: flex;
    align-items: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    border: 1px solid #eee;
}

.install-icon {
    font-size: 30px;
    margin-right: 15px;
}

.install-text {
    flex-grow: 1;
}

.install-text strong {
    display: block;
    font-size: 16px;
    color: #333;
}

.install-text span {
    font-size: 12px;
    color: #666;
}

.btn-primary {
    background: #28a745;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
}

.btn-close {
    background: none;
    border: none;
    font-size: 20px;
    color: #999;
    margin-left: 10px;
    cursor: pointer;
}

@keyframes slideUp {
    from { transform: translateY(100px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}


.autocomplete-box {
    position: absolute;
    left: 0;           /* Se pega al borde izquierdo del contenedor padre */
    right: 0;          /* Se pega al borde derecho */
    width: 100%;       /* Fuerza el ancho total */
    display: none;     /* JS lo cambia a flex */
    background: white;
    border: 1px solid #ccc;
    z-index: 1000;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    border-radius: 8px;
    margin-top: 2px;
    overflow: hidden;
}

.auto-column {
    flex: 1;           /* Cada columna ocupa exactamente la mitad */
    min-width: 0;      /* Evita que el contenido ancho empuje la columna */
}

.auto-column:first-child {
    border-right: 1px solid #eee; /* Separador central */
    background-color: #fdfdfd;
}

/* TÍTULOS DENTRO DEL DESPLEGABLE DE SUGERENCIAS */
.auto-header {
    font-size: 0.65rem;
    font-weight: bold;
    color: #999;
    padding: 8px;
    text-transform: uppercase;
    background: #f8f8f8;
    border-bottom: 1px solid #eee;
}

.autocomplete-item {
    padding: 12px 6px; /* Reducimos un poco el padding lateral para ganar espacio */
    font-size: 0.9rem;
}
/* fin de cesta.php */



/* el archivo style.css */
/* ==== contenido de style.css ==== */

.container {
    max-width: 480px;
    margin: auto;
    padding: 20px;
}

h1 {
    text-align: center;
    font-size: 28px;
    color: #333;
    margin-bottom: 20px;
}

/* ==== INPUT Y BOTÓN ==== */
.add-ingredient-box {
    display: flex;
    gap: 12px;
    margin-bottom: 15px;
}

.add-ingredient-box input {
    flex: 1;
    padding: 16px 14px;
    border-radius: 12px;
    border: 1px solid #ccc;
    font-size: 18px;
    transition: 0.2s;
}

.add-ingredient-box input:focus {
    border-color: #008cff;
    outline: none;
    box-shadow: 0 0 8px rgba(0,140,255,0.2);
}

.add-ingredient-box button {
    padding: 16px 20px;
    background: #008cff;
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 18px;
    cursor: pointer;
    transition: 0.2s;
}

.add-ingredient-box button:hover {
    background: #006bb3;
}

/* ==== LISTA DE INGREDIENTES ==== */
.ingredient-list {
    list-style: none;
    padding: 0;
    margin: 10px 0 25px 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ingredient-list li {
    background: #e4f1ff;
    padding: 10px 14px;
    border-radius: 20px;
    display: flex;
    align-items: center;
    font-size: 16px;
}

.ingredient-list li .delete-btn {
    margin-left: 8px;
    border: none;
    background: #ff5f5f;
    color: white;
    border-radius: 50%;
    padding: 3px 7px;
    cursor: pointer;
    transition: 0.2s;
}

.ingredient-list li .delete-btn:hover {
    background: #d43f3a;
}
/* ==== AUTOCOMPLETADO ==== */
.autocomplete-box {
    background: white;
    border: 1px solid #ccc;
    border-radius: 12px;
    margin-top: -5px;
    position: absolute;
    width: calc(100% - 20px);
    max-height: 220px;
    overflow-y: auto;
    display: none;
    z-index: 10;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.autocomplete-item {
    padding: 12px 14px;
    cursor: pointer;
    border-bottom: 1px solid #eee;
    transition: 0.1s;
}

.autocomplete-item:hover {
    background: #e8f3ff;
}

.autocomplete-group-title {
    font-weight: bold;
    background: #f0f0f0;
    padding: 10px 14px;
    border-bottom: 1px solid #ccc;
}

/* ==== RESPONSIVE MOBILE ==== */
@media (max-width: 480px) {
    h1 {
        font-size: 30px;
    }
    .add-ingredient-box input {
        font-size: 18px;
        padding: 16px 14px;
    }
    .add-ingredient-box button {
        font-size: 18px;
        padding: 16px 18px;
    }
    .ingredient-list li {
        font-size: 16px;
        padding: 10px 14px;
    }
    .search-button {
        font-size: 20px;
        padding: 18px;
    }
    .autocomplete-item {
        font-size: 16px;
        padding: 12px 14px;
    }
    .autocomplete-group-title {
        font-size: 16px;
        padding: 10px 14px;
    }
}



