:root {
  --parchment-dark: #6b4a2b;
  --parchment-text: #4a3220;
  --gold: #c9a24b;
  --gold-deep: #9c7a2e;
  --blue-title: #5b7fb5;
  --sky-blue: #a9d6f5;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Poppins', sans-serif;
  color: var(--parchment-text);
  background: url('../assets/fondo-2.jpg') center top / cover no-repeat fixed;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
}

/* soft veil so content stays readable over the busy background */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0.05) 40%, rgba(255,255,255,0.25) 100%);
  pointer-events: none;
  z-index: 0;
}

main, header {
  position: relative;
  z-index: 1;
}

img {
  max-width: 100%;
  display: block;
}

/* ---------- Reusable scroll/parchment frame ---------- */
/* Single wide parchment asset (native ~8:1 ratio) sized to fill the
   element — no cropping/stitching, so there are no seams at the edges. */

.main-nav ul,
.collection-title,
.btn-scroll {
  background-color: transparent;
  background-image: url('../assets/pergamino-ancho.png');
  background-repeat: no-repeat;
  background-position: center;
  background-size: 100% 100%;
  border: none;
  appearance: none;
  -webkit-appearance: none;
}

/* ---------- Header / Nav ---------- */

.site-header {
  padding: 24px 16px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.main-nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 10px 36px;
  min-height: 88px;
  padding: 10px 92px;
  min-width: 320px;
}

.main-nav a {
  display: inline-block;
  padding: 8px 2px;
  text-decoration: none;
  color: var(--parchment-text);
  font-weight: 700;
  font-size: clamp(0.85rem, 1.6vw, 1.05rem);
  letter-spacing: 0.02em;
  transition: color 0.2s ease, text-shadow 0.2s ease;
  white-space: nowrap;
}

.main-nav a:hover,
.main-nav a:focus-visible {
  color: #8a2b1f;
  text-shadow: 0 0 8px rgba(201,162,75,0.6);
}

.title-banner {
  position: relative;
  margin-top: -18px;
  width: min(680px, 92vw);
}

.title-image {
  width: 100%;
  filter: drop-shadow(0 6px 12px rgba(0,0,0,0.25));
}

.mascot-captain {
  position: absolute;
  top: -22px;
  right: -8px;
  width: clamp(72px, 10vw, 112px);
  z-index: 2;
  filter: drop-shadow(0 8px 10px rgba(0,0,0,0.3));
  animation: sway 5s ease-in-out infinite;
  transform-origin: 50% 85%;
}

.deco-airship {
  position: absolute;
  top: 2px;
  right: 2%;
  width: clamp(110px, 15vw, 190px);
  z-index: 1;
  filter: drop-shadow(0 10px 14px rgba(0,0,0,0.3));
  animation: drift 9s ease-in-out infinite;
  pointer-events: none;
}

@media (max-width: 700px) {
  .mascot-captain { width: clamp(56px, 14vw, 84px); top: -14px; }
}

@media (max-width: 600px) {
  /* Nav wraps to multiple lines and the parchment stretches near full
     width here, so the airship would sit on top of the menu text. */
  .deco-airship { display: none; }

  /* The wide flat scroll (8:1) was made for one line of text — stretched
     tall enough for 3 wrapped nav lines it looks distorted. Swap to a
     boxier scroll (~1.8:1) that suits that taller shape. */
  .main-nav ul {
    background-image: url('../assets/pergamino-caja.png');
  }
}

@media (max-width: 420px) {
  /* The fixed 92px side padding and nowrap link text were built for
     desktop's single-line scroll and overflow the viewport on small
     phones — shrink the padding and let long links wrap instead. */
  .main-nav ul {
    padding: 10px 18px;
    gap: 6px 16px;
    min-width: 0;
  }
  .main-nav a {
    white-space: normal;
    text-align: center;
  }
}

/* ---------- Collections ---------- */

.collections {
  display: grid;
  grid-template-columns: 1fr;
  gap: 56px;
  max-width: 1200px;
  margin: 40px auto 80px;
  padding: 0 24px;
}

@media (min-width: 900px) {
  .collections {
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

.collection {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.collection-title {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 76px;
  padding: 8px 72px;
}

.scroll-text {
  font-family: 'MedievalSharp', cursive;
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  color: #8a5a1f;
  text-shadow: 1px 1px 0 rgba(255,255,255,0.4);
  white-space: nowrap;
}

.scroll-badge img {
  width: 46px;
  height: 46px;
  object-fit: contain;
  filter: drop-shadow(0 3px 4px rgba(0,0,0,0.3));
}

@media (max-width: 420px) {
  /* Same overflow fix as the nav: the 72px padding plus nowrap title
     text is wider than very narrow phones. */
  .collection-title {
    padding: 8px 16px;
    gap: 6px;
  }
  .scroll-text {
    white-space: normal;
    text-align: center;
  }
  .scroll-badge img {
    width: 34px;
    height: 34px;
  }
}

/* ---------- Product cards ---------- */

.product-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 230px));
  gap: 24px 28px;
  justify-content: center;
  width: 100%;
}

@media (max-width: 480px) {
  .product-row {
    grid-template-columns: minmax(0, 230px);
  }
}

.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  background:
    radial-gradient(120% 100% at 50% 0%, rgba(255,255,255,0.55) 0%, rgba(255,250,235,0.4) 45%, rgba(238,222,190,0.45) 100%);
  backdrop-filter: blur(4px);
  border-radius: 16px;
  padding: 22px 18px 24px;
  width: 100%;
  text-align: center;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
  box-shadow:
    0 8px 20px rgba(60, 40, 10, 0.18),
    inset 0 0 0 1px rgba(255,255,255,0.5),
    inset 0 0 0 3px rgba(201, 162, 75, 0.55);
}

