/**
 * ============================================
 * ESTILOS - LANDING PAGE DÍA DE LAS MADRES
 * StudioMix
 * ============================================
 * Paleta: Blanco, Negro y Tonos Rosados
 * Tipografía: Montserrat
 */

/* ============================================
   CSS VARIABLES
   ============================================ */
:root {
    --color-primary: #D81B60;
    --color-primary-hover: #AD1457;
    --color-primary-light: #F8BBD0;
    --color-secondary: #FCE4EC;
    
    --bg-main: #FFF5F8;
    --bg-white: #FFFFFF;
    --bg-dark: #1A1A1A;
    
    --text-dark: #1A1A1A;
    --text-muted: #555555;
    --text-light: #FFFFFF;
    
    --shadow-soft: 0 4px 20px rgba(216, 27, 96, 0.1);
    --shadow-card: 0 10px 40px rgba(0, 0, 0, 0.08);
    --shadow-floating: 0 20px 60px rgba(216, 27, 96, 0.25);
    
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 24px;
    --radius-pill: 9999px;
    
    --transition-fast: 0.2s ease;
    --transition-normal: 0.3s ease;
    --transition-slow: 0.5s ease;
}

/* Imperial Script: coloca fonts/Imperial-Script.ttf para usarla */
@font-face {
    font-family: 'Imperial Script';
    src: url('../fonts/Imperial-Script.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* ============================================
   RESET Y ESTILOS BASE
   ============================================ */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Montserrat', sans-serif;
    font-weight: 400;
    color: var(--text-dark);
    background-color: var(--bg-main);
    line-height: 1.6;
    overflow-x: hidden;
}

body.modal-open {
    overflow: hidden;
}

/* Aviso: file:// o Live Server — hay que usar http://localhost con Laragon */
.studiomix-http-only-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 99999;
    background: linear-gradient(135deg, #1a0a12 0%, #4a1028 100%);
    color: #fff;
    padding: 14px 48px 14px 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
    font-size: 0.9rem;
    line-height: 1.45;
}

.studiomix-http-only-banner-inner {
    max-width: 900px;
    margin: 0 auto;
    position: relative;
}

.studiomix-http-only-banner p {
    margin: 0 0 0.5rem;
}

.studiomix-http-only-banner p:last-of-type {
    margin-bottom: 0;
}

.studiomix-http-only-banner-url a {
    color: #ffb3d0;
    font-weight: 700;
    word-break: break-all;
}

.studiomix-http-only-banner-hint {
    font-size: 0.8rem;
    opacity: 0.9;
}

.studiomix-http-only-banner-hint code {
    background: rgba(255, 255, 255, 0.12);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 0.85em;
}

.studiomix-http-only-banner-close {
    position: absolute;
    top: 0;
    right: 0;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.studiomix-http-only-banner-close:hover {
    background: rgba(255, 255, 255, 0.28);
}

body.studiomix-http-warning-active {
    padding-top: 0;
}

/* Utilidades */
.hidden {
    display: none !important;
}

h1, h2, h3, h4, h5, h6 {
    font-weight: 700;
    line-height: 1.2;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

/* ============================================
   MODAL DE ACCESO INICIAL (glassmorphism + imagen en contenedor)
   ============================================ */
.access-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: radial-gradient(circle at top, rgba(216, 27, 96, 0.25), rgba(0, 0, 0, 0.75));
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    z-index: 2000;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.access-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

.access-modal-content {
    max-width: 480px;
    width: 100%;
    background: url('../img/modal_inicio.jpg') center center / cover no-repeat;
    border-radius: 24px;
    padding: 32px 28px 28px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.45);
    color: var(--text-dark);
    position: relative;
    overflow: hidden;
    max-height: 90vh;
}

.access-modal-content::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 24px;
    pointer-events: none;
}

.access-modal-content > * {
    position: relative;
    z-index: 1;
}

.access-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-secondary);
    color: var(--text-dark);
    font-size: 24px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    border: none;
    transition: background var(--transition-fast);
}

.access-modal-close:hover {
    background: var(--color-primary-light);
}

