:root {
    --color-bg: #F9F7F2;
    --color-bg-alt: #F5F2ED;
    --color-text: #1A1A1A;
    --color-text-muted: #666666;
    --color-text-light: #8C8C8C;
    --color-accent: #5C6B50;
    --color-accent-dark: #3A4735;
    --color-gold: #C4A574;
    --color-border: #E5E0D8;
    --color-white: #FFFFFF;
    --color-black: #000000;

    /* Restored Fonts */
    --font-serif: 'Cormorant Garamond', Georgia, serif;
    --font-sans: 'Montserrat', -apple-system, BlinkMacSystemFont, sans-serif;
    --font-display: var(--font-serif);
    --font-body: var(--font-sans);

    --spacing-container: 24px;
}

/* --- CREAM DROP CARD --- */
.cream-drop-card:hover {
    transform: scale(1.05);
}

.cream-drop-card:hover img {
    transform: scale(1.1);
}

/* --- VISUAL EFFECTS --- */
.hero-bg-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 320px;
    overflow: hidden;
    z-index: 0;
    opacity: 0.1;
    /* Subtle background presence */
    pointer-events: none;
}

.hero-bg-face {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: grayscale(100%);
}

.hero-scan-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, transparent 40%, rgba(92, 107, 80, 0.2) 50%, transparent 60%);
    animation: heroScan 4s linear infinite;
}

.bio-dots {
    position: absolute;
    width: 4px;
    height: 4px;
    background: var(--color-accent);
    border-radius: 50%;
    opacity: 0.6;
}

.analysis-mesh {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: radial-gradient(var(--color-accent) 1px, transparent 1px);
    background-size: 20px 20px;
    opacity: 0.3;
    z-index: 10;
}

@keyframes heroScan {
    0% {
        top: -100%;
    }

    100% {
        top: 100%;
    }
}

@keyframes popIn {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }

    100% {
        opacity: 1;
        transform: scale(1);
    }
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
}

body {
    font-family: var(--font-sans);
    background-color: var(--color-bg);
    color: var(--color-text);
    min-height: 100dvh;
    line-height: 1.6;
    font-weight: 400;
    letter-spacing: 0.02em;
}

/* Tipografía Saper */
.font-serif {
    font-family: var(--font-serif);
    font-weight: 400;
    letter-spacing: 0.03em;
}

.text-elegant {
    font-family: var(--font-serif);
    font-weight: 300;
    font-style: italic;
    letter-spacing: 0.05em;
}

/* Container */
.container {
    max-width: 420px;
    margin: 0 auto;
    padding: 24px 20px;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

/* Header estilo Saper */
.header {
    text-align: center;
    padding: 16px 0 24px;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 32px;
}

.logo {
    font-family: var(--font-serif);
    font-size: 28px;
    font-weight: 400;
    letter-spacing: 0.25em;
    color: var(--color-text);
    text-transform: uppercase;
}

.tagline {
    font-size: 9px;
    letter-spacing: 0.3em;
    color: #343434;
    text-transform: uppercase;
    margin-top: 6px;
    font-weight: 500;
}

/* Estados */
.state-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    /* Evita gap enorme en resultados */
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.state-hidden {
    display: none;
    /* Ocultar completamente para evitar espacios */
    opacity: 0;
    transform: translateY(20px);
    pointer-events: none;
    position: absolute;
    width: calc(100% - 40px);
}

.state-visible {
    display: flex;
    /* Anular display:none de state-hidden */
    opacity: 1;
    transform: translateY(0);
}

/* Botón principal estilo Saper */
.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    background-color: var(--color-black);
    color: var(--color-white);
    padding: 18px 40px;
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 56px;
}

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

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    color: var(--color-text);
    padding: 14px 28px;
    font-family: var(--font-sans);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    border: 1px solid var(--color-text);
    cursor: pointer;
    transition: all 0.3s ease;
    min-height: 48px;
    text-decoration: none;
}

.btn-secondary:hover {
    background-color: var(--color-text);
    color: var(--color-white);
}

