/* ==========================================================
   Regalar.net — sistema visual compartido
   Se carga DESPUÉS de los estilos de cada página: aquí viven los
   colores, la tipografía y los componentes comunes.
   ========================================================== */

:root {
    /* Papel y tinta */
    --bg: #faf5ec;
    --bg-sunk: #f3ebdd;
    --card-bg: #ffffff;
    --card-border: #e8ddcd;
    --text: #211a16;
    --text-secondary: #5c5149;
    --text-muted: #85786d;

    /* Acento único: rojo lazo */
    --primary: #d43c22;
    --primary-hover: #b02e18;
    --primary-light: #fdeee8;
    --primary-border: #f4cabf;
    --btn-bg: #d43c22;
    --btn-hover: #b02e18;
    --btn-color: #fff;

    /* Apoyo */
    --sun: #f2a93b;
    --sun-soft: #fdf1d8;
    --success: #1e7b5a;
    --success-soft: #e2f2ea;
    --danger: #c62f2f;

    --input-bg: #fff;
    --input-border: #d9cdbb;

    --shadow-sm: 0 1px 2px rgba(60, 40, 20, .06);
    --shadow: 0 6px 18px -6px rgba(60, 40, 20, .16), 0 2px 4px rgba(60, 40, 20, .05);
    --shadow-lg: 0 24px 48px -18px rgba(60, 40, 20, .28), 0 4px 10px rgba(60, 40, 20, .06);
    --radius: 12px;
    --radius-lg: 16px;
    --radius-xl: 24px;

    --font-display: 'Bricolage Grotesque', 'Figtree', system-ui, sans-serif;
    --font-body: 'Figtree', system-ui, -apple-system, 'Segoe UI', sans-serif;

    /* Bootstrap */
    --bs-primary: #d43c22;
    --bs-primary-rgb: 212, 60, 34;
    --bs-link-color: #b02e18;
    --bs-link-color-rgb: 176, 46, 24;
    --bs-link-hover-color: #8c2412;
    --bs-link-hover-color-rgb: 140, 36, 18;
    --bs-body-font-family: var(--font-body);
    --bs-border-color: var(--card-border);
}

[data-theme="dark"],
[data-bs-theme="dark"] {
    --bg: #161210;
    --bg-sunk: #100d0b;
    --card-bg: #221c18;
    --card-border: #3b3029;
    --text: #f6efe6;
    --text-secondary: #c2b5a8;
    --text-muted: #94877b;

    --primary: #ff7a5c;
    --primary-hover: #ff957c;
    --primary-light: #3a1f17;
    --primary-border: #6b3324;
    --btn-bg: #d43c22;
    --btn-hover: #e85235;
    --btn-color: #fff;

    --sun: #f2a93b;
    --sun-soft: #3a2c12;
    --success: #5fcf9f;
    --success-soft: #16352a;
    --danger: #ff7b7b;

    --input-bg: #1b1613;
    --input-border: #4a3d34;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, .4);
    --shadow: 0 6px 18px -6px rgba(0, 0, 0, .6);
    --shadow-lg: 0 24px 48px -18px rgba(0, 0, 0, .7);

    --bs-link-color: #ff957c;
    --bs-link-color-rgb: 255, 149, 124;
    --bs-link-hover-color: #ffb3a1;
    --bs-link-hover-color-rgb: 255, 179, 161;
    --bs-body-bg: #161210;
    --bs-body-color: #f6efe6;
    --bs-border-color: #3b3029;
    --bs-secondary-color: #c2b5a8;
    --bs-tertiary-bg: #221c18;
}

/* ---------- Base ---------- */
body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    font-size: 1rem;
    line-height: 1.55;
    text-rendering: optimizeLegibility;
}
h1, h2, h3, h4, .display-font {
    font-family: var(--font-display);
    letter-spacing: -.02em;
    text-wrap: balance;
}
p { text-wrap: pretty; }
a { text-underline-offset: .18em; }
::selection { background: var(--primary); color: #fff; }

:focus-visible {
    outline: 3px solid color-mix(in srgb, var(--primary) 55%, transparent);
    outline-offset: 2px;
    border-radius: 6px;
}
.text-muted { color: var(--text-muted) !important; }
.text-primary { color: var(--primary) !important; }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
}