/* Modal: WhatsApp antes de personalizar (1 tarjeta por número) */
.inicio-crear-modal {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: radial-gradient(circle at top, rgba(216, 27, 96, 0.25), rgba(0, 0, 0, 0.75));
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    z-index: 1999;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.inicio-crear-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

.inicio-crear-backdrop {
    position: absolute;
    inset: 0;
}

.inicio-crear-content {
    position: relative;
    max-width: 420px;
    width: 100%;
    background: #ffffff;
    border-radius: 24px;
    padding: 32px 28px 28px;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
    color: var(--text-dark);
    z-index: 1;
}

.inicio-crear-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-secondary);
    color: var(--text-dark);
    font-size: 24px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border: none;
    transition: background var(--transition-fast);
}

.inicio-crear-close:hover {
    background: var(--color-primary-light);
}

.inicio-crear-title {
    font-size: clamp(1.3rem, 3vw, 1.6rem);
    margin-bottom: 8px;
    text-align: center;
}

.inicio-crear-subtitle {
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-bottom: 20px;
    text-align: center;
}

.inicio-crear-form .btn-access {
    width: 100%;
    margin-top: 8px;
    background: var(--color-primary);
}

.inicio-crear-form .btn-access:hover {
    background: var(--color-primary-hover);
}

.inicio-crear-message {
    margin-top: 12px;
    font-size: 0.9rem;
    text-align: center;
}

.inicio-crear-message.error {
    color: var(--color-error, #c62828);
}

.inicio-crear-message.success {
    color: var(--color-success, #2e7d32);
}

.access-title {
    text-transform: uppercase;
    font-size: clamp(1.4rem, 3.5vw, 1.8rem);
    margin-bottom: 8px;
    text-align: center;
}

.access-subtitle {
    font-size: 0.95rem;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.access-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.access-form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.access-form-group label {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-dark);
}

.access-form-group input {
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: 1.5px solid rgba(255, 255, 255, 0.7);
    background: rgba(255, 255, 255, 0.9);
    font-family: inherit;
    font-size: 0.95rem;
    box-shadow: 0 0 0 2px rgba(255, 78, 143, 0.695);

    transition: border-color var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}

.access-form-group input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 1px rgba(161, 0, 59, 0.733);
    background: #ffffff;
}

.access-help {
    font-size: 0.75rem;
    color: var(--text-muted);
}

/* Teléfono MX: prefijo +52 visible; el usuario escribe solo 10 dígitos */
.input-phone-prefix-row {
    display: flex;
    align-items: stretch;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: #fff;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.input-phone-prefix-row:focus-within {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 1px rgba(161, 0, 59, 0.733);
}

.input-phone-prefix {
    flex: 0 0 auto;
    padding: 0 12px;
    background: rgba(0, 0, 0, 0.06);
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    color: var(--text-dark);
}

.input-phone-prefix-row input {
    flex: 1;
    min-width: 0;
    border: none !important;
    border-radius: 0 !important;
    padding: 14px 12px;
    font-size: 1rem;
    background: transparent;
    box-shadow: none !important;
}

.input-phone-prefix-row input:focus {
    outline: none;
}

.btn-access {
    margin-top: 4px;
    background: var(--color-primary);
    color: var(--text-light);
    padding: 14px 24px;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 0.95rem;
    border: none;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition-normal);
    box-shadow: var(--shadow-floating);
}

.btn-access:hover {
    background: var(--color-primary-hover);
    transform: translateY(-1px);
}

.access-modal .btn-access {
    /* Verde tipo WhatsApp */
    background: #25D366;
}

.access-modal .btn-access:hover {
    background: #20BD5A;
}

.btn-access:disabled {
    background: var(--text-muted);
    box-shadow: none;
    cursor: not-allowed;
}

.access-legal {
    margin-top: 8px;
    font-size: 0.75rem;
    color: var(--text-muted);
}

.access-message {
    margin-top: 6px;
    font-size: 0.8rem;
    font-weight: 500;
}

.access-message.error {
    color: #D32F2F;
}

.access-message.success {
    color: #25D366;
}

@media (max-width: 480px) {
    .access-modal-content {
        padding: 24px 20px 20px;
        border-radius: 20px;
    }
}

/* ============================================
   MODAL DE PERSONALIZACIÓN (web + móvil)
   ============================================ */
.personalize-modal {
    position: fixed;
    inset: 0;
    z-index: 2500;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.personalize-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

.personalize-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
}

.personalize-modal-content {
    position: relative;
    width: 100%;
    max-width: 520px;
    max-height: 95vh;
    overflow-y: auto;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.3);
    padding: 24px 20px 28px;
}

