/* ==========================================================================
   Estilos CSS Premium - Portal de Códigos Promocionales LATAM
   Diseño: Ultra-moderno (Dark Mode, Glassmorphism, Neon Glows)
   Rendimiento: Peso pluma, sin dependencias externas
   ========================================================================== */

/* Variables de Diseño */
:root {
    --bg-color: #050508;
    --bg-gradient: radial-gradient(circle at 50% 0%, #151329 0%, #050508 70%);
    --card-bg: rgba(18, 17, 28, 0.75);
    --card-border: rgba(255, 255, 255, 0.07);
    --card-border-hover: rgba(0, 242, 254, 0.3);
    --surface-elevated: rgba(255, 255, 255, 0.04);
    --surface-muted: rgba(255, 255, 255, 0.02);
    --panel-shadow: 0 16px 48px rgba(0, 0, 0, 0.22);
    --header-bg: rgba(5, 5, 8, 0.7);
    --footer-bg: rgba(5, 5, 8, 0.9);

    /* Paleta Neon & Premium */
    --primary: #00f2fe;
    --primary-rgb: 0, 242, 254;
    --secondary: #9b51e0;
    --secondary-rgb: 155, 81, 224;
    --text-main: #f6f8ff;
    --text-muted: #c6cce0;
    --text-dark: #94a0bb;
    --text-strong: #ffffff;
    --icon-tint: #00f2fe;

    /* Fuentes optimizadas del sistema (Cero descargas de red, render inmediato) */
    --font-stack:
        system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
        "Helvetica Neue", Arial, sans-serif;

    /* Transiciones y Sombras */
    --transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    --glow-shadow: 0 8px 32px 0 rgba(0, 242, 254, 0.15);
    --glass-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.37);
}

[data-theme="light"] {
    --bg-color: #f5f7fb;
    --bg-gradient: radial-gradient(circle at 50% 0%, #ffffff 0%, #eef3ff 68%);
    --card-bg: rgba(255, 255, 255, 0.84);
    --card-border: rgba(20, 24, 39, 0.08);
    --card-border-hover: rgba(0, 136, 204, 0.22);
    --surface-elevated: rgba(18, 24, 39, 0.04);
    --surface-muted: rgba(18, 24, 39, 0.02);
    --panel-shadow: 0 18px 42px rgba(17, 24, 39, 0.08);
    --header-bg: rgba(255, 255, 255, 0.78);
    --footer-bg: rgba(255, 255, 255, 0.88);
    --text-main: #111827;
    --text-muted: #4b5563;
    --text-dark: #64748b;
    --text-strong: #0f172a;
    --icon-tint: #0ea5e9;
    --glow-shadow: 0 12px 36px rgba(14, 165, 233, 0.12);
    --glass-shadow: 0 8px 32px rgba(15, 23, 42, 0.1);
}

/* Reset y Estilos Base */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    font-family: var(--font-stack);
    scroll-behavior: smooth;
    color-collapse: separate;
    background-color: var(--bg-color);
    -webkit-text-size-adjust: 100%;
}

body {
    background: var(--bg-gradient);
    color: var(--text-main);
    min-height: 100vh;
    line-height: 1.6;
    overflow-x: hidden;
    position: relative;
}

/* Globos de gradiente de fondo (SaaS Look) */
body::before {
    content: "";
    position: absolute;
    top: -10%;
    left: 20%;
    width: 50vw;
    height: 50vw;
    background: radial-gradient(
        circle,
        rgba(0, 242, 254, 0.08) 0%,
        rgba(155, 81, 224, 0.05) 50%,
        rgba(0, 0, 0, 0) 100%
    );
    z-index: -1;
    pointer-events: none;
}

body::after {
    content: "";
    position: absolute;
    bottom: 10%;
    right: -10%;
    width: 40vw;
    height: 40vw;
    background: radial-gradient(
        circle,
        rgba(155, 81, 224, 0.06) 0%,
        rgba(0, 242, 254, 0.03) 60%,
        rgba(0, 0, 0, 0) 100%
    );
    z-index: -1;
    pointer-events: none;
}

/* Contenedor Principal */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

/* Encabezado / Barra de Navegación */
header {
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--header-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    transition: var(--transition);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 70px;
}

