/* =========================================
   1. VARIABLES Y CONFIGURACIÓN GLOBAL
   ========================================= */
:root {
  /* Paleta de Colores */
  --color-dorado: #ffb300;
  --color-madera: #3e2723;
  --color-negro: #1a1a1a;
  --color-naranja-fuego: #fe7f2a;

  /* Tipografías */
  --font-titulos: "Pirata One", system-ui;
  --font-texto: "Della Respira", serif;
}

/* Reset Básico */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  background-color: #1a1a1a; /* Color de seguridad */
  background-image: radial-gradient(
    circle at top center,
    #2a2a2a,
    var(--color-negro)
  );
  font-family: var(--font-texto);
  color: #fff;
  min-height: 100vh;
}

/* Utilidades Generales */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}
.section-padding {
  padding: 80px 0;
}

/* Títulos Globales */
h1,
h2,
h3 {
  font-family: var(--font-titulos);
}

.section-title {
  color: var(--color-dorado);
  font-size: 3.5rem;
  text-align: center;
  margin-bottom: 50px;
  text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

/* =========================================
   2. COMPONENTES (BOTONES)
   ========================================= */
.btn-cta {
  display: inline-block;
  background-color: var(--color-naranja-fuego);
  color: #fff !important;
  padding: 10px 25px;
  border-radius: 4px;
  font-weight: bold;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: var(--font-texto);
  font-size: 1.1rem;
}

.btn-cta:hover {
  background-color: var(--color-naranja-fuego);
  transform: scale(1.05);
}

.btn-large {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  height: 70px;
  background-color: var(--color-dorado);
  color: var(--color-negro) !important;
  font-size: 1.9rem;
  font-family: var(--font-titulos);
}

.qty-btn {
  background: #444;
  border: none;
  color: #fff;
  width: 40px;
  height: 50px;
  cursor: pointer;
  font-size: 1.2rem;
  font-family: var(--font-titulos);
  transition: background 0.2s;
}

.qty-btn:hover {
  background: var(--color-naranja-fuego);
}

.main-btn {
  display: inline-block;
  padding: 12px 30px;
  font-size: 1.2rem;
  background-color: var(--color-naranja-fuego);
  color: var(--color-negro);
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font-titulos);
  text-transform: uppercase;
  text-decoration: none;
  transition: transform 0.2s;
}

.main-btn:hover {
  transform: scale(1.05);
  background-color: #fff;
}

/* =========================================
   3. BARRA DE NAVEGACIÓN (HEADER)
   ========================================= */
.navbar {
  background-color: var(--color-madera);
  height: 80px;
  border-bottom: 4px solid var(--color-naranja-fuego);
  position: sticky;
  top: 0;
  z-index: 1000;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.5);
}

.nav-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

.logo {
  font-family: var(--font-titulos);
  font-size: 2.5rem;
  color: var(--color-dorado);
  text-decoration: none;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 30px;
  align-items: center;
}

.nav-links a {
  text-decoration: none;
  color: #ffffff;
  font-size: 1.1rem;
  transition: color 0.3s ease;
}

.nav-links > li > a:hover {
  color: var(--color-naranja-fuego);
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 21px;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  height: 3px;
  width: 100%;
  background-color: var(--color-naranja-fuego);
  border-radius: 3px;
  transition: all 0.3s ease;
}

/* =========================================
   4. SECCIÓN HERO (PORTADA)
   ========================================= */
.hero {
  background: linear-gradient(
      to right,
      rgba(0, 0, 0, 0.85) 0%,
      rgba(0, 0, 0, 0.3) 50%,
      rgba(0, 0, 0, 0.1) 100%
    ),
    url("barco.jpg");
  background-size: cover;
  background-position: center 60%;
  background-repeat: no-repeat;
  width: 100%;
  min-height: 450px;
  padding: 80px 0;
  border-bottom: 4px solid var(--color-naranja-fuego);
  display: flex;
  align-items: center;
}

.hero .container {
  display: flex;
  flex-direction: column;
  align-items: center; /* CAMBIO: Centra los elementos (título, botón) horizontalmente */
  justify-content: center;
  text-align: center; /* CAMBIO: Centra el texto si ocupa varias líneas */
}

.hero h1 {
  font-size: 4rem;
  color: var(--color-dorado);
  margin-bottom: 15px;
  line-height: 1.1;
  text-shadow: 2px 3px 5px rgba(0, 0, 0, 0.9);
  max-width: 600px;
}