.personalize-modal-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--color-secondary);
    color: var(--text-dark);
    font-size: 24px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    transition: background var(--transition-fast);
}

.personalize-modal-close:hover {
    background: var(--color-primary-light);
}

/* Editor solo visible dentro del modal; oculto en la landing */
#editor-controls-wrapper {
    display: none;
}

.personalize-modal-body #editor-controls-wrapper {
    display: block;
}

/* ============================================
   MODAL ENCUADRE FOTO (CROP)
   ============================================ */
.crop-modal {
    position: fixed;
    inset: 0;
    z-index: 3000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
}

.crop-modal.is-open {
    opacity: 1;
    pointer-events: auto;
}

.crop-modal-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
}

.crop-modal-content {
    position: relative;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    padding: 24px;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.4);
}

.crop-modal-title {
    font-size: 1.25rem;
    margin-bottom: 4px;
}

.crop-modal-hint {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 16px;
}

.crop-viewport {
    width: 280px;
    height: 280px;
    margin: 0 auto 20px;
    overflow: hidden;
    position: relative;
    background: #eee;
    border: 2px solid var(--color-secondary);
}

.crop-viewport.shape-circle {
    border-radius: 50%;
}

.crop-viewport.shape-square {
    border-radius: 0;
}

.crop-viewport.shape-rounded {
    border-radius: 0;
    clip-path: url(#roundedRectClip);
}

.crop-viewport.shape-diamond {
    border-radius: 0;
    clip-path: polygon(50% 0%, 100% 50%, 50% 100%, 0% 50%);
}

.crop-viewport-inner {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    cursor: move;
    user-select: none;
}

.crop-viewport-inner img {
    position: absolute;
    display: block;
    pointer-events: none;
    max-width: none;
    border-radius: 0 !important;
}

.crop-controls {
    margin-bottom: 16px;
}

.crop-zoom-label {
    display: flex;
    flex-direction: column;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-muted);
}

.crop-zoom {
    width: 100%;
    accent-color: var(--color-primary);
}

.crop-actions {
    display: flex;
    gap: 12px;
    justify-content: flex-end;
}

.btn-crop-cancel {
    padding: 10px 20px;
    border-radius: var(--radius-pill);
    background: var(--color-secondary);
    color: var(--text-dark);
    font-weight: 600;
}

.btn-crop-apply {
    padding: 10px 20px;
    border-radius: var(--radius-pill);
    background: var(--color-primary);
    color: var(--text-light);
    font-weight: 600;
}

.btn-crop-apply:hover,
.btn-crop-cancel:hover {
    opacity: 0.9;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    font-family: inherit;
    cursor: pointer;
    border: none;
    outline: none;
}

/* ============================================
   NAVBAR
   ============================================ */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.3);
    transition: var(--transition-normal);
}

.navbar.scrolled {
    box-shadow: var(--shadow-soft);
}

.navbar-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 16px 24px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

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

.navbar-logo-img {
    height: 40px;
    width: auto;
    max-width: 160px;
    object-fit: contain;
    display: block;
}

.navbar-links {
    display: flex;
    gap: 32px;
    list-style: none;
}

.navbar-links a {
    font-weight: 500;
    font-size: 14px;
    color: #ffffff;
    padding: 8px 0;
    position: relative;
    transition: var(--transition-fast);
}

.navbar-links a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-primary);
    transition: var(--transition-fast);
}

.navbar-links a:hover {
    color: var(--color-primary);
}

.navbar-links a:hover::after {
    width: 100%;
}

/* Hamburger Menu */
.hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    cursor: pointer;
    padding: 8px;
}

