/* 1. CONFIGURACIÓN BASE */

:root {
  --font-main: "EB Garamond", serif;
  --font-ui: "Noto Sans", sans-serif;

  --color-bluedark: #2c3e50;
  --color-dark: #121212;
  --color-medium-gray: #5a5466;
  --color-light: #fdfaf6;
  --color-accent: #c5a059;
  --color-accent-dark: #b08d4a;

  --color-instagram: #e4405f;
  --color-twitter: #000000;
  --color-facebook: #1877f2;
  --color-tiktok: #010101;
  --color-glyph: #888888;
  --color-amazon: #ff9900;

  --header-height: 70px;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  max-width: 100%;
}

img,
iframe,
video {
  max-width: 100%;
  height: auto;
  display: block;
}

html {
  scroll-behavior: smooth;
  overflow-x: clip;
}

body {
  font-family: var(--font-main);
  background-color: var(--color-light);
  color: var(--color-dark);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: clip;
  max-width: 100%;
  margin: 0;
}

.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition:
    opacity 0.8s cubic-bezier(0.2, 1, 0.3, 1),
    transform 0.8s cubic-bezier(0.2, 1, 0.3, 1);
  will-change: opacity, transform;
}
.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

/* 2. HEADER */
.header {
  position: sticky;
  top: 0;
  z-index: 1000;
  width: 100%;
  height: var(--header-height);
  display: flex;
  align-items: center;
  background-color: rgba(253, 250, 246, 0.8);
  backdrop-filter: blur(15px);
  -webkit-backdrop-filter: blur(15px);
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);
  transition: all 0.3s ease;
}

.header__container {
  width: 95%;
  max-width: 1800px;
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.header__logo {
  font-family: var(--font-main);
  font-size: clamp(2rem, 5vw, 2.8rem);
  font-weight: 700;
  text-decoration: none;
  letter-spacing: -0.5px;
  color: var(--color-bluedark);
  transition: transform 0.3s ease;
}
.header__logo:hover {
  transform: scale(1.02);
}

/* BOTÓN MÓVIL */
.mobile-btn {
  display: none;
  background: none;
  border: none;
  padding: 10px;
  font-size: 1.8rem;
  color: var(--color-bluedark);
  cursor: pointer;
  z-index: 1100;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.3s ease;
}
.mobile-btn:active {
  transform: scale(0.9);
}

/* NAV DESKTOP */
.header__nav {
  display: none;
}
@media (min-width: 992px) {
  .header__nav {
    display: block;
  }
}

.header__menu {
  list-style: none;
  display: flex;
  gap: 1.5rem;
  align-items: center;
}

.header__link {
  text-decoration: none;
  color: var(--color-dark);
  font-size: 0.85rem;
  font-weight: 500;
  transition: color 0.3s ease;
  text-transform: uppercase;
  letter-spacing: 1px;
}
.header__link:hover {
  color: var(--color-accent);
}

.header__cta {
  background-color: var(--color-accent);
  color: white;
  padding: 0.7rem 1.6rem;
  border-radius: 4px;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 0.8rem;
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 4px 15px rgba(197, 160, 89, 0.2);
  text-transform: uppercase;
  letter-spacing: 1px;
  border: none;
  cursor: pointer;
}
.header__cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(197, 160, 89, 0.4);
  background-color: var(--color-accent-dark);
}
.header__cta:active {
  transform: translateY(0) scale(0.98);
}

/* EMAIL ANIMADO */
.mail-wrapper {
  display: flex;
  align-items: center;
  position: relative;
}
.nav-email-icon {
  font-size: 1.3rem;
  color: var(--color-bluedark);
  transition: all 0.4s ease;
}
.mail-wrapper .fa-envelope-open {
  display: none;
}
@media (hover: hover) {
  .mail-wrapper:hover .fa-envelope {
    display: none;
  }
  .mail-wrapper:hover .fa-envelope-open {
    display: inline-block;
    color: var(--color-accent);
  }
}

.cart-wrapper {
  display: flex;
  align-items: center;
}

.nav-cart-icon {
  font-size: 1.3rem;
  /* color: var(--color-bluedark); */
  color: #b0b0b0;
  transition: all 0.4s ease;
  display: inline-block;
  text-decoration: none;
}

/* .nav-cart-icon:hover {
  color: var(--color-accent);
  transform: scale(1.15);
} */

