:root {
    --bg-dark: #2c2c2c;
    --accent: #c45a2b;
    --accent-hover: #a84a22;
    --text-light: #f5f5f5;
    --gray-dark: #333333;
    /* Tono claro para secciones */
    --section-light-bg: rgba(255, 252, 248, 0.95);
    --section-soft-bg: rgba(250, 248, 245, 0.92);
    --section-register-bg: rgba(255, 252, 248, 0.97);
    --text-dark: #2c2c2c;
    --text-muted: #5a5a5a;
    --card-shadow: 0 8px 32px rgba(0, 0, 0, 0.08);
    --border-light: rgba(0, 0, 0, 0.06);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'DM Sans', sans-serif;
    color: var(--text-dark);
    line-height: 1.6;
    overflow-x: hidden;
    background-color: #f8f6f4;
    position: relative;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-size: 500px;
    background-repeat: repeat;
    opacity: 0.08;
    z-index: -1;
    pointer-events: none;
    background-image: url('../assets/images/cocina1.png');
    animation: bgSlideShow 30s infinite;
    mix-blend-mode: multiply;
}

@keyframes bgSlideShow {
    0% { background-image: url('../assets/images/cocina1.png'); }
    33% { background-image: url('../assets/images/cocina2.png'); }
    66% { background-image: url('../assets/images/cocina3.png'); }
    100% { background-image: url('../assets/images/cocina1.png'); }
}


/* Loading overlay */
#loading-overlay {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.72);
    z-index: 9999;
    backdrop-filter: blur(4px);
    transition: opacity 0.4s ease;
}

#loading-overlay.hidden {
    opacity: 0;
    pointer-events: none;
}

#loading-overlay .loading-box {
    background: rgba(15, 15, 15, 0.92);
    border-radius: 16px;
    padding: 24px 32px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.45);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    min-width: 260px;
}

#loading-overlay .loading-text {
    color: #fdfdfd;
    font-size: 1.1rem;
    font-weight: 500;
    letter-spacing: 0.04em;
}

#loading-overlay .loading-spinner {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: 3px solid rgba(255, 255, 255, 0.25);
    border-top-color: var(--accent);
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Background layers: imagen de fondo mantenida, más sutil */
.bg-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    opacity: 0.12;
    z-index: -1;
    pointer-events: none;
}

.layer-1 { animation: fade 15s infinite; }
.layer-2 { animation: fade 15s infinite 5s; opacity: 0; }
.layer-3 { animation: fade 15s infinite 10s; opacity: 0; }

@keyframes fade {
    0%, 33% { opacity: 0.12; }
    34%, 100% { opacity: 0; }
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

/* Header: contraste mantenido (oscuro) */
.main-header {
    height: 100px;
    background-color: var(--gray-dark);
    display: flex;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.25);
}

.header-content {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    width: 100%;
    gap: 20px;
}

.main-header .container {
    padding-left: 16px;
    padding-right: 16px;
}

.logo {
    flex-shrink: 0;
}

.logo h1 {
    font-size: 2rem;
    font-weight: 700;
    color: var(--text-light);
}

.logo span { color: var(--accent); }
.logo span { margin: 0 6px; }

.main-nav > ul {
    display: flex;
    list-style: none;
    gap: 16px;
    align-items: center;
    flex-wrap: nowrap;
}

.main-nav a {
    text-decoration: none;
    color: var(--text-light);
    font-weight: 500;
    transition: color 0.2s;
}

.main-nav a:hover { color: var(--accent); }

.lang-select-wrap {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}
.lang-select-wrap .sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
#lang-select {
    padding: 6px 10px;
    font-size: 0.9rem;
    border: 1px solid rgba(255,255,255,0.4);
    border-radius: 8px;
    background: rgba(255,255,255,0.15);
    color: var(--text-light);
    cursor: pointer;
    min-width: 56px;
}
#lang-select:focus { outline: none; border-color: var(--accent); }

.btn-login {
    background-color: var(--accent);
    color: white !important;
    padding: 10px 22px;
    border-radius: 8px;
}

.btn-login:hover {
    background-color: var(--accent-hover);
    color: white !important;
}

.portal-profile-menu {
    position: relative;
}

.portal-profile-dropdown {
    display: none;
    position: absolute;
    right: 0;
    top: calc(100% + 8px);
    list-style: none;
    margin: 0;
    padding: 8px 0;
    min-width: 180px;
    background: #e6eaef;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.16);
    z-index: 50;
}

.portal-profile-dropdown.is-open {
    display: block;
}

.portal-profile-dropdown a {
    display: block;
    color: #222;
    padding: 10px 14px;
    text-decoration: none;
    white-space: nowrap;
}

.portal-profile-dropdown a:hover {
    background: #f5f7fb;
    color: #111;
}

#portal-menu-profile {
    border-top: 1px solid rgba(17, 17, 17, 0.18);
}

/* Hero: slider mantenido */
.hero-banner {
    height: 520px;
    overflow: hidden;
    position: relative;
    background: #1a1a1a;
}