.hamburger span {
    width: 24px;
    height: 2px;
    background: #ffffff;
    transition: var(--transition-fast);
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.hamburger.active span:nth-child(2) {
    opacity: 0;
}

.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Menu */
.mobile-menu {
    display: none;
    position: fixed;
    top: 72px;
    left: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(16px);
    padding: 24px;
    opacity: 0;
    transform: translateY(-20px);
    transition: var(--transition-normal);
    pointer-events: none;
}

.mobile-menu.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.mobile-menu ul {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.mobile-menu a {
    font-weight: 500;
    font-size: 16px;
    padding: 12px 0;
    display: block;
    border-bottom: 1px solid var(--color-secondary);
    color: var(--text-dark);
}

/* ============================================
   HERO SECTION
   ============================================ */
.hero {
    width: 100vw;
    height: 600px;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
    margin-top: 72px;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('../img/HERO-MAMA.jpg');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(26, 26, 26, 0.5) 0%, rgba(26, 26, 26, 0.7) 100%);
}

.hero-content {
    position: relative;
    z-index: 2;
    text-align: left;
    padding: 24px;
    max-width: 900px;
    margin-left: 8vw;
}

.hero-title {
    font-size: clamp(2rem, 6vw, 4.5rem);
    font-weight: 900;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 4px;
    text-shadow: 0 4px 30px rgba(0, 0, 0, 0.3);
    animation: fadeInUp 1s ease forwards;
}

.hero-subtitle {
    font-size: clamp(1rem, 2vw, 1.25rem);
    font-weight: 400;
    color: rgba(255, 255, 255, 0.9);
    margin-top: 16px;
    animation: fadeInUp 1s ease 0.2s forwards;
    opacity: 0;
}

.hero-cta {
    margin-top: 32px;
    animation: fadeInUp 1s ease 0.4s forwards;
    opacity: 0;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--color-primary);
    color: var(--text-light);
    padding: 16px 40px;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 16px;
    transition: var(--transition-normal);
    box-shadow: var(--shadow-floating);
}

.btn-primary:hover {
    background: var(--color-primary-hover);
    transform: translateY(-2px);
}

/* ============================================
   INDICACIONES
   ============================================ */
.indicaciones {
    padding: 80px 24px;
    background: var(--bg-white);
}

.indicaciones-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.indicaciones-content h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    color: var(--text-dark);
    margin-bottom: 24px;
}

.indicaciones-content h2 span {
    color: var(--color-primary);
}

.indicaciones-steps {
    display: flex;
    flex-direction: column;
    gap: 24px;
    margin-top: 32px;
}

.step {
    display: flex;
    gap: 20px;
    align-items: flex-start;
}

.step-number {
    width: 48px;
    height: 48px;
    min-width: 48px;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-light));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    font-weight: 700;
    font-size: 20px;
}

.step-content h3 {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 4px;
}

.step-content p {
    color: var(--text-muted);
    font-size: 15px;
}

.indicaciones-image {
    position: relative;
}

.indicaciones-image img {
    width: 100%;
    /*height: 400px;*/
    object-fit: cover;
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
}

.indicaciones-image::before {
    content: '';
    position: absolute;
    top: -20px;
    right: -20px;
    width: 100%;
    height: 100%;
    background: var(--color-secondary);
    border-radius: var(--radius-lg);
    z-index: -1;
}

/* ============================================
   SECCIÓN CREAR TARJETA (CTA + resultado)
   ============================================ */
.plantillas {
    padding: 80px 24px;
    background: var(--bg-main);
}

.plantillas-header {
    text-align: center;
    max-width: 600px;
    margin: 0 auto 48px;
}

.plantillas-header h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    margin-bottom: 16px;
}

.plantillas-header h2 span {
    color: var(--color-primary);
}

.plantillas-header p {
    color: var(--text-muted);
}

/* CTA única: Crear tarjeta (sin carrusel) */
.plantillas-cta .crear-tarjeta-cta {
    text-align: center;
    margin-top: 24px;
}

.plantillas-cta .btn-use-template {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 16px 40px;
    border-radius: var(--radius-pill);
    background: var(--color-primary);
    color: var(--text-light);
    font-weight: 700;
    font-size: 1rem;
    text-decoration: none;
    transition: var(--transition-normal);
    box-shadow: var(--shadow-floating);
}

.plantillas-cta .btn-use-template:hover {
    background: var(--color-primary-hover);
    transform: translateY(-2px);
}

/* Tarjeta única: imagen IA + texto superpuesto */
.card-preview-ai {
    position: relative;
    width: 100%;
    max-width: 400px;
    margin: 0 auto;
    aspect-ratio: 3 / 4;
    background: #ffffff;
    border-radius: var(--radius-md);
    padding: 14px 14px 24px;
    box-shadow: var(--shadow-card);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    overflow: hidden;
}

.card-ai-placeholder {
    text-align: center;
    padding: 24px;
    color: var(--text-muted);
}

.card-ai-placeholder span {
    display: block;
    font-weight: 600;
    color: var(--text-dark);
    margin-bottom: 8px;
}

