/**
 * ============================================================================
 * CLICKMENU PLATFORM FOOTER & PWA INSTALLATION SUITE (RESTAURANT MENUS)
 * ============================================================================
 * Modern 4-column corporate platform footer with integrated PWA app download,
 * official app store badges, legal hub, and modal guidance.
 * ============================================================================
 */

:root {
    --rf-bg: #090b0e;
    --rf-border: rgba(255, 255, 255, 0.07);
    --rf-text: #94a3b8;
    --rf-heading: #f8fafc;
    --rf-gold: #f59e0b;
    --rf-gold-glow: rgba(245, 158, 11, 0.25);
    --rf-transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

[data-theme="light"] {
    --rf-bg: #f8fafc;
    --rf-border: rgba(0, 0, 0, 0.08);
    --rf-text: #64748b;
    --rf-heading: #0f172a;
}

/* ── Footer Container Principal ── */
.marketplace-footer {
    background: var(--rf-bg);
    border-top: 1px solid var(--rf-border);
    margin-top: 70px;
    padding: 65px 0 35px;
    color: var(--rf-text);
    font-family: 'Outfit', 'Poppins', -apple-system, sans-serif;
    position: relative;
    z-index: 20;
    box-sizing: border-box;
}

.marketplace-footer *,
.marketplace-footer *::before,
.marketplace-footer *::after {
    box-sizing: border-box;
}

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

/* ── Grid Multicolumna ── */
.footer-grid {
    display: grid;
    grid-template-columns: 1.3fr 0.9fr 0.9fr 1.2fr;
    gap: 36px;
    margin-bottom: 45px;
}

/* ── Columna 1: Marca y Propuesta ── */
.footer-logo {
    font-size: 1.85rem;
    font-weight: 900;
    letter-spacing: -0.03em;
    margin-bottom: 14px;
    display: inline-block;
    text-decoration: none;
    cursor: pointer;
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.2s ease, filter 0.25s ease;
}

.footer-logo:hover {
    text-decoration: none;
    opacity: 0.95;
    transform: translateY(-2px);
    filter: drop-shadow(0 4px 14px rgba(245, 158, 11, 0.35));
}

.footer-logo:focus-visible {
    outline: 2px solid var(--rf-gold);
    outline-offset: 4px;
    border-radius: 6px;
}

.footer-logo .logo-click {
    color: #ffffff;
}

.footer-logo .logo-menu {
    color: var(--rf-gold);
}

.footer-tagline {
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--rf-text);
    margin: 0 0 18px;
    max-width: 380px;
}

.footer-location-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 0.82rem;
    font-weight: 600;
    color: #cbd5e1;
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 7px 16px;
    border-radius: 20px;
}

/* ── Columnas de Enlaces (Restaurantes & Legal) ── */
.footer-col-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--rf-heading);
    margin: 0 0 18px;
    letter-spacing: -0.01em;
}

.footer-links {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.footer-links a {
    color: var(--rf-text);
    text-decoration: none;
    font-size: 0.92rem;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    gap: 9px;
    transition: var(--rf-transition);
}

.footer-links a i {
    font-size: 0.82rem;
    color: var(--rf-gold);
    transition: transform 0.2s ease;
    width: 14px;
    text-align: center;
}

.footer-links a:hover {
    color: var(--rf-gold);
    transform: translateX(4px);
}

.footer-links a:hover i {
    transform: scale(1.2);
}

/* ── Columna 4: Descarga la App & PWA ── */
.footer-col-app {
    display: flex;
    flex-direction: column;
}

.footer-app-desc {
    font-size: 0.88rem;
    line-height: 1.55;
    color: var(--rf-text);
    margin: 0 0 15px;
}

/* Botón Principal PWA */
.footer-pwa-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 14px;
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.12) 0%, rgba(245, 158, 11, 0.04) 100%);
    border: 1px solid rgba(245, 158, 11, 0.35);
    border-radius: 14px;
    color: #ffffff;
    cursor: pointer;
    text-align: left;
    width: 100%;
    transition: var(--rf-transition);
    box-shadow: 0 4px 16px -4px rgba(245, 158, 11, 0.15);
    position: relative;
    overflow: hidden;
    font-family: inherit;
}

.footer-pwa-btn:hover {
    background: linear-gradient(135deg, rgba(245, 158, 11, 0.22) 0%, rgba(245, 158, 11, 0.08) 100%);
    border-color: var(--rf-gold);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px -4px rgba(245, 158, 11, 0.3);
}

.footer-pwa-btn:active {
    transform: translateY(0) scale(0.98);
}

.footer-pwa-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background: rgba(245, 158, 11, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--rf-gold);
    font-size: 1.2rem;
    flex-shrink: 0;
}

.footer-pwa-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
    flex: 1;
}

.footer-pwa-sub {
    font-size: 0.62rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: var(--rf-gold);
    text-transform: uppercase;
}

.footer-pwa-title {
    font-size: 0.94rem;
    font-weight: 700;
    color: #ffffff;
    line-height: 1.2;
}

.footer-pwa-badge {
    background: #10b981;
    color: #ffffff;
    font-size: 0.66rem;
    font-weight: 800;
    padding: 3px 8px;
    border-radius: 6px;
    letter-spacing: 0.04em;
    box-shadow: 0 0 10px rgba(16, 185, 129, 0.35);
    flex-shrink: 0;
}

