:root {
  --serif: "Alegreya", Georgia, serif;
  --sans: "Onest", "Segoe UI", sans-serif;
  --tile-strip: linear-gradient(
    135deg,
    var(--red-deep) 0 25%,
    var(--cream) 25% 50%,
    var(--gold) 50% 75%,
    var(--olive-deep) 75% 100%
  );
}

body {
  font-family: var(--sans);
  font-weight: 430;
  font-optical-sizing: auto;
}

::selection {
  color: var(--cream);
  background: var(--red-deep);
}

.topline {
  background: #29271c;
  font-weight: 570;
}

.site-header {
  border-bottom: 0;
  background: rgba(101, 104, 61, 0.985);
  backdrop-filter: none;
}

.site-header::after {
  position: absolute;
  right: 0;
  bottom: -5px;
  left: 0;
  height: 5px;
  content: "";
  background: var(--tile-strip) 0 0 / 32px 5px repeat-x;
}

.site-header--scrolled {
  background: rgba(76, 79, 43, 0.99);
}

.brand__wordmark strong {
  font-size: 25px;
  font-weight: 650;
  letter-spacing: -0.015em;
}

.brand__wordmark small {
  margin-top: 3px;
  font-weight: 620;
  letter-spacing: 0.18em;
}

.desktop-nav a {
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.025em;
}

.desktop-nav a::after {
  right: auto;
  bottom: 19px;
  left: 50%;
  width: 7px;
  height: 7px;
  background: var(--cream);
  transform: translateX(-50%) rotate(45deg) scale(0);
  transform-origin: center;
}

.desktop-nav a:hover::after {
  transform: translateX(-50%) rotate(45deg) scale(1);
}

.icon-button,
.cart-link {
  border-radius: 2px 13px 2px 13px;
}

.cart-link b {
  border-radius: 2px 8px 2px 8px;
}