.card-ai-placeholder small {
    font-size: 0.8rem;
}

.card-ai-placeholder.hidden,
.card-ai-loading.hidden,
.card-ai-result.hidden {
    display: none !important;
}

.card-ai-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    /* Fondo en tonos rosados suaves para el loading */
    background: linear-gradient(135deg, #fde4f0, #ffe9f4);
    color: var(--text-dark);
    padding: 24px;
}

.card-ai-loading-spinner {
    width: 48px;
    height: 48px;
    border: 4px solid var(--color-secondary);
    border-top-color: var(--color-primary);
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.card-ai-loading p {
    font-weight: 600;
    margin: 0;
}

.card-ai-loading small {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.card-ai-result {
    position: relative;
    inset: auto;
    width: 100%;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
}

.card-ai-result .card-ai-image {
    position: relative;
    width: 100%;
    flex-shrink: 0;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    display: block;
    border-radius: 6px;
}

.card-ai-result .card-ai-phrase {
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: clamp(1rem, 3.5vw, 1.35rem);
    line-height: 1.35;
    margin: 0;
    padding: 10px 16px 0;
    width: 100%;
    flex-shrink: 0;
    text-align: center;
    color: #a81a4a;
    background: transparent;
}

.card-ai-result .card-ai-name {
    font-family: 'Tangerine', cursive;
    font-weight: 700;
    font-size: clamp(2.25rem, 8vw, 4rem);
    line-height: 1.2;
    margin: 0;
    padding: 2px 16px 0;
    width: 100%;
    flex-shrink: 0;
    text-align: center;
    color: #c2185b;
    background: transparent;
}

.card-ai-result .card-ai-text {
    position: relative;
    z-index: 2;
    margin: 0;
    padding: 18px 16px 0;
    width: 100%;
    text-align: center;
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
    font-weight: 600;
    color: #333333;
    text-shadow: none;
    background: transparent;
}

.control-select {
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: 2px solid var(--color-secondary);
    background: var(--bg-white);
    font-family: inherit;
    font-size: 15px;
    cursor: pointer;
}

.control-select:focus {
    outline: none;
    border-color: var(--color-primary);
}

/* ============================================
   EDITOR DE TARJETA / SECCIÓN RESULTADO
   ============================================ */
.editor-section {
    padding: 0 24px 80px;
    background: var(--bg-main);
    display: none;
    animation: fadeIn 0.5s ease;
}

.editor-section.active {
    display: block;
}

.result-section .result-container {
    max-width: 500px;
    margin: 0 auto;
    text-align: center;
}

.result-section .result-title {
    font-size: 1.25rem;
    margin-bottom: 24px;
    color: var(--text-dark);
}

/* Tarjeta resultado: mismo 3:4 en desktop y móvil (como imagen1) */
.result-section .card-preview-container {
    aspect-ratio: 3 / 4;
    max-height: none;
    width: 100%;
    max-width: 400px;
    margin-left: auto;
    margin-right: auto;
}

.result-section .card-preview-ai {
    max-width: 100%;
}

.preview-label {
    font-size: 12px;
    font-weight: 600;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 16px;
}

.card-preview-container {
    width: 100%;
    aspect-ratio: 3 / 4;
    max-width: 100%;
    border-radius: var(--radius-md);
    overflow: visible;
    box-shadow: none;
}

.card-preview {
    width: 100%;
    height: 100%;
}

.editor-controls {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.control-group label {
    font-size: 14px;
    font-weight: 600;
    color: var(--text-dark);
}

.control-group input[type="text"],
.control-group input[type="tel"],
.control-group input[type="email"] {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--color-secondary);
    border-radius: var(--radius-md);
    background: var(--bg-white);
    font-family: inherit;
    font-size: 16px;
    color: var(--text-dark);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.control-group input:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(216, 27, 96, 0.15);
}

.control-group input::placeholder {
    color: var(--text-muted);
}

.control-group input[type="file"] {
    padding: 12px;
    border: 2px dashed var(--color-secondary);
    border-radius: var(--radius-md);
    background: var(--bg-main);
    font-size: 14px;
    cursor: pointer;
}

.control-group input[type="file"]:focus {
    border-color: var(--color-primary);
}

.control-group textarea {
    width: 100%;
    min-height: 140px;
    padding: 14px 16px;
    border: 2px solid var(--color-secondary);
    border-radius: var(--radius-md);
    background: var(--bg-white);
    font-family: inherit;
    font-size: 16px;
    color: var(--text-dark);
    resize: vertical;
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
}

.control-group textarea:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px rgba(216, 27, 96, 0.15);
}

.control-group textarea::placeholder {
    color: var(--text-muted);
}

.btn-generate {
    width: 100%;
    padding: 16px 24px;
    border-radius: var(--radius-pill);
    background: var(--color-primary);
    color: var(--text-light);
    font-family: inherit;
    font-weight: 700;
    font-size: 16px;
    border: none;
    cursor: pointer;
    transition: background var(--transition-normal), transform var(--transition-fast);
    box-shadow: 0 4px 20px rgba(216, 27, 96, 0.35);
}

.btn-generate:hover {
    background: var(--color-primary-hover);
    transform: translateY(-1px);
}

.btn-generate:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
    transform: none;
}