/* ---------- Cabecera ---------- */
.header {
    background: color-mix(in srgb, var(--bg) 86%, transparent);
    -webkit-backdrop-filter: saturate(1.4) blur(12px);
    backdrop-filter: saturate(1.4) blur(12px);
    border-bottom: 1px solid transparent;
}
.header.scrolled { border-bottom-color: var(--card-border); box-shadow: none; }
.header > .container > div { min-height: 60px; }
.header-brand {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 1.3rem;
    letter-spacing: -.03em;
    gap: 10px;
    color: var(--text);
}
.header-brand:hover { color: var(--text); }
.header-brand .footer-gift {
    width: 36px; height: 36px;
    display: inline-grid; place-items: center;
    font-size: 1.15rem;
    background: var(--primary);
    border-radius: 11px;
    box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .14);
    transform: rotate(-6deg);
    transition: transform .25s cubic-bezier(.3, 1.6, .5, 1);
    animation: none !important;
}
.header-brand:hover .footer-gift { transform: rotate(4deg) scale(1.06); }
#headerSubtitle {
    font-family: var(--font-body);
    font-size: .68rem !important;
    font-weight: 500 !important;
    letter-spacing: 0;
    opacity: 1 !important;
    color: var(--text-muted);
    margin-top: 1px !important;
}
.header-btn, .header-btn-sm, .header-icon-btn, .theme-switch {
    border-radius: 999px;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    color: var(--text);
    font-weight: 600;
}
.header-btn-sm, .header-icon-btn, .theme-switch { width: 40px; height: 40px; }
.header-btn { padding: .5rem 1.05rem; display: inline-flex; align-items: center; }
.header-btn:hover, .header-btn-sm:hover, .header-icon-btn:hover, .theme-switch:hover {
    background: var(--card-bg);
    border-color: var(--text);
    color: var(--text);
}

/* ---------- Botones ---------- */
.btn {
    font-family: var(--font-body);
    font-weight: 600;
    border-radius: var(--radius);
}
.r-btn, .btn-submit, .cta-section .btn, .btn-primary {
    display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
    background: var(--btn-bg);
    color: var(--btn-color);
    border: 1px solid transparent;
    border-radius: 14px;
    font-weight: 700;
    font-family: var(--font-body);
    text-decoration: none;
    box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .16);
    transition: background .15s, transform .15s, box-shadow .15s;
}
.r-btn { padding: .8rem 1.5rem; font-size: 1rem; cursor: pointer; }
.r-btn:hover, .btn-submit:hover, .cta-section .btn:hover, .btn-primary:hover, .btn-primary:focus, .btn-primary:active {
    background: var(--btn-hover) !important;
    border-color: transparent !important;
    color: #fff !important;
    transform: translateY(-1px);
    box-shadow: inset 0 -3px 0 rgba(0, 0, 0, .16), 0 8px 18px -8px rgba(212, 60, 34, .6);
}
.r-btn:active, .btn-submit:active { transform: translateY(1px); box-shadow: inset 0 -1px 0 rgba(0, 0, 0, .16); }
.r-btn.r-btn-ghost {
    background: transparent;
    color: var(--text);
    border-color: var(--card-border);
    box-shadow: none;
}
.r-btn.r-btn-ghost:hover {
    background: var(--card-bg) !important;
    color: var(--text) !important;
    border-color: var(--text) !important;
    box-shadow: none;
}
.r-btn.r-btn-dark { background: var(--text); color: var(--bg); }
.r-btn.r-btn-dark:hover { background: var(--text) !important; color: var(--bg) !important; opacity: .9; box-shadow: var(--shadow); }
.r-btn.r-btn-sm { padding: .5rem 1rem; font-size: .88rem; border-radius: 11px; }
.r-link {
    color: var(--text);
    font-weight: 600;
    text-decoration: underline;
    text-decoration-color: var(--primary);
    text-decoration-thickness: 2px;
}
.r-link:hover { color: var(--primary); }

