/* ===================================================================
   Raffle Platform — Public site styles
   Plain CSS (no build step) so it runs as-is on shared hosting.
   =================================================================== */

:root {
    --color-primary: #0d9b52;
    --color-primary-dark: #0a7a40;
    --color-dark: #111827;
    --color-bg: #f2f4f7;
    --color-card: #ffffff;
    --color-text: #1f2937;
    --color-muted: #6b7280;
    --color-border: #e5e7eb;
    --radius: 14px;
    --shadow: 0 1px 3px rgba(0,0,0,.08), 0 6px 20px rgba(0,0,0,.04);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.5;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
.container { max-width: 1080px; margin: 0 auto; padding: 20px 16px 0; }

/* ---------- Header ---------- */
.site-header { background: var(--color-dark); color: #fff; position: sticky; top: 0; z-index: 40; box-shadow: 0 2px 10px rgba(0,0,0,.2); }
.header-inner { display: flex; align-items: center; gap: 16px; height: 64px; }
.brand { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 17px; letter-spacing: .01em; }
.brand img { height: 34px; width: auto; }
.brand-text { color: #fff; }
.menu-toggle { display: none; flex-direction: column; gap: 4px; background: none; border: none; cursor: pointer; padding: 8px; }
.menu-toggle span { width: 22px; height: 2px; background: #fff; display: block; }
.main-nav { display: flex; gap: 24px; margin-left: auto; }
.main-nav a { color: #d1d5db; font-size: 14px; font-weight: 600; transition: color .15s; }
.main-nav a:hover { color: #fff; }

@media (max-width: 720px) {
    .menu-toggle { display: flex; }
    .main-nav {
        position: fixed; top: 64px; left: 0; right: 0; background: var(--color-dark);
        flex-direction: column; padding: 8px 16px 16px; gap: 4px;
        transform: translateY(-8px); opacity: 0; pointer-events: none; transition: all .15s;
    }
    .main-nav.open { transform: translateY(0); opacity: 1; pointer-events: auto; }
    .main-nav a { padding: 10px 0; border-bottom: 1px solid rgba(255,255,255,.08); }
}

/*
 * Used only on the campaign page when Estilo 2 is active: the header floats
 * transparently over the hero image instead of sitting in its own solid bar,
 * so the photo can start right at the very top of the page.
 */
.site-header--overlay {
    position: absolute;
    width: 100%;
    background: transparent;
    box-shadow: none;
}
.site-header--overlay .header-inner { height: 48px; }
.site-header--overlay .menu-toggle span,
.site-header--overlay .brand-text { text-shadow: 0 1px 3px rgba(0,0,0,.5); }
.site-header--overlay .menu-toggle span { box-shadow: 0 1px 2px rgba(0,0,0,.35); }

/* ---------- Alerts ---------- */
.alert { margin: 16px 0; padding: 12px 16px; border-radius: 10px; font-size: 14px; }
.alert-error { background: #fef2f2; border: 1px solid #fecaca; color: #991b1b; }
.alert-success { background: #f0fdf4; border: 1px solid #bbf7d0; color: #166534; }

/* ---------- Hero / banner ---------- */
.hero { position: relative; background: var(--color-dark); padding-bottom: 2px; }
.hero-image { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.hero-badge {
    position: absolute; left: 16px; bottom: 16px; background: var(--color-primary);
    color: #fff; padding: 7px 16px; border-radius: 999px; font-size: 13px; font-weight: 700;
    box-shadow: 0 4px 14px rgba(0,0,0,.25);
}
.hero-card {
    background: var(--color-card); padding: 22px 18px 26px; box-shadow: 0 -8px 24px rgba(0,0,0,.08);
    border-radius: 20px 20px 0 0; margin-top: -18px; position: relative; z-index: 2;
}
.hero-title { font-size: 22px; font-weight: 800; margin: 0 0 4px; }
.hero-sub { color: var(--color-muted); font-size: 14px; margin: 0 0 18px; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    background: var(--color-primary); color: #fff; border: none; border-radius: 12px;
    padding: 14px 20px; font-size: 15px; font-weight: 700; cursor: pointer; width: 100%;
    transition: background .15s, transform .05s;
}
.btn:hover { background: var(--color-primary-dark); }
.btn:active { transform: scale(.99); }
.btn-outline { background: transparent; border: 1px solid var(--color-border); color: var(--color-text); }
.btn-dark { background: var(--color-dark); }
.btn-danger { background: #dc2626; }
.btn-sm { padding: 8px 14px; font-size: 13px; width: auto; }

/* ---------- Section titles ---------- */
.section-title { display: flex; align-items: center; gap: 8px; font-size: 18px; font-weight: 800; margin: 28px 0 12px; }

/* ---------- Campaign cards / grid ---------- */
.campaign-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 16px; margin-bottom: 24px; }
.card { background: var(--color-card); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; transition: transform .15s, box-shadow .15s; }
a.card:hover { transform: translateY(-3px); box-shadow: 0 4px 10px rgba(0,0,0,.1), 0 12px 28px rgba(0,0,0,.08); }
.card-img-wrap { position: relative; }
.card-img { width: 100%; aspect-ratio: 16/10; object-fit: cover; }
.badge { position: absolute; left: 10px; top: 10px; background: var(--color-primary); color:#fff; font-size:12px; font-weight:700; padding:4px 10px; border-radius:999px; }
.badge-muted { background: #6b7280; }
.card-body { padding: 14px 16px 18px; }
.card-title { font-size: 15px; font-weight: 700; margin: 0 0 4px; }
.card-sub { font-size: 13px; color: var(--color-muted); margin: 0 0 12px; }

/* ---------- Progress bar ---------- */
.progress { background: var(--color-border); border-radius: 999px; height: 8px; overflow: hidden; margin: 10px 0 6px; }
.progress-bar { background: var(--color-primary); height: 100%; border-radius: 999px; transition: width .3s; }
.progress-meta { display: flex; justify-content: space-between; font-size: 12px; color: var(--color-muted); }

/* ---------- Winners list ---------- */
.winners-scroll { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 4px; }
.winner-card { min-width: 230px; background: var(--color-card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 14px; display:flex; gap:10px; align-items:center; }
.winner-avatar {
    width: 44px; height: 44px; border-radius: 50%; background: linear-gradient(135deg,#22c55e,#0ea5e9);
    flex-shrink:0; display:flex; align-items:center; justify-content:center; font-size:20px;
}
.winner-name { font-weight: 700; font-size: 14px; }
.winner-prize { font-size: 12px; color: var(--color-muted); }
.winner-meta { font-size: 11px; color: var(--color-muted); }

/* ---------- Campaign detail page ---------- */
.gallery-main { position: relative; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); margin-bottom: 10px; }
/* Estilo 2: image sits flush against the viewport edges — no card rounding/shadow. */
.gallery-main--flush { border-radius: 0; box-shadow: none; margin-bottom: 0; }
.gallery-main img, .gallery-main video { width: 100%; aspect-ratio: 16/10; object-fit: cover; display: block; }
.gallery-overlay {
    position: absolute; left: 0; right: 0; bottom: 0; padding: 34px 18px 16px;
    background: linear-gradient(to top, rgba(0,0,0,.82) 0%, rgba(0,0,0,.45) 55%, rgba(0,0,0,0) 100%);
}
.gallery-overlay .badge { position: static; display: inline-block; margin-bottom: 8px; }
.gallery-overlay-title { color: #fff; font-size: 21px; font-weight: 800; margin: 0 0 2px; text-shadow: 0 1px 4px rgba(0,0,0,.4); }
.gallery-overlay-sub { color: #e5e7eb; font-size: 13px; margin: 0; }
.gallery-thumbs { display: flex; gap: 8px; overflow-x: auto; margin-bottom: 20px; }
.gallery-thumbs img { width: 76px; height: 56px; object-fit: cover; border-radius: 8px; cursor: pointer; opacity: .7; border: 2px solid transparent; }
.gallery-thumbs img.active { opacity: 1; border-color: var(--color-primary); }

/*
 * Three independent grid items — media (photo/gallery), buy (purchase box),
 * info (description/regulation) — placed via named areas instead of source
 * order + `order:-1` tricks. That matters because `order` only reshuffles
 * whole grid items: media and info used to be ONE item, so pushing "buy"
 * before it dragged the photo down with the text. Named areas let each
 * piece move independently per breakpoint.
 */
.detail-grid {
    display: grid;
    grid-template-columns: 1.4fr 1fr;
    grid-template-areas: "media buy" "info buy";
    gap: 28px;
    align-items: start;
}
.gallery-media { grid-area: media; }
.buy-column { grid-area: buy; }
.gallery-info { grid-area: info; }

@media (max-width: 860px) {
    .detail-grid {
        grid-template-columns: 1fr;
        grid-template-areas: "media" "buy" "info";
    }
}

.buy-box { background: var(--color-card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; position: sticky; top: 80px; }
.countdown { display: flex; gap: 8px; margin: 12px 0; }
.countdown div { flex: 1; background: var(--color-dark); color: #fff; border-radius: 10px; padding: 10px 4px; text-align: center; }
.countdown .num { font-size: 20px; font-weight: 800; display:block; }
.countdown .label { font-size: 10px; color: #9ca3af; text-transform: uppercase; }

.quick-title { display: flex; align-items: baseline; gap: 8px; font-size: 15px; font-weight: 800; margin: 18px 0 10px; }
.quick-title span { font-size: 12px; font-weight: 600; color: var(--color-muted); }

.qty-quick { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 12px 0 18px; }
.quick-btn {
    position: relative; padding: 16px 8px 12px; border-radius: 14px; border: 1.5px solid var(--color-border);
    background: #f9fafb; cursor: pointer; text-align: center; transition: border-color .15s, background .15s, transform .05s;
}
.quick-btn:hover { border-color: var(--color-primary); }
.quick-btn:active { transform: scale(.98); }
.quick-btn.popular { border-color: var(--color-primary); background: #f0fdf4; }
.quick-btn.active { background: var(--color-primary); border-color: var(--color-primary); }
.quick-btn.active .quick-amount, .quick-btn.active .quick-label { color: #fff; }
.quick-amount { display: block; font-size: 19px; font-weight: 800; color: var(--color-text); line-height: 1.2; }
.quick-label { display: block; font-size: 10px; font-weight: 700; letter-spacing: .04em; color: var(--color-muted); margin-top: 4px; }
.popular-badge {
    position: absolute; top: -11px; left: 50%; transform: translateX(-50%);
    background: var(--color-primary); color: #fff; font-size: 10px; font-weight: 700;
    padding: 3px 12px; border-radius: 999px; white-space: nowrap; box-shadow: 0 2px 6px rgba(0,0,0,.15);
}

.qty-stepper { display: flex; align-items: center; gap: 12px; margin: 12px 0 18px; }
.stepper-btn {
    width: 44px; height: 44px; border-radius: 50%; border: 1.5px solid var(--color-border); background: #fff;
    font-size: 20px; font-weight: 700; cursor: pointer; flex-shrink: 0; line-height: 1;
}
.stepper-btn:hover { border-color: var(--color-primary); color: var(--color-primary); }
.qty-stepper input { flex: 1; text-align: center; padding: 10px; border: 1px solid var(--color-border); border-radius: 10px; font-size: 18px; font-weight: 700; }

.btn-cta { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 20px; }
.btn-cta .cta-value { font-size: 17px; font-weight: 800; }

/* ---------- Buy widget — Estilo 2 (escuro, com caixa de promoção) ---------- */
/* Full-bleed hero for the campaign page: no side padding, image hugs the
   very top of the viewport, header floats over it (see .site-header--overlay). */
.gallery-media { position: relative; }
.gallery-top-fade {
    position: absolute; top: 0; left: 0; right: 0; height: 90px;
    background: linear-gradient(to bottom, rgba(0,0,0,.55) 0%, rgba(0,0,0,0) 100%);
    pointer-events: none;
}
.gallery-thumbs--flat { padding: 8px 12px; margin-bottom: 0; background: var(--color-bg); }

.my-tickets-bar {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    background: #1c2230; color: #fff; font-size: 12px; font-weight: 600;
    padding: 8px; cursor: pointer; border: none; width: 100%;
}

/* Flat content zone: sits directly on the page background — no floating
   card/shadow around the whole widget, matching the reference exactly. */
.buy-flat { padding: 12px 16px 18px; }

.price-pill-dark {
    display: inline-block; background: var(--color-dark); color: #fff; font-weight: 500;
    padding: 5px 12px; border-radius: 7px; font-size: 11px; margin: 2px 0 12px;
}
.price-pill-dark strong { font-size: 12px; font-weight: 800; }

.promo-box { background: var(--color-dark); border-radius: 12px; padding: 12px; margin-bottom: 12px; }
.promo-box-header { display: flex; align-items: center; gap: 6px; color: #fff; font-weight: 700; font-size: 12px; margin: 0 0 8px; }
.promo-box-header .muted { color: #fbbf24; font-weight: 600; font-size: 11px; }
.promo-inner { background: rgba(255,255,255,.06); border-radius: 8px; padding: 10px 12px; position: relative; }
.promo-badge {
    position: absolute; top: 8px; right: 8px; background: #facc15; color: var(--color-dark);
    font-size: 11px; font-weight: 800; padding: 2px 9px; border-radius: 999px;
}
.promo-title { color: #fff; font-size: 15px; font-weight: 800; margin: 0; }
.promo-sub { color: #9ca3af; font-size: 11px; margin: 3px 0 8px; }
.promo-buy-btn {
    display: flex; align-items: center; justify-content: center; gap: 6px; width: 100%;
    padding: 9px; border-radius: 7px; border: none; cursor: pointer; font-weight: 700;
    font-size: 12px; color: #fff; background: linear-gradient(90deg, #0ea5e9, #22c55e);
}
.promo-buy-btn:hover { filter: brightness(1.08); }

.buy-flat .quick-btn { background: #17181c; border-color: #17181c; padding: 12px 6px 9px; }
.buy-flat .quick-btn:hover { border-color: var(--color-primary); }
.buy-flat .quick-amount, .buy-flat .quick-label { color: #fff; }
.buy-flat .quick-amount { font-size: 16px; }
.buy-flat .quick-label { font-size: 9px; color: #9ca3af; }
.buy-flat .quick-btn.popular { background: var(--color-primary); border-color: var(--color-primary); }
.buy-flat .quick-btn.active { outline: 2px solid var(--color-primary); outline-offset: 1px; }
.buy-flat .btn-cta { padding: 13px 16px; font-size: 14px; border-radius: 11px; }
.buy-flat .btn-cta .cta-value { font-size: 15px; }

.qty-stepper--pill {
    display: flex; align-items: stretch; background: #fff; border: 1px solid var(--color-border);
    border-radius: 999px; overflow: hidden; margin-bottom: 12px;
}
.qty-stepper--pill .clear-btn {
    width: 40px; flex-shrink: 0; color: #dc2626; background: none; border: none; border-right: 1px solid var(--color-border);
    font-size: 14px; cursor: pointer;
}
.qty-stepper--pill .stepper-btn {
    width: 44px; flex-shrink: 0; border: none; border-radius: 0; background: none; font-size: 18px;
}
.qty-stepper--pill .stepper-btn:first-of-type { border-right: 1px solid var(--color-border); }
.qty-stepper--pill .stepper-btn:last-of-type { border-left: 1px solid var(--color-border); }
.qty-stepper--pill input { border: none; text-align: center; font-weight: 800; font-size: 15px; flex: 1; padding: 8px 4px; font-variant-numeric: tabular-nums; }
.qty-stepper--pill input:focus { outline: none; }

/* "Descrição/Regulamento" and "Bilhetes premiados" flat rows below the CTA */
.flat-bar {
    display: flex; align-items: center; justify-content: center; gap: 8px;
    background: #fff; border-radius: 11px; padding: 12px; font-size: 13px; font-weight: 700;
    box-shadow: var(--shadow); margin-bottom: 10px; cursor: pointer; border: none; width: 100%;
}
.tickets-row {
    display: flex; align-items: center; gap: 10px;
    background: #fff; border-radius: 11px; padding: 12px 14px; box-shadow: var(--shadow);
}
.tickets-row .trophy { font-size: 20px; }
.tickets-row-title { font-size: 13px; font-weight: 700; margin: 0; }
.tickets-row-sub { font-size: 11px; color: var(--color-muted); margin: 1px 0 0; }

.manual-toggle { font-size: 13px; color: var(--color-primary); text-decoration: underline; cursor: pointer; background:none; border:none; padding:0; margin-bottom: 10px; }
.numbers-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(42px, 1fr)); gap: 6px; max-height: 240px; overflow-y: auto; margin: 12px 0; padding: 8px; border: 1px solid var(--color-border); border-radius: 10px; }
.numbers-grid button { padding: 8px 2px; font-size: 12px; border-radius: 6px; border: 1px solid var(--color-border); background: #fff; cursor: pointer; }
.numbers-grid button.selected { background: var(--color-primary); color: #fff; border-color: var(--color-primary); }
.numbers-grid button:disabled { background: #f3f4f6; color: #d1d5db; cursor: not-allowed; }

.info-block { background: var(--color-card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px; margin-bottom: 20px; }
.info-block h2 { font-size: 16px; margin: 0 0 10px; }
.info-block .prose { font-size: 14px; color: var(--color-text); white-space: pre-line; }

/* ---------- Forms (checkout, admin) ---------- */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.form-group input, .form-group select, .form-group textarea {
    width: 100%; padding: 11px 12px; border: 1px solid var(--color-border); border-radius: 10px; font-size: 14px; font-family: inherit;
}
.form-group textarea { resize: vertical; min-height: 100px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 560px) { .form-row { grid-template-columns: 1fr; } }

/* ---------- Order / checkout status page ---------- */
.order-summary { background: var(--color-card); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px; max-width: 640px; margin: 24px auto; }
.order-status { display:inline-block; padding: 4px 12px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.status-pending { background:#fef9c3; color:#854d0e; }
.status-paid { background:#dcfce7; color:#166534; }
.status-canceled, .status-expired { background:#fee2e2; color:#991b1b; }
.number-chip { display:inline-block; background:#f3f4f6; border-radius:8px; padding:6px 10px; font-size:13px; font-weight:700; margin:3px; }
.pix-pending-box { background:#fffbeb; border:1px solid #fde68a; border-radius: var(--radius); padding:20px; margin-top:16px; text-align:center; }

footer.site-footer { background: var(--color-dark); color: #9ca3af; margin-top: 40px; padding: 32px 0; }
.footer-inner { text-align: center; }
.footer-brand { color: #fff; font-weight: 700; font-size: 16px; margin-bottom: 10px; }
.footer-social { display: flex; justify-content: center; gap: 16px; margin-bottom: 12px; font-size: 13px; }
.footer-social a:hover { color: #fff; }
.footer-badge { display: inline-block; border: 1px solid #374151; border-radius: 999px; padding: 4px 12px; font-size: 12px; margin: 8px 0; }
.footer-copy, .footer-text { font-size: 12px; }

.empty-state { text-align: center; padding: 40px 16px; color: var(--color-muted); }