.btn-edit-photo {
    margin-top: 10px;
    padding: 10px 18px;
    border-radius: var(--radius-md);
    background: var(--bg-white);
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
    font-family: inherit;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background var(--transition-fast), color var(--transition-fast);
}

.btn-edit-photo:hover {
    background: var(--color-primary);
    color: var(--text-light);
}

.control-help {
    font-size: 12px;
    color: var(--text-muted);
    display: block;
    margin-top: 4px;
}

.char-counter {
    font-size: 12px;
    color: var(--text-muted);
    text-align: right;
}

/* ============================================
   DESCARGA Y COMPARTIR
   ============================================ */
.share-section {
    display: none;
    animation: fadeIn 0.5s ease;
}

.share-section.active {
    display: block;
    margin-top: 32px;
    padding-top: 32px;
    border-top: 1px solid var(--color-secondary);
}

.btn-share-card {
    width: 100%;
    max-width: 420px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 16px 24px;
    border-radius: var(--radius-pill);
    background: var(--color-primary);
    color: var(--text-light);
    font-weight: 800;
    font-size: 1rem;
    border: none;
    cursor: pointer;
    transition: var(--transition-normal);
    box-shadow: var(--shadow-floating);
}

.btn-share-card:hover {
    background: var(--color-primary-hover);
    transform: translateY(-2px);
}

/* Paso para solicitar número destino y enviar */
.wa-destination-step {
    margin-top: 16px;
}

.wa-destination-title {
    font-size: 0.95rem;
    margin-bottom: 8px;
    color: var(--text-dark);
}

.wa-destination-step input {
    width: 100%;
    padding: 12px 14px;
    border-radius: var(--radius-md);
    border: 2px solid var(--color-secondary);
    background: rgba(255, 255, 255, 0.96);
    font-family: inherit;
    font-size: 0.95rem;
    margin-bottom: 12px;
}

.btn-whatsapp-send {
    width: 100%;
    background: #2E7D32;
    color: var(--text-light);
    padding: 14px 20px;
    border-radius: var(--radius-pill);
    font-weight: 800;
    border: none;
    cursor: pointer;
    transition: var(--transition-normal);
}

.btn-whatsapp-send:hover {
    background: #1B5E20;
    transform: translateY(-2px);
}

.privacy-link {
    margin-top: 14px;
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
}

.privacy-link a {
    color: var(--color-primary);
    font-weight: 700;
    text-decoration: none;
}

.privacy-link a:hover {
    text-decoration: underline;
}

/* ============================================
   Anti-screenshot (ofuscación temporal)
   ============================================ */
.screenshot-guard-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.88);
    display: none;
    z-index: 5000;
    pointer-events: none;
}

.screenshot-guard-overlay.is-active {
    display: block;
}

/* Se activa momentáneamente cuando se intenta capturar */
.screenshot-obfuscate .card-preview-ai {
    filter: blur(18px) saturate(0.6) !important;
}

.share-buttons {
    display: flex;
    gap: 16px;
    flex-wrap: wrap;
}

.btn-download {
    flex: 1;
    min-width: 200px;
    background: var(--bg-dark);
    color: var(--text-light);
    padding: 16px 32px;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition-normal);
}

.btn-download:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-card);
}

.btn-download.loading {
    position: relative;
    pointer-events: none;
}