.slider-wrapper { width: 100%; height: 100%; }

.slider {
    display: flex;
    width: 400%;
    height: 100%;
    animation: slide-horizontal 20s infinite cubic-bezier(0.45, 0, 0.55, 1);
}

.slide {
    flex: 0 0 25%;
    height: 100%;
    background-size: cover;
    background-position: center;
    display: flex;
    align-items: center;
    justify-content: center;
}

@keyframes slide-horizontal {
    0%, 20% { transform: translateX(0); }
    25%, 45% { transform: translateX(-25%); }
    50%, 70% { transform: translateX(-50%); }
    75%, 95% { transform: translateX(-75%); }
    100% { transform: translateX(-75%); }
}

.slide-content {
    background: rgba(0, 0, 0, 0.35);
    padding: 48px;
    border-radius: 16px;
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
}

.slide-content h2 {
    font-size: clamp(2rem, 4vw, 3.5rem);
    margin-bottom: 16px;
    color: #fff;
    text-shadow: 0 2px 8px rgba(0,0,0,0.4);
}

.slide-content p {
    font-size: 1.15rem;
    max-width: 560px;
    margin: 0 auto;
    color: rgba(255,255,255,0.95);
}

/* Secciones genéricas (tono claro) */
.section {
    padding: 80px 0;
}

.section-light {
    background: var(--section-light-bg);
    color: var(--text-dark);
    box-shadow: 0 1px 0 var(--border-light);
}

.section-soft {
    background: var(--section-soft-bg);
    color: var(--text-dark);
}

/* Módulos: oculto hasta que el usuario inicie sesión */
.section-modulos.modulos-oculto {
    display: none !important;
}

.section-modulos {
    background: var(--section-light-bg);
    color: var(--text-dark);
    box-shadow: 0 1px 0 var(--border-light);
}

/* Modal de inicio de sesión (Portal) */
.modal-overlay-portal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.modal-overlay-portal[aria-hidden="true"] {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.modal-box-portal {
    background: var(--section-light-bg);
    border-radius: 16px;
    padding: 32px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    border: 1px solid var(--border-light);
    position: relative;
}

.modal-title-portal {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.modal-lead-portal {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 24px;
}

.modal-box-portal .form-group {
    margin-bottom: 18px;
}

.modal-box-portal .form-group label {
    display: block;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 6px;
    font-size: 0.95rem;
}

.modal-box-portal .form-group input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border-light);
    border-radius: 10px;
    font-size: 1rem;
    background: #fff;
}

.modal-box-portal .form-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(196, 90, 43, 0.15);
}

.error-msg-portal {
    color: #c62828;
    font-size: 0.9rem;
    margin-bottom: 12px;
    min-height: 1.2em;
}

.modal-box-portal .btn-submit {
    width: 100%;
    padding: 14px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

.modal-box-portal .btn-submit:hover {
    background: var(--accent-hover);
}

.modal-box-portal .btn-close-modal {
    display: block;
    width: 100%;
    margin-top: 14px;
    padding: 10px;
    background: transparent;
    color: var(--text-muted);
    border: 1px solid var(--border-light);
    border-radius: 10px;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
}

.modal-box-portal .btn-close-modal:hover {
    background: var(--section-soft-bg);
    color: var(--text-dark);
}

.modulos-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 24px;
}

.modulo-card {
    background: #fff;
    border-radius: 14px;
    padding: 24px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-light);
    transition: box-shadow 0.2s, border-color 0.2s;
}

.modulo-card:hover {
    box-shadow: 0 12px 36px rgba(0, 0, 0, 0.1);
    border-color: var(--accent);
}

.modulo-link {
    display: inline-block;
    text-decoration: none;
    margin-bottom: 12px;
}

.modulo-name {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--accent);
    border-bottom: 2px solid transparent;
    transition: border-color 0.2s, color 0.2s;
}

.modulo-link:hover .modulo-name {
    color: var(--accent-hover);
    border-bottom-color: var(--accent-hover);
}

.modulo-desc {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
    margin: 0;
}

.section-title {
    font-size: clamp(1.75rem, 3vw, 2.25rem);
    font-weight: 700;
    color: var(--text-dark);
    text-align: center;
    margin-bottom: 16px;
}

.section-lead {
    font-size: 1.1rem;
    color: var(--text-muted);
    text-align: center;
    max-width: 720px;
    margin: 0 auto 48px;
    line-height: 1.65;
}

/* La Cocina: tarjetas con imagen */
.cocina-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
}

.cocina-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-light);
    transition: transform 0.2s, box-shadow 0.2s;
}

.cocina-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
}

.cocina-card-img {
    height: 200px;
    background-size: cover;
    background-position: center;
}

.cocina-card-body {
    padding: 24px;
}

.cocina-card-body h3 {
    font-size: 1.25rem;
    color: var(--text-dark);
    margin-bottom: 10px;
}

.cocina-card-body p {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Control fácil */
.control-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 24px;
    margin-bottom: 48px;
}

.control-card {
    background: #fff;
    padding: 28px;
    border-radius: 14px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-light);
    text-align: center;
}

