/* Variables corporativas — Rifas Morelia */
:root {
    --primary: #CC0000;
    --primary-dark: #990000;
    --secondary: #121212;
    --surface-dark: #121212;
    --text-on-dark: #f5f5f5;
    --text-muted-on-dark: #c8c8c8;
    --dark: #1a1a1a;
    --light: #ffffff;
    --gray: #f4f4f4;
    --gradient: linear-gradient(135deg, #CC0000 0%, #7a0000 100%);
}

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

body {
    font-family: 'Poppins', sans-serif;
    background: var(--gray);
    color: var(--dark);
    line-height: 1.6;
}

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

/* Header */
.header {
    background: var(--surface-dark);
    box-shadow: 0 2px 12px rgba(0,0,0,0.35);
    border-bottom: 1px solid #2a2a2a;
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem 0;
}

/* Navegación rifas: 3 enlaces + menú (métodos / privacidad) */
.navbar-rifas-nav {
    position: relative;
    flex-wrap: wrap;
    gap: 0.5rem 0;
}

.nav-toggle {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 44px;
    height: 44px;
    margin-left: auto;
    padding: 10px;
    border: none;
    border-radius: 10px;
    background: #2a2a2a;
    cursor: pointer;
    flex-shrink: 0;
}
.nav-toggle span {
    display: block;
    width: 22px;
    height: 3px;
    background: var(--text-on-dark);
    border-radius: 2px;
    transition: transform 0.2s, opacity 0.2s;
}
.nav-toggle:hover {
    background: #3a3a3a;
}

.nav-links-main {
    flex: 1;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 1rem 1.25rem;
}

.nav-drawer {
    display: none;
    position: absolute;
    top: calc(100% - 6px);
    right: 0;
    left: auto;
    min-width: 220px;
    background: #1e1e1e;
    border-radius: 12px;
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
    border: 1px solid #333;
    padding: 8px 0;
    z-index: 1005;
}
.nav-drawer.is-open {
    display: block;
}
.nav-drawer a {
    display: block;
    padding: 12px 18px;
    color: var(--text-on-dark);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
}
.nav-drawer a:hover,
.nav-drawer a.active {
    background: #2a2a2a;
    color: #ffffff;
}

@media (max-width: 640px) {
    .nav-links-main {
        order: 3;
        width: 100%;
        justify-content: flex-start;
        gap: 0.65rem 1rem;
        font-size: 0.88rem;
    }
    .nav-toggle {
        order: 2;
        margin-left: auto;
    }
    .navbar-rifas-nav .logo {
        order: 1;
    }
}

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

.logo-img {
    height: 40px;
    width: auto;
}

.logo-text {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-on-dark);
    letter-spacing: -1px;
}

.nav-links {
    display: flex;
    gap: 2rem;
    list-style: none;
}

.nav-links a {
    text-decoration: none;
    color: var(--text-muted-on-dark);
    font-weight: 500;
    transition: color 0.3s;
}

.nav-links a:hover,
.nav-links a.active {
    color: #ffffff;
}

/* Enlace logo en barra superior (compacto, nítido) */
.logo-link {
    display: flex;
    align-items: center;
    text-decoration: none;
    color: inherit;
    line-height: 0;
}
.logo-link.logo-link-with-text {
    line-height: 1.15;
    gap: clamp(8px, 2vw, 14px);
}
.logo-site-name {
    font-size: clamp(1.05rem, 2.6vw, 1.85rem);
    font-weight: 800;
    color: var(--text-on-dark);
    letter-spacing: -0.02em;
    line-height: 1.1;
}
@media (max-width: 380px) {
    .logo-site-name {
        font-size: 1rem;
        max-width: 38vw;
    }
}
.logo-img-nav {
    height: auto;
    width: auto;
    max-height: 52px;
    max-width: min(220px, 46vw);
    object-fit: contain;
    object-position: left center;
}
@media (max-width: 640px) {
    .logo-img-nav {
        max-height: 42px;
        max-width: 44vw;
    }
}