/* Títulos */
.title-large {
    font-family: var(--font-serif);
    font-size: 32px;
    font-weight: 400;
    line-height: 1.2;
    color: var(--color-text);
    margin-bottom: 16px;
}

.title-medium {
    font-family: var(--font-serif);
    font-size: 22px;
    font-weight: 400;
    line-height: 1.3;
    color: var(--color-text-muted);
}

.subtitle {
    font-size: 13px;
    color: var(--color-text-light);
    font-weight: 400;
    line-height: 1.7;
}

/* Badge IA */
.ai-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background-color: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    padding: 8px 16px;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--color-text-light);
    margin-bottom: 20px;
}

/* Imagen circular */
.preview-container {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    overflow: hidden;
    border: 2px solid var(--color-border);
    margin: 0 auto 24px;
    position: relative;
    background-color: var(--color-bg-alt);
}

.preview-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Animación de escaneo */
@keyframes scan {
    0% {
        top: 0;
        opacity: 0;
    }

    5% {
        opacity: 0.8;
    }

    95% {
        opacity: 0.8;
    }

    100% {
        top: calc(100% - 3px);
        opacity: 0;
    }
}

.scan-line {
    position: absolute;
    left: 10%;
    right: 10%;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--color-accent), var(--color-gold), var(--color-accent), transparent);
    animation: scan 1.8s ease-in-out infinite;
}

/* Animación pulse durante análisis */
@keyframes pulse-border {

    0%,
    100% {
        border-color: var(--color-border);
    }

    50% {
        border-color: var(--color-accent);
    }
}

.analyzing .preview-container {
    animation: pulse-border 2s ease-in-out infinite;
}

/* Loading dots */
@keyframes fade-dots {

    0%,
    20% {
        opacity: 0.3;
    }

    50% {
        opacity: 1;
    }

    100% {
        opacity: 0.3;
    }
}

.dot {
    animation: fade-dots 1.4s infinite;
}

.dot:nth-child(2) {
    animation-delay: 0.2s;
}

.dot:nth-child(3) {
    animation-delay: 0.4s;
}

/* Cards */
.card {
    background: var(--color-white);
    border: 1px solid var(--color-border);
    padding: 20px;
    margin-bottom: 16px;
}

.card-title {
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #343434;
    margin-bottom: 16px;
}

/* Barras de progreso */
.progress-item {
    margin-bottom: 16px;
}

.progress-item:last-child {
    margin-bottom: 0;
}

.progress-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 6px;
}

.progress-label {
    font-size: 12px;
    color: var(--color-text);
    font-weight: 500;
}

.progress-value {
    font-size: 12px;
    color: var(--color-text);
    font-weight: 600;
}

.progress-bar {
    height: 4px;
    background: var(--color-bg-alt);
    overflow: hidden;
}

.progress-fill {
    height: 100%;
    background: var(--color-accent);
    transition: width 0.8s ease-out;
}

.progress-desc {
    font-size: 11px;
    color: var(--color-text-muted);
    margin-top: 4px;
    line-height: 1.5;
}