.nav-shell {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.logo {
    font-size: 1.3rem;
    font-weight: 800;
    text-decoration: none;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: linear-gradient(
        135deg,
        var(--primary) 0%,
        var(--secondary) 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    letter-spacing: -0.5px;
}

.logo-icon {
    width: 24px;
    height: 24px;
    fill: var(--primary);
}

.theme-toggle,
.menu-toggle {
    width: 46px;
    height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: var(--text-main);
    cursor: pointer;
    transition: var(--transition);
}

.menu-toggle {
    border: 1px solid rgba(255, 255, 255, 0.08);
    background: rgba(255, 255, 255, 0.03);
}

.theme-toggle {
    border: none;
    background: none;
    color: var(--text-main);
}

.theme-toggle:hover,
.menu-toggle:hover {
    border-color: rgba(0, 242, 254, 0.3);
    color: var(--primary);
    transform: translateY(-1px);
}

.menu-toggle:focus-visible,
.site-nav a:focus-visible,
.btn-telegram:focus-visible,
.back-link:focus-visible,
.brand-card:focus-visible {
    outline: 2px solid rgba(0, 242, 254, 0.9);
    outline-offset: 3px;
}

.menu-toggle svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.site-nav {
    position: absolute;
    right: 0;
    top: calc(100% + 12px);
    width: min(92vw, 320px);
    padding: 0.65rem;
    border: 1px solid var(--card-border);
    border-radius: 18px;
    background: var(--card-bg);
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    display: grid;
    gap: 0.35rem;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-8px);
    transition: var(--transition);
    z-index: 110;
}

.site-nav.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.site-nav a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0.45rem 0.75rem;
    border-radius: 12px;
    color: var(--text-main);
    text-decoration: none;
    font-size: 0.95rem;
    font-weight: 600;
    transition: var(--transition);
}

.site-nav a:hover {
    background: rgba(255, 255, 255, 0.04);
    color: var(--primary);
}

.site-nav a[aria-current="page"] {
    background: rgba(0, 242, 254, 0.08);
    color: var(--primary);
}

/* Hero Section */
.hero {
    text-align: center;
    padding: 5rem 1rem 3rem 1rem;
    position: relative;
}

.hero h1 {
    font-size: 3rem;
    font-weight: 800;
    line-height: 1.15;
    margin-bottom: 1.5rem;
    letter-spacing: -1px;
}

.hero h1 span {
    background: linear-gradient(
        135deg,
        var(--primary) 0%,
        #00b8ff 50%,
        var(--secondary) 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.hero-subtitle {
    font-size: 1.15rem;
    color: var(--text-muted);
    max-width: 650px;
    margin: 0 auto 2.5rem auto;
    font-weight: 400;
}

.hero-kicker {
    max-width: 780px;
    margin: 0 auto 1.25rem auto;
    color: var(--text-muted);
    text-align: center;
    font-size: 0.98rem;
}

.query-list {
    display: grid;
    gap: 1rem;
    margin-top: 2rem;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.query-card {
    display: block;
    padding: 1.1rem 1.15rem;
    border-radius: 16px;
    text-decoration: none;
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--card-border);
    transition: var(--transition);
}

.query-card:hover {
    transform: translateY(-3px);
    border-color: rgba(0, 242, 254, 0.25);
    box-shadow: var(--glow-shadow);
}

.query-card h2,
.query-card h3 {
    font-size: 1.05rem;
    margin-bottom: 0.4rem;
    letter-spacing: -0.2px;
}

.query-card p {
    color: var(--text-muted);
    font-size: 0.92rem;
    line-height: 1.55;
}

.hero-subtitle,
.hero-kicker,
.detail-description p,
.seo-section p,
.query-card p,
.quote-text,
.quote-author,
.footer-text {
    position: relative;
    background: linear-gradient(
        180deg,
        var(--surface-elevated),
        var(--surface-muted)
    );
    border: 1px solid var(--card-border);
    border-radius: 18px;
    box-shadow: var(--panel-shadow);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
}

.hero-subtitle,
.hero-kicker,
.detail-description p,
.seo-section p,
.query-card p,
.quote-text,
.quote-author,
.footer-text {
    padding: 1rem 1rem 1rem 3.15rem;
}

.hero-subtitle::before,
.hero-kicker::before,
.detail-description p::before,
.seo-section p::before,
.query-card p::before,
.quote-text::before,
.quote-author::before,
.footer-text::before {
    content: "";
    position: absolute;
    left: 1rem;
    top: 1rem;
    width: 16px;
    height: 16px;
    background-color: var(--icon-tint);
    -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l2.9 6.2L21 11l-6.1 2.8L12 20l-2.9-6.2L3 11l6.1-2.8L12 2z'/%3E%3C/svg%3E")
        center / contain no-repeat;
    mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 2l2.9 6.2L21 11l-6.1 2.8L12 20l-2.9-6.2L3 11l6.1-2.8L12 2z'/%3E%3C/svg%3E")
        center / contain no-repeat;
}

.detail-description p,
.seo-section p,
.query-card p,
.quote-text,
.quote-author {
    margin-bottom: 1rem;
}

.hero-subtitle,
.hero-kicker {
    text-align: left;
    max-width: 780px;
}

.quote-text {
    font-style: italic;
    color: var(--text-main);
}

.quote-author {
    color: var(--text-dark);
}

.footer-text {
    max-width: 620px;
    line-height: 1.6;
    text-align: left;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 242, 254, 0.07);
    border: 1px solid rgba(0, 242, 254, 0.2);
    color: var(--primary);
    padding: 0.4rem 0.8rem;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 1.5rem;
}

/* Grid de Marcas */
.brand-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 1.5rem;
    padding: 2rem 0 5rem 0;
}

