
/* =========================================
   PUFFY LINES — ESTILOS GENERALES
========================================= */

:root {
  --cream: #fff7f0;
  --pink: #c77e95;
  --ink: #584753;
  --sage: #e6eedf;
  --lavender: #f0e7f5;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: Arial, sans-serif;
  line-height: 1.6;
}

a {
  color: inherit;
}

section {
  padding: 65px 24px;
}

.container {
  max-width: 1100px;
  margin: auto;
}

h1 {
  font-size: clamp(32px, 4.2vw, 54px);
  line-height: 1.12;
}

h2 {
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.2;
}

p {
  max-width: 650px;
}

.center {
  text-align: center;
}

.center p {
  margin: 15px auto;
}


/* =========================================
   CABECERA
========================================= */

.site-header {
  max-width: 1150px;
  margin: auto;
  padding: 12px 24px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.header-top {
  position: relative;
  width: 100%;
  min-height: 58px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.logo {
  font-size: 36px;
  font-weight: 800;
  text-align: center;
  margin: 0;
}

.logo span {
  color: var(--pink);
}

.header-top .country-picker {
  position: absolute;
  top: 0;
  left: 0;
  z-index: 20;
}

.header-nav {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 38px;
  margin-top: 8px;
}

.header-nav a {
  text-decoration: none;
  font-size: 14px;
}


/* =========================================
   SELECTOR DE AMAZON POR PAÍS
========================================= */

.country-picker {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.country-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  color: #8c6b7b;
  text-transform: uppercase;
}

.country-dropdown {
  position: relative;
}

.country-trigger {
  display: flex;
  align-items: center;
  gap: 9px;
  width: 185px;
  padding: 10px 12px;
  background: #fffdfb;
  border: 1px solid #eadbde;
  border-radius: 12px;
  color: var(--ink);
  font-size: 13px;
  cursor: pointer;
}

.country-trigger img,
.country-option img {
  width: 24px;
  height: 17px;
  object-fit: cover;
  border-radius: 2px;
}

.country-arrow {
  width: 8px;
  height: 8px;
  margin-left: auto;
  border-right: 2px solid #8c6b7b;
  border-bottom: 2px solid #8c6b7b;
  transform: rotate(45deg);
  flex-shrink: 0;
}

.country-menu {
  position: absolute;
  top: calc(100% + 7px);
  right: 0;
  width: 225px;
  max-height: 340px;
  overflow-y: auto;
  padding: 6px;
  background: #fffdfb;
  border: 1px solid #eadbde;
  border-radius: 14px;
  box-shadow: 0 12px 28px rgba(88, 71, 83, 0.15);
  z-index: 2000;
}

.country-menu[hidden] {
  display: none;
}

.country-option {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  padding: 10px;
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: var(--ink);
  font-size: 13px;
  text-align: left;
  cursor: pointer;
}

.country-option:hover,
.country-option[aria-selected="true"] {
  background: #f8e9e9;
}

.country-check {
  margin-left: auto;
  color: var(--pink);
  font-weight: bold;
}

.country-trigger:focus-visible,
.country-option:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: 2px;
}


/* =========================================
   PORTADA — HERO ROSA
========================================= */

main > section:first-child {
  padding-top: 20px;
}

.hero {
  width: 100%;
  background: #fbe5dc;
  border-radius: 28px;
  padding: 35px 30px;
  text-align: center;
}

.site-header + .hero {
  margin-top: 12px;
}

.eyebrow {
  color: #a66f7f;
  text-transform: uppercase;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 2px;
}

.hero h1 {
  font-size: clamp(32px, 4.2vw, 54px);
  line-height: 1.12;
  margin-top: 14px;
  margin-bottom: 14px;
}

.hero p {
  margin: 0 auto 12px;
}


/* =========================================
   CATÁLOGO DE LIBROS
========================================= */

.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 20px;
  margin-top: 35px;
}

.hero .grid {
  width: 100%;
  max-width: 100%;
  margin: 20px auto 0;
}

.card {
  min-width: 0;
  width: 100%;
  background: white;
  padding: 22px;
  border-radius: 20px;
  box-shadow: 0 5px 20px #5847530c;
  transition: transform 0.25s ease,
              box-shadow 0.25s ease;
}

.card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 28px #58475320;
}

.card h3 {
  margin-bottom: 5px;
}

.card .button {
  margin-top: 12px;
}


/* =========================================
   BOTONES
========================================= */

.button {
  display: inline-block;
  padding: 13px 23px;
  border-radius: 12px;
  background: var(--pink);
  color: white;
  font-weight: bold;
  text-decoration: none;
  border: 0;
  cursor: pointer;
  transition: transform 0.2s ease,
              background 0.2s ease;
}

.button.secondary {
  background: white;
  color: var(--ink);
}

.button:hover:not(:disabled) {
  transform: translateY(-2px);
  background: #ad6680;
}

.button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}


/* =========================================
   GALERÍAS INTERACTIVAS DE LOS LIBROS
========================================= */