.hero p {
  font-size: 1.25rem;
  max-width: 500px;
  margin-bottom: 30px;
  color: #f0f0f0;
}

/* =========================================
   5. SECCIÓN: SOBRE EL LIBRO
   ========================================= */
.about-book {
  background-color: #242424;
  border-top: 1px solid var(--color-madera);
  border-bottom: 1px solid var(--color-madera);
}

.about-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 50px;
  align-items: center;
}

.book-cover-placeholder {
  border-radius: 8px;
  border: 4px solid var(--color-naranja-fuego);
  box-shadow: 10px 10px 30px rgba(0, 0, 0, 0.6);
  transform: rotate(-3deg);
  transition: all 0.3s ease;
  margin: 0 auto;
  display: block;
  width: 450px;
  padding: 20px 0;
}

.book-cover-placeholder:hover {
  transform: rotate(0deg) scale(1.05);
  box-shadow: 0 15px 40px rgba(255, 179, 0, 0.2);
}

.book-cover-real {
  width: 100%;
  max-width: 350px;
  height: auto;
  margin: 0 auto;
  display: block;
}

.book-info h2 {
  color: var(--color-dorado);
  font-size: 3rem;
  margin-bottom: 20px;
}

.book-info .synopsis {
  font-size: 1.1rem;
  line-height: 1.8;
  color: #ddd;
  border-left: 3px solid var(--color-naranja-fuego);
  padding-left: 20px;
  margin-bottom: 30px;
}

.tech-specs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 15px;
  background: rgba(0, 0, 0, 0.3);
  padding: 20px;
  border-radius: 8px;
  border: 1px dashed var(--color-naranja-fuego);
}

.spec-item strong {
  color: var(--color-dorado);
  display: block;
  font-family: var(--font-texto);
  font-size: 1em;
}

/* =========================================
   6. SECCIÓN: PERSONAJES
   ========================================= */
.char-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 40px;
}

.char-card {
  background-color: #222;
  border: 1px solid #444;
  border-radius: 8px;
  overflow: hidden;
  transition: transform 0.3s ease;
}

.char-card:hover {
  transform: translateY(-10px);
  border-color: var(--color-naranja-fuego);
  box-shadow: 0 10px 20px rgba(255, 179, 0, 0.2);
}

.char-image {
  height: 500px;
  width: 100%;
  background-color: #333;
  border-bottom: 4px solid var(--color-naranja-fuego);
  overflow: hidden;
}

.char-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  transition: transform 0.5s ease;
}

.char-card:hover .char-image img {
  transform: scale(1.1);
}

.char-content {
  padding: 25px;
  text-align: center;
}

.char-content h3 {
  font-size: 2rem;
  color: #fff;
  margin-bottom: 5px;
}

.char-content .role {
  color: var(--color-naranja-fuego);
  font-weight: bold;
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 2px;
}

/* =========================================
   7. SECCIÓN: COMPRA
   ========================================= */
.buy-section {
  background-color: var(--color-negro);
}

.product-card-wrapper {
  background-color: var(--color-madera);
  border: 2px solid var(--color-naranja-fuego);
  border-radius: 12px;
  padding: 40px;
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 50px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.5);
  align-items: center;
}

.book-3d-mockup {
  background-image: url(tapadura.jpg);
  background-size: cover;
  background-position: center;
  display: block;
  height: 620px;
  width: 100%;
}

.book-3d-img {
  width: 100%;
  max-width: 320px;
  height: auto;
  border: 3px solid var(--color-naranja-fuego);
  border-radius: 4px 8px 8px 4px;
  transform: perspective(1000px) rotateY(-20deg);
  box-shadow: -15px 15px 25px rgba(0, 0, 0, 0.5);
  transition: transform 0.5s ease;
  margin: 0 auto;
  display: block;
}

.book-3d-img:hover {
  transform: perspective(1000px) rotateY(0deg) scale(1.05);
  z-index: 10;
}

.category-tag {
  background-color: var(--color-naranja-fuego);
  padding: 5px 10px;
  border-radius: 4px;
  text-transform: uppercase;
  font-size: 0.8rem;
  font-weight: bold;
}

.product-title {
  font-size: 3.5rem;
  margin: 15px 0 10px;
  line-height: 1;
}

.product-price {
  font-size: 2.5rem;
  color: var(--color-naranja-fuego);
  margin-bottom: 20px;
}

.old-price {
  font-size: 1.5rem;
  color: #888;
  text-decoration: line-through;
  margin-left: 10px;
}