/* Franja principal: logo grande y optimizado (responsive, sin recorte) */
.logo-hero-strip {
    background: linear-gradient(180deg, #0a0a0a 0%, #121212 45%, #161616 100%);
    padding: clamp(1.5rem, 5vw, 3rem) 1rem;
    text-align: center;
    border-bottom: 1px solid #2a2a2a;
}
.logo-hero-strip-inner {
    max-width: 960px;
    margin: 0 auto;
}
.logo-hero-img {
    display: block;
    width: min(94vw, 820px);
    max-width: 100%;
    height: auto;
    max-height: min(300px, 36vh);
    margin: 0 auto;
    object-fit: contain;
    object-position: center;
    filter: drop-shadow(0 12px 32px rgba(0, 0, 0, 0.45));
}
@media (max-width: 480px) {
    .logo-hero-img {
        max-height: min(200px, 32vh);
    }
}

/* Hero */
.hero-wrapper {
    background: var(--surface-dark);
    padding-bottom: 2.5rem;
    clip-path: polygon(0 0, 100% 0, 100% 85%, 0 100%);
    margin-bottom: 2rem;
}

.hero-diagonal {
    background: var(--gradient);
    padding: 6rem 2rem 9rem 2rem;
    clip-path: polygon(0 0, 100% 0, 100% 82%, 0 100%);
}

.hero-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 3rem;
}

.hero-text {
    flex: 1.2;
    text-align: left;
    color: white;
}

.hero-text h1 {
    font-size: 4.5rem;
    font-weight: 800;
    text-transform: uppercase;
    line-height: 1.05;
    margin-bottom: 1.5rem;
    text-shadow: 4px 4px 0px rgba(0,0,0,0.2); 
    letter-spacing: -2px;
}

.hero-text p {
    font-size: 1.3rem;
    margin-bottom: 2.5rem;
    font-weight: 500;
    opacity: 0.95;
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
    position: relative;
}

.hero-image img {
    max-width: 120%;
    transform: rotate(8deg) scale(1.1) translateY(20px);
    filter: drop-shadow(15px 25px 20px rgba(0,0,0,0.4)); 
    transition: transform 0.5s ease;
}

.hero-image img:hover {
    transform: rotate(5deg) scale(1.15) translateY(0);
}

/* Promociones */
.promo-section {
    text-align: center;
    padding: 1rem 20px 3rem 20px;
}

.promo-section h2 {
    font-weight: 800;
    font-size: 2.5rem;
    color: var(--dark);
    text-transform: uppercase;
    letter-spacing: -1px;
}

.promo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-top: 2.5rem;
}

.promo-card {
    padding: 2.5rem 1.5rem;
    border-radius: 20px;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    transition: transform 0.3s;
}

.promo-card:hover {
    transform: translateY(-10px);
}

.promo-card h3 {
    font-weight: 800;
    font-size: 1.5rem;
    text-transform: uppercase;
    margin-bottom: 10px;
}

.promo-card p {
    font-weight: 500;
    font-size: 0.95rem;
    opacity: 0.9;
}

.btn-promo {
    margin-top: 1.5rem;
    padding: 12px 25px;
    background: var(--dark);
    color: white;
    text-decoration: none;
    border-radius: 50px;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.9rem;
    transition: transform 0.2s, box-shadow 0.2s;
}

.btn-promo:hover {
    transform: scale(1.05);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

/* Botón Principal */
.btn-primary {
    background: var(--gradient);
    color: white;
    padding: 12px 28px;
    border: none;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 600;
    transition: transform 0.3s, box-shadow 0.3s;
    display: inline-block;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
    text-transform: uppercase;
    letter-spacing: 1px;
    font-size: 0.9rem;
    cursor: pointer;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 20px rgba(204, 0, 0, 0.35);
    color: white;
}

/* Rifas Grid */
.rifas-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin: 3rem 0;
}

.rifa-card {
    background: white;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
    transition: transform 0.3s, box-shadow 0.3s;
    border: 1px solid #eaeaea;
}

.rifa-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 35px rgba(0,0,0,0.1);
}

.rifa-image {
    height: 220px;
    background-size: cover;
    background-position: center;
    position: relative;
}

.rifa-tag {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(0,0,0,0.75);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
}

.rifa-content {
    padding: 1.5rem;
}