/* Diagnóstico badge - PROTAGONISTA */
.diagnosis-badge {
    display: inline-block;
    background: var(--color-black);
    color: var(--color-white);
    padding: 16px 40px;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* Resumen */
.summary-card {
    background: var(--color-bg-alt);
    border: 1px solid var(--color-border);
    padding: 20px;
    margin-bottom: 24px;
}

.summary-title {
    font-family: var(--font-serif);
    font-size: 16px;
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 10px;
}

.summary-text {
    font-size: 13px;
    color: var(--color-text-light);
    line-height: 1.7;
}

/* Product cards */
.product-card {
    display: flex;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    margin-bottom: 12px;
    transition: border-color 0.3s ease;
}

.product-card:hover {
    border-color: var(--color-accent);
}

.product-image {
    width: 100px;
    height: 100px;
    flex-shrink: 0;
    background: var(--color-bg-alt);
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-info {
    flex: 1;
    padding: 12px 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-name {
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text);
    line-height: 1.4;
    margin-bottom: 4px;
}

.product-desc {
    font-size: 11px;
    color: var(--color-text-muted);
    line-height: 1.4;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
}

.product-price {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text);
}

/* Estilos para ofertas/descuentos de Shopify */
.product-price-wrapper {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.product-price-original {
    font-size: 12px;
    font-weight: 400;
    color: #999;
    text-decoration: line-through;
}

.product-price-sale {
    color: #c0392b;
    font-weight: 700;
}

.product-discount-badge {
    display: inline-block;
    background: #c0392b;
    color: #fff;
    font-size: 9px;
    font-weight: 700;
    padding: 2px 5px;
    border-radius: 3px;
    letter-spacing: 0.02em;
}

.btn-buy {
    background: var(--color-black);
    color: var(--color-white);
    padding: 10px 16px;
    font-size: 9px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    text-decoration: none;
    transition: background 0.3s ease;
    min-height: 40px;
    display: flex;
    align-items: center;
}

.btn-buy:hover {
    background: var(--color-accent-dark);
}

/* Link de reinicio */
.restart-link {
    display: inline-block;
    font-size: 11px;
    color: var(--color-text-light);
    text-decoration: underline;
    text-underline-offset: 4px;
    transition: color 0.3s ease;
    letter-spacing: 0.05em;
}

.restart-link:hover {
    color: var(--color-text);
}

/* Footer */
.footer {
    text-align: center;
    padding: 24px 0 16px;
    border-top: 1px solid var(--color-border);
    margin-top: auto;
}

.footer-text {
    font-size: 10px;
    color: var(--color-text-muted);
    letter-spacing: 0.1em;
}

/* Pequeños ajustes mobile */
@media (max-width: 380px) {
    .title-large {
        font-size: 28px;
    }

    .btn-primary {
        padding: 16px 32px;
    }
}

/* Subscription Form */
.sub-form-container {
    margin-top: 40px;
    padding: 32px 20px;
    background-color: #F2EFE9;
    /* Slightly darker crema */
    border: 1px solid var(--color-border);
    text-align: center;
}

.sub-form-claim {
    font-family: var(--font-serif);
    font-size: 18px;
    line-height: 1.4;
    color: var(--color-text);
    margin-bottom: 24px;
}

.sub-input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid #D0CEC7;
    background: #FFF;
    font-family: var(--font-sans);
    font-size: 11px;
    margin-bottom: 12px;
    border-radius: 8px;
    /* Pillow shape for modern feel */
    outline: none;
    transition: border-color 0.3s;
}

.sub-input:focus {
    border-color: var(--color-text);
}

.btn-black {
    width: 100%;
    background: #000;
    color: #FFF;
    padding: 14px;
    border: none;
    border-radius: 8px;
    font-family: var(--font-serif);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 12px;
    cursor: pointer;
    margin-top: 8px;
}

.checkbox-container {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin-top: 16px;
    text-align: left;
}

.checkbox-container input {
    margin-top: 2px;
}

.checkbox-label {
    font-size: 10px;
    color: var(--color-text-muted);
    line-height: 1.4;
}

.checkbox-label a {
    color: var(--color-text);
    text-decoration: underline;
}

/* Routine Steps */
.step-header {
    text-align: left;
    margin: 32px 0 16px;
    padding-left: 12px;
    border-left: 2px solid var(--color-accent);
}

.step-label {
    font-family: var(--font-serif);
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--color-text);
    font-weight: 600;
    display: block;
}

.step-benefit {
    font-size: 11px;
    color: var(--color-text-muted);
    font-weight: 400;
    margin-top: 4px;
    font-style: italic;
    display: block;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Face Guide Overlay */
.face-guide {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 75vw;
    height: 100vw;
    max-width: 400px;
    max-height: 533px;
    border: 2px dashed rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    box-shadow: 0 0 0 9999px rgba(0, 0, 0, 0.5);
    z-index: 15;
    pointer-events: none;
}

@media (min-width: 768px) {
    .face-guide {
        width: 45vh;
        height: 60vh;
        border-radius: 50% / 40%;
    }
}

/* Camera Modal */
.camera-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #000;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.camera-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: scaleX(-1);
    /* Mirror effect */
}