.product-card::before,
.product-card::after {
  content: '\2726';
  position: absolute;
  top: 8px;
  color: var(--gold-deep);
  font-size: 0.75rem;
  opacity: 0.8;
}

.product-card::before { left: 10px; }
.product-card::after { right: 10px; }

.product-card:hover {
  transform: translateY(-6px);
  box-shadow:
    0 16px 30px rgba(60, 40, 10, 0.28),
    inset 0 0 0 1px rgba(255,255,255,0.6),
    inset 0 0 0 3px rgba(201, 162, 75, 0.85);
}

.product-image-frame {
  position: relative;
  width: 100%;
  margin-bottom: 12px;
}

.product-image-frame::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -4px;
  transform: translateX(-50%);
  width: 70%;
  height: 14px;
  background: radial-gradient(closest-side, rgba(60,40,10,0.35), transparent 75%);
  z-index: -1;
}

.product-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  filter: drop-shadow(0 8px 10px rgba(0,0,0,0.25));
  transition: transform 0.25s ease;
}

.product-card:hover .product-image {
  transform: scale(1.04);
}

.product-card h3 {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.5em;
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.25;
  margin-bottom: 4px;
}

.product-caption {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 2.2em;
  margin-bottom: 8px;
  font-size: 0.85rem;
  color: #6b4a2b;
  font-style: italic;
}

.product-price {
  display: inline-block;
  margin-top: auto;
  font-size: 1rem;
  font-weight: 700;
  color: #5a3b12;
  background: linear-gradient(180deg, #f6e3a1 0%, #d9ab4a 55%, #c1902f 100%);
  border: 1px solid #8a6a1f;
  border-radius: 999px;
  padding: 5px 18px;
  box-shadow:
    0 2px 5px rgba(60, 40, 10, 0.3),
    inset 0 1px 0 rgba(255,255,255,0.6);
}

/* ---------- Buttons ---------- */

.btn-scroll {
  font-family: 'Poppins', sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: var(--parchment-text);
  cursor: pointer;
  padding: 10px 60px;
  min-height: 58px;
  min-width: 200px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.btn-scroll:hover,
.btn-scroll:focus-visible {
  transform: scale(1.05);
  filter: brightness(1.08);
}

.btn-scroll:active {
  transform: scale(0.98);
}

/* ---------- Decorative elements ---------- */

.deco-mascot {
  position: fixed;
  right: 18px;
  bottom: 18px;
  width: 64px;
  z-index: 2;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,0.3));
  animation: bob 4s ease-in-out infinite;
}

@keyframes bob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes drift {
  0%   { transform: translate(0, 0) rotate(0deg); }
  25%  { transform: translate(-8px, -10px) rotate(-2deg); }
  50%  { transform: translate(5px, -16px) rotate(1.5deg); }
  75%  { transform: translate(-4px, -6px) rotate(-1deg); }
  100% { transform: translate(0, 0) rotate(0deg); }
}

@keyframes sway {
  0%, 100% { transform: rotate(0deg) translateY(0); }
  50% { transform: rotate(4deg) translateY(-4px); }
}

@media (max-width: 640px) {
  .deco-mascot { width: 60px; right: 10px; bottom: 10px; }
}

/* ---------- Footer ---------- */

.site-footer {
  position: relative;
  z-index: 1;
  margin-top: 40px;
  padding: 48px 24px 24px;
  background: linear-gradient(180deg, rgba(58, 38, 20, 0.88), rgba(32, 20, 9, 0.94));
  color: #f3e6c9;
}

.footer-content {
  max-width: 1100px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr;
  gap: 32px;
}

@media (min-width: 700px) {
  .footer-content {
    grid-template-columns: 1.4fr 1fr 1fr 1fr;
  }
}

.footer-brand .footer-logo {
  width: 170px;
  filter: drop-shadow(0 4px 8px rgba(0,0,0,0.4));
  margin-bottom: 12px;
}

.footer-brand p {
  font-size: 0.85rem;
  line-height: 1.55;
  opacity: 0.85;
  max-width: 32ch;
}

.footer-col h4 {
  font-family: 'MedievalSharp', cursive;
  color: var(--gold);
  font-size: 1rem;
  font-weight: 400;
  margin-bottom: 14px;
  letter-spacing: 0.02em;
}

.footer-col {
  display: flex;
  flex-direction: column;
}

.footer-col a {
  color: #f3e6c9;
  text-decoration: none;
  font-size: 0.88rem;
  opacity: 0.85;
  padding: 5px 0;
  transition: color 0.2s ease, opacity 0.2s ease;
  width: fit-content;
}

.footer-col a:hover,
.footer-col a:focus-visible {
  color: var(--gold);
  opacity: 1;
  text-decoration: underline;
}

.footer-social {
  display: flex;
  gap: 10px;
  margin-top: 4px;
}

.footer-social a {
  width: 34px;
  height: 34px;
  margin-bottom: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(243, 230, 201, 0.4);
  border-radius: 50%;
  font-size: 0.7rem;
  font-weight: 700;
}

.footer-social a:hover {
  border-color: var(--gold);
  background: rgba(201, 162, 75, 0.15);
}

.footer-copy {
  max-width: 1100px;
  margin: 36px auto 0;
  padding-top: 20px;
  border-top: 1px solid rgba(243, 230, 201, 0.2);
  text-align: center;
  font-size: 0.78rem;
  opacity: 0.7;
}