.rifa-title {
    font-size: 1.3rem;
    margin-bottom: 0.5rem;
    font-weight: 700;
}

.rifa-price {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary);
    margin: 1rem 0;
}

.progress-bar {
    background: #e9ecef;
    border-radius: 10px;
    height: 10px;
    overflow: hidden;
    margin: 1rem 0;
}

.progress-fill {
    background: var(--gradient);
    height: 100%;
    width: 0%;
    transition: width 0.5s ease;
}

.btn-comprar {
    background: var(--primary);
    color: white;
    border: none;
    padding: 12px;
    width: 100%;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.3s;
    margin-top: 1rem;
    font-size: 1rem;
}

.btn-comprar:hover {
    background: var(--primary-dark);
}

.btn-maquina {
    background: white;
    color: var(--primary);
    border: 2px solid var(--primary);
    padding: 10px;
    width: 100%;
    border-radius: 50px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    margin-top: 0.8rem;
    font-size: 0.95rem;
}

.btn-maquina:hover {
    background: var(--primary);
    color: white;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.6);
    backdrop-filter: blur(5px);
    z-index: 1000;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background: white;
    border-radius: 20px;
    max-width: 95%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 2.5rem;
    position: relative;
    width: 700px;
    box-shadow: 0 20px 50px rgba(0,0,0,0.2);
}

.close {
    position: absolute;
    right: 1.5rem;
    top: 1.5rem;
    font-size: 1.8rem;
    cursor: pointer;
    color: #999;
    transition: color 0.3s;
    line-height: 1;
}

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

.numeros-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 10px;
    margin: 1rem 0;
    max-height: 300px;
    overflow-y: auto;
    padding: 15px;
    background: var(--gray);
    border-radius: 15px;
}

.numero-item {
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 0.8rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 600;
    color: var(--dark);
}

.numero-item.selected {
    background: var(--gradient);
    color: white;
    border: none;
    box-shadow: 0 4px 10px rgba(204, 0, 0, 0.35);
}

.numero-item.vendido {
    background: #e9ecef;
    color: #adb5bd;
    cursor: not-allowed;
    text-decoration: line-through;
    border-color: transparent;
}

.resumen {
    background: var(--gray);
    padding: 1.5rem;
    border-radius: 15px;
    margin: 1.5rem 0;
    border-left: 4px solid var(--primary);
}

.form-group {
    margin-bottom: 1.2rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-family: inherit;
    background: #f9f9f9;
}

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

.form-label-inline {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: #555;
    margin-bottom: 6px;
}

.form-apartar-compact .form-group {
    margin-bottom: 0.95rem;
}

/* Chatbot Override */
#close-chatbot:hover {
    transform: scale(1.2);
}
.chatbot-mensaje::-webkit-scrollbar {
    width: 6px;
}
.chatbot-mensaje::-webkit-scrollbar-thumb {
    background-color: var(--primary);
    border-radius: 10px;
}

/* Footer */
.footer {
    background: var(--surface-dark);
    color: var(--text-muted-on-dark);
    text-align: center;
    padding: 2rem 0;
    margin-top: 4rem;
    border-top: 1px solid #2a2a2a;
}

.site-footer-brand-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.site-footer-brand-logo {
    height: 40px;
    width: auto;
    object-fit: contain;
    opacity: 0.95;
}

.site-footer-brand-logo-rm {
    height: auto;
    max-height: 72px;
    width: auto;
    max-width: min(300px, 88vw);
    object-fit: contain;
}

.site-footer-brand-text {
    color: var(--text-on-dark);
    font-size: 1rem;
    font-weight: 600;
    margin: 0;
    letter-spacing: 0.02em;
}

.site-footer-brand-text a {
    color: var(--text-on-dark);
    text-decoration: none;
}

.site-footer-brand-text a:hover {
    text-decoration: underline;
    color: #ffffff;
}

.site-footer-brand-text a:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
    border-radius: 2px;
}

.site-footer-copy {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-muted-on-dark);
}