.purchase-controls {
  display: flex;
  gap: 20px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.quantity-selector {
  display: flex;
  align-items: center;
  border: 1px solid #666;
  border-radius: 4px;
  overflow: hidden;
}

.quantity-selector input {
  background: #222;
  border: none;
  color: #fff;
  width: 50px;
  text-align: center;
  height: 50px;
  font-size: 1.2rem;
}

.product-features {
  list-style: none;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: 20px;
}

.product-features li {
  margin-bottom: 8px;
  color: #ccc;
}

/* =========================================
   8. FOOTER
   ========================================= */
.main-footer {
  background-color: var(--color-madera);
  padding-top: 60px;
  border-top: 4px solid var(--color-naranja-fuego);
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 40px;
  padding-bottom: 40px;
}

.footer-logo h3 {
  font-size: 2rem;
  color: var(--color-naranja-fuego);
  margin-bottom: 10px;
}

.footer-links ul {
  list-style: none;
}

.footer-links ul li {
  margin-bottom: 10px;
}

.footer-links a {
  color: #ccc;
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--color-naranja-fuego);
}

.footer-bottom {
  background-color: #2b1b18;
  text-align: center;
  padding: 20px;
  color: #aaa;
}

/* =========================================
   9. PÁGINA CHECKOUT
   ========================================= */
.checkout-container {
  display: grid;
  grid-template-columns: 1.5fr 1fr;
  gap: 60px;
  padding: 60px 20px;
  align-items: start;
}

.page-title {
  color: var(--color-naranja-fuego);
  font-size: 3rem;
  margin-bottom: 30px;
}

.pirate-form input {
  width: 100%;
  padding: 12px;
  background-color: #2a2a2a;
  border: 1px solid #444;
  border-radius: 4px;
  color: #fff;
  margin-bottom: 10px;
}

.btn-full {
  width: 100%;
  margin-top: 20px;
  font-size: 1.5rem;
}

.summary-card {
  background-color: var(--color-madera);
  padding: 30px;
  border-radius: 8px;
  border: 2px solid var(--color-naranja-fuego);
}

.total-row.final-total {
  margin-top: 20px;
  font-size: 1.5rem;
  font-weight: bold;
}

/* =========================================
   10. RESPONSIVE (MÓVIL)
   ========================================= */
@media (max-width: 768px) {
  .nav-toggle {
    display: flex;
    z-index: 2000;
  }
  .nav-links {
    position: absolute;
    top: 80px;
    left: 0;
    width: 100%;
    background-color: rgba(62, 39, 35, 0.95);
    flex-direction: column;
    padding: 20px 0;
    transform: translateY(-150%);
    transition: transform 0.4s ease;
    z-index: 1000;
  }
  .nav-links.active {
    transform: translateY(0);
  }

  .hero {
    background-position: 70% center;
    min-height: 400px;
  }
  .hero h1 {
    font-size: 2.8rem;
  }
  .about-grid,
  .checkout-container,
  .product-card-wrapper {
    grid-template-columns: 1fr;
  }
  .book-cover-real,
  .book-3d-img {
    max-width: 250px;
  }
  .btn-large {
    width: 100%;
  }
}
/* =========================================
   11. ESTILOS DE FICHAS DE PERSONAJE (PERFILES)
   ========================================= */

/* Ajuste para que la tarjeta de perfil alinee el contenido arriba */
.product-card-wrapper.profile-layout {
  align-items: flex-start;
}

/* Contenedor de la foto en la ficha */
.profile-image-container {
  height: auto; /* Se adapta a la imagen */
  border-radius: 8px;
  border: 4px solid var(--color-dorado);
  overflow: hidden;
}

.profile-image-container img {
  display: block;
  width: 100%;
  height: auto;
}

/* Caja de Estadísticas (Habilidades) */
.stats-card {
  margin-top: 20px;
  background-color: rgba(0, 0, 0, 0.3);
  padding: 20px;
  border-radius: 8px;
  font-size: 1.4em;
}

.stats-card h3 {
  color: var(--color-dorado);
  margin-bottom: 10px;
}

/* Texto de la Biografía */
.char-quote {
  font-size: 1.5rem;
  color: var(--color-dorado);
  font-style: italic;
  margin-bottom: 20px;
}

.char-bio {
  line-height: 1.8;
  font-size: 1.1rem;
  color: #ddd;
}

/* Utilidad para enlaces en bloque (Index) */
.link-block {
  display: block;
}