.btn-outline-primary { --bs-btn-color: var(--primary); --bs-btn-border-color: var(--primary-border); --bs-btn-hover-bg: var(--primary); --bs-btn-hover-border-color: var(--primary); --bs-btn-active-bg: var(--primary-hover); --bs-btn-active-border-color: var(--primary-hover); }
.btn-outline-secondary { --bs-btn-color: var(--text-secondary); --bs-btn-border-color: var(--card-border); --bs-btn-hover-bg: var(--text); --bs-btn-hover-border-color: var(--text); --bs-btn-hover-color: var(--bg); }
.btn-success { --bs-btn-bg: #1e7b5a; --bs-btn-border-color: #1e7b5a; --bs-btn-hover-bg: #17634a; --bs-btn-hover-border-color: #17634a; }

/* ---------- Formularios ---------- */
.form-control, .form-select {
    border-radius: var(--radius);
    border-color: var(--input-border);
    background-color: var(--input-bg);
    color: var(--text);
}
.form-control:focus, .form-select:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent);
}

/* ---------- Tarjetas genéricas ---------- */
.card {
    background: var(--card-bg);
    border: 1px solid var(--card-border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-sm);
}
.card:hover { box-shadow: var(--shadow-sm); transform: none; }

/* ---------- Pie ---------- */
.footer {
    border-top: 1px solid var(--card-border);
    padding: 1.75rem 0 2rem;
    margin-top: 3rem;
    background: transparent;
}
.footer .footer-gift { font-size: 1.5rem; }
.footer a[href]:not(.footer-gift-link) {
    background: transparent !important;
    border: 0 !important;
    padding: 0 !important;
    margin: 0 .6rem;
    color: var(--text-secondary) !important;
    font-size: .88rem !important;
    font-weight: 600 !important;
    border-radius: 0 !important;
}
.footer a[href]:not(.footer-gift-link):hover { color: var(--primary) !important; text-decoration: underline !important; }
.footer .footer-phrase, #footerPhrase {
    font-family: var(--font-display);
    font-size: .95rem !important;
    font-weight: 500;
    color: var(--text-secondary) !important;
    margin-top: .9rem;
    text-align: center;
}

/* ---------- SweetAlert ---------- */
.swal2-popup {
    font-family: var(--font-body);
    border-radius: var(--radius-xl) !important;
    background: var(--card-bg) !important;
    color: var(--text) !important;
    box-shadow: var(--shadow-lg);
}
.swal2-title { font-family: var(--font-display); font-weight: 700 !important; letter-spacing: -.02em; color: var(--text) !important; }
.swal2-html-container { color: var(--text-secondary) !important; }
.swal2-styled { border-radius: 12px !important; font-weight: 700 !important; padding: .7rem 1.4rem !important; box-shadow: none !important; }
.swal2-styled.swal2-cancel { background: transparent !important; color: var(--text) !important; border: 1px solid var(--card-border) !important; }
.swal2-styled.swal2-cancel:hover { border-color: var(--text) !important; }
.swal2-input, .swal2-textarea {
    border-radius: var(--radius) !important;
    border: 1.5px solid var(--input-border) !important;
    background: var(--input-bg) !important;
    color: var(--text) !important;
    box-shadow: none !important;
}
.swal2-input:focus, .swal2-textarea:focus { border-color: var(--primary) !important; box-shadow: 0 0 0 4px color-mix(in srgb, var(--primary) 18%, transparent) !important; }
.swal2-footer { border-top-color: var(--card-border) !important; color: var(--text-muted) !important; }
div:where(.swal2-container).swal2-backdrop-show { background: rgba(33, 26, 22, .55); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); }

