/* ==========================================================================
   Tema "Pancho Villa" — paleta tomada del logo de Rifas Pancho Villa:
   pergamino, tinta sepia y bronce. Estructura sobria basada en Confianza
   (tarjetas claras con sombra suave, badges de garantía); títulos en serif
   para un aire elegante y confiable. Solo toma los COLORES del logo, no su
   estilo de grabado.
   ========================================================================== */

* { box-sizing: border-box; }

body {
    font-family: 'Lato', -apple-system, BlinkMacSystemFont, sans-serif;
    background: #F5EFE3;
    color: #3A2A1C;
    margin: 0;
    -webkit-font-smoothing: antialiased;
}

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

/* ===== Header ===== */
.header {
    background: #FFFCF6;
    box-shadow: 0 2px 16px rgba(58, 42, 28, 0.06);
}
.header .container { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding: 1rem 1.5rem; }
.header .logo { display: flex; align-items: center; gap: 0.85rem; }
.header .logo img { width: 50px; height: 50px; border-radius: 50%; object-fit: cover; box-shadow: 0 2px 8px rgba(0,0,0,0.12); }
.header .logo h1 { margin: 0; font-size: 1.15rem; font-weight: 600; color: #3A2A1C; }
.header .nav-links { display: flex; gap: 0.6rem; flex-wrap: wrap; }
.header .nav-link {
    display: flex; align-items: center; gap: 0.5rem;
    padding: 0.65rem 1.15rem; border-radius: 10px; border: 1px solid #E6DAC4;
    background: #FFFCF6; color: #3A2A1C; font-weight: 600; font-size: 0.85rem;
    text-decoration: none; transition: all 0.15s ease;
}
.header .nav-link:hover { border-color: var(--color-dorado, #8C6A43); box-shadow: 0 4px 14px rgba(0,0,0,0.08); transform: translateY(-1px); }
.header .nav-link i { color: var(--color-dorado, #8C6A43); }
.header .nav-link.pay-highlight { background: var(--color-cta-verde, #3F7A4D); border-color: var(--color-cta-verde, #3F7A4D); color: #FFFCF6; }
.header .nav-link.pay-highlight i { color: #FFFCF6; }
.header .nav-link.pay-highlight:hover { background: var(--color-cta-verde-hover, #33663F); }

@media (max-width: 768px) {
    .header .container { flex-direction: column; align-items: stretch; gap: 0.85rem; padding: 0.85rem 1rem; }
    .header .logo { justify-content: center; }
    .header .nav-links { justify-content: center; }
    .header .nav-link { flex: 1 1 auto; justify-content: center; min-height: 44px; }
}

.main { padding-top: 1.5rem; }

/* ===== Botones ===== */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
    padding: 0.85rem 1.5rem; border-radius: 10px; border: none; font-weight: 600; font-size: 0.9rem;
    cursor: pointer; text-decoration: none; transition: all 0.15s ease;
}
.btn:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(0,0,0,0.12); }
.btn:active { transform: translateY(0); }

.btn-primary { background: var(--color-dorado, #8C6A43); color: #FFFCF6; width: 100%; box-shadow: 0 4px 14px rgba(var(--color-dorado-rgb, 140,106,67), 0.35); }
.btn-primary:hover { background: var(--color-dorado-oscuro, #6B4F2F); }
.btn-secondary { background: #FFFCF6; color: #3A2A1C; border: 1px solid #DCCDB2; }
.btn-secondary:hover { border-color: #C9B699; }
.btn-whatsapp { background: var(--color-cta-verde, #3F7A4D); color: #FFFCF6 !important; }
.btn-whatsapp:hover { background: var(--color-cta-verde-hover, #33663F); }
.btn-ghost { background: transparent; color: #7D6A55 !important; box-shadow: none; padding: 0.7rem 0.9rem; }
.btn-ghost:hover { background: #F1E9DA; transform: none; box-shadow: none; }
.btn-lucky { background: #3A2A1C; color: #FFFCF6; }
.btn-lucky:hover { background: #5A4128; }

/* ===== Hero (home) ===== */
.hero {
    text-align: center;
    background: linear-gradient(180deg, #FFFCF6 0%, #FBF6EA 100%);
    border: 1px solid #E8D9BB;
    border-radius: 18px;
    padding: 3.5rem 2rem;
    margin-bottom: 3rem;
    box-shadow: 0 10px 30px rgba(58, 42, 28, 0.06);
}
.hero h2 { font-size: 2.3rem; font-weight: 700; color: #3A2A1C; margin: 0 0 0.85rem; }
.hero p { font-size: 1.05rem; color: #6B5844; max-width: 560px; margin: 0 auto; }

.rifas-section { margin-bottom: 3rem; }
.rifas-section h3 { font-size: 1.5rem; font-weight: 700; color: #3A2A1C; margin-bottom: 1.5rem; text-align: center; }

.rifas-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 1.75rem; }

.rifa-card {
    background: #FFFCF6; border-radius: 16px; overflow: hidden; cursor: pointer;
    box-shadow: 0 4px 20px rgba(58, 42, 28, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.rifa-card:hover { transform: translateY(-4px); box-shadow: 0 14px 36px rgba(58, 42, 28, 0.14); }

.rifa-content { padding: 1.5rem; }
.rifa-title { font-size: 1.2rem; font-weight: 700; color: #3A2A1C; margin: 0 0 0.5rem; }
.rifa-description { color: #6B5844; font-size: 0.95rem; margin: 0 0 1rem; }
.rifa-info { display: flex; align-items: center; justify-content: space-between; gap: 0.75rem; flex-wrap: wrap; margin-bottom: 1rem; }
.rifa-price { font-weight: 700; color: var(--color-dorado, #8C6A43); font-size: 1.05rem; }
.rifa-available { font-size: 0.85rem; }

.no-rifas, .no-faqs { text-align: center; padding: 3rem 1.5rem; color: #6B5844; border-radius: 16px; border: 1px dashed #DCCDB2; grid-column: 1 / -1; }
.no-rifas i, .no-faqs i { font-size: 2rem; color: var(--color-dorado, #8C6A43); margin-bottom: 0.75rem; display: block; }
.no-rifas h4, .no-faqs h4 { color: #3A2A1C; margin: 0 0 0.4rem; }

/* ===== FAQ ===== */
.faq-card { background: #FFFCF6; border-radius: 16px; padding: 1.6rem; box-shadow: 0 4px 20px rgba(58, 42, 28, 0.08); }
.faq-container { max-width: 900px; margin: 2rem auto; padding: 0 1rem; }
.faq-header { text-align: center; margin-bottom: 2rem; }
.faq-header h1 { font-size: 1.8rem; font-weight: 700; color: #3A2A1C; }
.faq-header p { color: #6B5844; }
.faq-item { border-bottom: 1px solid #EFE6D4; padding-bottom: 1rem; margin-bottom: 1rem; }
.faq-item:last-child { border-bottom: none; margin-bottom: 0; }
.faq-question { display: flex; justify-content: space-between; align-items: center; cursor: pointer; padding: 1rem 1.25rem; background: #FAF5EA; border-radius: 12px; border: 1px solid #E6DAC4; transition: all 0.15s ease; }
.faq-question:hover { border-color: var(--color-dorado, #8C6A43); }
.faq-question h3, .faq-question h4 { margin: 0; color: #3A2A1C; font-size: 1rem; font-weight: 600; }
.faq-question i { color: var(--color-dorado, #8C6A43); transition: transform .2s ease; }
.faq-answer-content { padding: 1rem 1.25rem; color: #4E3D2D; line-height: 1.6; }
.action-buttons { display: flex; gap: 0.85rem; justify-content: center; margin-top: 2rem; flex-wrap: wrap; }
@media (max-width: 768px) { .action-buttons { flex-direction: column; } }

/* ===== Footer ===== */
.footer { background: #FFFCF6; border-top: 1px solid #E6DAC4; padding: 2.5rem 0; margin-top: 3rem; color: #6B5844; text-align: center; }
.footer p { margin: 0 0 0.5rem; }
.contact-info { display: flex; gap: 1.25rem; justify-content: center; flex-wrap: wrap; margin-top: 0.75rem; }
.contact-item { margin: 0; display: flex; align-items: center; gap: 0.4rem; }
.contact-item a { color: #6B5844; text-decoration: none; }
.contact-item a:hover { color: var(--color-dorado, #8C6A43); }
.social-links { margin-top: 1.25rem; }
.social-links h4 { font-size: 0.9rem; color: #3A2A1C; margin-bottom: 0.75rem; font-weight: 600; }
.social-icons { display: flex; gap: 0.75rem; justify-content: center; flex-wrap: wrap; }
.social-link {
    display: flex; align-items: center; gap: 0.4rem;
    padding: 0.55rem 1rem; border-radius: 10px; border: 1px solid #E6DAC4;
    color: #3A2A1C; text-decoration: none; font-size: 0.85rem; font-weight: 600; transition: all 0.15s ease;
}
.social-link:hover { border-color: var(--color-dorado, #8C6A43); box-shadow: 0 4px 12px rgba(0,0,0,0.08); }

/* ===== Métodos de pago ===== */
.payment-container { max-width: 800px; margin: 2rem auto; padding: 0 1rem; }
.payment-header { text-align: center; margin-bottom: 2rem; }
.payment-header h1 { font-size: 1.8rem; font-weight: 700; color: #3A2A1C; }
.payment-card { background: #FFFCF6; border-radius: 16px; padding: 2rem; box-shadow: 0 4px 20px rgba(58, 42, 28, 0.08); }
.payment-methods { display: grid; gap: 1rem; margin-bottom: 2rem; }
.payment-method {
    border-radius: 14px; padding: 1.25rem; display: flex; align-items: flex-start; gap: 1.1rem;
    background: #FAF5EA; border: 1px solid #E6DAC4; transition: all 0.15s ease;
}
.payment-method:hover { border-color: var(--color-dorado, #8C6A43); box-shadow: 0 4px 16px rgba(0,0,0,0.06); }
.payment-method i { font-size: 1.6rem; width: 50px; text-align: center; color: var(--color-dorado, #8C6A43); }
.payment-method-info h4 { margin: 0 0 0.4rem; color: #3A2A1C; font-size: 1.05rem; }
.payment-method-info p { margin: 0; color: #6B5844; font-size: 0.9rem; }
@media (max-width: 768px) { .payment-card { padding: 1.4rem; } }

/* ===== Alertas ===== */
.alert { padding: 1rem 1.25rem; border-radius: 12px; margin-bottom: 1.5rem; font-weight: 600; }
.alert-success { background: rgba(var(--color-exito-rgb, 40,167,69), 0.1); color: var(--color-exito, #28a745); border: 1px solid rgba(var(--color-exito-rgb, 40,167,69), 0.25); }
.alert-error { background: rgba(var(--color-error-rgb, 220,53,69), 0.1); color: var(--color-error, #dc3545); border: 1px solid rgba(var(--color-error-rgb, 220,53,69), 0.25); }

/* Foco visible por teclado (accesibilidad) — agregado para .boleto-item, .btn y enlaces */
.boleto-item:focus-visible,
.btn:focus-visible,
a:focus-visible {
    outline: 3px solid #6B4F2F;
    outline-offset: 2px;
}


/* ===== Ajustes propios de Pancho Villa ===== */
body { background: #F5EFE3; color: #3A2A1C; }
h1, h2, h3, h4,
.hero h2, .rifas-section h3, .rifa-title, .faq-header h1, .payment-header h1, .rifa-main-title {
    font-family: 'Playfair Display', Georgia, 'Times New Roman', serif;
    letter-spacing: 0.005em;
}

/* Header en tinta sepia con filete bronce (como el aro del logo) */
.header { background: #3A2A1C; box-shadow: 0 4px 18px rgba(58, 42, 28, 0.25); border-bottom: 3px solid #B08D5B; }

/* Hero: pergamino con doble filete */
.hero {
    background: linear-gradient(180deg, #FFFCF6 0%, #F3EADA 100%);
    border: 1px solid #DCC6A0;
    box-shadow: inset 0 0 0 6px #FFFCF6, inset 0 0 0 7px #E8D9BB, 0 12px 32px rgba(58, 42, 28, 0.08);
}
.hero h2 { color: #3A2A1C; }

.rifas-section > h3::after {
    content: ''; display: block; width: 64px; height: 2px; margin: 0.75rem auto 0;
    background: linear-gradient(90deg, transparent, #8C6A43, transparent);
}

.rifa-card { border: 1px solid #E6DAC4; }
.rifa-price { color: #6B4F2F; }
.btn-primary { color: #FFFCF6; }

/* Footer oscuro, a juego con el header */
.footer { background: #3A2A1C; border-top: 3px solid #B08D5B; color: #E9DCC3; }
.footer p, .contact-item a { color: #E9DCC3; }
.contact-item a:hover { color: #FFFCF6; }
.social-links h4 { color: #FFFCF6; }
.social-link { color: #F4ECDD; border-color: rgba(233, 220, 195, 0.3); }
.social-link:hover { border-color: #C9AC7E; box-shadow: none; }

::selection { background: #E9DCC3; color: #3A2A1C; }

/* ===== Tarjetas de rifa: fotos grandes y completas ===== */
.rifas-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr));
    gap: 2rem;
}

.rifa-card { display: flex; flex-direction: column; overflow: hidden; }
.rifa-card .rifa-content { display: flex; flex: 1; flex-direction: column; padding: 1.5rem 1.6rem 1.7rem; }
.rifa-card .rifa-content .btn-primary { margin-top: auto; }
.rifa-card .rifa-title { font-size: 1.45rem; }

/* Contenedor de la foto: la imagen se ve COMPLETA (contain). El cuadro toma la
   forma de la foto (public/js/imagen-ajustada.js); el relleno difuminado que
   había antes se quitó porque se veía borroso alrededor de la imagen */
.rifa-media {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 5;
    overflow: hidden;
    background: #EDE3CF;
    isolation: isolate;
}
.rifa-media::before {
    content: '';
    position: absolute;
    inset: -24px;
    z-index: -1;
    background: var(--rifa-fondo, none) center / cover no-repeat;
    display: none;
    transition: background-image 0.5s ease;
}
.rifa-media .carousel { position: absolute; inset: 0; }
.rifa-media .carousel img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    transition: opacity 0.5s ease, transform 0.4s ease;
}
.rifa-card:hover .rifa-media .carousel img { transform: none; }

.rifa-media-vacia {
    display: flex; align-items: center; justify-content: center;
    height: 100%; color: #C9B699; font-size: 3rem;
}

.carousel-btn {
    position: absolute; top: 50%; z-index: 2;
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; margin-top: -20px; padding: 0;
    border: 1px solid rgba(255, 252, 246, 0.5); border-radius: 50%;
    background: rgba(58, 42, 28, 0.72); color: #FFFCF6;
    cursor: pointer; opacity: 0; transition: opacity 0.2s ease, background-color 0.2s ease;
}
.carousel-prev { left: 12px; }
.carousel-next { right: 12px; }
.rifa-card:hover .carousel-btn, .carousel-btn:focus-visible { opacity: 1; }
.carousel-btn:hover { background: rgba(58, 42, 28, 0.8); }
@media (hover: none) { .carousel-btn { opacity: 1; } }
.carousel-count {
    position: absolute; right: 12px; bottom: 12px; z-index: 2;
    padding: 4px 10px; border-radius: 999px;
    background: rgba(58, 42, 28, 0.7); color: #FFFCF6; font-size: 0.78rem; font-weight: 700;
}

/* Una sola rifa activa: tarjeta horizontal a todo lo ancho */
@media (min-width: 900px) {
    .rifas-grid:has(> .rifa-card:only-child) { grid-template-columns: 1fr; }
    .rifa-card:only-child { flex-direction: row; }
    .rifa-card:only-child .rifa-media { flex: 0 0 58%; aspect-ratio: auto; min-height: 560px; }
    .rifa-card:only-child .rifa-content { justify-content: center; padding: 2.5rem; }
    .rifa-card:only-child .rifa-title { font-size: 2rem; }
}

/* Colores del header compartido (public/css/header.css) */
.header.site-header { --hdr-texto: #F4ECDD; --hdr-acento: #C9AC7E; --hdr-fondo: #3A2A1C; }
