:root {
  --red: #a80f16;
  --red-dark: #65080c;
  --green: #128044;
  --green-dark: #07552b;
  --cream: #fff7ea;
  --cream-strong: #f5e5ca;
  --ink: #17120f;
  --muted: #74685c;
  --line: #eadbc3;
  --soft: #fffaf1;
  --card: #ffffff;
  --shadow: 0 18px 45px rgba(91, 32, 14, 0.11);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--cream);
}

a {
  color: inherit;
  text-decoration: none;
}

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

.container {
  width: min(1280px, calc(100% - 48px));
  margin: 0 auto;
}

.topbar {
  background: var(--green-dark);
  color: #fffaf1;
  font-size: 14px;
}

.topbar__inner,
.topbar__links,
.navbar__inner,
.nav-menu,
.search,
.breadcrumb,
.section__heading,
.contact-list a {
  display: flex;
  align-items: center;
}

.topbar__inner {
  justify-content: space-between;
  min-height: 38px;
}

.topbar a,
.footer a,
.footer p {
  color: inherit;
}

.topbar strong,
.topbar svg,
.footer svg,
.section__heading a,
.contact-list svg {
  color: var(--red);
}

svg {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

.topbar a,
.topbar__links {
  gap: 8px;
}

.topbar__links {
  gap: 28px;
}

.navbar {
  background: rgba(255, 250, 241, 0.96);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 12px 28px rgba(91, 32, 14, 0.05);
}

.navbar::after {
  content: "";
  display: block;
  height: 4px;
  background: linear-gradient(90deg, var(--green) 0 33.3%, #fff 33.3% 66.6%, var(--red) 66.6% 100%);
}

.navbar__inner {
  min-height: 96px;
  gap: 34px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  font-weight: 900;
  letter-spacing: 0;
  min-width: 210px;
}

.brand img {
  width: 62px;
  height: 62px;
  object-fit: contain;
}

.brand span {
  font-size: 20px;
}

.nav-menu {
  gap: 34px;
  font-size: 15px;
  text-transform: uppercase;
}

.nav-menu a {
  padding: 38px 0 12px;
  border-bottom: 1px solid transparent;
}

.nav-menu .active,
.nav-menu a:hover {
  color: var(--red);
  border-color: var(--red);
}

.search {
  margin-left: auto;
  width: min(470px, 36vw);
  border: 1px solid var(--cream-strong);
  border-radius: 999px;
  padding: 0 14px 0 22px;
  height: 44px;
  background: #fff;
}

.search input {
  border: 0;
  outline: 0;
  flex: 1;
  min-width: 0;
  font-size: 16px;
}

.search button,
.nav-toggle {
  border: 0;
  background: transparent;
  color: var(--red);
  cursor: pointer;
}

.nav-toggle {
  display: none;
  position: relative;
  width: 44px;
  height: 44px;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  transition:
    background 0.25s ease,
    color 0.25s ease,
    transform 0.25s ease;
}

.hero {
  padding: 76px 0 42px;
  background:
    radial-gradient(circle at 18% 18%, rgba(215, 8, 18, 0.11), transparent 30%),
    linear-gradient(135deg, #fffaf1 0%, #fff7ea 58%, #f4ead8 100%);
}

.hero__grid,
.consult__grid,
.contact-page,
.product-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 70px;
  align-items: center;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--red);
  font-weight: 800;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.03;
  letter-spacing: 0;
  margin-bottom: 22px;
}

h2 {
  font-size: clamp(28px, 3vw, 40px);
  line-height: 1.12;
}

.hero__copy p,
.consult p,
.contact-page p {
  color: var(--muted);
  font-size: 18px;
  line-height: 1.7;
}

.hero__actions {
  display: flex;
  gap: 14px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 30px;
  border-radius: 8px;
  font-weight: 800;
  border: 1px solid transparent;
  cursor: pointer;
}

.button--primary {
  background: var(--red);
  color: #fff;
  box-shadow: 0 14px 26px rgba(215, 8, 18, 0.18);
}

.button--outline {
  color: var(--green-dark);
  border-color: var(--green);
  background: #fffaf1;
}

.hero__visual {
  position: relative;
}

.hero__visual--statement {
  min-height: 430px;
  display: grid;
  align-items: center;
  padding: clamp(28px, 5vw, 58px);
  overflow: hidden;
  border: 1px solid rgba(215, 8, 18, 0.16);
  border-radius: 8px;
  background: linear-gradient(135deg, #d81428, #8c0e1a);
  box-shadow: var(--shadow);
  color: #fff;
}

.hero__visual--statement::before {
  content: "";
  position: absolute;
  z-index: 1;
  inset: 0;
  background:
    radial-gradient(circle at 82% 16%, rgba(255, 255, 255, 0.18), transparent 32%),
    linear-gradient(90deg, rgba(128, 0, 12, 0.62), rgba(128, 0, 12, 0.1));
}

.hero__visual--statement::after {
  content: "";
  position: absolute;
  z-index: 2;
  right: 24px;
  top: 24px;
  width: 154px;
  aspect-ratio: 1;
  background: url("assets/molino-scoppettuolo-logo.png") center / contain no-repeat;
  opacity: 1;
  pointer-events: none;
}

.hero__visual > img {
  width: 100%;
  aspect-ratio: 1.25;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(215, 8, 18, 0.16);
}

.hero__statement {
  position: relative;
  z-index: 2;
  max-width: 470px;
}

.hero__statement p {
  margin: 0 0 12px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero__statement h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(32px, 4vw, 54px);
  line-height: 0.98;
}

.hero__statement span {
  display: block;
  max-width: 400px;
  margin-top: 18px;
  color: rgba(255, 255, 255, 0.86);
  font-weight: 700;
  line-height: 1.6;
}

.hero__badge {
  position: absolute;
  left: 26px;
  bottom: 26px;
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255, 250, 241, 0.95);
  border: 1px solid var(--cream-strong);
  border-radius: 8px;
  padding: 10px 16px 10px 10px;
  font-weight: 900;
  box-shadow: var(--shadow);
}

.hero__badge img {
  width: 54px;
  height: 54px;
  object-fit: contain;
}

.section {
  padding: 72px 0;
}

.section--compact {
  padding-top: 36px;
}

.section__heading {
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.section__heading--center {
  display: block;
  text-align: center;
}

.section__heading a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 800;
}

.category-strip,
.category-grid,
.product-grid,
.related-row,
.news__grid {
  display: grid;
  gap: 22px;
}

.category-strip {
  grid-template-columns: repeat(4, 1fr);
}

.mini-category,
.category-card {
  position: relative;
  overflow: hidden;
  min-height: 190px;
  border-radius: 8px;
  color: #fff;
  background: var(--red-dark);
  border: 1px solid rgba(255, 250, 241, 0.5);
}

.mini-category img,
.category-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
  transition: transform 0.25s ease;
}

