/* Shared layout, header and global base styles */
:root {
  --bfz-blue: #006ba9;
  --bfz-blue-dark: #1a2f58;
  --bfz-yellow: #eedc3a;
  --bfz-yellow-soft: #f6edaf;
  --bfz-bg: #f3f4f7;
  --bfz-text: #1f2a44;
  --bfz-white: #ffffff;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: var(--bfz-text);
  background: var(--bfz-bg);
}

.bfz-topbar {
  background: var(--bfz-yellow);
}

@media (min-width: 768px) and (max-width: 991.98px) and (orientation: portrait) {
  body {
    padding-top: 85px;
  }

  .bfz-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
  }
}

@media (min-width: 992px) {
  body {
    padding-top: 85px;
  }

  .bfz-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
  }
}

.bfz-topbar-inner {
  position: relative;
  min-height: 90px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 12px;
}

.bfz-tagline {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  margin: 0;
  color: var(--bfz-blue);
  font-size: clamp(1rem, 2.5vw, 1.75rem);
  line-height: 1.04;
  font-weight: 800;
  text-align: center;
  white-space: nowrap;
  pointer-events: none;
  z-index: 1;
}

.bfz-logo-wrap {
  display: flex;
  justify-content: flex-start;
}

.bfz-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  padding: 0;
  max-width: 170px;
  transition: transform 0.22s ease, filter 0.22s ease;
}

.bfz-logo-image {
  display: block;
  width: 100%;
  max-width: 170px;
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(19, 36, 71, 0.22));
}

.bfz-logo:hover,
.bfz-logo:focus-visible {
  transform: translateY(-2px) scale(1.02);
  filter: saturate(1.06);
}

.bfz-header-actions {
  justify-self: end;
  display: flex;
  gap: 10px;
}

