  :root {
  --tp-common-black: #C04E29;
}

body {
  font-family: Geist, sans-serif;
    margin: 0;
    padding: 20px;
    background-color: #000000;
    max-width: 100%;
    overflow-x: hidden;
  }
  
  .container {
    max-width: 100%;
    width: 95vw;
    margin: 0 auto;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    overflow: visible; 
  }
  
  .flipbook-viewport {
    position: relative;
    width: 90%;
    max-width: 1400px;
    margin: 10px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: visible;
  }
  
  .side-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: var(--tp-common-black);
    color: white;
    border: none;
    border-radius: 50%;
    width: 35px;
    height: 35px;
    cursor: pointer;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
  }
  
  .side-nav-btn i {
    font-size: 14px; /* Icono más pequeño */
  }

  #prev.side-nav-btn {
    left: -50px; /* Fuera del contenedor de la imagen */
  }
  
  #next.side-nav-btn {
    right: -50px; /* Fuera del contenedor de la imagen */
  }

  /* Responsividad para pantallas pequeñas */
  @media (max-width: 1200px) {
    .flipbook-viewport {
      width: 85%;
    }
    #prev.side-nav-btn { left: -40px; }
    #next.side-nav-btn { right: -40px; }
  }

  @media (max-width: 768px) {
    .flipbook-viewport {
      width: 80%;
    }
    #prev.side-nav-btn { 
      left: -35px;
      width: 30px;
      height: 30px;
    }
    #next.side-nav-btn { 
      right: -35px;
      width: 30px;
      height: 30px;
    }
  }

  #flipbook {
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
    background-color: var(--tp-common-black);
    margin: 0 auto;
  }
  
  /* Ajuste para turn.js */
  .magazine .page {
    width: 100%;
    height: 100%;
    background-color: #000000;
    box-shadow: 0 0 5px rgba(0,0,0,0.1);
    position: relative;
  }

  /* Efecto de esquina doblada (peel) */
  .magazine .page::after {
    content: "";
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 0 0 0;
    border-color: transparent transparent #f0f0f0 #ccc;
    box-shadow: -2px -2px 5px rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    pointer-events: none;
    z-index: 10;
    opacity: 0;
  }

  /* Mostrar solo al pasar el mouse */
  .magazine .page:hover::after {
    opacity: 1;
    border-width: 0 0 45px 45px;
  }

  /* Animación más pronunciada al estar cerca de la esquina */
  .magazine .page:hover::after {
    border-color: transparent transparent #e0e0e0 #bbb;
  }

  /* Ocultar el efecto en la última página */
  .magazine .page.last-page::after {
    display: none;
  }

  #flipbook img {
    width: 100% !important;
    height: 100% !important;
    display: block;
  }

  /* Controles y Redes Sociales en una línea */
  .controls-container {
    margin: 20px auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
    box-sizing: border-box;
  }

  .left-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
  }

  .center-logo {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .flip-footer-logo {
    height: 40px;
    width: auto;
    filter: brightness(0) invert(1);
  }

  .right-social {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    flex: 1;
  }

  .right-social .social-icons {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 10px;
  }

  .right-social .social-icons .separator {
    width: 1px;
    height: 20px;
    background-color: #ccc;
    margin: 5px 10px;
    list-style: none;
  }

  .right-social .social-icons a {
    color: #555;
    font-size: 14px; 
    transition: all 0.3s ease;
    display: inline-block;
    width: 30px;
    height: 30px;
    line-height: 30px;
    text-align: center;
    border-radius: 50%;
    background-color: #f9f9f9;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
  }

  .right-social .social-icons a:hover {
    color: #4285f4;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
    background-color: white;
  }

  .page-indicator {
    margin-left: 15px;
    padding: 8px 12px;
    background-color: #f0f0f0;
    border-radius: 4px;
    font-size: 14px;
    color: #333;
  }

  button {
    padding: 8px 15px;
    background-color: var(--tp-common-black);
    color: white;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
  }
  
  button:hover:not(:disabled) {
    background-color: #000;
    transform: translateY(-1px);
  }

  button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
  }

  .btn-outlined {
    background-color: transparent !important;
    border: 1px solid var(--tp-common-black) !important;
    color: var(--tp-common-black) !important;
  }

  .btn-outlined:hover:not(:disabled) {
    background-color: var(--tp-common-black) !important;
    color: white !important;
  }

  .btn-icon {
    background: none !important;
    border: none !important;
    color: var(--tp-common-black) !important;
    font-size: 1.2rem !important;
    padding: 5px !important;
    width: auto !important;
    height: auto !important;
  }

  .btn-icon:hover {
    color: #000 !important;
    transform: scale(1.1) !important;
    background: none !important;
  }

  /* Fullscreen styles */
  #flipbook-container:fullscreen {
    background-color: #f5f5f5;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100vw;
    height: 100vh;
  }

  #flipbook-container:fullscreen #flipbook {
    margin: 20px auto;
  }

  #loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(255,255,255,0.8);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
  }
  
  .spinner {
    border: 5px solid #f3f3f3;
    border-top: 5px solid #3498db;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    animation: spin 1s linear infinite;
  }
  
  @keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }

  /* Versión Mobile */
  @media (max-width: 768px) {
    .container {
      padding-top: 80px;
      justify-content: flex-start;
      min-height: calc(100vh - 80px);
    }

    .center-logo {
      position: absolute;
      top: 20px;
      left: 0;
      right: 0;
      flex: none;
      z-index: 10;
    }

    .flip-footer-logo {
      height: 35px;
    }

    .controls-container {
      flex-direction: column;
      gap: 20px;
      margin-top: 30px;
    }

    .left-controls {
      order: 1;
      width: 100%;
      justify-content: center;
      flex-wrap: wrap;
    }

    .right-social {
      order: 2;
      width: 100%;
      justify-content: center;
      flex: none;
    }

    .flipbook-viewport {
      margin: 0 auto;
    }

    .side-nav-btn {
      width: 40px;
      height: 40px;
    }

    #page-num {
      margin: 0 10px;
    }

    #flipbook img {
       object-fit: contain !important;
     }
   }

  /* Modo Horizontal en Móviles */
  @media (max-width: 932px) and (orientation: landscape) {
    .container {
      padding-top: 10px;
      padding-bottom: 10px;
      min-height: auto;
    }

    .flipbook-viewport {
      width: 100% !important;
      max-width: 100vw !important;
      margin: 0;
    }

    #flipbook {
      width: 100% !important;
    }

    .center-logo {
      display: none !important; /* Ocultar logo en horizontal para ganar espacio vertical */
    }

    #fullscreen-btn {
      display: flex !important; /* Forzar mostrar el botón de fullscreen en horizontal */
    }

    .controls-container {
      margin-top: 10px;
      flex-direction: row !important;
      gap: 10px;
      width: 100%;
      justify-content: space-around;
    }

    .side-nav-btn {
      background-color: rgba(0, 0, 0, 0.5); /* Más sutil en horizontal */
    }

    #prev.side-nav-btn { left: 10px; }
    #next.side-nav-btn { right: 10px; }
  }