/* MENÚ MÓVIL — Ú*/
@media (max-width: 991px) {
  .nav-cart-icon {
    font-size: 1.6rem;
    padding: 0.5rem 0;
  }
  .mobile-btn {
    display: block;
  }

  .header__nav {
    display: block;
    position: fixed;
    top: var(--header-height);
    right: 0;
    width: 100%;
    height: calc(100vh - var(--header-height));
    background-color: #ffffff;
    transform: translateX(100%);
    transition: transform 0.5s cubic-bezier(0.2, 1, 0.3, 1);
    z-index: 1050;
    visibility: hidden;
    overflow-y: auto;
  }

  .header__nav.active {
    transform: translateX(0);
    visibility: visible;
    box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
  }

  .header__menu {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 4rem 2rem;
    gap: 2.5rem;
    width: 100%;
    min-height: 100%;
  }

  .header__link {
    font-size: 1.1rem;
    width: 100%;
    text-align: center;
    border-bottom: 1px solid rgba(0, 0, 0, 0.03);
    padding-bottom: 1rem;
    color: var(--color-bluedark);
  }
}

/* 3. HERO */
.hero {
  padding: clamp(4rem, 10vh, 8rem) 0;
  min-height: calc(100vh - var(--header-height));
  display: flex;
  align-items: center;
  overflow: hidden;
  text-align: center;
}
@media (min-width: 992px) {
  .hero {
    text-align: left;
  }
}

.hero__container {
  width: 95%;
  max-width: 1800px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 3rem;
  align-items: center;
}
@media (min-width: 992px) {
  .hero__container {
    grid-template-columns: 1.3fr 0.7fr;
    gap: 5rem;
  }
}
@media (max-width: 991px) {
  .hero__container {
    padding: 0 1rem;
  }
}

.hero__tag {
  display: inline-block;
  background-color: rgba(197, 160, 89, 0.1);
  color: var(--color-accent);
  padding: 0.5rem 1.2rem;
  border-radius: 50px;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 2rem;
  border: 1px solid rgba(197, 160, 89, 0.2);
}

.hero__title {
  line-height: 1.1;
  margin-bottom: 2.5rem;
}

.hero__book-title {
  display: block;
  font-family: var(--font-ui);
  font-size: clamp(3rem, 7vw, 6rem);
  color: var(--color-bluedark);
  font-weight: 700;
}

.hero__book-subtitle {
  display: block;
  font-family: var(--font-ui);
  font-size: clamp(1.8rem, 5vw, 4.5rem);
  color: var(--color-accent);
  font-weight: 400;
  margin-top: 0.2rem;
}

.hero__description {
  font-size: clamp(1.1rem, 1.5vw, 1.3rem);
  color: #3e3e3e;
  margin-bottom: 4rem;
  line-height: 1.8;
  max-width: 800px;
}
@media (max-width: 991px) {
  .hero__description {
    margin-left: auto;
    margin-right: auto;
  }
}

.hero__actions {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
  justify-content: center;
}
@media (min-width: 992px) {
  .hero__actions {
    justify-content: flex-start;
  }
}

.hero__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  padding: 1.2rem 2.4rem;
  border-radius: 4px;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: none;
  cursor: pointer;
}
.hero__btn--primary {
  background-color: var(--color-bluedark);
  color: white;
  box-shadow: 0 10px 25px rgba(44, 62, 80, 0.25);
}
.hero__btn--secondary {
  border: 2px solid var(--color-bluedark);
  color: var(--color-bluedark);
  background-color: transparent;
}
.hero__btn:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(44, 62, 80, 0.2);
}
.hero__btn--secondary:hover {
  background-color: var(--color-bluedark);
  color: white;
}

.hero__visual {
  display: flex;
  justify-content: center;
  align-items: center;
  perspective: 2000px;
  margin-top: 3rem;
}
@media (min-width: 992px) {
  .hero__visual {
    margin-top: 0;
    justify-content: flex-end;
  }
  .hero__book-cover {
    border-radius: 4px 15px 15px 4px;
  }
}

.hero__book-cover {
  max-width: 85%;
  width: 420px;
  height: auto;
  border-radius: 15px;
  box-shadow: 30px 30px 80px rgba(0, 0, 0, 0.25);
  transform: rotateY(-12deg) rotateX(2deg);
  transition:
    transform 0.8s cubic-bezier(0.2, 1, 0.3, 1),
    box-shadow 0.5s ease;
  transform-style: preserve-3d;
  will-change: transform;
}
.hero__book-cover:hover {
  transform: rotateY(-5deg) rotateX(0deg) scale(1.04);
  box-shadow: 20px 20px 60px rgba(0, 0, 0, 0.3);
}