.whatsapp-share {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.whatsapp-share input {
    width: 100%;
    padding: 14px 16px;
    border: 2px solid var(--color-secondary);
    border-radius: var(--radius-pill);
    font-family: inherit;
    font-size: 14px;
    transition: var(--transition-fast);
}

.whatsapp-share input:focus {
    outline: none;
    border-color: #25D366;
}

.btn-whatsapp {
    background: #25D366;
    color: var(--text-light);
    padding: 16px 32px;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition-normal);
}

.btn-whatsapp:hover {
    background: #128C7E;
}

/* ============================================
   REGISTRO
   ============================================ */
.registro {
    padding: 80px 24px;
    background: var(--bg-white);
}

.registro-container {
    max-width: 600px;
    margin: 0 auto;
    text-align: center;
}

.registro h2 {
    font-size: clamp(1.75rem, 4vw, 2.5rem);
    margin-bottom: 16px;
}

.registro h2 span {
    color: var(--color-primary);
}

.registro p {
    color: var(--text-muted);
    margin-bottom: 32px;
}

.registro-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.registro-form input {
    width: 100%;
    padding: 16px 20px;
    border: 2px solid var(--color-secondary);
    border-radius: var(--radius-md);
    font-family: inherit;
    font-size: 15px;
    transition: var(--transition-fast);
}

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

.btn-registro {
    background: var(--color-primary);
    color: var(--text-light);
    padding: 16px 32px;
    border-radius: var(--radius-pill);
    font-weight: 700;
    font-size: 16px;
    transition: var(--transition-normal);
    margin-top: 8px;
}

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

.btn-registro:disabled {
    background: var(--text-muted);
    cursor: not-allowed;
}

.form-message {
    margin-top: 16px;
    font-size: 14px;
    font-weight: 500;
}

.form-message.success {
    color: #25D366;
}

.form-message.error {
    color: #D32F2F;
}

/* ============================================
   FOOTER
   ============================================ */
.footer {
    background: var(--bg-dark);
    color: var(--text-light);
    padding: 40px 24px;
    text-align: center;
}

.footer p {
    font-size: 14px;
    opacity: 0.8;
}

.footer a {
    color: var(--color-primary-light);
    text-decoration: underline;
}