.mini-category::after,
.category-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(23, 18, 15, 0.02), rgba(23, 18, 15, 0.26));
}

.mini-category:hover img,
.category-card:hover img {
  transform: scale(1.05);
}

.mini-category span,
.category-card span {
  position: absolute;
  inset: auto 20px 22px;
  z-index: 1;
  text-align: center;
  font-size: 24px;
  line-height: 1.15;
  font-weight: 900;
  text-shadow: 0 2px 18px rgba(0, 0, 0, 0.4);
}

.news {
  padding-top: 36px;
}

.news__grid {
  grid-template-columns: repeat(2, 1fr);
}

.news-card {
  background: #fffaf1;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

.news-card img {
  width: 100%;
  aspect-ratio: 1.8;
  object-fit: cover;
}

.news-card div {
  padding: 24px;
}

.news-card span {
  color: var(--red);
  font-weight: 900;
}

.news-card p {
  color: var(--muted);
  line-height: 1.6;
}

.consult {
  background: linear-gradient(90deg, rgba(18, 128, 68, 0.1), rgba(255, 250, 241, 0.9), rgba(215, 8, 18, 0.08));
}

.consult__grid > img {
  border-radius: 8px;
  aspect-ratio: 1.65;
  object-fit: cover;
  width: 100%;
}

.contact-list {
  display: grid;
  gap: 22px;
  margin-top: 26px;
}

.contact-list a {
  gap: 16px;
}

.contact-list svg {
  width: 48px;
  height: 48px;
  padding: 12px;
  border-radius: 50%;
  background: var(--red);
  color: #fff;
}

.contact-list span {
  display: grid;
  color: var(--muted);
}

.contact-list strong {
  color: var(--ink);
  font-size: 20px;
}

.footer {
  background: #17120f;
  color: #fffaf1;
  padding: 58px 0 0;
  border-top: 5px solid var(--red);
}

.footer__grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 68px;
}

.footer__brand img {
  width: 142px;
}

.footer h2 {
  margin: 10px 0 6px;
  font-size: 26px;
}

.footer h3 {
  color: #fff;
}