.brand-card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 2rem;
    text-decoration: none;
    color: var(--text-main);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

/* Bordes degradados sutiles al hover */
.brand-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--primary), var(--secondary));
    opacity: 0.3;
    transition: var(--transition);
}

.brand-card:hover {
    transform: translateY(-5px);
    border-color: var(--card-border-hover);
    box-shadow: var(--glow-shadow);
}

.brand-card:hover::before {
    opacity: 1;
}

.brand-card-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 1rem;
}

.brand-logo-container {
    width: 50px;
    height: 50px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
}

.brand-icon {
    width: 28px;
    height: 28px;
    fill: #fff;
}

/* Colores de iconos específicos de marcas */
.icon-mercadolibre {
    fill: #ffe600;
}
.icon-rappi {
    fill: #ff441f;
}
.icon-pedidosya {
    fill: #e5004f;
}
.icon-uber {
    fill: #ffffff;
}
.icon-didi {
    fill: #ff7020;
}
.icon-cabify {
    fill: #8258fc;
}
.icon-shein {
    fill: #ffffff;
}
.icon-aliexpress {
    fill: #ff4747;
}
.icon-airbnb {
    fill: #ff5a5f;
}
.icon-spotify {
    fill: #1db954;
}

.discount-tag {
    background: linear-gradient(
        135deg,
        rgba(0, 242, 254, 0.15) 0%,
        rgba(155, 81, 224, 0.15) 100%
    );
    border: 1px solid rgba(0, 242, 254, 0.2);
    color: #fff;
    padding: 0.3rem 0.6rem;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
}

.brand-card-content h2 {
    font-size: 1.4rem;
    font-weight: 700;
    margin-bottom: 0.5rem;
    letter-spacing: -0.3px;
}

.brand-card-content p {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.brand-card-footer {
    display: flex;
    align-items: center;
    color: var(--primary);
    font-size: 0.85rem;
    font-weight: 700;
    gap: 0.3rem;
}

.brand-card-footer svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
    transition: var(--transition);
}

.brand-card:hover .brand-card-footer svg {
    transform: translateX(4px);
}

/* ==========================================================================
   Estilos para las Páginas de Detalle (Lando)
   ========================================================================== */

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    margin-top: 2rem;
    transition: var(--transition);
}

.back-link:hover {
    color: var(--primary);
}

.back-link svg {
    width: 16px;
    height: 16px;
    fill: currentColor;
}

.detail-layout {
    display: grid;
    grid-template-columns: 1fr 380px;
    gap: 2.5rem;
    padding: 2rem 0 5rem 0;
}

@media (max-width: 850px) {
    .detail-layout {
        grid-template-columns: 1fr;
    }

    .detail-layout .sidebar {
        order: -1;
    }
}