/* Un solo rectángulo crema por libro */
.book-gallery {
  width: 100%;
  min-width: 0;
  padding: 14px;
  background: #f3e9e5;
  border-radius: 18px;
}

/* Portada o imagen principal */
.cover {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  aspect-ratio: 3 / 4;
  background: #f3e9e5;
  border-radius: 12px;
  overflow: hidden;
}

.cover img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Ajuste de la imagen dentro de la galería */
.book-gallery .cover {
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  padding: 0;
  margin: 0;
  background: transparent;
  overflow: hidden;
}

.book-gallery .cover img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 380px;
  object-fit: contain;
  border-radius: 10px;
}

/* Fila de cuatro miniaturas */
.book-thumbnails {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  min-width: 0;
  margin: 10px 0 0;
  padding: 0;
  overflow: visible;
}

/* Botón de cada miniatura */
.book-thumbnail {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  min-width: 0;
  max-width: 100%;
  height: auto;
  aspect-ratio: 1 / 1;
  padding: 2px;
  margin: 0;
  border: 2px solid transparent;
  border-radius: 9px;
  background: transparent;
  cursor: pointer;
  overflow: hidden;
  transform: none;
  transition: background-color 0.2s ease,
              border-color 0.2s ease;
}

.book-thumbnail img {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  object-fit: contain;
  border-radius: 5px;
}

/* Efecto verde menta sin movimiento */
.book-thumbnail:hover {
  background-color: #e5fff4;
  border-color: #55d9b7;
  transform: none;
}

/* Miniatura seleccionada */
.book-thumbnail.active,
.book-thumbnail[aria-pressed="true"] {
  border-color: var(--pink);
}

/* Accesibilidad con teclado */
.book-thumbnail:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}


/* =========================================
   GALERÍA — PEEK INSIDE
========================================= */

.gallery {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  margin-top: 25px;
}

.gallery img {
  display: block;
  width: 100%;
  border-radius: 14px;
}

.gallery-item {
  background: white;
  padding: 15px;
  border-radius: 18px;
}

.preview-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.preview-pair img {
  width: 100%;
}

.preview-pair small {
  display: block;
  text-align: center;
}


/* =========================================
   SECCIONES ADICIONALES
========================================= */

.hero-art {
  background: #fffaf5;
  border-radius: 22px;
  padding: 25px;
  max-width: 380px;
  margin: 28px auto;
}

.hero-art img {
  width: 100%;
  border-radius: 12px;
}

.shop {
  background: var(--sage);
  border-radius: 24px;
  padding: 45px 25px;
  text-align: center;
}

.notice {
  font-size: 13px;
  color: #786b70;
}


/* =========================================
   PIE DE PÁGINA
========================================= */

footer {
  text-align: center;
  padding: 40px 20px;
  font-size: 13px;
}


/* =========================================
   AVISO DE COOKIES
========================================= */

#consent {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: calc(100% - 40px);
  max-width: 350px;
  margin: 0;
  padding: 18px;
  background: #fffdfb;
  border: 1px solid #eadbde;
  box-shadow: 0 8px 28px rgba(88, 71, 83, 0.14);
  border-radius: 18px;
  z-index: 1000;
  font-size: 13px;
  line-height: 1.5;
}

#consent[hidden] {
  display: none;
}

#consent strong {
  font-size: 15px;
}

#consent p {
  margin: 9px 0 14px;
}

#consent .button {
  padding: 9px 13px;
  font-size: 12px;
  margin: 3px;
}

#consent .button.secondary {
  border: 1px solid #eadbde;
}

#consent button {
  margin: 5px;
}


/* =========================================
   DISEÑO RESPONSIVE — MÓVILES
========================================= */

@media (max-width: 700px) {

  section {
    padding: 45px 16px;
  }

  .site-header {
    padding-top: 18px;
  }

  .header-top {
    flex-direction: column;
    gap: 18px;
  }

  .header-top .country-picker {
    position: relative;
    align-self: flex-start;
  }

  .header-nav {
    gap: 22px;
    margin-top: 18px;
    flex-wrap: wrap;
  }

  .header-nav a {
    font-size: 12px;
  }

  .hero {
    padding: 35px 18px;
  }

  .grid,
  .hero .grid {
    grid-template-columns: 1fr;
  }

  .gallery {
    grid-template-columns: 1fr;
  }

  .book-gallery {
    padding: 12px;
  }

  .book-thumbnails {
    gap: 6px;
    margin-top: 8px;
  }
}

@media (max-width: 480px) {

  #consent {
    bottom: 12px;
    right: 12px;
    left: 12px;
    width: auto;
    max-width: none;
  }

  .logo {
    font-size: 30px;
  }
}
/* =========================================
   VISOR DE IMÁGENES AMPLIADAS
========================================= */

.image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 55px 65px;
  background: rgba(35, 27, 33, 0.88);
}

.image-lightbox[hidden] {
  display: none;
}

#lightbox-image {
  display: block;
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 12px;
  background: white;
}