.footer a,
.footer p {
  display: flex;
  align-items: center;
  gap: 14px;
  line-height: 1.5;
  margin: 16px 0;
}

.footer__social {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  width: fit-content;
  padding: 0;
  color: #fffaf1;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  font-size: 16px;
  font-weight: 700;
}

.facebook-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  color: #050505;
  background: #ffffff;
  border: 3px solid #050505;
  border-radius: 50%;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 28px;
  font-weight: 900;
  line-height: 1;
}

.footer__bottom {
  margin-top: 44px;
  padding: 28px 16px 32px;
  border-top: 1px solid rgba(255, 250, 241, 0.12);
  text-align: center;
  color: #d9c8b6;
}

.footer__bottom p {
  display: block;
  margin: 8px 0;
}

.footer__bottom a {
  display: inline;
  margin: 0;
  color: #fff3e3;
}

.page {
  padding: 32px 0 72px;
}

.page--soft {
  background: var(--soft);
  min-height: 700px;
}

.breadcrumb {
  gap: 9px;
  color: #a38970;
  font-size: 14px;
  margin-bottom: 44px;
}

.breadcrumb a {
  color: var(--green-dark);
}

.category-grid {
  grid-template-columns: repeat(4, 1fr);
  margin-top: 34px;
}

.category-card {
  min-height: 205px;
}

.catalog-layout {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 52px;
}

.sidebar {
  align-self: start;
  position: sticky;
  top: 112px;
  overflow: hidden;
  background:
    linear-gradient(90deg, var(--green) 0 33%, #fffaf1 33% 66%, var(--red) 66% 100%) top / 100% 4px no-repeat,
    #fffdf8;
  border: 1px solid rgba(168, 15, 22, 0.14);
  border-radius: 8px;
  padding: 18px;
  box-shadow: 0 18px 38px rgba(91, 32, 14, 0.08);
}

.sidebar__title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  width: 100%;
  margin-bottom: 14px;
  padding: 2px 2px 12px;
  color: var(--ink);
  font: inherit;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}

.sidebar__title strong {
  font-size: 18px;
}

.sidebar__title i {
  flex: 0 0 auto;
  transition: transform 0.2s ease;
}

#sidebar-categories {
  display: grid;
  gap: 8px;
  max-height: 760px;
  overflow: hidden;
  opacity: 1;
  transition: max-height 0.24s ease, opacity 0.18s ease, margin-top 0.18s ease;
}

.sidebar.is-collapsed .sidebar__title {
  margin-bottom: 0;
  padding-bottom: 2px;
  border-bottom-color: transparent;
}

.sidebar.is-collapsed .sidebar__title i {
  transform: rotate(180deg);
}

.sidebar.is-collapsed #sidebar-categories {
  max-height: 0;
  margin-top: 0;
  opacity: 0;
}

.sidebar-category {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 58px;
  padding: 10px;
  color: var(--muted);
  border: 1px solid transparent;
  border-radius: 8px;
  transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease, transform 0.18s ease;
}

.sidebar-category:hover,
.sidebar-category.active {
  transform: translateX(3px);
  background: #fff7ea;
  border-color: var(--line);
}

.sidebar-category.active {
  color: var(--red);
  background: linear-gradient(90deg, rgba(18, 128, 68, 0.1), rgba(215, 8, 18, 0.08));
  border-color: rgba(215, 8, 18, 0.18);
}

.sidebar-category__icon {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  color: var(--green-dark);
  background: #fffaf1;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.sidebar-category.active .sidebar-category__icon {
  color: #fffaf1;
  background: var(--red);
  border-color: var(--red);
}

.sidebar-category__text {
  display: grid;
  gap: 3px;
  min-width: 0;
}

.sidebar-category__text strong {
  color: var(--ink);
  font-size: 15px;
  line-height: 1.2;
}

.sidebar-category.active .sidebar-category__text strong {
  color: var(--red-dark);
}

.sidebar-category__text em {
  color: #a38970;
  font-size: 12px;
  font-style: normal;
}

.sidebar-category small {
  display: grid;
  place-items: center;
  min-width: 30px;
  height: 28px;
  margin-left: auto;
  color: var(--green-dark);
  font-weight: 800;
  background: #f5f8ef;
  border-radius: 999px;
}

.sidebar-category.active small {
  color: #fffaf1;
  background: var(--green-dark);
}

.product-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 34px;
}

