/* Recortes y límites de composición derivados del prototipo final. */
:root { --ink: #2d2a32; }

body { color: var(--ink); }

@media (min-width: 821px) {
  .hero { height: min(485px, 32.6vw); }
  .hero-art {
    isolation: isolate;
    background: linear-gradient(105deg, transparent 0 8%, #ffd900 8% 64%, #9846f4 64% 100%);
  }
  .hero-art::before {
    content: "";
    position: absolute;
    z-index: -1;
    left: -8%;
    bottom: -36%;
    width: 36%;
    aspect-ratio: 1;
    border-radius: 50%;
    background: #ffd900;
  }
  .hero-art img {
    width: 96%;
    height: auto;
    max-width: none;
    right: 2%;
    top: auto;
    bottom: 0;
    transform: none;
  }

  .collections {
    height: clamp(290px, 21vw, 390px);
    display: grid;
    grid-template-columns: 39% 1fr 31%;
    align-items: center;
    overflow: hidden;
    background: radial-gradient(circle at 10% 115%, #09caca 0 25%, transparent 25.3%), radial-gradient(circle at 96% 108%, #ff5b60 0 28%, transparent 28.3%), linear-gradient(90deg,#fff 0%,#fff7ee 100%);
  }

  .collections-art { display: flex; align-self: stretch; align-items: end; justify-content: center; overflow: hidden; }
  .collections-art img { width: 96%; height: 96%; object-fit: contain; object-position: center bottom; transform: none; }
  .collections-copy {
    position: static;
    padding: 0 3%;
    max-width: 650px;
    z-index: 2;
  }
  .collections-copy > * {
    opacity: 1;
    pointer-events: auto;
  }
  .collections-copy .button {
    display: inline-flex;
    position: static;
    width: auto;
    height: auto;
    opacity: 1;
    pointer-events: auto;
  }
  .collections-books { align-self: stretch; display: flex; align-items: end; justify-content: end; overflow: hidden; }
  .collections-books img { width: 112%; max-width: none; transform: translate(5%,5%); }
}

@media (max-width: 820px) {
  .hero-art img {
    width: 104%;
    height: auto;
    max-width: none;
    right: -2%;
    top: auto;
    bottom: 0;
    transform: none;
  }
  .hero-art { background: linear-gradient(105deg,#ffd900 0 60%,#9846f4 60%); }
  .collections {
    min-height: 520px;
    height: auto;
    display: grid;
    grid-template-columns: 1fr;
    background: linear-gradient(180deg, #fff, #fff8f2);
  }
  .collections-art {
    display: block;
    height: 250px;
    overflow: hidden;
  }
  .collections-art img {
    height: 100%; width: 100%; object-fit: contain; object-position: center bottom; transform: none;
  }
  .collections-copy {
    position: relative;
    padding: 26px 24px 34px;
  }
  .collections-copy > * { opacity: 1; pointer-events: auto; }
  .collections-copy .button {
    display: inline-flex;
    position: static;
    width: auto;
    height: auto;
    opacity: 1;
  }
  .collections-books { display: none; }
}

@media (max-width: 540px) {
  .hero-art { height: 190px; }
  .hero-art img { width: 104%; top: auto; bottom: 0; }
  .collections { min-height: 455px; }
  .collections-art { height: 185px; }
  .collections-art img { transform: scale(1.15); }
}

.toast:empty { display: none; }
.toast.show { display: block; }

.main-nav {
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-size: .9rem;
  font-weight: 700;
  letter-spacing: .055em;
  text-transform: uppercase;
  color: var(--ink);
}
.main-nav a {
  padding: 14px 4px;
  text-shadow: 0 0 .01px currentColor;
  transition: color .22s ease, transform .22s ease;
}
.main-nav a::after { height: 6px; bottom: 4px; }
.main-nav a:hover,
.main-nav a:focus-visible {
  color: inherit;
  transform: translateY(-2px);
}
.main-nav a:nth-child(1)::after { background: #ffd400; }
.main-nav a:nth-child(2)::after { background: #ff5b68; }
.main-nav a:nth-child(3)::after { background: #12c8c8; }
.main-nav a:nth-child(4)::after { background: #8b46ee; }
.main-nav a:nth-child(5)::after { background: #f18fba; }

.back-to-top {
  position: fixed;
  z-index: 55;
  right: 22px;
  bottom: 20px;
  width: 78px;
  height: 92px;
  padding: 0;
  border: 0;
  background: transparent;
  color: #65566f;
  cursor: pointer;
  display: grid;
  justify-items: center;
  align-content: center;
  opacity: 0;
  pointer-events: none;
  transform: translateY(25px) rotate(5deg);
  transition: opacity .25s ease, transform .25s ease;
  filter: drop-shadow(0 8px 10px rgba(49,25,83,.2));
}
.back-to-top.visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) rotate(0);
}
.back-to-top:hover { transform: translateY(-7px) rotate(-4deg) scale(1.06); }
.back-to-top img { width: 70px; height: 70px; object-fit: contain; }
.back-to-top span {
  margin-top: -7px;
  padding: 3px 9px;
  border-radius: 999px;
  background: white;
  font-family: "Trebuchet MS", sans-serif;
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
}
.toast { bottom: 118px; }

@media (max-width: 540px) {
  .back-to-top { right: 10px; bottom: 12px; width: 64px; height: 76px; }
  .back-to-top img { width: 58px; height: 58px; }
}

.hero h1 {
  font-family: "Trebuchet MS", "Segoe UI", sans-serif;
  font-weight: 700;
  letter-spacing: -.055em;
  line-height: .92;
  color: #48208f;
}

.social-links a[data-social="pinterest"] { border: 0; background: white; }
.social-links a[data-social="pinterest"]:hover { background: #fff; }
.social-links .pinterest-mark { width: 28px; height: 28px; fill: var(--purple); stroke: none; }

@media (min-width: 821px) {
  .products { padding-top: 20px; padding-bottom: 30px; }
  .section-heading { margin-bottom: 14px; }
  .section-heading h2 { font-size: 2.6rem; }
  .product-grid {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    padding: 8px 4px 15px;
  }
  .product-grid::-webkit-scrollbar { display: none; }
  .product-card {
    flex: 0 0 calc((100% - 42px) / 4);
    scroll-snap-align: start;
    min-height: 168px;
    padding: 12px;
    display: grid;
    grid-template-columns: 43% 1fr 42px;
    grid-template-rows: auto 1fr auto;
    column-gap: 12px;
    align-items: start;
  }
  .product-image {
    grid-column: 1;
    grid-row: 1 / 4;
    height: 144px;
  }
  .product-card h3 {
    grid-column: 2 / 4;
    grid-row: 1;
    margin: 7px 32px 4px 0;
    font-size: 1rem;
    line-height: 1.15;
  }
  .product-card .tag {
    grid-column: 2 / 4;
    grid-row: 2;
    margin: 0;
    font-size: .82rem;
  }
  .product-card .heart { right: 11px; top: 10px; width: 30px; height: 30px; font-size: 1.25rem; }
  .cart-button {
    grid-column: 3;
    grid-row: 3;
    width: 38px;
    height: 38px;
    display: grid;
    place-items: center;
    border-radius: 11px;
    background: var(--coral);
    color: white;
    font-size: 1.1rem;
    box-shadow: 0 7px 18px rgba(255,84,93,.28);
    transition: transform .2s ease;
  }
  .cart-button:hover { transform: translateY(-3px) rotate(-3deg); }
  .newsletter { grid-template-columns: 220px 1fr minmax(350px,520px) auto; gap: 20px; }
}

.product-carousel { position: relative; }
.carousel-arrow {
  position: absolute;
  z-index: 8;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  background: #111;
  color: white;
  font-size: 2rem;
  line-height: 1;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(0,0,0,.2);
  transition: transform .2s ease, background .2s ease;
}
.carousel-arrow:hover { background: var(--purple); transform: translateY(-50%) scale(1.08); }
.carousel-arrow:disabled { opacity: .28; cursor: default; }
.carousel-prev { left: -20px; }
.carousel-next { right: -20px; }
.carousel-dots { display: flex; justify-content: center; gap: 7px; margin-top: 5px; }
.carousel-dots button { width: 9px; height: 9px; padding: 0; border: 0; border-radius: 50%; background: #d6d0da; cursor: pointer; }
.carousel-dots button.active { width: 28px; border-radius: 8px; background: var(--purple); }

@media (max-width: 820px) {
  .product-grid {
    display: flex;
    grid-template-columns: none;
    gap: 16px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    padding: 8px 4px 16px;
  }
  .product-grid::-webkit-scrollbar { display: none; }
  .product-card { flex: 0 0 min(84vw, 360px); scroll-snap-align: center; }
  .carousel-prev { left: -12px; }
  .carousel-next { right: -12px; }
  .carousel-arrow { width: 42px; height: 42px; }
}

.social-links { display: flex; align-items: center; gap: 12px; }
.social-links a {
  width: 43px;
  height: 43px;
  border: 2px solid rgba(255,255,255,.9);
  border-radius: 50%;
  display: grid;
  place-items: center;
  transition: transform .2s ease, background .2s ease;
}
.social-links a:hover { transform: translateY(-3px); background: rgba(255,255,255,.15); }
.social-links svg { width: 26px; height: 26px; fill: none; stroke: white; stroke-width: 1.8; }
.social-links svg .fill { fill: white; stroke: none; }

@media (max-width: 1100px) {
  .newsletter .social-links { grid-column: 2; justify-self: end; }
}

@media (max-width: 820px) {
  .cart-button {
    display: inline-flex;
    justify-content: center;
    align-items: center;
    width: 44px;
    height: 44px;
    margin-top: 10px;
    border-radius: 12px;
    background: var(--coral);
  }
  .newsletter .social-links { grid-column: 1 / -1; justify-self: center; }
}

/* La ilustración actual ya incluye el fondo amarillo/violeta.
   Evita superponer el fondo decorativo anterior y recorta su borde superior. */
.hero-art {
  isolation: auto;
  background: #fff;
}

.hero-art::before {
  display: none;
}

.hero-art img {
  width: 102%;
  height: 104%;
  max-width: none;
  right: -1%;
  top: -2%;
  bottom: auto;
  object-fit: cover;
  object-position: center;
  transform: none;
}