@media (max-width: 991px) {
  .hero__visual {
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 2rem;
  }

  .hero__visual a {
    display: block;
    width: fit-content;
    margin: 0 auto;
  }

  .hero__book-cover {
    width: 100%;
    max-width: 300px;
    height: auto;
    transform: rotateY(-8deg) rotateX(2deg);
    transform-origin: center center;
    margin: 0 auto;
  }

  .hero__container {
    padding: 0 1rem;
    grid-template-columns: 1fr;
    justify-items: center;
  }
}

/* 4. BIOGRAFÍA */
.author-bio {
  padding: clamp(6rem, 12vh, 10rem) 0;
  background-color: #fff;
  scroll-margin-top: var(--header-height);
  text-align: center;
}
@media (min-width: 992px) {
  .author-bio {
    text-align: left;
  }
}

.author-bio__container {
  width: 95%;
  max-width: 1800px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 4rem;
  align-items: center;
}
@media (min-width: 992px) {
  .author-bio__container {
    grid-template-columns: 0.9fr 1.1fr;
    gap: 6rem;
  }
}

.author-bio__visual {
  position: relative;
  max-width: 500px;
  margin: 0 auto;
}
@media (min-width: 992px) {
  .author-bio__visual {
    margin: 0;
  }
}

.author-bio__image {
  width: 100%;
  height: auto;
  border-radius: 24px;
  box-shadow: 0 40px 80px -20px rgba(0, 0, 0, 0.15);
  filter: grayscale(40%);
  transition: all 0.6s cubic-bezier(0.2, 1, 0.3, 1);
  will-change: filter, transform;
}
.author-bio__image:hover {
  filter: grayscale(0%);
  transform: scale(1.01);
}

.author-bio__decoration {
  position: absolute;
  top: -20px;
  left: -20px;
  width: 120px;
  height: 120px;
  border-top: 4px solid var(--color-accent);
  border-left: 4px solid var(--color-accent);
  z-index: -1;
  opacity: 0.6;
}

.author-bio__title {
  font-family: var(--font-main);
  font-size: clamp(2.2rem, 5vw, 4rem);
  color: var(--color-bluedark);
  margin-bottom: 2.5rem;
  line-height: 1.1;
}
.author-bio__title span {
  font-size: clamp(2.2rem, 3.5vw, 2.5rem);
  display: block;
  color: var(--color-accent);
  font-weight: 400;
}
.author-bio__text {
  font-size: clamp(1.1rem, 1.4vw, 1.25rem);
  line-height: 1.9;
  color: #444;
  margin-bottom: 2rem;
  max-width: 750px;
}
@media (max-width: 991px) {
  .author-bio__text {
    margin-left: auto;
    margin-right: auto;
  }
}

/* 5. FOOTER */
.footer {
  margin-top: auto;
  padding: clamp(4rem, 8vh, 6rem) 1.5rem;
  background-color: #ffffff;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  text-align: center;
  scroll-margin-top: var(--header-height);
}

/* Newsletter block */
.footer__newsletter {
  margin-bottom: 3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
}

.footer__newsletter-title {
  font-family: var(--font-main);
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  font-weight: 700;
  color: var(--color-bluedark);
}

.footer__newsletter-text {
  font-family: var(--font-main);
  font-size: clamp(1rem, 2vw, 1.2rem);
  color: #666;
  max-width: 500px;
  line-height: 1.6;
}

.footer__newsletter-action {
  margin-top: 0.5rem;
}

/* Redes sociales */
.footer__social-list {
  list-style: none;
  display: flex;
  justify-content: center;
  gap: 2.5rem;
  margin-bottom: 3rem;
}

.footer__social-link {
  font-size: 1.8rem;
  color: var(--color-glyph);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  text-decoration: none;
  display: inline-block;
  padding: 0.5rem;
}
.footer__social-link--instagram:hover {
  color: var(--color-instagram);
  transform: translateY(-5px);
}
.footer__social-link--twitter:hover {
  color: var(--color-twitter);
  transform: translateY(-5px);
}
.footer__social-link--facebook:hover {
  color: var(--color-facebook);
  transform: translateY(-5px);
}
.footer__social-link--tiktok:hover {
  color: var(--color-tiktok);
  transform: translateY(-5px);
}
.footer__social-link--amazon:hover {
  color: #ff9900;
  transform: translateY(-3px);
}

/* Email */
.footer__email {
  display: inline-block;
  margin-bottom: 2.5rem;
  color: var(--color-bluedark);
  text-decoration: none;
  font-weight: 700;
  font-family: var(--font-ui);
  font-size: clamp(1.2rem, 3vw, 1.6rem);
  transition: color 0.3s ease;
  position: relative;
}
.footer__email::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 1px;
  bottom: -4px;
  left: 0;
  background-color: var(--color-accent);
  transform: scaleX(0);
  transition: transform 0.3s ease;
}
.footer__email:hover {
  color: var(--color-accent);
}
.footer__email:hover::after {
  transform: scaleX(1);
}