/* —— Grid virtual (apartado manual) —— */
.numeros-grid-virtual-host {
    max-height: 320px;
    overflow-y: auto;
    padding: 15px;
    background: var(--gray);
    border-radius: 15px;
    scroll-behavior: smooth;
}
.numeros-grid-virtual-track {
    position: relative;
    width: 100%;
}
.numeros-grid-virtual-viewport {
    box-sizing: border-box;
}

.numeros-grid-maquina-resumen {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
    padding: 15px;
    background: var(--gray);
    border-radius: 15px;
}

/* —— Métodos de pago (modal) —— */
.metodos-pago-block {
    margin: 18px 0;
}
.metodos-pago-heading {
    font-size: 1.05rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 6px;
}
.metodos-pago-nota {
    font-size: 0.82rem;
    color: #666;
    margin: 0 0 14px;
    line-height: 1.45;
}
.metodos-pago-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 14px;
}
.metodo-pago-card {
    background: linear-gradient(160deg, #fffafa 0%, #ffecec 100%);
    border: 1px solid #f0d0d0;
    border-radius: 14px;
    padding: 14px 16px 16px;
    box-shadow: 0 8px 22px rgba(204, 0, 0, 0.08);
}
.metodo-pago-bank-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}
.metodo-pago-logo {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    color: #fff;
    font-size: 13px;
    letter-spacing: 0.02em;
    flex-shrink: 0;
}
.metodo-pago-logo.a {
    background: linear-gradient(135deg, #0d47a1, #1976d2);
}
.metodo-pago-logo.b {
    background: linear-gradient(135deg, #b71c1c, #e53935);
}
.metodo-pago-bank-name {
    font-size: 0.92rem;
    color: #1a1a1a;
}
.metodo-pago-sub {
    font-size: 0.76rem;
    color: #888;
    margin-top: 2px;
}
.metodo-pago-label {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: #777;
    margin: 8px 0 3px;
}
.metodo-pago-value {
    font-weight: 700;
    color: #222;
    font-size: 0.92rem;
    word-break: break-word;
}
.metodo-pago-clabe {
    font-family: ui-monospace, 'Cascadia Code', 'Consolas', monospace;
    letter-spacing: 0.04em;
}
.btn-copy-clabe {
    margin-top: 10px;
    width: 100%;
    padding: 10px 12px;
    border-radius: 10px;
    border: none;
    cursor: pointer;
    font-weight: 800;
    font-size: 0.82rem;
    background: var(--primary);
    color: #fff;
    transition: opacity 0.2s, transform 0.15s;
}
.btn-copy-clabe:hover {
    opacity: 0.92;
    transform: translateY(-1px);
}
.bank-card-pago .metodo-pago-label:first-of-type {
    margin-top: 10px;
}

/* —— Chatbot rifas (misma UX / colores que web principal) —— */
.chatbot-btn {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: var(--gradient);
    color: #fff !important;
    border-radius: 50px;
    padding: 14px 22px;
    cursor: pointer;
    box-shadow: 0 5px 18px rgba(204, 0, 0, 0.35);
    z-index: 1002;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-size: 15px;
    transition: transform 0.2s;
}
.chatbot-btn:hover {
    transform: scale(1.04);
}

.chatbot-modal {
    display: none;
    position: fixed;
    bottom: 85px;
    right: 20px;
    width: 350px;
    max-width: calc(100vw - 24px);
    background: #fff;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    z-index: 1003;
    overflow: hidden;
}

.chatbot-header {
    background: var(--gradient);
    color: #fff;
    padding: 15px 20px;
    font-weight: 700;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#close-chatbot {
    cursor: pointer;
    font-size: 1.5rem;
    line-height: 1;
    transition: transform 0.2s;
}
#close-chatbot:hover {
    transform: scale(1.15);
}

.chatbot-body .form-group {
    margin-bottom: 0;
}

.chatbot-body .chatbot-send {
    width: auto !important;
    min-width: 46px;
}

.chatbot-mensaje {
    text-align: left;
    white-space: pre-wrap;
    color: var(--dark);
}
.chatbot-mensaje::-webkit-scrollbar {
    width: 6px;
}
.chatbot-mensaje::-webkit-scrollbar-thumb {
    background: var(--primary);
    border-radius: 10px;
}