.lightbox-close,
.lightbox-arrow {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: #fff7f0;
  color: #584753;
  cursor: pointer;
  font-size: 25px;
}

.lightbox-close {
  top: 18px;
  right: 20px;
  font-size: 32px;
}

.lightbox-prev {
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-next {
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
}

.book-gallery .cover {
  cursor: zoom-in;
}

@media (max-width: 700px) {
  .image-lightbox {
    padding: 65px 45px;
  }

  .lightbox-arrow {
    width: 34px;
    height: 34px;
    font-size: 20px;
  }

  .lightbox-prev {
    left: 5px;
  }

  .lightbox-next {
    right: 5px;
  }
}
/* =========================================
   CONTADOR DEL ZOOM
========================================= */

.lightbox-counter {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  padding: 7px 15px;
  border-radius: 20px;
  background: rgba(255, 247, 240, 0.95);
  color: #584753;
  font-size: 13px;
  font-weight: bold;
  letter-spacing: 1px;
  pointer-events: none;
}

#lightbox-image {
  touch-action: pan-y;
}

/* =========================================
   THE PUFFY COLORING CORNER
========================================= */

.coloring-corner {
  padding-top: 65px;
  padding-bottom: 75px;
}

.corner-heading {
  text-align: center;
  margin-bottom: 36px;
}

.corner-eyebrow {
  color: #b8758c;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 2px;
}

.corner-heading h2 {
  margin: 12px 0;
}

.corner-heading p {
  margin: 0 auto;
  max-width: 550px;
}

.corner-book {
  margin: 0 0 28px;
  padding: 24px;
  background: #fff0ed;
  border-radius: 24px;
}

.corner-book:nth-child(2) {
  background: #f0e7f5;
}

.corner-book:nth-child(3) {
  background: #e6eedf;
}

.corner-book-header {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  margin-bottom: 18px;
  padding: 0 85px;
}

.corner-book-header h3 {
  margin: 0;
  font-size: 21px;
  text-align: center;
}

.corner-controls {
  position: absolute;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  gap: 8px;
}

.corner-book-header h3 {
  margin: 0;
  font-size: 21px;
}

.corner-controls {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.corner-arrow {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border: 1px solid #e4d1d5;
  border-radius: 50%;
  background: white;
  color: #584753;
  font-size: 23px;
  cursor: pointer;
}

.corner-arrow:hover {
  background: #ffe4ed;
  border-color: #c77e95;
}

.corner-arrow:disabled {
  opacity: 0.35;
  cursor: default;
}

.corner-track {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: calc((100% - 36px) / 3);
  gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  scrollbar-width: none;
  padding: 10px 5px 16px;
}

.corner-track::-webkit-scrollbar {
  display: none;
}

/* Tarjetas tipo scrapbook */
.corner-page {
  position: relative;
  min-width: 0;
  padding: 11px 11px 18px;
  background: #fffdfb;
  border: 0;
  border-radius: 6px;
  box-shadow: 0 5px 14px rgba(88, 71, 83, 0.13);
  scroll-snap-align: start;
  cursor: pointer;
  transform: rotate(-1.5deg);
  transition: transform 0.25s ease,
              box-shadow 0.25s ease;
}

.corner-page:nth-child(even) {
  transform: rotate(1.5deg);
}

.corner-page:hover,
.corner-page.is-colored {
  transform: rotate(0);
  box-shadow: 0 9px 22px rgba(88, 71, 83, 0.19);
}

/* Cinta adhesiva decorativa */
.corner-page::before {
  content: "";
  position: absolute;
  top: -7px;
  left: 50%;
  width: 62px;
  height: 17px;
  background: rgba(199, 126, 149, 0.28);
  transform: translateX(-50%) rotate(-4deg);
  z-index: 2;
  pointer-events: none;
}

.corner-image-wrap {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #fff;
  border-radius: 3px;
}

.corner-image-wrap img {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.corner-image-color {
  opacity: 0;
  transition: opacity 0.35s ease;
}

/* En ordenador: mostrar color al pasar el ratón */
@media (hover: hover) {
  .corner-page:hover .corner-image-color {
    opacity: 1;
  }
}

/* Al tocar: mantener la versión coloreada */
.corner-page.is-colored .corner-image-color {
  opacity: 1;
}

.corner-page-label {
  display: block;
  margin-top: 12px;
  color: #806a75;
  font-size: 12px;
  font-weight: bold;
  text-align: center;
}

.corner-tip {
  text-align: center;
  margin: 20px auto 0;
  color: #8c7080;
  font-size: 13px;
}

/* Tablet */
@media (max-width: 850px) {
  .corner-track {
    grid-auto-columns: calc((100% - 18px) / 2);
  }
}

/* Móvil */
@media (max-width: 550px) {
  .corner-book {
    padding: 17px;
  }

  .corner-book-header h3 {
    font-size: 17px;
  }

  .corner-track {
    grid-auto-columns: 82%;
    gap: 14px;
  }

  .corner-heading h2 {
    font-size: 29px;
  }
}