.product-card {
  background: #fffaf1;
  border-radius: 8px;
  padding: 10px 10px 18px;
  min-height: 300px;
  box-shadow: 0 1px 0 rgba(91, 32, 14, 0.04);
  border: 1px solid var(--line);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.product-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.product-card__image {
  width: 100%;
  aspect-ratio: 1;
  border-radius: 8px;
  background: #fff;
  object-fit: contain;
}

.product-card h3 {
  margin: 16px 8px 0;
  font-size: 16px;
  line-height: 1.25;
  text-align: center;
  text-transform: uppercase;
}

.product-detail {
  align-items: start;
}

.product-gallery {
  display: block;
}

.product-gallery__main {
  background: #fffaf1;
  border-radius: 8px;
  object-fit: contain;
}

.product-gallery__main {
  width: 100%;
  aspect-ratio: 1;
}

.product-info h1 {
  font-size: clamp(30px, 4vw, 42px);
  text-transform: uppercase;
}

.product-code {
  color: var(--muted);
  font-size: 20px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--red);
}

.product-spec {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  line-height: 1.55;
}

.product-origin {
  display: flex;
  justify-content: space-between;
  padding: 22px 0;
  border-bottom: 1px solid var(--line);
}

.related-row {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.contact-page {
  align-items: start;
  grid-template-columns: minmax(0, 820px);
  justify-content: center;
}

@media (max-width: 1100px) {
  .search {
    width: min(360px, 32vw);
  }

  .category-grid,
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .related-row {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 860px) {
  .container {
    width: min(100% - 32px, 720px);
  }

  .topbar__links,
  .search {
    display: none;
  }

  .navbar__inner {
    min-height: 78px;
    justify-content: space-between;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav-toggle:hover,
  .nav-toggle.is-open {
    background: rgba(215, 8, 18, 0.08);
  }

  .nav-toggle svg {
    opacity: 0;
  }

  .nav-toggle::before,
  .nav-toggle::after {
    content: "";
    position: absolute;
    left: 12px;
    width: 20px;
    height: 2px;
    border-radius: 999px;
    background: currentColor;
    box-shadow: 0 6px 0 currentColor;
    transition:
      transform 0.28s ease,
      top 0.28s ease,
      box-shadow 0.18s ease;
  }

  .nav-toggle::before {
    top: 14px;
  }

  .nav-toggle::after {
    top: 26px;
    box-shadow: none;
  }

  .nav-toggle.is-open {
    transform: rotate(90deg);
  }

  .nav-toggle.is-open::before {
    top: 21px;
    transform: rotate(45deg);
    box-shadow: 0 0 0 transparent;
  }

  .nav-toggle.is-open::after {
    top: 21px;
    transform: rotate(-45deg);
  }

  .nav-menu {
    position: absolute;
    left: 16px;
    right: 16px;
    top: 120px;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateY(-12px) scale(0.98);
    transform-origin: top right;
    background: #fff;
    border: 1px solid var(--line);
    border-radius: 8px;
    box-shadow: var(--shadow);
    transition:
      max-height 0.34s ease,
      opacity 0.22s ease,
      transform 0.28s ease,
      visibility 0.28s ease;
    visibility: hidden;
  }

  .nav-menu.open {
    max-height: 260px;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0) scale(1);
    visibility: visible;
  }

  .nav-menu a {
    padding: 16px;
    border-bottom: 1px solid var(--line);
  }

  .hero__grid,
  .consult__grid,
  .contact-page,
  .product-detail,
  .catalog-layout,
  .footer__grid {
    grid-template-columns: 1fr;
    gap: 34px;
  }

  .category-strip,
  .category-grid,
  .product-grid,
  .news__grid,
  .related-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .sidebar {
    position: static;
    top: auto;
    border-bottom: 1px solid var(--line);
    padding-bottom: 18px;
  }
}

@media (max-width: 560px) {
  .brand span {
    font-size: 16px;
  }

  .brand img {
    width: 52px;
    height: 52px;
  }

  h1 {
    font-size: 34px;
  }

  .hero {
    padding-top: 42px;
  }

  .hero__visual--statement {
    min-height: 360px;
    padding: 26px;
    background: linear-gradient(135deg, #d81428, #8c0e1a);
  }

  .hero__visual--statement::after {
    right: 16px;
    top: 16px;
    width: 108px;
    opacity: 1;
  }

  .hero__statement h2 {
    font-size: 30px;
  }

  .hero__actions,
  .button {
    width: 100%;
  }

  .category-strip,
  .category-grid,
  .product-grid,
  .news__grid,
  .related-row {
    grid-template-columns: 1fr;
  }

}
