* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
html, body {
    width: 100%;
    height: 100%;
    background-color: #ffffff;
}

/* En desktop: sin scroll */
@media (min-width: 769px) {
    body {
        overflow: hidden;
    }
}

/* En móvil: con scroll */
@media (max-width: 768px) {
    body {
        overflow-y: auto;
        overflow-x: hidden;
    }
}
/* ========================
   CAPA TRASERA (la imagen que se ve al doblar la esquina)
======================== */
#background-behind{
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('../img/background_behind.png') no-repeat center center;
  background-size: 100% 100%;
  z-index: 1;
}
/* NUEVO DIV CON IMAGEN DETRAS DEL LOADER */
#background-loader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('../img/fondo_loader.jpg') no-repeat center center;
  background-size: cover;
  z-index: 9997;
}
/* LOADER PRINCIPAL - Versión desktop */
#loader {
  position: fixed;
  inset: 0;
  width: 100%;
  min-height: 100vh;
  background: url('../img/background_loading.jpg') no-repeat center center;
  background-size: cover;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  z-index: 9999;
  transition: opacity 0.8s ease, visibility 0.8s;
  padding: 40px 20px;
  /* Recortar la esquina superior izquierda - TAMAÑO 200px */
  clip-path: polygon(
    200px 0%,
    100% 0%,
    100% 100%,
    0% 100%,
    0% 200px
  );
}

/* En móvil, el loader debe permitir scroll y mantener la esquina doblada */
@media (max-width: 768px) {
    #loader {
        position: relative;
        min-height: 100vh;
        height: auto;
        overflow-y: visible;
        /* Mantener la esquina doblada en móvil con tamaño ajustado */
        clip-path: polygon(
            120px 0%,
            100% 0%,
            100% 100%,
            0% 100%,
            0% 120px
        );
        padding: 60px 20px 40px 20px;
    }
}
@media (max-width: 550px) {
    #loader {
        clip-path: polygon(
            100px 0%,
            100% 0%,
            100% 100%,
            0% 100%,
            0% 100px
        );
        padding: 80px 20px 40px 20px;
    }
}
/* Sombra para dar efecto de profundidad en la esquina doblada - Versión desktop */
.loader-corner-shadow {
    position: absolute;
    top: 0;
    left: 0;
    width: 200px;
    height: 200px;
    pointer-events: none;
    z-index: 10000;

    /* sombra principal */
    background:
        linear-gradient(
            135deg,
            rgba(0,0,0,0.30) 0%,
            rgba(0,0,0,0.18) 18%,
            rgba(0,0,0,0.08) 35%,
            rgba(0,0,0,0) 65%
        );

    /* profundidad */
    filter: blur(1px);

    /* sombra extra para efecto 3D */
    box-shadow:
        12px 12px 30px rgba(0,0,0,0.18),
        inset -8px -8px 15px rgba(255,255,255,0.08);
}
@media (max-width: 768px) {
    .loader-corner-shadow {
        width: 120px;
        height: 120px;
    }
}