.hero {
  background: linear-gradient(90deg, #74764a 0 58%, #4e522e 58% 100%);
}

.hero::before {
  display: none;
}

.hero::after {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: 42%;
  content: "";
  background:
    linear-gradient(45deg, transparent 47%, rgba(255, 255, 255, 0.075) 48% 52%, transparent 53%) 0 0 / 54px 54px,
    linear-gradient(-45deg, transparent 47%, rgba(214, 173, 74, 0.11) 48% 52%, transparent 53%) 0 0 / 54px 54px;
  pointer-events: none;
}

.hero__grid {
  z-index: 1;
}

.hero__side-note {
  position: absolute;
  z-index: 8;
  top: 50%;
  right: -22px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 9px;
  font-weight: 720;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  transform: translateY(-50%) rotate(180deg);
  writing-mode: vertical-rl;
}

.kicker {
  font-weight: 650;
  letter-spacing: 0.13em;
}

.hero h1 {
  max-width: 760px;
  font-size: clamp(62px, 6.1vw, 100px);
  font-weight: 610;
  letter-spacing: -0.035em;
  line-height: 0.9;
}

.hero h1 em {
  display: block;
  width: fit-content;
  max-width: 100%;
  margin-top: 8px;
  font-style: italic;
  font-weight: 520;
  text-decoration: underline;
  text-decoration-color: var(--gold);
  text-decoration-thickness: 4px;
  text-underline-offset: 9px;
}

.hero__lead {
  max-width: 600px;
  font-weight: 420;
}

.hero__sun {
  top: 9%;
  right: 6%;
  width: 330px;
  height: 330px;
  background:
    linear-gradient(45deg, rgba(127, 27, 28, 0.86) 25%, transparent 25%) 0 0 / 68px 68px,
    linear-gradient(-45deg, rgba(127, 27, 28, 0.86) 25%, transparent 25%) 0 34px / 68px 68px,
    linear-gradient(45deg, transparent 75%, rgba(244, 238, 223, 0.82) 75%) 34px -34px / 68px 68px,
    linear-gradient(-45deg, transparent 75%, rgba(244, 238, 223, 0.82) 75%) -34px 0 / 68px 68px,
    var(--gold);
  border: 10px solid rgba(255, 255, 255, 0.15);
  border-radius: 0;
  box-shadow: none;
  transform: rotate(8deg);
}

.hero__sun::after {
  inset: 18px;
  width: auto;
  height: auto;
  border: 1px solid rgba(255, 255, 255, 0.35);
  border-radius: 0;
  transform: none;
}

.hero__stamp {
  top: 26px;
  left: 0;
  width: auto;
  height: auto;
  padding: 10px 13px 8px;
  border: 2px solid rgba(255, 255, 255, 0.72);
  border-radius: 0;
  font-size: 13px;
  font-weight: 560;
  line-height: 1.05;
  text-transform: uppercase;
  transform: rotate(-4deg);
}

.hero-product {
  border-width: 5px;
  box-shadow: 12px 16px 0 rgba(31, 28, 12, 0.2);
}

.hero__note {
  color: #fff;
  background: var(--red-deep);
  border: 0;
  border-radius: 0;
  box-shadow: 7px 7px 0 rgba(35, 32, 18, 0.22);
  transform: rotate(-2deg);
}

.hero__marquee {
  background: var(--red-deep);
  border-top: 5px solid var(--cream);
}

.hero__marquee div {
  width: max-content;
  min-width: 100%;
  margin-inline: auto;
  animation: none;
  letter-spacing: 0.13em;
  text-align: center;
}

.button {
  border-radius: 2px 14px 2px 14px;
  font-weight: 720;
  letter-spacing: 0.065em;
}

.button--red {
  box-shadow: 6px 6px 0 rgba(85, 21, 22, 0.28);
}

.button:hover {
  transform: translate(3px, -3px);
}

.section-heading {
  position: relative;
  padding-top: 26px;
  border-top: 1px solid var(--line);
}

.section-heading::before {
  position: absolute;
  top: -4px;
  left: 0;
  width: 86px;
  height: 7px;
  content: "";
  background: var(--tile-strip) 0 0 / 28px 7px repeat-x;
}

.section-heading h2,
.visit-section h2 {
  font-size: clamp(46px, 4.9vw, 76px);
  font-weight: 610;
  letter-spacing: -0.026em;
  line-height: 0.98;
}

.category-card::before {
  right: 24px;
  bottom: 24px;
  width: 92px;
  height: 92px;
  background:
    linear-gradient(45deg, var(--gold) 25%, transparent 25%) 0 0 / 28px 28px,
    linear-gradient(-45deg, var(--cream) 25%, transparent 25%) 0 14px / 28px 28px,
    var(--red-deep);
  border: 4px solid var(--cream);
  border-radius: 0;
  opacity: 0;
  transform: rotate(8deg) scale(0.7);
}

.category-card:hover::before {
  opacity: 0.85;
  transform: rotate(8deg) scale(1);
}

.category-card:nth-child(even):hover {
  background: var(--red-deep);
}

.category-card__number {
  font-size: 18px;
  font-weight: 600;
}

.category-card:hover .category-card__number {
  color: var(--cream);
}

.category-card__content strong {
  font-weight: 570;
  letter-spacing: -0.015em;
}

.product-card {
  border: 1px solid var(--line);
  box-shadow: 6px 6px 0 transparent;
}

.product-card:hover {
  border-color: var(--olive-deep);
  box-shadow: 7px 7px 0 var(--cream-2);
  transform: translate(-3px, -3px);
}

.product-card__badges b {
  border-radius: 0 8px 0 8px;
  font-weight: 720;
}

.product-card h3 {
  font-size: 22px;
  font-weight: 560;
  letter-spacing: -0.012em;
}

.price strong,
.product-info__price strong {
  font-family: var(--sans);
  font-variant-numeric: tabular-nums;
  font-weight: 720;
}

.story-card--quote blockquote,
.story-card__metric strong,
.story-card__big {
  font-weight: 580;
  letter-spacing: -0.025em;
}

.journal-grid {
  grid-template-rows: repeat(2, minmax(230px, auto));
}

.journal-card:first-child {
  grid-column: span 7;
  grid-row: span 2;
}

.journal-card:not(:first-child) {
  grid-column: span 5;
}

.journal-card:first-child a {
  min-height: 520px;
}

.journal-card:not(:first-child) a {
  min-height: 260px;
}

.journal-card h3 {
  font-weight: 580;
  letter-spacing: -0.018em;
}

.journal-card:not(:first-child) h3 {
  margin-top: 24px;
  font-size: clamp(25px, 2.1vw, 34px);
}

.journal-grid:has(.journal-card:only-child) {
  grid-template-rows: none;
}

.journal-grid:has(.journal-card:only-child) .journal-card {
  grid-column: 1 / -1;
  grid-row: auto;
}

.journal-grid:has(.journal-card:nth-child(2):last-child) {
  grid-template-rows: none;
}

.journal-grid:has(.journal-card:nth-child(2):last-child) .journal-card {
  grid-column: span 6;
  grid-row: auto;
}

.journal-grid:has(.journal-card:nth-child(2):last-child) .journal-card a {
  min-height: 360px;
}

.page-hero {
  background: linear-gradient(108deg, #4d512d 0 72%, #6e7145 72% 100%);
}

.page-hero::after {
  right: 5vw;
  bottom: -54px;
  width: 260px;
  height: 260px;
  background:
    linear-gradient(45deg, rgba(214, 173, 74, 0.92) 25%, transparent 25%) 0 0 / 44px 44px,
    linear-gradient(-45deg, rgba(127, 27, 28, 0.8) 25%, transparent 25%) 0 22px / 44px 44px,
    rgba(244, 238, 223, 0.16);
  border: 7px solid rgba(255, 255, 255, 0.12);
  border-radius: 0;
  opacity: 0.7;
  transform: rotate(8deg);
}

.page-hero .eyebrow {
  color: #fff;
  font-weight: 680;
}

.page-hero h1 {
  font-size: clamp(54px, 6.6vw, 96px);
  font-weight: 620;
  letter-spacing: -0.03em;
}

.page-hero__count {
  position: relative;
  padding: 12px 19px 12px 28px;
  background: var(--cream);
  border: 1px solid var(--ink);
  border-radius: 2px 14px 2px 14px;
  box-shadow: 6px 6px 0 rgba(33, 31, 20, 0.18);
  transform: rotate(-2deg);
}

.page-hero__count::before {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 8px;
  content: "";
  background: var(--red);
}

.catalog-mobile-categories {
  display: none;
}

.catalog-category,
.catalog-subcategories a {
  border-radius: 2px 9px 2px 9px;
}

.search-field,
.sort-field select {
  border-radius: 2px 14px 2px 14px;
}

.product-grid--catalog {
  gap: 1px;
  padding: 1px;
  background: var(--line);
}

.product-grid--catalog .product-card {
  border: 0;
  box-shadow: none;
}

.product-grid--catalog .product-card:hover {
  box-shadow: inset 0 -5px var(--red);
  transform: none;
}

@media (max-width: 920px) {
  .hero {
    background: var(--olive);
  }

  .hero::after,
  .hero__side-note {
    display: none;
  }

  .journal-grid {
    grid-template-rows: none;
  }

  .journal-card:first-child,
  .journal-card:not(:first-child) {
    grid-column: span 6;
    grid-row: auto;
  }

  .journal-card:last-child:nth-child(odd) {
    grid-column: span 12;
  }

  .journal-card:first-child a,
  .journal-card:not(:first-child) a {
    min-height: 330px;
  }

  .catalog-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .product-detail,
  .product-copy__grid,
  .static-page__grid,
  .checkout-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .catalog-sidebar__sticky,
  .checkout-panel {
    position: static;
    max-height: none;
  }

  .product-gallery__main {
    min-height: 500px;
  }

  .static-page__aside {
    max-width: 430px;
  }
}

@media (max-width: 920px) {
  .catalog-sidebar {
    display: none;
  }

  .catalog-mobile-categories {
    display: block;
    margin-bottom: 20px;
    background: var(--cream);
    border: 1px solid var(--line);
    box-shadow: 5px 5px 0 var(--cream-2);
  }

  .catalog-mobile-categories summary {
    position: relative;
    display: grid;
    padding: 14px 48px 14px 16px;
    list-style: none;
    cursor: pointer;
    gap: 2px;
  }

  .catalog-mobile-categories summary::-webkit-details-marker {
    display: none;
  }

  .catalog-mobile-categories summary:focus-visible {
    outline: 3px solid var(--gold);
    outline-offset: 3px;
  }

  .catalog-mobile-categories summary::after {
    position: absolute;
    top: 50%;
    right: 18px;
    content: "+";
    color: var(--red-deep);
    font-size: 24px;
    transform: translateY(-50%);
  }

  .catalog-mobile-categories[open] summary::after {
    content: "−";
  }

  .catalog-mobile-categories summary span {
    color: var(--red-deep);
    font-size: 9px;
    font-weight: 720;
    letter-spacing: 0.12em;
    text-transform: uppercase;
  }

  .catalog-mobile-categories summary strong {
    font-family: var(--serif);
    font-size: 23px;
    font-weight: 600;
  }

  .catalog-mobile-categories nav {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-height: 55vh;
    padding: 0 14px 16px;
    overflow-y: auto;
    border-top: 1px solid var(--line);
    gap: 14px;
  }

  .catalog-mobile-categories nav > a {
    grid-column: 1 / -1;
    margin-top: 14px;
  }

  .catalog-mobile-categories section {
    min-width: 0;
  }

  .catalog-mobile-categories a {
    display: flex;
    justify-content: space-between;
    padding: 7px 5px;
    gap: 10px;
  }

  .catalog-mobile-categories section > a {
    color: var(--red-deep);
    border-bottom: 1px solid var(--line);
    font-family: var(--serif);
    font-size: 18px;
    font-weight: 600;
  }

  .catalog-mobile-categories a.is-active {
    color: #fff;
    background: var(--olive-deep);
  }

  .catalog-mobile-categories small {
    color: var(--muted);
    font-family: var(--sans);
    font-size: 10px;
  }

  .catalog-mobile-categories a.is-active small {
    color: rgba(255, 255, 255, 0.72);
  }
}

@media (max-width: 700px) {
  .hero__visual {
    min-height: 430px;
  }

  .hero__sun {
    width: 280px;
    height: 280px;
  }

  .page-hero__inner {
    min-height: 250px;
    padding-block: 48px 42px;
  }
}

@media (max-width: 620px) {
  .brand__wordmark strong {
    font-size: 21px;
  }

  .hero h1 {
    font-size: clamp(46px, 13.5vw, 60px);
    letter-spacing: -0.025em;
  }

  .hero h1 em {
    text-decoration-thickness: 3px;
    text-underline-offset: 6px;
  }

  .hero__sun {
    width: 250px;
    height: 250px;
  }

  .hero__stamp {
    top: 4px;
    left: 5px;
    padding: 8px 10px 7px;
    font-size: 10px;
  }

  .section-heading h2,
  .visit-section h2 {
    font-size: 46px;
  }

  .journal-card:first-child,
  .journal-card:not(:first-child) {
    grid-column: auto;
  }

  .page-hero__inner {
    min-height: 230px;
    padding-block: 42px 38px;
  }

  .page-hero h1 {
    font-size: clamp(42px, 12vw, 52px);
  }

  .page-hero::after {
    right: -70px;
    bottom: -90px;
    width: 190px;
    height: 190px;
    opacity: 0.35;
  }

  .catalog-mobile-categories nav {
    grid-template-columns: 1fr;
  }

  .hero__marquee div {
    width: 100%;
    font-size: 0;
  }

  .hero__marquee div::after {
    content: "QUESO  ◆  JAMÓN  ◆  ACEITUNAS  ◆  MÁS";
    font-size: 10px;
    letter-spacing: 0.12em;
  }
}

@media (prefers-reduced-motion: reduce) {
  .hero__marquee div {
    transform: none !important;
  }
}
