/* Configuración Global y Resets */
*, *::before, *::after {
    box-sizing: border-box;
}
body {
    margin: 0;
    padding: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    min-height: 100vh;
}

/* Punto 3: Fondo repetible conservando calidad (Aplicado a Cliente y Admin) */
.client-body, .admin-body {
    background-image: url('https://www.lakarakola.com/fondo.png');
    background-repeat: repeat;
    background-size: auto;
}

/* Logos y Cabeceras comunes */
.main-header {
    width: 100%;
    text-align: center;
    padding: 15px 0;
}
/* Logo incrementado al 170% de su tamaño anterior (180px * 1.7 = 306px) */
.center-logo {
    max-width: 306px;
    height: auto;
}
.menu-title {
    color: #5c3a21; /* Café */
    text-align: center;
    font-size: 1.6rem;
    margin-top: 5px;
}

/* Estilos de Contenedor de Catálogo de Clientes e Interfaces */
.menu-wrapper, .admin-container {
    width: 90%;
    margin: 20px auto 100px auto;
    background-color: #99AFC9;
    padding: 20px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.admin-container h1 {
    color: #5c3a21;
    text-align: center;
    margin-bottom: 25px;
}

/* Configuración de Categorías - Punto 2 */
.category-section {
    margin-bottom: 35px;
}
.category-header {
    width: 100%;
    text-align: center;
    background-color: #00A896; /* Color Agua del Mar */
    color: #ffffff;
    font-weight: bold;
    font-size: 1.4rem;
    padding: 10px 0;
    text-transform: uppercase;
}
.category-divider {
    height: 3px;
    background-color: #5c3a21; /* Línea Café */
    margin: 8px auto 20px auto;
    width: 100%;
}

/* Rejilla adaptativa de productos - 5 por fila en PC y ajustable en celular */
.products-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 15px;
}
.product-card {
    background-color: #B7D0ED; /* Color de fondo tarjeta */
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.2s;
    display: flex;
    flex-direction: column;
}
.product-card:hover {
    transform: scale(1.03);
}
.card-img-wrapper img {
    width: 100%;
    height: 150px;
    object-fit: cover;
}
.card-footer-name {
    padding: 10px;
    text-align: center;
    font-weight: bold;
    color: #2c3e50;
    margin-top: auto;
}

/* Texto enmascarado con imagen de fondo - Punto 18 */
.text-masked {
    background-image: url('https://www.lakakola.com/fondo.png');
    background-clip: text;
    -webkit-background-clip: text;
    color: transparent;
    font-weight: bold;
}

/* Nuevos Estilos Solicitados: Textos sobre la Imagen en el Popup */
.popup-text-styled {
    color: #ECE2C6 !important;
    font-weight: bold;
    /* Efecto de borde negro limpio alrededor del texto */
    text-shadow: 
        -1px -1px 0 #000,  
         1px -1px 0 #000,
        -1px  1px 0 #000,
         1px  1px 0 #000,
        -2px  0px 0 #000,
         2px  0px 0 #000,
         0px -2px 0 #000,
         0px  2px 0 #000;
}
.popup-top-info-overlay {
    position: absolute;
    top: 12px;
    left: 12px;
    right: 12px;
    z-index: 10;
}
.popup-top-info-overlay h2 {
    margin: 0 0 5px 0;
    font-size: 1.6rem;
}
.popup-top-info-overlay .font-ingredients {
    margin: 0;
    font-size: 1rem;
    line-height: 1.3;
}

/* Modales e Interfaces Emergentes (PopUps) */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: rgba(0,0,0,0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}
.modal-content {
    background-color: #ffffff;
    padding: 20px;
    border-radius: 8px;
    width: 90%;
    max-width: 500px;
    position: relative;
}
.product-detail-popup {
    background-color: #B7D0ED !important; /* Punto 16 */
}
.popup-media-container {
    width: 100%;
    height: 300px; /* Incrementado para mejor espacio de visualización de los textos */
    background-size: cover;
    background-position: center;
    position: relative;
    border-radius: 6px;
    margin-bottom: 15px;
}
.watermark-logo-right {
    position: absolute;
    bottom: 10px;
    left: 10px; /* Movido a la izquierda para no cruzarse con el precio */
    width: 60px;
    opacity: 0.4;
}
.popup-price-tag {
    position: absolute;
    bottom: 12px;
    right: 12px;
    font-size: 1.8rem;
    z-index: 10;
    margin: 0;
}

/* Botones Especiales */
.btn-order-orange {
    width: 100%;
    background-color: rgba(255, 127, 80, 0.8); /* Naranja Semitransparente */
    border: none;
    color: white;
    font-size: 1.2rem;
    padding: 12px;
    font-weight: bold;
    border-radius: 4px;
    cursor: pointer;
}