/* ---------- Piezas reutilizables ---------- */
.r-eyebrow {
    display: inline-flex; align-items: center; gap: .45rem;
    font-size: .8rem; font-weight: 700;
    letter-spacing: .08em; text-transform: uppercase;
    color: var(--primary);
}
.r-chip {
    display: inline-flex; align-items: center; gap: .4rem;
    padding: .4rem .8rem;
    border-radius: 999px;
    border: 1px solid var(--card-border);
    background: var(--card-bg);
    color: var(--text);
    font-size: .86rem; font-weight: 600;
    cursor: pointer;
    transition: border-color .15s, transform .15s, background .15s;
    white-space: nowrap;
}
.r-chip:hover { border-color: var(--text); transform: translateY(-1px); }
.r-section-title {
    font-family: var(--font-display);
    font-size: clamp(1.6rem, 1.2rem + 1.6vw, 2.3rem);
    font-weight: 700;
    line-height: 1.1;
    margin: 0 0 .6rem;
}
.r-section-lead { color: var(--text-secondary); font-size: 1.05rem; max-width: 46ch; margin: 0; }

/* ==========================================================
   Estructura común (cabecera, pie, enlace de salto) para que
   las páginas generadas en PHP no dependan del <style> de cada HTML
   ========================================================== */
* { box-sizing: border-box; }
body { min-height: 100vh; -webkit-font-smoothing: antialiased; }
.header { position: sticky; top: 0; z-index: 100; }
.header-brand { display: flex; align-items: center; text-decoration: none; line-height: 1.3; }
.header-btn { font-size: .875rem; text-decoration: none; }
.header-icon-btn, .theme-switch, .header-btn-sm { display: inline-flex; align-items: center; justify-content: center; cursor: pointer; font-size: .9rem; }
.footer-gift-link { text-decoration: none; }

.skip-link {
    position: absolute; left: 1rem; top: -100px; z-index: 1000;
    background: var(--text); color: var(--bg);
    padding: .6rem 1rem; border-radius: 10px; font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: .75rem; }

/* Enlaces del pie: antes eran estilos en línea con onmouseover (sin foco de teclado) */
.footer-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: .35rem .2rem; margin: 0; padding: 0; list-style: none; }
.footer-occasions { display: flex; flex-wrap: wrap; justify-content: center; gap: .25rem .2rem; margin: 1rem 0 0; padding: 1rem 0 0; list-style: none; border-top: 1px dashed var(--card-border); }
.footer-occasions a[href]:not(.footer-gift-link) { font-size: .8rem !important; font-weight: 500 !important; color: var(--text-muted) !important; }

/* Títulos de página reutilizables */
.page-title { font-size: clamp(2rem, 1.3rem + 3vw, 3.2rem); font-weight: 800; letter-spacing: -.035em; line-height: 1.02; margin: .4rem 0 1rem; }
.page-lead { color: var(--text-secondary); font-size: 1.05rem; line-height: 1.55; max-width: 58ch; margin: 0 auto; }

/* ==========================================================
   Páginas de ocasión (/lista-de-boda, /lista-de-nacimiento…)
   ========================================================== */