/* Copy */
.footer__copy {
  font-size: 0.85rem;
  color: #777;
  letter-spacing: 0.5px;
  margin-bottom: 0.8rem;
  font-family: var(--font-main);
}

/* BOTONES */
.btn-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: var(--color-accent);
  color: white;
  padding: 1.2rem 2.8rem;
  border-radius: 6px;
  text-decoration: none;
  font-family: var(--font-ui);
  font-weight: 700;
  font-size: 1rem;
  letter-spacing: 1px;
  border: none;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  box-shadow: 0 10px 20px rgba(197, 160, 89, 0.2);
  text-align: center;
}
.btn-cta:hover {
  background-color: var(--color-accent-dark);
  transform: translateY(-4px);
  box-shadow: 0 15px 30px rgba(197, 160, 89, 0.35);
}
.btn-cta:active {
  transform: translateY(-1px) scale(0.98);
  box-shadow: 0 5px 10px rgba(197, 160, 89, 0.2);
}

/* FOMO TAG */
.fomo-tag {
  display: inline-flex;
  align-items: center;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #555;
  font-family: var(--font-main);
  background-color: rgba(0, 0, 0, 0.03);
  padding: 0.6rem 1.4rem;
  border-radius: 50px;
  border: 1px solid rgba(0, 0, 0, 0.05);
}
.fomo-tag i {
  color: #27ae60;
  margin-right: 8px;
  font-size: 0.9rem;
  animation: pulse-icon 2s infinite;
}
@keyframes pulse-icon {
  0% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.2);
    opacity: 0.8;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

/* MODAL */
.modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: 0.5s;
}
.modal--active {
  opacity: 1;
  visibility: visible;
}
.modal__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(10px);
}
.modal__content {
  position: relative;
  background: var(--color-light);
  padding: 4rem;
  max-width: 550px;
  width: 90%;
  border-radius: 20px;
  text-align: center;
}
.modal__close {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  font-size: 2rem;
  cursor: pointer;
  border: none;
  background: none;
}
.modal__title {
  font-size: 2.2rem;
  margin-bottom: 1rem;
  color: var(--color-bluedark);
  font-family: var(--font-main);
}
.modal__warning {
  margin-bottom: 2rem;
}
.modal__warning p,
.modal__description {
  font-size: 1.3rem;
  color: #666;
  line-height: 1.6;
  margin-bottom: 2.5rem;
}
.modal__form {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
}
.modal__input {
  width: 100%;
  padding: 1.2rem;
  border: 2px solid #eee;
  border-radius: 8px;
  outline: none;
  font-family: var(--font-main);
  font-size: 1rem;
  transition: border-color 0.3s;
}
.modal__input:focus {
  border-color: var(--color-accent);
}
.modal__submit {
  width: 100%;
  background: var(--color-accent);
  color: white;
  padding: 1.2rem 2.5rem;
  border-radius: 6px;
  font-family: var(--font-main);
  font-weight: 700;
  text-transform: uppercase;
  font-size: 0.9rem;
  letter-spacing: 2px;
  border: none;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}
.modal__submit:hover {
  background: var(--color-accent-dark);
  transform: translateY(-3px);
}

/* FIX OVERFLOW MÓVIL */
@media (max-width: 600px) {
  .modal__content {
    width: 95%;
    padding: 2.5rem 1.5rem;
    max-width: 100%;
  }

  .modal__title,
  #modalTitle {
    font-size: 1.6rem;
  }

  .modal__description,
  .modal__warning p {
    font-size: 1rem;
  }

  .modal__input {
    font-size: 1rem;
  }

  .modal__submit,
  .btn-cta {
    font-size: 0.8rem;
    padding: 1rem 1.5rem;
    width: 100%;
  }
}

/* BACK TO TOP */
#backToTop {
  position: fixed;
  bottom: 30px;
  right: 30px;
  width: 55px;
  height: 55px;
  background-color: var(--color-accent);
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  z-index: 999;
  text-decoration: none;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  font-size: 1.3rem;
}
#backToTop.visible {
  opacity: 1;
  visibility: visible;
}
#backToTop:hover {
  background-color: var(--color-accent-dark);
  transform: translateY(-5px) scale(1.1);
}

.footer__credit {
  font-size: 0.75rem;
  color: #bbb;
  font-family: var(--font-ui);
  margin-top: 1.5rem;
  letter-spacing: 0.3px;
}

.footer__credit-link {
  color: var(--color-accent);
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer__credit-link:hover {
  color: var(--color-accent-dark);
}