/* Barra de Pedido Inferior - Punto 9 */
.cart-bar {
    position: fixed;
    bottom: 50px; /* Sobre el Footer */
    left: 0; right: 0;
    background-color: #A0C4FF; /* Azul Claro */
    padding: 12px;
    cursor: pointer;
    display: none;
    z-index: 1000;
}
.cart-bar.active { display: block; }
.cart-bar-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.badge-container {
    position: relative;
}
#cart-count {
    background-color: #ff4d4d; /* Botón pequeño rojo */
    color: white;
    padding: 4px 8px;
    border-radius: 50%;
    font-size: 0.8rem;
    font-weight: bold;
}

/* Cita Religiosa */
.religious-quote {
    color: #5c3a21;
    font-size: 1.3rem;
    text-align: center;
    margin: 30px 0;
    font-weight: bold;
    line-height: 1.5;
}

/* Distribución de Mapas y Redes */
.footer-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 20px;
}
.social-box {
    display: flex;
    justify-content: space-around;
    align-items: center;
}
.social-box img {
    width: 60px;
    height: auto;
}

/* Pie de Página de Agua Marina - Punto 14 */
.sea-footer {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 50px;
    background-color: #00A896;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 15px;
    color: white;
    z-index: 1010;
}
.footer-logo-left {
    height: 30%; /* 30% de su tamaño relativo del footer */
}
.footer-center-text {
    font-size: 1.1rem;
    font-weight: bold;
}