.flash-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: white;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.1s ease-out;
    z-index: 1001;
}

.camera-controls {
    position: absolute;
    bottom: 30px;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    z-index: 1002;
}

.btn-capture {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: white;
    border: 4px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
}

.btn-cancel {
    color: white;
    background: rgba(0, 0, 0, 0.5);
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12px;
    border: none;
}

.low-light-warning {
    position: absolute;
    top: 20px;
    background: rgba(0, 0, 0, 0.6);
    color: #FFD700;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 12px;
    display: none;
    z-index: 1002;
}

.camera-btn-secondary {
    display: block;
    margin-top: 15px;
    font-size: 12px;
    color: var(--color-text);
    text-decoration: underline;
    cursor: pointer;
    font-weight: 500;
}

/* ============================= */
/* CUESTIONARIO PRELIMINAR       */
/* ============================= */

/* Barra de progreso */
.q-progress-container {
    margin-bottom: 24px;
}

.q-progress-bar {
    height: 4px;
    background: var(--color-border);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 8px;
}

.q-progress-fill {
    height: 100%;
    background: var(--color-accent);
    transition: width 0.3s ease;
}

.q-progress-text {
    font-size: 11px;
    color: var(--color-text-muted);
    letter-spacing: 0.05em;
}

/* Pasos del cuestionario */
.q-step {
    display: none;
    animation: fadeIn 0.3s ease;
}

.q-step-visible {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.q-title {
    font-family: var(--font-serif);
    font-size: 24px;
    font-weight: 400;
    color: var(--color-text);
    margin-bottom: 8px;
}

.q-subtitle {
    font-size: 12px;
    color: var(--color-text-muted);
    margin-bottom: 28px;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

/* Preguntas */
.q-question {
    margin-bottom: 24px;
    text-align: left;
}

.q-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: var(--color-text);
    margin-bottom: 12px;
    line-height: 1.4;
}

.q-label small {
    font-weight: 400;
    color: var(--color-text-muted);
}

.q-label-small {
    font-size: 11px;
    margin-bottom: 8px;
}

/* Sub-preguntas condicionales */
.q-sub-question {
    margin-top: 16px;
    padding: 12px;
    background: var(--color-bg-alt);
    border-radius: 8px;
}

/* Grid de opciones - Mobile-first (2 columnas por defecto) */
.q-options-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
    overflow: hidden;
    /* Evitar desbordamiento lateral */
}