@media (max-width: 550px) {
    .loader-corner-shadow {
        width: 100px;
        height: 100px;
    }
}
.loader-content {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center; 
    justify-content: center;
    text-align: center;
    max-width: 1200px;
    width: 100%;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);
}
.loader-title{
    font-family: 'Barlow', sans-serif;
    font-weight: 200;
    font-size: 2.40rem;
    color: #173060;
    letter-spacing: 3px;
    text-align: center;
    margin-bottom: 2px;
    line-height: 1;
    opacity: 0;
    animation: text-focus-in 1s ease forwards;
    animation-delay: 5s;
}
.loader-subtitle{
    font-family: 'Barlow', sans-serif;
    font-weight: 200;
    font-size: 1.40rem;
    color: #173060;
    text-align: center;
    margin-bottom: 20px;
    line-height: 1.1;
    opacity: 0;
    animation: text-focus-in 1s ease forwards;
    animation-delay: 5s;
}
.loader-img {
    width: 70%;
    max-width: none;
    height: auto;
    display: block;
    opacity: 0;
    animation: showLogo 0.8s ease forwards;
    animation-delay: 1s;
    will-change: opacity, transform;
    transform: translateZ(0);
    -webkit-transform: translateZ(0);

    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    image-rendering: auto;
}
@keyframes showLogo {
    from {
        opacity: 0;
        transform: translateZ(0);
    }
    to {
        opacity: 1;
        transform: translateZ(0);
    }
}
/* Animación text-focus-in */
@-webkit-keyframes text-focus-in {
    0% {
        -webkit-filter: blur(12px);
                filter: blur(12px);
        opacity: 0;
    }
    100% {
        -webkit-filter: blur(0px);
                filter: blur(0px);
        opacity: 1;
    }
}
@keyframes text-focus-in {
    0% {
        -webkit-filter: blur(12px);
                filter: blur(12px);
        opacity: 0;
    }
    100% {
        -webkit-filter: blur(0px);
                filter: blur(0px);
        opacity: 1;
    }
}
.loader-icons {
    width: 50%;
    margin-top: 25px;
    margin-bottom: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 5px;
    height: 40px;
    overflow: hidden;
}
.icon {
    width: auto;
    height: 90%;
    max-height: 40px;
    object-fit: contain;
    display: block;
    flex-shrink: 0;
    animation: text-focus-in 0.8s cubic-bezier(0.550, 0.085, 0.680, 0.530) forwards;
    opacity: 0;
}
.loader-icons .icon:nth-child(1) { animation-delay: 2.5s; animation-duration: 1.2s; }
.loader-icons .icon:nth-child(2) { animation-delay: 3.2s; animation-duration: 1.2s; }
.loader-icons .icon:nth-child(3) { animation-delay: 3.9s; animation-duration: 1.2s; }
/* ========== ESTILOS DE LAS CARDS - Sin efecto zoom ========== */
.cards-container {
    display: flex;
    justify-content: center;
    gap: 60px;
    flex-wrap: wrap;
    width: 100%;
    margin: 5px 0;
    opacity: 0;
    transform: translateY(100px);
    animation: cardsUp 1.2s ease forwards;
    animation-delay: 6s;
}
@keyframes cardsUp {
    from {
        opacity: 0;
        transform: translateY(100px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
.card {
    position: relative;
    width: 280px;
    height: 220px;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.card:hover {
    transform: translateY(-5px);
}
/* Contenedor de la imagen de fondo - SIN ZOOM */
.card-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}
/* Overlay oscuro para mejorar legibilidad */
.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}
/* Icono pequeño para la primera card - Centrado verticalmente */
.card-icon {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    width: 100px;
    height: 100px;
}
.card-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
/* Email centrado verticalmente para la card dos */
.card-email {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    font-family: 'Barlow', sans-serif;
    font-weight: 500;
    font-size: 1.20rem;
    color: #173060;
    text-align: center;
    white-space: nowrap;
}
/* Icono de Instagram centrado verticalmente para la card tres */
.card-instagram {
    position: absolute;
    top: 30%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2;
    width: 50px;
    height: 50px;
}
.card-instagram img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}
/* Contenido de la card - Texto en la parte inferior (bottom) */
.card-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 20px;
}
.card-title {
    font-family: 'Barlow', sans-serif;
    font-size: 1.45rem;
    color: #173060;
    text-align: center;
    letter-spacing: 2px;
    font-weight: 300;
    margin: 0;
    line-height: 1.3;
}

.email-footer {
    font-family: 'Barlow', sans-serif;
    font-size: 0.9rem;
    color: rgba(255,255,255,0.8);
    text-align: center;
    margin-top: 20px;
    letter-spacing: 1px;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(23, 48, 96, 0.40);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
}
.modal-content {
    position: relative;
    width: 90%;
    max-width: 1000px;
    height: 85%;
    background: #fff;
    border-radius: 10px;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.5);
    overflow: hidden;
    animation: modalFadeIn 0.3s ease;
}
@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

.close-modal {
    position:absolute;
    top:14px;
    right:16px;
    width:32px;
    height:32px;
    padding:0;
    display:flex;
    align-items:center;
    justify-content:center;
    border:2px solid rgba(255,255,255,.5);
    border-radius:50%;
    background:#e6e9ec;
    backdrop-filter:blur(5px);
    cursor:pointer;
    overflow:hidden;
    transition:
    border-color .3s ease,
    background .3s ease,
    box-shadow .3s ease;
    z-index:99999;
}
.close-modal svg{
    width:14px;
    height:14px;
    stroke:#385077;
    stroke-width:2.5;
    fill:none;
    stroke-linecap:round;
    stroke-linejoin:round;
    transform-origin:center center;
    transition:
    stroke .3s ease,
    transform .5s ease;
}
.close-modal:hover {
    background: #f0f4f8;
    border-color: #17305a;
    box-shadow: 0 4px 16px rgba(0, 27, 83, 0.15);
}

.close-modal:hover svg {
    stroke: #17305a;
    transform: rotate(90deg);
}

.close-modal:active svg {
    transform: rotate(90deg) scale(0.85);
}

.close-modal:focus-visible {
    outline: 3px solid #001B53;
    outline-offset: 3px;
}

.close-modal:focus-visible svg {
    transform: rotate(90deg);
}
.pdf-viewer {
    width: 100%;
    height: 100%;
    border: none;
}
#flipbook{
    width: 100%;
    height: 100%;
    min-height: 700px;
    background: #111;
    position: relative;
    overflow: hidden;
    cursor: default;
    display: flex;
    justify-content: center;
    align-items: center;
}

.flipbook-inner{
    position: relative;
    width: fit-content;
    height: fit-content;
    transform-origin: center center;
    transition: transform .2s ease;
    will-change: transform;
}

#flipbook.zoom-active{
    cursor: grab;
}

#flipbook.zoom-active.dragging{
    cursor: grabbing;
}

#flipbook::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}   

#flipbook::-webkit-scrollbar-track {
    background: rgba(0,0,0,0.2);
}