.bfz-header .bfz-header-affiliati {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 112px;
  padding: 0 14px;
  border-radius: 999px;
  margin: 0;
  border: 0;
  outline: 0;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  text-decoration: none;
  text-transform: none;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1;
  color: var(--bfz-white);
  background: var(--bfz-blue);
  box-shadow: 0 6px 14px rgba(15, 78, 233, 0.35);
  transition: transform 0.18s ease, background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.bfz-header .bfz-header-affiliati:hover,
.bfz-header .bfz-header-affiliati:focus-visible {
  transform: translateY(-2px) scale(1.03);
  color: var(--bfz-white);
  border-color: transparent;
  background: var(--bfz-blue);
  box-shadow: 0 8px 18px rgba(15, 78, 233, 0.42);
  opacity: 0.95;
}

.bfz-header .bfz-header-affiliati:active {
  transform: translateY(0) scale(0.96);
}

.bfz-header .bfz-header-preferiti {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  min-width: 44px;
  padding: 0 16px;
  border-radius: 999px;
  margin: 0;
  border: 0;
  outline: 0;
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  text-decoration: none;
  text-transform: none;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1;
  color: var(--bfz-white);
  background: #e74c6f;
  box-shadow: 0 6px 14px rgba(231, 76, 111, 0.35);
  transition: transform 0.18s ease, background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.bfz-header .bfz-header-preferiti .bi-house-heart-fill {
  font-size: 1rem;
  line-height: 1;
}

.bfz-header .bfz-header-preferiti:hover,
.bfz-header .bfz-header-preferiti:focus-visible {
  transform: translateY(-2px) scale(1.03);
  color: var(--bfz-white);
  background: #d64161;
  box-shadow: 0 8px 18px rgba(231, 76, 111, 0.42);
}

.bfz-header .bfz-header-preferiti:active {
  transform: translateY(0) scale(0.96);
}

.bfz-header-actions-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.bfz-circle-btn {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 0;
  background: var(--bfz-blue);
  color: var(--bfz-white);
  font-size: 1.15rem;
  box-shadow: 0 6px 14px rgba(15, 78, 233, 0.35);
  transition: transform 0.18s ease, box-shadow 0.18s ease, opacity 0.18s ease, background-color 0.18s ease;
}

.bfz-circle-btn:hover,
.bfz-circle-btn:focus-visible,
.bfz-circle-btn.is-active {
  transform: translateY(-2px) scale(1.03);
  box-shadow: 0 8px 18px rgba(15, 78, 233, 0.42);
  opacity: 0.95;
}

.bfz-circle-btn:active {
  transform: translateY(0) scale(0.96);
}

@media (max-width: 767.98px) {
  .bfz-topbar-inner {
    display: grid;
    grid-template-columns: auto 1fr;
    grid-template-rows: auto auto;
    min-height: auto;
    padding: 10px 12px;
    gap: 12px;
  }

  .bfz-logo-wrap {
    grid-column: 1;
    grid-row: 1;
    justify-content: flex-start;
  }

  .bfz-tagline {
    position: static;
    left: auto;
    transform: none;
    grid-column: 2;
    grid-row: 1;
    font-size: clamp(0.85rem, 3.5vw, 1.1rem);
    line-height: 1.08;
    max-width: none;
    text-align: right;
    pointer-events: auto;
  }

  .bfz-logo {
    max-width: 130px;
  }

  .bfz-header-actions {
    grid-column: 1 / -1;
    grid-row: 2;
    width: 100%;
    max-width: 100%;
    justify-content: space-between;
    justify-self: stretch;
    margin: 8px 0 0 0;
    gap: 0;
  }

  .bfz-circle-btn {
    width: 42px;
    height: 42px;
    font-size: 0.98rem;
  }

  .bfz-header-affiliati {
    min-height: 42px;
    min-width: 108px;
    padding: 0 12px;
    font-size: 0.74rem;
  }

  .bfz-header .bfz-header-preferiti {
    width: 42px;
    height: 42px;
    min-width: 42px;
    min-height: 42px;
    padding: 0;
    border-radius: 999px;
    justify-content: center;
  }

  .bfz-header .bfz-header-preferiti .bfz-header-preferiti-text {
    display: none;
  }

  .bfz-header .bfz-header-preferiti .bi-house-heart-fill {
    font-size: 1.15rem;
  }

  .bfz-side-menu {
    width: 100vw;
    max-width: 100vw;
  }

  .bfz-side-menu .offcanvas-header,
  .bfz-side-menu-body {
    padding-left: 18px;
    padding-right: 18px;
  }

  .bfz-side-menu-link {
    min-height: 48px;
    padding: 12px 14px;
    font-size: 0.92rem;
  }
}

@media (min-width: 768px) and (max-width: 991.98px) and (orientation: portrait) {
  .bfz-topbar-inner {
    min-height: auto;
    padding: 10px 12px;
    gap: 12px;
  }

  .bfz-logo {
    max-width: 140px;
  }
}

@media (max-width: 575.98px) {
  .bfz-header-actions {
    gap: 0;
  }

  .bfz-header-affiliati {
    min-width: 102px;
    padding: 0 11px;
    font-size: 0.7rem;
  }

  .bfz-logo {
    max-width: 132px;
  }

  .bfz-side-menu-title {
    font-size: 1.3rem;
  }

  .bfz-side-menu-group-title {
    font-size: 0.82rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bfz-logo,
  .bfz-circle-btn,
  .bfz-header .bfz-header-affiliati,
  .bfz-header .bfz-header-preferiti {
    transition: none;
  }

  .bfz-logo:hover,
  .bfz-logo:focus-visible,
  .bfz-header .bfz-header-affiliati:hover,
  .bfz-header .bfz-header-affiliati:focus-visible,
  .bfz-header .bfz-header-affiliati:active,
  .bfz-header .bfz-header-preferiti:hover,
  .bfz-header .bfz-header-preferiti:focus-visible,
  .bfz-header .bfz-header-preferiti:active,
  .bfz-circle-btn:hover,
  .bfz-circle-btn:focus-visible,
  .bfz-circle-btn:active,
  .bfz-circle-btn.is-active {
    transform: none;
  }
}

.bfz-side-menu {
  width: min(420px, 90vw);
  background:
    radial-gradient(700px 240px at 100% 0%, rgba(255, 255, 255, 0.18), rgba(255, 255, 255, 0)),
    linear-gradient(180deg, #f8e96b 0%, #eedc3a 100%);
  color: var(--bfz-blue);
  border-left: 1px solid rgba(26, 47, 88, 0.12);
  box-shadow: -24px 0 60px rgba(12, 18, 30, 0.18);
}

.bfz-side-menu .offcanvas-header {
  padding: 22px 22px 8px;
}

.bfz-side-menu-title {
  margin: 0;
  color: var(--bfz-blue);
  font-size: 1.55rem;
  font-weight: 900;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

.bfz-side-menu-close {
  opacity: 1;
  background-size: 0.8rem;
  box-shadow: none;
  filter: brightness(0) saturate(100%) invert(17%) sepia(18%) saturate(1850%) hue-rotate(192deg) brightness(92%) contrast(93%);
  transition: transform 0.18s ease, opacity 0.18s ease;
}

.bfz-side-menu-close:hover,
.bfz-side-menu-close:focus-visible {
  transform: rotate(90deg) scale(1.05);
  opacity: 0.9;
}

.bfz-side-menu-body {
  padding: 10px 22px 24px;
}

.bfz-side-menu-nav {
  display: grid;
  gap: 18px;
}

.bfz-side-menu-group {
  display: grid;
  gap: 8px;
}

.bfz-side-menu-group-title {
  margin: 0 0 2px;
  color: var(--bfz-blue);
  font-size: 0.92rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.bfz-side-menu-link {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 12px 14px;
  border-radius: 14px;
  text-decoration: none;
  color: var(--bfz-blue);
  font-size: 0.94rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  background: rgba(255, 255, 255, 0.28);
  border: 1px solid rgba(26, 47, 88, 0.08);
  transition: transform 0.18s ease, background-color 0.18s ease, color 0.18s ease, box-shadow 0.18s ease;
}

.bfz-side-menu-link:hover,
.bfz-side-menu-link:focus-visible {
  transform: translateX(-4px);
  background: rgba(255, 255, 255, 0.5);
  color: var(--bfz-blue);
  box-shadow: inset 0 0 0 1px rgba(26, 47, 88, 0.08);
}

.bfz-side-menu-link:active {
  transform: translateX(-2px) scale(0.99);
}

.bfz-side-menu-link--preferiti {
  color: #e74c6f;
  border-color: rgba(231, 76, 111, 0.2);
  background: rgba(231, 76, 111, 0.08);
}

.bfz-side-menu-link--preferiti:hover,
.bfz-side-menu-link--preferiti:focus-visible {
  color: #ffffff;
  background: #e74c6f;
  border-color: #e74c6f;
  box-shadow: 0 4px 14px rgba(231, 76, 111, 0.3);
}

@media (max-width: 575.98px) {
  .bfz-side-menu {
    width: min(92vw, 420px);
  }

  .bfz-side-menu .offcanvas-header,
  .bfz-side-menu-body {
    padding-left: 18px;
    padding-right: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bfz-side-menu-close,
  .bfz-side-menu-link {
    transition: none;
  }

  .bfz-side-menu-close:hover,
  .bfz-side-menu-close:focus-visible,
  .bfz-side-menu-link:hover,
  .bfz-side-menu-link:focus-visible,
  .bfz-side-menu-link:active {
    transform: none;
  }
}
