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

html {
    scroll-behavior: smooth;
}

body {
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ===== COLORES PERSONALIZADOS ===== */
:root {
    --primary: #E2AD9F;
    --cream: #F6F5EF;
    --beige: #E1CFC1;
    --dark: #333333;
    --white: #FFFFFF;
}

/* ===== ANIMACIONES ===== */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: all 0.8s ease-out;
}

.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

/* Animación de entrada escalonada para las cards */
.fade-in:nth-child(1) {
    transition-delay: 0.1s;
}

.fade-in:nth-child(2) {
    transition-delay: 0.2s;
}

.fade-in:nth-child(3) {
    transition-delay: 0.3s;
}

.fade-in:nth-child(4) {
    transition-delay: 0.4s;
}

/* ===== BOTONES ===== */
.cta-button {
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.cta-button::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.6s;
}

.cta-button:hover::before {
    left: 100%;
}

.cta-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 15px 35px rgba(226, 173, 159, 0.4);
}

.cta-button:active {
    transform: translateY(-1px);
    transition: all 0.1s ease;
}

/* ===== TESTIMONIAL CARDS ===== */
.testimonial-card {
    background: linear-gradient(145deg, var(--cream) 0%, var(--beige) 100%);
    border: 1px solid rgba(226, 173, 159, 0.1);
    transition: all 0.3s ease;
    position: relative;
}

.testimonial-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 1rem;
    padding: 2px;
    background: linear-gradient(145deg, var(--primary), var(--beige));
    mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    mask-composite: subtract;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.testimonial-card:hover::before {
    opacity: 1;
}

.testimonial-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(226, 173, 159, 0.2);
}

/* ===== NAVEGACIÓN ===== */
nav {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(226, 173, 159, 0.1);
}

/* ===== SECCIONES ===== */
section {
    position: relative;
    overflow: hidden;
}

/* Decorative elements */
section::before,
section::after {
    content: '';
    position: absolute;
    width: 200px;
    height: 200px;
    border-radius: 50%;
    opacity: 0.05;
    pointer-events: none;
}

section::before {
    background: var(--primary);
    top: -100px;
    right: -100px;
    animation: float 6s ease-in-out infinite;
}

section::after {
    background: var(--beige);
    bottom: -100px;
    left: -100px;
    animation: float 8s ease-in-out infinite reverse;
}

@keyframes float {

    0%,
    100% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-20px);
    }
}

/* ===== HERO SECTION ===== */
/* ===== HERO SECTION ===== */
#hero {
    background: linear-gradient(135deg, var(--cream) 0%, var(--beige) 50%, var(--primary) 100%);
}

/* ===== IMAGEN DEL LIBRO ===== */
.book-reflection::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    height: 20px;
    background: linear-gradient(to top, rgba(255, 255, 255, 0.2) 0%, transparent 100%);
    border-radius: 0 0 8px 8px;
    pointer-events: none;
}

/* Badge/etiqueta */
.book-badge {
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

/* Loading state para la imagen */
.book-loading {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

/* Imagen cargada */
.book-image {
    opacity: 0;
    transition: opacity 0.5s ease;
}

.book-image.loaded {
    opacity: 1;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .book-image-hover {
        width: 300px;
        height: 380px;
    }
    
    .book-image-hover:hover {
        transform: scale(1.02) rotate(0.5deg);
    }
}

@media (max-width: 480px) {
    .book-image-hover {
        width: 250px;
        height: 320px;
    }
    
    .book-image-hover:hover {
        transform: none; /* Deshabilitar hover en móviles pequeños */
    }
}

/* Accesibilidad - reducir movimiento */
@media (prefers-reduced-motion: reduce) {
    .book-image-hover {
        transition: none !important;
    }
    
    .book-image-hover:hover {
        transform: none !important;
    }
}

/* Fallback si la imagen no carga */
.book-fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #E2AD9F 0%, #E1CFC1 100%);
    color: #F6F5EF;
    font-family: 'Petrona', serif;
    font-size: 1.5rem;
    text-align: center;
    width: 320px;
    height: 384px;
    border-radius: 8px;
}

/* Focus state para accesibilidad */
.book-image-hover:focus {
    outline: 3px solid #E2AD9F;
    outline-offset: 4px;
}

/* Optimización de rendimiento */
.book-container {
    will-change: transform;
    transform: translateZ(0);
}

/* ===== EFECTOS DE SCROLL ===== */
.parallax {
    transform: translateZ(0);
    transition: transform 0.1s ease-out;
}

/* ===== RESPONSIVE BREAKPOINTS ===== */
@media (max-width: 768px) {
    .testimonial-card {
        margin-bottom: 1rem;
    }

    .cta-button {
        width: 100%;
        margin-bottom: 0.5rem;
    }

    nav {
        padding: 1rem 0;
    }

    .book-3d:hover {
        transform: none;
        /* Deshabilitar efecto 3D en móviles */
    }
}

@media (max-width: 480px) {
    .container {
        padding-left: 1rem;
        padding-right: 1rem;
    }
}

/* ===== ACCESIBILIDAD ===== */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }

    .fade-in {
        opacity: 1;
        transform: none;
    }
}

/* ===== FOCUS STATES ===== */
.cta-button:focus,
nav a:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* ===== LOADING STATES ===== */
.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

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

/* ===== DARK MODE SUPPORT (OPCIONAL) ===== */
@media (prefers-color-scheme: dark) {
    /* Si quieres agregar soporte para dark mode más adelante */
}

/* ===== PRINT STYLES ===== */
@media print {

    nav,
    footer,
    .cta-button {
        display: none;
    }

    body {
        background: white;
        color: black;
    }

    section {
        break-inside: avoid;
        margin-bottom: 2rem;
    }
}

/* ===== IMAGEN DE LA AUTORA ===== */
.author-image {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 4px solid rgba(226, 173, 159, 0.2);
}

.author-image:hover {
    transform: scale(1.05);
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .author-image:hover {
        transform: scale(1.02);
    }
}

@media (prefers-reduced-motion: reduce) {
    .author-image {
        transition: none !important;
    }
    .author-image:hover {
        transform: none !important;
    }
}

.logo-cropped {
    height: 48px;
    width: 60px; /* Ajusta según necesites */
    object-fit: cover;
    object-position: center;
}