/* Contenido Principal de Detalle */
.detail-content {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.detail-header {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.detail-header .brand-logo-container {
    width: 70px;
    height: 70px;
    border-radius: 16px;
}

.detail-header .brand-icon {
    width: 40px;
    height: 40px;
}

.detail-header h1 {
    font-size: 2.2rem;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.detail-description {
    font-size: 1.05rem;
    color: var(--text-muted);
    line-height: 1.7;
}

.detail-description p {
    margin-bottom: 1.2rem;
}

/* Secciones SEO expandidas (H2 + Texto) */
.seo-section {
    border-top: 1px solid var(--card-border);
    padding-top: 1.8rem;
}

.seo-section h2 {
    font-size: 1.4rem;
    font-weight: 700;
    letter-spacing: -0.3px;
    margin-bottom: 0.9rem;
    background: linear-gradient(
        135deg,
        var(--text-main) 0%,
        var(--text-muted) 100%
    );
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.seo-section p {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.75;
    margin-bottom: 1rem;
}

/* Sección de Citas / Opiniones (Humanizer elements) */
.quotes-section {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: 16px;
    padding: 2rem;
    box-shadow: var(--glass-shadow);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.quotes-section h3 {
    font-size: 1.25rem;
    font-weight: 700;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.quotes-section h3 svg {
    width: 20px;
    height: 20px;
    fill: var(--primary);
}

.quote-card {
    border-left: 3px solid var(--primary);
    background: rgba(255, 255, 255, 0.02);
    padding: 1rem 1.2rem;
    border-radius: 0 8px 8px 0;
    margin-bottom: 1.2rem;
}

.quote-card:last-child {
    margin-bottom: 0;
}

.quote-text {
    font-size: 0.95rem;
    font-style: italic;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.quote-author {
    font-size: 0.8rem;
    color: var(--text-dark);
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

/* Sidebar / Caja de Cupón */
.sidebar {
    position: sticky;
    top: 90px;
    height: fit-content;
}

.coupon-box {
    background: linear-gradient(
        145deg,
        rgba(20, 18, 38, 0.8) 0%,
        rgba(10, 9, 20, 0.8) 100%
    );
    border: 1px solid rgba(0, 242, 254, 0.15);
    border-radius: 20px;
    padding: 2.5rem 2rem;
    text-align: center;
    box-shadow: var(--glow-shadow);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    position: relative;
    overflow: hidden;
}

.coupon-box::before {
    content: "";
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(
        circle,
        rgba(0, 242, 254, 0.05) 0%,
        transparent 60%
    );
    pointer-events: none;
}

.coupon-title {
    font-size: 1.1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--primary);
    margin-bottom: 0.5rem;
}

.coupon-value {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    background: linear-gradient(90deg, #fff 0%, var(--text-muted) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.btn-telegram {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
    width: 100%;
    padding: 1.1rem 1.5rem;
    background: linear-gradient(135deg, #0088cc 0%, #00a2ed 100%);
    border: none;
    border-radius: 12px;
    color: #fff;
    font-size: 1.05rem;
    font-weight: 700;
    text-decoration: none;
    box-shadow: 0 4px 20px rgba(0, 136, 204, 0.4);
    transition: var(--transition);
    cursor: pointer;
    position: relative;
    z-index: 1;
}

.btn-telegram:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 136, 204, 0.6);
    filter: brightness(1.1);
}

.btn-telegram svg {
    width: 22px;
    height: 22px;
    fill: #fff;
}

.coupon-info {
    margin-top: 1.5rem;
    font-size: 0.8rem;
    color: var(--text-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}

.coupon-info svg {
    width: 14px;
    height: 14px;
    fill: currentColor;
}

/* Footer Global */
footer {
    margin-top: 5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    background: var(--footer-bg);
    padding: 3rem 0;
    text-align: center;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
}

.footer-logo {
    margin-bottom: 0.5rem;
}

.footer-text {
    padding-top: 1rem;
    padding-bottom: 1rem;
}

.footer-copyright {
    color: var(--text-dark);
    margin-top: 1rem;
}

[data-theme="light"] .brand-icon {
    fill: #111827;
}

[data-theme="light"] .icon-shein,
[data-theme="light"] .icon-uber,
[data-theme="light"] .icon-airbnb,
[data-theme="light"] .icon-spotify {
    fill: #111827;
}

[data-theme="light"] .brand-card-content p,
[data-theme="light"] .detail-description p,
[data-theme="light"] .seo-section p,
[data-theme="light"] .quote-text,
[data-theme="light"] .quote-author,
[data-theme="light"] .hero-subtitle,
[data-theme="light"] .hero-kicker,
[data-theme="light"] .footer-text {
    color: var(--text-main);
}

/* Responsive adjustments */
@media (max-width: 600px) {
    .hero h1 {
        font-size: 2.2rem;
    }
    .nav-container {
        height: 64px;
    }
    .brand-grid {
        grid-template-columns: 1fr;
    }
    .detail-header h1 {
        font-size: 1.7rem;
    }
    .coupon-box {
        padding: 2rem 1.5rem;
    }
    .site-nav {
        width: min(92vw, 280px);
    }
    .hero-subtitle,
    .hero-kicker,
    .detail-description p,
    .seo-section p,
    .query-card p,
    .quote-text,
    .quote-author,
    .footer-text {
        padding-left: 2.8rem;
    }
}

@media (min-width: 901px) {
    .site-nav {
        width: 360px;
    }
}

@media (prefers-reduced-motion: reduce) {
    html {
        scroll-behavior: auto;
    }

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}