.occ-hero { padding: clamp(2rem, 6vw, 4.5rem) 0 clamp(1.5rem, 4vw, 3rem); max-width: 820px; }
.occ-hero h1 { font-size: clamp(2.1rem, 1.3rem + 3.6vw, 3.6rem); font-weight: 800; letter-spacing: -.035em; line-height: 1.02; margin: .6rem 0 1rem; }
.occ-hero .lead { color: var(--text-secondary); font-size: clamp(1.05rem, 1rem + .3vw, 1.2rem); max-width: 60ch; }
.occ-form { display: flex; gap: .5rem; max-width: 560px; margin-top: 1.6rem; padding: .45rem; background: var(--card-bg); border: 2px solid var(--text); border-radius: 18px; box-shadow: 6px 6px 0 var(--text); }
.occ-form:focus-within { border-color: var(--primary); box-shadow: 6px 6px 0 var(--primary); }
.occ-form input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--text); font-size: 1.05rem; font-weight: 600; padding: .6rem .8rem; }
.occ-form .r-btn { white-space: nowrap; }
.occ-trust { display: flex; flex-wrap: wrap; gap: .4rem 1.2rem; margin: 1.1rem 0 0; padding: 0; list-style: none; color: var(--text-secondary); font-size: .92rem; font-weight: 500; }
.occ-trust i { color: var(--success); margin-right: .35rem; }
.occ-section { padding: clamp(2.25rem, 5vw, 3.5rem) 0; border-top: 1px solid var(--card-border); }
.occ-section h2 { font-size: clamp(1.5rem, 1.1rem + 1.4vw, 2.1rem); font-weight: 700; line-height: 1.1; margin: 0 0 1rem; }
.occ-prose { max-width: 70ch; color: var(--text-secondary); font-size: 1.02rem; line-height: 1.7; }
.occ-prose strong { color: var(--text); }
.occ-steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1rem, 3vw, 2rem); margin: 1.5rem 0 0; padding: 0; list-style: none; counter-reset: s; }
.occ-steps li { counter-increment: s; padding-top: 1rem; border-top: 2px solid var(--text); }
.occ-steps li::before { content: counter(s, decimal-leading-zero); display: block; font-family: var(--font-display); font-weight: 700; color: var(--primary); margin-bottom: .6rem; }
.occ-steps h3 { font-size: 1.15rem; font-weight: 700; margin: 0 0 .35rem; }
.occ-steps p { color: var(--text-secondary); margin: 0; font-size: .96rem; }
.occ-ideas { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: .75rem; margin: 1.25rem 0 0; padding: 0; list-style: none; }
.occ-ideas li { display: flex; gap: .75rem; align-items: flex-start; background: var(--card-bg); border: 1px solid var(--card-border); border-radius: var(--radius-lg); padding: .9rem 1rem; }
.occ-ideas .ic { font-size: 1.4rem; line-height: 1; }
.occ-ideas strong { display: block; font-size: .98rem; }
.occ-ideas span.d { color: var(--text-secondary); font-size: .88rem; line-height: 1.45; }
.occ-tips { margin: 1rem 0 0; padding-left: 1.2rem; color: var(--text-secondary); max-width: 70ch; line-height: 1.65; }
.occ-tips li { margin-bottom: .5rem; }
.occ-tips strong { color: var(--text); }
.occ-faq details { border-bottom: 1px solid var(--card-border); padding: 1rem 0; max-width: 780px; }
.occ-faq summary { cursor: pointer; font-weight: 700; font-size: 1.05rem; list-style: none; display: flex; justify-content: space-between; gap: 1rem; }
.occ-faq summary::-webkit-details-marker { display: none; }
.occ-faq summary::after { content: '+'; font-family: var(--font-display); color: var(--primary); font-size: 1.4rem; line-height: 1; }
.occ-faq details[open] summary::after { content: '−'; }
.occ-faq details p { margin: .7rem 0 0; color: var(--text-secondary); line-height: 1.65; }
.occ-related { display: flex; flex-wrap: wrap; gap: .5rem; margin-top: 1rem; }
.occ-related a { text-decoration: none; }
.occ-cta { background: var(--text); color: var(--bg); border-radius: var(--radius-xl); padding: clamp(2rem, 5vw, 3.25rem); display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; flex-wrap: wrap; margin-top: 1rem; }
.occ-cta h2 { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.2rem); font-weight: 800; margin: 0 0 .3rem; }
.occ-cta p { margin: 0; opacity: .75; }
@media (max-width: 767px) {
    .occ-steps { grid-template-columns: 1fr; }
    .occ-form { flex-direction: column; box-shadow: 4px 4px 0 var(--text); }
}

/* Tarjetas de ocasión de la portada convertidas en enlaces */
a.occasion { color: inherit; text-decoration: none; }
a.occasion:hover h3 { color: var(--primary); text-decoration: underline; text-decoration-thickness: 2px; }
a.occasion h3 .bi { font-size: .8em; margin-left: .25rem; color: var(--primary); }