.control-icon {
    font-size: 2.5rem;
    margin-bottom: 16px;
}

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

.control-card p {
    font-size: 0.95rem;
    color: var(--text-muted);
}

.control-visual {
    text-align: center;
}

.control-img {
    max-width: 100%;
    width: 100%;
    max-height: 380px;
    object-fit: cover;
    border-radius: 16px;
    box-shadow: var(--card-shadow);
}

/* Categorías de carta */
.categorias-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 32px;
}

.categoria-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-light);
    transition: transform 0.2s, box-shadow 0.2s;
}

.categoria-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.1);
}

.categoria-card-img {
    height: 200px;
    background-size: cover;
    background-position: center;
}

.categoria-card-body {
    padding: 24px;
}

.categoria-card-body h3 {
    font-size: 1.3rem;
    color: var(--text-dark);
    margin-bottom: 6px;
}

.categoria-sub {
    font-size: 0.85rem;
    color: var(--accent);
    font-weight: 600;
    margin-bottom: 12px;
}

.categoria-card-body p:last-child {
    font-size: 0.95rem;
    color: var(--text-muted);
    line-height: 1.6;
}

/* Ventajas (info cards en tono claro) */
.info-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
}

.info-card {
    background: #fff;
    padding: 40px 32px;
    border-radius: 16px;
    text-align: center;
    border-bottom: 4px solid var(--accent);
    box-shadow: var(--card-shadow);
}

.card-icon {
    font-size: 2.75rem;
    margin-bottom: 20px;
}

.info-card h3 {
    font-size: 1.35rem;
    color: var(--text-dark);
    margin-bottom: 12px;
}

.info-card p {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.65;
}

/* Registro: tono claro */
.section-register {
    padding: 100px 0;
    background: var(--section-register-bg);
}

.register-card {
    max-width: 800px;
    margin: 0 auto;
    background: #fff;
    padding: 48px 56px;
    border-radius: 20px;
    box-shadow: var(--card-shadow);
    border: 1px solid var(--border-light);
}

.register-card h2 {
    font-size: 1.85rem;
    color: var(--text-dark);
    text-align: center;
    margin-bottom: 12px;
}

.register-card > p {
    text-align: center;
    color: var(--text-muted);
    margin-bottom: 32px;
}

#register-message.msg-success .reg-success-note {
    display: block;
    margin-top: 14px;
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--text-muted, #555);
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-top: 24px;
}

.full-width { grid-column: 1 / -1; }

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--text-dark);
}

.form-group input {
    width: 100%;
    padding: 12px 14px;
    background: #f8f6f4;
    border: 1px solid #ddd;
    color: var(--text-dark);
    border-radius: 8px;
    font-family: inherit;
}

.form-group input:focus {
    outline: none;
    border-color: var(--accent);
}

.btn-submit {
    width: 100%;
    margin-top: 28px;
    padding: 16px;
    background: var(--accent);
    color: white;
    border: none;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    font-size: 1.05rem;
    transition: background 0.2s;
}

.btn-submit:hover {
    background: var(--accent-hover);
}

/* Footer: contraste mantenido (oscuro) */
.main-footer {
    background-color: var(--gray-dark);
    padding: 80px 0 0 0;
    margin-top: 0;
    box-shadow: 0 -2px 12px rgba(0, 0, 0, 0.1);
}

.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 48px;
    margin-bottom: 56px;
}

.footer-col h3 {
    font-size: 1.35rem;
    color: var(--accent);
    margin-bottom: 20px;
    padding-bottom: 10px;
    position: relative;
}

.footer-col h3::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 48px;
    height: 2px;
    background: var(--accent);
}

.contact-info p {
    margin-bottom: 18px;
    color: #bbb;
}

.contact-info strong {
    color: var(--text-light);
    font-size: 0.9rem;
    display: block;
    margin-bottom: 4px;
}

.footer-contact-form input,
.footer-contact-form textarea {
    width: 100%;
    padding: 12px 14px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    color: #fff;
    border-radius: 8px;
    margin-bottom: 14px;
    font-family: inherit;
}

.footer-contact-form input::placeholder,
.footer-contact-form textarea::placeholder {
    color: #999;
}

.btn-footer-submit {
    background: var(--accent);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s, transform 0.2s;
}

.btn-footer-submit:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
}

.footer-bottom {
    background: #1a1a1a;
    padding: 28px 0;
    text-align: center;
    border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-bottom p {
    color: #777;
    font-size: 0.9rem;
}

.message {
    margin-top: 20px;
    text-align: center;
    padding: 12px;
    border-radius: 8px;
}

.msg-success { background: #d4edda; color: #155724; }
.msg-error { background: #f8d7da; color: #721c24; }

/* Responsive */
@media (max-width: 768px) {
    .main-nav ul { gap: 16px; }
    .section { padding: 56px 0; }
    .form-grid { grid-template-columns: 1fr; }
    .register-card { padding: 32px 24px; }
    .slide-content { padding: 28px 20px; }
}