#flipbook::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.4);
    border-radius: 4px;
}
#flipbook .stf__block {
    margin: 0 auto !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
}
#flipbook.dragging{
    cursor: grabbing;
}
.page {
    background: #fff;
    display: flex;
    justify-content: center;
    align-items: center;
}
.page canvas{
    display:block;
    margin:auto;
    max-width:100%;
    height:auto;
    image-rendering:auto;
    image-rendering:high-quality;
    backface-visibility:hidden;
    transform:translateZ(0);
}
#pdf-loader{
    position:absolute;
    inset:0;
    background:#111;
    display:flex;
    flex-direction:column;
    justify-content:center;
    align-items:center;
    z-index:20;
    color:white;
    font-family:'Barlow',sans-serif;
    gap:20px;
}
.spinner{
    width:60px;
    height:60px;
    border:4px solid rgba(255,255,255,.2);
    border-top-color:white;
    border-radius:50%;
    animation:spin 1s linear infinite;
}
@keyframes spin{
    to{
        transform:rotate(360deg);
    }
}

.pdf-controls{
    position:absolute;
    width:100%;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    z-index: 10002;
    display: flex;
    align-content:center;
    justify-content:center;
    gap: 12px;
}

.pdf-controls button{
    width: 48px;
    height: 48px;
    border: none;
    border-radius: 50%;
    background: rgba(0,0,0,.75);
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    font-weight: bold;
    line-height: 1;
    transition: .25s;
    backdrop-filter: blur(5px);
}

.pdf-controls button i {
    font-size: 24px;
}

.pdf-controls button:hover{
    transform: scale(1.08);
    background: rgba(0,0,0,.95);
}

#flipbook {
    overflow: hidden !important;
}

.flipbook-inner {
    transition: transform 0.3s ease !important;
}

@media (max-width: 1024px) {
    .loader-title {
        margin-top: 60px;
        font-size: 1.30rem;
    }
    .loader-subtitle{
        font-size: 0.90rem;
    }
    .loader-icons {
        width: 70%;
        margin-top: 10px;
        margin-bottom: 20px;
    }
    .icon {
        height: 60%;
    }
    .cards-container {
        gap: 20px;
        margin-bottom: 40px;
    }
    .card {
        width: 210px;
        height: 210px;
    }
    .card-title {
        font-size: 1rem;
    }
    .card-icon {
        width: 80px;
        height: 80px;
    }
    .card-email {
        font-size: 1.05rem;
        white-space: normal;
        text-align: center;
        width: 100%;
    }
    .card-instagram {
        width: 60px;
        height: 60px;
    }
    .loader-img {
        width: 50%;
    }
}
/* Responsive para cards en móvil */
@media (max-width: 768px) {
    .modal-content {
        width: 95%;
        height: 90%;
    }
    .close-modal {
        top: 10px;
        right: 10px;
        width: 35px;
        height: 35px;
        font-size: 28px;
    }
    .loader-title {
        margin-top: 40px;
        font-size: 1rem;
    }
    .loader-subtitle {
        margin-top: 5px;
        margin-bottom: 10px;
        font-size: 0.70rem;
    }
    .loader-icons {
        width: 70%;
    }
    .icon {
        height: 40%;
    }
    .cards-container {
        gap: 20px;
        margin-bottom: 40px;
    }
    .card {
        width: 240px;
        height: 240px;
    }
    .card-title {
        font-size: 1.5rem;
    }
    .loader-img {
        width: 50%;
    }
    .pdf-controls button {
        width: 40px;
        height: 40px;
        font-size: 20px;
    }
    .pdf-controls button i {
        font-size: 20px;
    }
    .pdf-controls {
        bottom: 10px;
        gap: 8px;
    }
}
/* En móvil, agregar más margen superior al subtítulo */
@media (max-width: 550px) {
    .loader-title {
        margin-top: 60px;
        font-size: 1.50rem;
    }
    .loader-subtitle {
        margin-top: 5px;
        margin-bottom: 5px;
        font-size: 0.80rem;
    }
    .loader-icons {
        width: 70%;
        margin-top: 10px;
        margin-bottom: 30px;
    }
    .icon {
        height: 40%;
    }
    .card {
        width: 100%;
        max-width: 280px;
        height: 280px;
    }
    .card-title {
        font-size: 1.30rem;
    }
    .loader-img {
        width: 90%;
    }
    .pdf-controls button {
        width: 38px;
        height: 38px;
        font-size: 18px;
    }
    .pdf-controls button i {
        font-size: 18px;
    }
}
@media (max-width: 540px) {
    .loader-img {
        width: 60%;
    }
    .icon {
        height: 35%;
    }
    .loader-title {
        margin-top: 60px;
        font-size: 1.20rem;
    }
}
@media (max-width: 480px) {
    .loader-icons {
        width: 90%;
        margin-top: 10px;
        margin-bottom: 30px;
    }
    .icon {
        height: 35%;
    }
    .card {
        width: 100%;
        max-width: 280px;
        height: 280px;
    }
    .loader-img {
        width: 90%;
    }
}@media (max-width: 480px) {
    .loader-img {
        width: 80%;
    }
}
@media (max-width: 360px) {
    .loader-img {
        width: 90%;
    }
}
@media (max-width: 320px) {
    .card {
        width: 100%;
        max-width: 280px
    }
}