/* Badges de Tiendas (Google Play & App Store) */
.footer-app-stores {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.app-store-badge {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 8px 12px;
    border-radius: 12px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    color: #ffffff;
    cursor: pointer;
    transition: var(--rf-transition);
    user-select: none;
    width: 100%;
}

.app-store-badge:hover {
    background: rgba(255, 255, 255, 0.07);
    border-color: rgba(255, 255, 255, 0.16);
    transform: translateY(-1px);
}

.app-store-badge:active {
    transform: scale(0.98);
}

.store-icon-play {
    font-size: 1.2rem;
    color: #38bdf8;
    flex-shrink: 0;
}

.store-icon-apple {
    font-size: 1.35rem;
    color: #ffffff;
    flex-shrink: 0;
}

.app-store-text {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

.app-store-sub {
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    color: var(--rf-text);
    text-transform: uppercase;
    line-height: 1;
}

.app-store-name {
    font-size: 0.86rem;
    font-weight: 800;
    color: #ffffff;
    line-height: 1.2;
}

.store-coming-pill {
    margin-left: auto;
    font-size: 0.65rem;
    font-weight: 700;
    color: var(--rf-gold);
    background: rgba(245, 158, 11, 0.1);
    border: 1px solid rgba(245, 158, 11, 0.25);
    padding: 3px 9px;
    border-radius: 12px;
    letter-spacing: 0.02em;
    flex-shrink: 0;
    white-space: nowrap;
}

/* ── Barra Inferior: Derechos y Firma ── */
.footer-bottom-bar {
    border-top: 1px solid var(--rf-border);
    padding-top: 24px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    gap: 8px;
    font-size: 0.88rem;
    color: var(--rf-text);
}

.footer-copyright {
    color: var(--rf-text);
    font-size: 0.88rem;
}

.footer-developer {
    font-size: 0.84rem;
    color: rgba(255, 255, 255, 0.65);
}

.footer-dev-link {
    color: var(--rf-gold);
    text-decoration: none;
    font-weight: 700;
    transition: opacity 0.2s ease, text-decoration 0.2s ease;
}

.footer-dev-link:hover {
    text-decoration: underline;
    opacity: 0.85;
}

/* ── Modal Guía PWA (iOS / Escritorio) ── */
#pwa-guide-modal.modal-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.82);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    padding: 20px;
}

#pwa-guide-modal.modal-backdrop.active {
    opacity: 1;
    visibility: visible;
}

.pwa-guide-card {
    background: #111520;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 20px;
    width: 100%;
    max-width: 440px;
    box-shadow: 0 24px 50px rgba(0, 0, 0, 0.6), 0 0 24px rgba(245, 158, 11, 0.15);
    overflow: hidden;
    transform: translateY(20px) scale(0.96);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

#pwa-guide-modal.modal-backdrop.active .pwa-guide-card {
    transform: translateY(0) scale(1);
}

.pwa-guide-card .modal-header {
    padding: 18px 22px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.pwa-guide-card .modal-title {
    font-size: 1.15rem;
    font-weight: 700;
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 9px;
}

.pwa-guide-card .modal-close-btn {
    background: none;
    border: none;
    color: var(--rf-text);
    font-size: 1.25rem;
    cursor: pointer;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.pwa-guide-card .modal-close-btn:hover {
    color: #ffffff;
    background: rgba(255, 255, 255, 0.08);
}

.pwa-guide-body {
    padding: 20px 22px 24px;
}

.pwa-guide-intro {
    font-size: 0.9rem;
    line-height: 1.55;
    color: var(--rf-text);
    margin: 0 0 16px;
}

.pwa-step-card {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid rgba(255, 255, 255, 0.07);
    border-radius: 14px;
    padding: 14px;
    margin-bottom: 12px;
}

.pwa-step-num {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--rf-gold);
    color: #0b0f19;
    font-weight: 900;
    font-size: 0.85rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.pwa-step-text {
    flex: 1;
}

.pwa-step-text strong {
    display: block;
    font-size: 0.94rem;
    color: #ffffff;
    margin-bottom: 4px;
}

.pwa-step-text p {
    font-size: 0.85rem;
    color: var(--rf-text);
    line-height: 1.45;
    margin: 0;
}

.pwa-guide-btn-confirm {
    width: 100%;
    padding: 13px;
    border-radius: 12px;
    background: var(--rf-gold);
    color: #0b0f19;
    font-weight: 800;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    margin-top: 8px;
    transition: transform 0.2s ease, opacity 0.2s ease;
    font-family: inherit;
}

.pwa-guide-btn-confirm:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}

/* ── Toast de Feedback Flotante (Nivel AAA) ── */
.restaurant-pwa-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(30px);
    background: rgba(15, 23, 42, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(245, 158, 11, 0.45);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.6), 0 0 20px rgba(245, 158, 11, 0.25);
    color: #ffffff;
    padding: 12px 22px;
    border-radius: 30px;
    font-size: 0.88rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 10px;
    z-index: 100010;
    opacity: 0;
    pointer-events: none;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 90vw;
    text-align: center;
}

.restaurant-pwa-toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
    pointer-events: auto;
}

/* ── Responsividad del Footer (Tablets y Móviles) ── */
@media (max-width: 1024px) {
    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 36px;
    }
}

@media (max-width: 640px) {
    .marketplace-footer {
        padding: 50px 0 28px;
        margin-top: 45px;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 32px;
        text-align: center;
    }

    .footer-col-brand {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    .footer-tagline {
        margin-left: auto;
        margin-right: auto;
    }

    .footer-location-badge {
        margin: 0 auto;
    }

    .footer-links {
        align-items: center;
    }

    .footer-col-app {
        align-items: center;
    }

    .footer-app-desc {
        max-width: 320px;
        margin-left: auto;
        margin-right: auto;
    }

    .footer-pwa-btn,
    .footer-app-stores {
        width: 100%;
        max-width: 320px;
        margin-left: auto;
        margin-right: auto;
    }
    
    .footer-bottom-bar {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 8px;
    }
}