/* Estilos de Administración */
.admin-section {
    background-color: rgba(255, 255, 255, 0.9);
    padding: 20px;
    border-radius: 6px;
    margin-bottom: 30px;
}
.admin-section h2 {
    color: #00A896;
    margin-top: 0;
    border-bottom: 2px solid #5c3a21;
    padding-bottom: 5px;
}
.admin-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 20px; margin-bottom: 30px;}
.admin-side-grid { display: flex; flex-direction: column; gap: 20px; }
.form-box { background: white; padding: 20px; border-radius: 6px; border: 1px solid #ccc; }
.field { margin-bottom: 12px; display: flex; flex-direction: column; }
.field label { font-weight: bold; margin-bottom: 5px; color: #2c3e50; }
.field input, .field textarea, .field select { padding: 8px; border: 1px solid #ccc; border-radius: 4px; }
.inline-field { display: flex; flex-direction: row; gap: 10px; }
.inline-field input { flex: 1; }
.table-container { overflow-x: auto; background: white; border-radius: 6px; padding: 10px; margin-top: 15px; border: 1px solid #ccc; }
table { width: 100%; border-collapse: collapse; }
table th, table td { padding: 10px; border-bottom: 1px solid #ddd; text-align: left; }
table th { background-color: #f4f6f9; color: #2c3e50; }

ul { list-style: none; padding: 0; margin: 10px 0 0 0; max-height: 150px; overflow-y: auto; border: 1px solid #eee; padding: 5px; border-radius: 4px; }
ul li { display: flex; justify-content: space-between; align-items: center; padding: 6px; border-bottom: 1px solid #eee; }
ul li:last-child { border-bottom: none; }
ul li button { background: #dc3545; color: white; border: none; padding: 2px 6px; border-radius: 3px; cursor: pointer; }

/* Botonera de acciones */
.btn-primary { background-color: #007bff; color: white; border: none; padding: 6px 12px; cursor: pointer; border-radius: 4px;}
.btn-danger { background-color: #dc3545; color: white; border: none; padding: 6px 12px; cursor: pointer; border-radius: 4px;}
.btn-success { background-color: #28a745; color: white; border: none; padding: 10px; cursor: pointer; border-radius: 4px; width: 100%; font-weight: bold;}
.btn-warning { background-color: #ffc107; color: #212529; border: none; padding: 6px 12px; cursor: pointer; border-radius: 4px; font-weight: bold;}

/* Interfaz de Login */
.login-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: #99AFC9; display: flex; align-items: center; justify-content: center; z-index: 3000; }
.login-box { background: white; padding: 35px; border-radius: 8px; width: 90%; max-width: 400px; box-shadow: 0 4px 15px rgba(0,0,0,0.3); text-align: center; }
.login-box img { max-width: 180px; margin-bottom: 20px; }

/* RESPONSIVE DESIGN (Media Queries para Celulares) */
@media (max-width: 768px) {
    .products-grid {
        grid-template-columns: repeat(2, 1fr); /* 2 productos por fila en móvil */
    }
    .admin-grid {
        grid-template-columns: 1fr; /* Colapso vertical de bloques */
    }
    .admin-side-grid {
        gap: 20px;
    }
    .footer-info-grid {
        grid-template-columns: 1fr;
    }
    .footer-center-text {
        font-size: 0.9rem;
    }
    .footer-right-text {
        font-size: 0.7rem;
    }
    
    /* Ajuste para que la dirección y ciudad no rompan el ancho en celulares */
    .checkout-form-popup .address-group {
        flex-direction: column;
        gap: 8px;
    }
    .checkout-form-popup .address-group input,
    .checkout-form-popup .address-group select {
        width: 100%;
        flex: none;
    }
}

/* ==========================================================================
   OPTIMIZACIÓN Y UNIFICACIÓN ESTÉTICA DE POPUPS (MODALES)
   ========================================================================== */

/* Fondo unificado azul claro, bordes redondeados y centrado para todos los popups */
.product-detail-popup,
.quantity-popup,
.cart-view-popup,
.checkout-form-popup {
    background-color: #B7D0ED !important;
    border-radius: 16px !important; /* Bordes más redondeados y modernos */
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3) !important;
    text-align: center !important; /* Centrado de textos por defecto */
    padding: 25px !important;
    border: 2px solid #5c3a21; /* Delicado borde café para mantener la identidad */
}

/* Centrado y personalización de títulos dentro de los modales */
.quantity-popup h3,
.cart-view-popup h3,
.checkout-form-popup h3 {
    color: #5c3a21;
    font-size: 1.5rem;
    margin-top: 0;
    margin-bottom: 20px;
    font-weight: bold;
}

/* Modal de Cantidad - Control de número grande y estético */
.quantity-control {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin: 25px 0;
}
.quantity-control button {
    background-color: #00A896;
    color: white;
    border: none;
    width: 50px;
    height: 50px;
    font-size: 1.8rem;
    font-weight: bold;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    transition: transform 0.1s, background-color 0.2s;
}
.quantity-control button:active {
    transform: scale(0.95);
}
.quantity-control input {
    width: 70px;
    height: 50px;
    font-size: 1.6rem;
    text-align: center;
    border: 2px solid #5c3a21;
    border-radius: 8px;
    background: white;
    color: #2c3e50;
    font-weight: bold;
}

/* Modal de Carrito - Lista de Productos y Total */
.cart-items-list {
    background: rgba(255, 255, 255, 0.6);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 20px;
    max-height: 200px;
    overflow-y: auto;
    border: 1px solid #99AFC9;
}
.cart-item-row {
    display: flex;
    justify-content: space-between;
    font-size: 1.1rem;
    color: #2c3e50;
    padding: 8px 0;
    border-bottom: 1px solid rgba(92, 58, 33, 0.2);
    font-weight: 600;
}
.cart-item-row:last-child {
    border-bottom: none;
}
.cart-total-footer {
    font-size: 1.6rem;
    font-weight: bold;
    color: #5c3a21;
    margin: 20px 0;
    text-shadow: 1px 1px 0px white;
}

/* Modal de Formulario - Inputs más limpios y legibles */
.checkout-form-popup .field {
    text-align: left; /* Mantiene las etiquetas alineadas de forma organizada */
    margin-bottom: 15px;
}
.checkout-form-popup .field label {
    color: #5c3a21;
    font-weight: bold;
    margin-bottom: 6px;
}
.checkout-form-popup input, 
.checkout-form-popup select {
    font-size: 1.1rem !important;
    padding: 12px !important;
    border-radius: 8px !important;
    border: 1px solid #5c3a21 !important;
}
.checkout-form-popup .address-group {
    display: flex;
    gap: 10px;
}
.checkout-form-popup .address-group input {
    flex: 2;
    width: 100%;
}
.checkout-form-popup .address-group select {
    flex: 1;
    width: 100%;
    background-color: white;
}

/* Botones Principales de Acción de los PopUps (Gigantes, Estéticos y Adaptativos) */
.btn-add-to-order,
.btn-checkout,
.btn-success-final {
    width: 100%;
    min-height: 55px;
    font-size: 1.3rem;
    font-weight: bold;
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s, filter 0.2s;
    margin-top: 10px;
}

/* Colores específicos para cada botón de acción */
.btn-add-to-order {
    background-color: #00A896; /* Verde Agua Marina */
}
.btn-checkout {
    background-color: #ff7f50; /* Naranja Coral */
}
.btn-success-final {
    background-color: #28a745; /* Verde Éxito */
}

/* Efecto Hover general para los botones */
.btn-add-to-order:hover,
.btn-checkout:hover,
.btn-success-final:hover {
    filter: brightness(1.1);
    transform: translateY(-2px);
}
.btn-add-to-order:active,
.btn-checkout:active,
.btn-success-final:active {
    transform: translateY(0);
}
/* Estilo adicional para botones de ordenación en administración */
.btn-sort {
    border: none;
    color: white;
    padding: 3px 8px;
    font-size: 0.8rem;
    border-radius: 3px;
    cursor: pointer;
    transition: background 0.2s;
}
.btn-sort:hover:not([disabled]) {
    filter: brightness(1.2);
}
.btn-sort[disabled] {
    opacity: 0.3;
    cursor: not-allowed;
}