.q-options-row {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.q-options-stack {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

/* Opciones tipo pill */
.q-option {
    position: relative;
    cursor: pointer;
}

.q-option input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.q-option span {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 10px 14px;
    background: var(--color-white);
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 11px;
    font-weight: 500;
    color: var(--color-text);
    text-align: center;
    transition: all 0.2s ease;
    min-height: 44px;
    /* Regla del pulgar */
}

.q-option:hover span {
    border-color: var(--color-accent);
}

.q-option input:checked+span {
    background: var(--color-accent);
    border-color: var(--color-accent);
    color: var(--color-white);
}

/* Opciones de ancho completo */
.q-option-full span {
    justify-content: flex-start;
    border-radius: 8px;
}

/* Opciones pequeñas */
.q-option-sm span {
    padding: 8px 10px;
    font-size: 10px;
    min-height: 36px;
}

/* Opción ancha (para última fila impar) */
.q-option-wide {
    grid-column: span 2;
}

/* Grid de checkboxes - estilo consistente con botones de stack */
.q-options-check .q-option span {
    border-radius: 8px;
}

/* Responsive móvil - asegurar 2 columnas y sin desbordamiento */
@media (max-width: 480px) {
    .q-options-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .q-option-wide {
        grid-column: span 2;
    }

    /* Asegurar que el texto no desborde */
    .q-option span {
        word-break: break-word;
        hyphens: auto;
        font-size: 10px;
        padding: 8px 10px;
    }
}

/* Navegación del cuestionario */
.q-nav {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--color-border);
}

.q-btn {
    flex: 1;
    padding: 14px 20px;
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    min-height: 48px;
}

.q-btn-primary {
    background: var(--color-black);
    color: var(--color-white);
    border: none;
}

.q-btn-primary:hover {
    background: var(--color-accent-dark);
}

.q-btn-secondary {
    background: transparent;
    color: var(--color-text);
    border: 1px solid var(--color-border);
}

.q-btn-secondary:hover {
    border-color: var(--color-text);
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* ESTILOS DE IMPRESIÓN - Formato A4 Optimizado */
/* ═══════════════════════════════════════════════════════════════════════════ */
@media print {

    /* RESET ABSOLUTO - ESTRATEGIA FULL WIDTH */
    @page {
        size: A4;
        margin: 1.5cm;
        /* Márgenes estándar de impresión */
    }

    html,
    body {
        background: #fff !important;
        height: auto !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        overflow: visible !important;
    }

    /* 1. OCULTAR TODO VISUALMENTE */
    body * {
        visibility: hidden;
    }

    /* 2. HACER VISIBLE SOLO RESULTADOS */
    #state-results,
    #state-results * {
        visibility: visible !important;
    }

    /* 3. POSICIONAMIENTO Y ANCHO COMPLETO */
    /* Romper la restricción de móvil (420px) */
    .container,
    .app-container,
    .main-content {
        max-width: none !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
    }

    /* Wrapper de resultados posicionado absolutamente en (0,0) de la página */
    #state-results {
        position: absolute !important;
        left: 0 !important;
        top: 0 !important;
        width: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        display: block !important;
        background-color: white !important;
        z-index: 9999 !important;
    }

    /* 4. OCULTAR ELEMENTOS INTERACTIVOS */
    #state-results .restart-link,
    #state-results button,
    #state-results .sub-form-container,
    #state-results .card-title,
    .no-print {
        display: none !important;
    }

    /* ESTILOS DE IMPRESIÓN (Tipografía y Layout) */
    #state-results::before {
        content: "SÅPER - Tu Diagnóstico de Piel Personalizado";
        display: block;
        font-family: serif;
        font-size: 24pt;
        /* Aumentado para A4 */
        font-weight: bold;
        text-align: center;
        margin-bottom: 25pt;
        padding-bottom: 10pt;
        border-bottom: 2px solid #333;
        visibility: visible !important;
    }

    #state-results::after {
        content: "www.saper.es • Såper Organic Skincare";
        display: block;
        text-align: center;
        font-size: 10pt;
        color: #666;
        margin-top: 30pt;
        padding-top: 10pt;
        border-top: 1px solid #ccc;
        visibility: visible !important;
    }

    /* Layout de cartas más amplio */
    .card {
        border: 1px solid #ddd !important;
        box-shadow: none !important;
        page-break-inside: avoid;
        margin-bottom: 20px !important;
        background: white !important;
        padding: 20px !important;
        /* Más aire interno */
    }

    /* Foto del usuario */
    .preview-container {
        width: 100px !important;
        height: 100px !important;
        margin: 15px auto !important;
        border: none !important;
        /* Quitar borde gris si se prefiere limpio */
    }

    canvas {
        max-width: 100% !important;
        height: auto !important;
        page-break-inside: avoid;
    }

    /* Productos: Grid optimizado para A4 (2 columnas amplias o 3) */
    #products-container {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 20px !important;
    }

    .product-card {
        border: 1px solid #eee !important;
        page-break-inside: avoid;
        margin: 0 !important;
    }

    /* Forzar colores de fondo */
    * {
        -webkit-print-color-adjust: exact !important;
        print-color-adjust: exact !important;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* TABS AM/PM RUTINA                                                            */
/* ═══════════════════════════════════════════════════════════════════════════ */

.routine-tabs {
    display: flex;
    gap: 0;
    margin-bottom: 20px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    overflow: hidden;
}

.routine-tab {
    flex: 1;
    padding: 14px 8px;
    background: var(--color-white);
    border: none;
    font-family: var(--font-sans);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.2s ease;
    color: var(--color-text);
}

.routine-tab:first-child {
    border-right: 1px solid var(--color-border);
}

.routine-tab:hover {
    background: var(--color-bg-alt);
}

.routine-tab.active {
    background: var(--color-black);
    color: var(--color-white);
}

/* Contenedores de productos AM/PM */
.routine-products {
    display: block;
}

.routine-products.routine-hidden {
    display: none;
}

.routine-products.routine-visible {
    display: block;
}

/* Ocultar contenedor print en pantalla */
.print-only {
    display: none !important;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* ANIMACIONES DE PRODUCTOS (Fade-in + Slide-up)                               */
/* ═══════════════════════════════════════════════════════════════════════════ */

@keyframes productFadeSlideIn {
    from {
        opacity: 0;
        transform: translateY(24px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-animate-in {
    opacity: 0;
    animation: productFadeSlideIn 0.5s ease-out forwards;
}

/* Delay escalonado para cada producto */
.product-animate-in:nth-child(1) {
    animation-delay: 0ms;
}

.product-animate-in:nth-child(2) {
    animation-delay: 100ms;
}

.product-animate-in:nth-child(3) {
    animation-delay: 200ms;
}

.product-animate-in:nth-child(4) {
    animation-delay: 300ms;
}

.product-animate-in:nth-child(5) {
    animation-delay: 400ms;
}

.product-animate-in:nth-child(6) {
    animation-delay: 500ms;
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* ESTILOS DE IMPRESIÓN - AM/PM Separados                                      */
/* ═══════════════════════════════════════════════════════════════════════════ */
@media print {

    /* Ocultar tabs en impresión */
    .routine-tabs,
    #cart-buttons-container,
    .cart-buttons {
        display: none !important;
    }

    /* Mostrar contenedor de impresión */
    .print-only {
        display: block !important;
    }

    /* Ocultar contenedores interactivos AM/PM */
    #products-am,
    #products-pm {
        display: none !important;
    }

    /* Encabezado de sección en impresión (rutina unificada) */
    .print-section-am::before {
        content: "Tu Rutina Diaria";
        display: block;
        font-family: var(--font-serif);
        font-size: 16pt;
        font-weight: bold;
        margin: 25pt 0 15pt;
        padding-bottom: 8pt;
        border-bottom: 2px solid var(--color-accent);
        color: var(--color-text);
    }

    /* OLD: Sección PM ya no aplica (rutina unificada) */
    .print-section-pm::before {
        content: none;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* ESTILOS DESKTOP/LAPTOP - Contenedor más ancho y fuentes más grandes        */
/* ═══════════════════════════════════════════════════════════════════════════ */
@media (min-width: 768px) {

    /* Contenedor más ancho para desktop */
    .container {
        max-width: 1024px;
        padding: 32px 40px;
    }

    /* Fuentes base más grandes */
    body {
        font-size: 16px;
    }

    /* Títulos más grandes */
    .logo {
        font-size: 32px;
    }

    .tagline {
        font-size: 15px;
    }

    .card-title {
        font-size: 22px;
    }

    /* Cuestionario */
    .q-title {
        font-size: 28px;
    }

    .q-subtitle {
        font-size: 13px;
    }

    .q-label {
        font-size: 15px;
    }

    .q-option span {
        font-size: 13px;
        padding: 12px 16px;
    }

    /* Resultados */
    .summary-text {
        font-size: 15px;
        line-height: 1.7;
    }

    .progress-label {
        font-size: 13px;
    }

    .progress-value {
        font-size: 13px;
    }

    .progress-desc {
        font-size: 13px;
    }

    /* Productos */
    .product-name {
        font-size: 15px;
    }

    .product-desc {
        font-size: 13px;
    }

    .product-price {
        font-size: 15px;
    }

    /* Botones */
    .btn-buy {
        font-size: 11px;
        padding: 10px 16px;
    }

    .q-btn {
        font-size: 12px;
        padding: 16px 24px;
    }

    /* Tabs AM/PM más grandes */
    .routine-tab {
        font-size: 12px;
        padding: 16px 12px;
    }

    /* Botones de carrito en desktop: Diurna/Nocturna lado a lado */
    #cart-buttons-container>div {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        gap: 12px;
        max-width: 100% !important;
    }

    #btn-cart-am,
    #btn-cart-pm {
        grid-row: 1;
    }

    #btn-add-all-cart {
        grid-column: 1 / -1;
        grid-row: 2;
    }
}

/* ═══════════════════════════════════════════════════════════════════════════ */
/* PANTALLAS PEQUEÑAS - Compactar portada y privacidad para above-the-fold  */
/* ═══════════════════════════════════════════════════════════════════════════ */
@media (max-height: 700px) and (max-width: 480px) {

    /* --- PORTADA (state-intro) --- */
    #state-intro {
        padding-top: 16px !important;
        padding-bottom: 16px !important;
    }
    
    /* H1 "TEST DE PIEL" */
    #state-intro > h1 {
        margin-bottom: 8px !important;
    }
    
    /* Emoji sparkle */
    #state-intro > div:first-of-type {
        font-size: 20px !important;
        margin-bottom: 10px !important;
    }
    
    /* "Descubre tu rutina ideal" */
    #state-intro > div:nth-of-type(2) {
        font-size: 26px !important;
        margin-bottom: 12px !important;
    }
    
    /* Subtexto descriptivo */
    #state-intro > p:first-of-type {
        margin-bottom: 16px !important;
        font-size: 13px !important;
    }
    
    /* Gota de crema - más pequeña */
    #state-intro .cream-drop-card {
        width: 100px !important;
        height: 130px !important;
        margin-bottom: 20px !important;
    }
    
    /* Textos bajo el botón CTA */
    #state-intro > p:nth-of-type(2) {
        margin-top: 10px !important;
    }
    #state-intro > p:nth-of-type(3) {
        margin-top: 4px !important;
    }

    /* --- PRIVACIDAD (state-privacy) --- */
    #state-privacy {
        padding: 12px 16px !important;
    }
    
    /* Header "Privacidad" */
    #state-privacy > div:first-child {
        margin-bottom: 12px !important;
    }
    
    /* Título "Tu Privacidad Importa" */
    #state-privacy > h2 {
        font-size: 22px !important;
        margin-bottom: 8px !important;
    }
    
    /* Subtexto descriptivo */
    #state-privacy > p:first-of-type {
        margin-bottom: 16px !important;
        font-size: 12px !important;
    }
    
    /* Contenedor de las 3 secciones de info */
    #state-privacy > div:nth-of-type(2) {
        gap: 10px !important;
        margin-bottom: 16px !important;
    }
    
    /* Cada card de info - más compacta */
    #state-privacy > div:nth-of-type(2) > div {
        padding: 10px 12px !important;
        gap: 10px !important;
    }
    
    /* Iconos más pequeños */
    #state-privacy > div:nth-of-type(2) > div > div:first-child {
        width: 28px !important;
        height: 28px !important;
        min-width: 28px !important;
    }
    #state-privacy > div:nth-of-type(2) > div > div:first-child svg {
        width: 14px !important;
        height: 14px !important;
    }
    
    /* Títulos de secciones info */
    #state-privacy > div:nth-of-type(2) > div > div:last-child > div {
        font-size: 12px !important;
        margin-bottom: 2px !important;
    }
    
    /* Textos de secciones info */
    #state-privacy > div:nth-of-type(2) > div > div:last-child > p {
        font-size: 11px !important;
    }
    
    /* Checkbox de aceptación */
    #state-privacy .checkbox-container {
        margin-bottom: 16px !important;
    }
}