/* ============================================
   ANIMACIONES
   ============================================ */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes typewriter {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.text-animated {
    animation: typewriter 0.6s ease forwards;
}

/* ============================================
   RESPONSIVE DESIGN (MOBILE FIRST)
   ============================================ */

/* Base: móvil (pantallas pequeñas por defecto) */
.navbar-links {
    display: none;
}

.hamburger {
    display: flex;
}

.mobile-menu {
    display: block;
}

.hero {
    height: 450px;
    margin-top: 72px;
}

.indicaciones-container {
    grid-template-columns: 1fr;
    gap: 40px;
}

.indicaciones-image {
    order: -1;
}

.indicaciones-image::before {
    display: none;
}

.btn-use-template {
    padding: 10px 24px;
    font-size: 12px;
}

.share-buttons {
    flex-direction: column;
}

/* Alineación móvil: tarjeta y botones */
.editor-section {
    padding-left: 16px;
    padding-right: 16px;
    padding-bottom: 60px;
    box-sizing: border-box;
}

.editor-controls {
    min-width: 0;
}

.card-preview-container {
    margin: 0 auto;
    width: 100%;
}

.control-group input,
.control-group textarea,
.control-group select,
.btn-generate,
.btn-edit-photo {
    max-width: 100%;
    box-sizing: border-box;
}

.share-buttons {
    width: 100%;
}

.share-buttons .btn-download,
.whatsapp-share {
    width: 100%;
    max-width: 100%;
}

@media (min-width: 480px) {
    .hero {
        height: 500px;
    }
}

@media (min-width: 768px) {
    .navbar-links {
        display: flex;
    }

    .hamburger {
        display: none;
    }

    .hero {
        height: 500px;
    }

    .btn-use-template {
        padding: 12px 32px;
        font-size: 14px;
    }
}

@media (min-width: 992px) {
    .indicaciones-container {
        grid-template-columns: 1fr 1fr;
        gap: 60px;
    }

    .indicaciones-image {
        order: 0;
    }

    .indicaciones-image::before {
        display: block;
    }

    .plantillas {
        padding: 40px 24px 40px;
    }

    .plantillas-header {
        margin-bottom: 24px;
    }

    .editor-section {
        padding: 24px 24px 40px;
    }
}

/* ============================================
   CARRUSEL INFINITO — tarjetas (centro ~+15% escala)
   Requiere duplicar el bloque de .carrusel-card en HTML (50% + 50%).
   ============================================ */
.carrusel-cards {
    --carrusel-gap: clamp(1rem, 3vw, 1.75rem);
    --carrusel-card-w: min(280px, 72vw);
    --carrusel-marquee-dur: 36s;
    /* Debe coincidir con marquee / 4 (una tarjeta por “beat”) */
    --carrusel-scale-dur: 9s;
    width: 100%;
    padding: clamp(2.5rem, 6vw, 4rem) 24px clamp(2rem, 5vw, 3.5rem);
    position: relative;
    background: var(--bg-main);
}

.carrusel-cards-header {
    text-align: center;
    max-width: 720px;
    margin: 0 auto clamp(1.75rem, 4vw, 2.5rem);
}

.carrusel-cards-title {
    font-size: clamp(1.35rem, 3.5vw, 2rem);
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    line-height: 1.2;
    margin: 0 0 0.75rem;
    color: var(--text-dark);
}

.carrusel-cards-title-accent {
    color: var(--color-primary);
}

.carrusel-cards-subtitle {
    margin: 0;
    font-size: clamp(0.95rem, 2.2vw, 1.1rem);
    line-height: 1.5;
    color: var(--text-muted);
}

.carrusel-cards-viewport {
    overflow: hidden;
    margin: 0 -24px;
    width: calc(100% + 48px);
    /* Degradado lateral solo sobre las tarjetas */
    mask-image: linear-gradient(
        to right,
        transparent 0%,
        black 8%,
        black 92%,
        transparent 100%
    );
    -webkit-mask-image: linear-gradient(
        to right,
        transparent 0%,
        black 8%,
        black 92%,
        transparent 100%
    );
}

.carrusel-cards-container {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: var(--carrusel-gap);
    width: max-content;
    will-change: transform;
    animation: carrusel-marquee var(--carrusel-marquee-dur) linear infinite;
}

@keyframes carrusel-marquee {
    from {
        transform: translateX(0);
    }
    to {
        transform: translateX(-50%);
    }
}

.carrusel-cards:hover .carrusel-cards-container {
    animation-play-state: paused;
}

.carrusel-card {
    flex: 0 0 auto;
    width: var(--carrusel-card-w);
    transform-origin: center center;
    will-change: transform;
    /* 1 → 1.15 (15%) → 1, sincronizado por retardo con el desplazamiento */
    animation: carrusel-card-scale var(--carrusel-scale-dur) ease-in-out infinite;
}

.carrusel-card img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: clamp(10px, 2vw, 16px);
    box-shadow:
        0 12px 40px rgba(0, 0, 0, 0.18),
        0 4px 12px rgba(0, 0, 0, 0.08);
    pointer-events: none;
    user-select: none;
}

@keyframes carrusel-card-scale {
    0%,
    100% {
        transform: scale(1);
        z-index: 1;
    }
    /* Pico al ~centro del tramo de cada tarjeta */
    45%,
    55% {
        transform: scale(1.15);
        z-index: 2;
    }
}

/* Desfase: cada tarjeta alcanza el máximo en momentos distintos (4 + 4 duplicadas) */
.carrusel-card:nth-child(1),
.carrusel-card:nth-child(5) {
    animation-delay: 0s;
}
.carrusel-card:nth-child(2),
.carrusel-card:nth-child(6) {
    animation-delay: calc(-1 * var(--carrusel-scale-dur) / 4);
}
.carrusel-card:nth-child(3),
.carrusel-card:nth-child(7) {
    animation-delay: calc(-1 * var(--carrusel-scale-dur) / 2);
}
.carrusel-card:nth-child(4),
.carrusel-card:nth-child(8) {
    animation-delay: calc(-1 * var(--carrusel-scale-dur) * 3 / 4);
}

@media (prefers-reduced-motion: reduce) {
    .carrusel-cards-container {
        animation: none;
        transform: translateX(0);
        flex-wrap: wrap;
        justify-content: center;
        width: 100%;
        max-width: 1200px;
        margin: 0 auto;
    }

    .carrusel-card {
        animation: none;
        transform: none;
    }

    .carrusel-cards-viewport {
        mask-image: none;
        -webkit-mask-image: none;
        margin: 0;
        width: 100%;
    }
}
