/* =========================================================
   Fatto a mano con amore — design system
   Desktop: premium editorial · Mobile: fluid app shell
   ========================================================= */

:root {
  --hfam-ink: #2a2220;
  --hfam-ink-soft: #5c514c;
  --hfam-muted: #8a7e78;
  --hfam-paper: #f7f3ef;
  --hfam-paper-2: #efe8e1;
  --hfam-surface: #fffdfb;
  --hfam-rose: #b44d63;
  --hfam-rose-deep: #8f3a4d;
  --hfam-champagne: #c4a574;
  --hfam-line: rgba(42, 34, 32, 0.1);
  --hfam-shadow: 0 18px 50px rgba(42, 34, 32, 0.08);
  --hfam-radius: 14px;
  --hfam-radius-sm: 10px;
  --hfam-font-display: "Cormorant Garamond", Georgia, serif;
  --hfam-font-ui: "Manrope", system-ui, sans-serif;
  --hfam-header-h: 72px;
  --hfam-app-nav-h: 68px;
  --hfam-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body.hfam-theme {
  margin: 0;
  color: var(--hfam-ink);
  background:
    radial-gradient(1200px 600px at 10% -10%, rgba(180, 77, 99, 0.08), transparent 55%),
    radial-gradient(900px 500px at 100% 0%, rgba(196, 165, 116, 0.12), transparent 50%),
    linear-gradient(180deg, var(--hfam-paper) 0%, var(--hfam-surface) 40%, var(--hfam-paper) 100%);
  font-family: var(--hfam-font-ui);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  padding-bottom: calc(var(--hfam-app-nav-h) + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 981px) {
  body.hfam-theme {
    padding-bottom: 0;
  }
}

body.hfam-theme h1,
body.hfam-theme h2,
body.hfam-theme h3,
body.hfam-theme .elementor-heading-title {
  font-family: var(--hfam-font-display);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--hfam-ink);
  line-height: 1.15;
}

a {
  color: var(--hfam-rose-deep);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  transition: color 0.25s var(--hfam-ease);
}

a:hover {
  color: var(--hfam-rose);
}

img {
  max-width: 100%;
  height: auto;
}

/* ----- Brand / site title signal ----- */
.site-header .site-title a,
.site-header .site-branding .site-title,
body.hfam-theme .elementor-location-header .elementor-heading-title,
body.hfam-theme .hfam-brand {
  font-family: var(--hfam-font-display);
  font-size: clamp(1.55rem, 2.4vw, 2.15rem);
  font-weight: 600;
  font-style: italic;
  color: var(--hfam-rose) !important;
  letter-spacing: 0.01em;
  text-decoration: none;
}

/* ----- Buttons ----- */
.hfam-btn,
body.hfam-theme .button,
body.hfam-theme button.button,
body.hfam-theme .woocommerce a.button,
body.hfam-theme .woocommerce button.button,
body.hfam-theme .elementor-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 48px;
  padding: 0.85rem 1.45rem;
  border: 0;
  border-radius: 999px;
  background: var(--hfam-rose);
  color: #fff !important;
  font-family: var(--hfam-font-ui);
  font-size: 0.92rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none !important;
  box-shadow: 0 10px 28px rgba(180, 77, 99, 0.28);
  transition: transform 0.3s var(--hfam-ease), background 0.25s ease, box-shadow 0.3s ease;
  cursor: pointer;
}

.hfam-btn:hover,
body.hfam-theme .button:hover,
body.hfam-theme .woocommerce a.button:hover,
body.hfam-theme .elementor-button:hover {
  background: var(--hfam-rose-deep);
  transform: translateY(-2px);
  box-shadow: 0 14px 34px rgba(143, 58, 77, 0.32);
  color: #fff !important;
}

.hfam-btn--ghost {
  background: transparent;
  color: var(--hfam-ink) !important;
  border: 1px solid var(--hfam-line);
  box-shadow: none;
}

/* ----- Hero (home) ----- */
.hfam-hero {
  position: relative;
  min-height: min(88vh, 820px);
  display: grid;
  align-items: end;
  overflow: hidden;
  color: #fff;
  background:
    linear-gradient(180deg, rgba(42, 34, 32, 0.15) 0%, rgba(42, 34, 32, 0.55) 55%, rgba(42, 34, 32, 0.78) 100%),
    var(--hfam-hero-image, linear-gradient(135deg, #8f3a4d, #2a2220)) center / cover no-repeat;
}

.hfam-hero__inner {
  width: min(1120px, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 4.5rem 0 3.5rem;
}

.hfam-hero__brand {
  display: block;
  margin: 0 0 0.85rem;
  font-family: var(--hfam-font-display);
  font-size: clamp(2.6rem, 7vw, 5rem);
  font-weight: 600;
  font-style: italic;
  line-height: 0.95;
  color: #fff !important;
  text-shadow: 0 4px 28px rgba(0, 0, 0, 0.55);
  animation: hfam-rise 0.9s var(--hfam-ease) both;
}

.hfam-hero__lead {
  max-width: 28rem;
  margin: 0 0 1.6rem;
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  color: rgba(255, 255, 255, 0.88);
  animation: hfam-rise 0.9s 0.12s var(--hfam-ease) both;
}

.hfam-hero__cta {
  animation: hfam-rise 0.9s 0.22s var(--hfam-ease) both;
}

@keyframes hfam-rise {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ----- Sections ----- */
.hfam-section {
  width: min(1180px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 3.25rem 0;
}

.hfam-section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.hfam-section__head h2 {
  margin: 0;
  font-size: clamp(1.85rem, 3.5vw, 2.6rem);
}

.hfam-section__head p {
  margin: 0.35rem 0 0;
  color: var(--hfam-ink-soft);
  max-width: 34rem;
}

/* ----- Occasion strip (app chips / premium tiles) ----- */
.hfam-occasions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

@media (min-width: 700px) {
  .hfam-occasions {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.1rem;
  }
}

.hfam-occasions__item {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--hfam-radius);
  text-decoration: none;
  color: #fff;
  aspect-ratio: 4 / 5;
  background: var(--hfam-paper-2);
  box-shadow: var(--hfam-shadow);
  transition: transform 0.45s var(--hfam-ease);
}

.hfam-occasions__item:hover {
  transform: translateY(-4px);
  color: #fff;
}

.hfam-occasions__media {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, transparent 35%, rgba(42, 34, 32, 0.72) 100%),
    var(--hfam-paper-2) center / cover no-repeat;
  transition: transform 0.7s var(--hfam-ease);
}

.hfam-occasions__item:hover .hfam-occasions__media {
  transform: scale(1.05);
}

.hfam-occasions__name {
  position: absolute;
  left: 1rem;
  right: 1rem;
  bottom: 1rem;
  font-family: var(--hfam-font-display);
  font-size: 1.35rem;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
}

/* ----- Trust ----- */
.hfam-trust {
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}

@media (min-width: 800px) {
  .hfam-trust {
    grid-template-columns: repeat(4, 1fr);
    gap: 1.5rem;
  }
}

.hfam-trust__item {
  padding: 1.25rem 0;
  border-top: 1px solid var(--hfam-line);
}

.hfam-trust__item strong {
  display: block;
  margin-bottom: 0.35rem;
  font-family: var(--hfam-font-display);
  font-size: 1.35rem;
  font-weight: 600;
}

.hfam-trust__item span {
  color: var(--hfam-ink-soft);
  font-size: 0.92rem;
}

/* ----- Reveal motion ----- */
[data-hfam-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.7s var(--hfam-ease), transform 0.7s var(--hfam-ease);
}

[data-hfam-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* ----- Mobile app nav ----- */
.hfam-app-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  height: calc(var(--hfam-app-nav-h) + env(safe-area-inset-bottom, 0px));
  padding: 0.35rem 0.4rem calc(0.35rem + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 253, 251, 0.92);
  backdrop-filter: blur(16px);
  border-top: 1px solid var(--hfam-line);
  box-shadow: 0 -10px 30px rgba(42, 34, 32, 0.06);
}

@media (min-width: 981px) {
  .hfam-app-nav,
  .hfam-search-sheet {
    display: none !important;
  }
}

.hfam-app-nav__item {
  appearance: none;
  border: 0;
  background: transparent;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  color: var(--hfam-muted);
  text-decoration: none;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: color 0.2s ease;
}

.hfam-app-nav__item.is-active,
.hfam-app-nav__item:hover {
  color: var(--hfam-rose);
}

.hfam-app-nav__icon {
  position: relative;
  display: inline-flex;
}

.hfam-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--hfam-rose);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}

/* Search sheet */
.hfam-search-sheet {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(42, 34, 32, 0.45);
  display: flex;
  align-items: flex-end;
}

.hfam-search-sheet[hidden] {
  display: none !important;
}

.hfam-search-sheet__panel {
  position: relative;
  width: 100%;
  padding: 1.25rem 1rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
  border-radius: 22px 22px 0 0;
  background: var(--hfam-surface);
  box-shadow: var(--hfam-shadow);
  animation: hfam-sheet 0.35s var(--hfam-ease);
}

@keyframes hfam-sheet {
  from {
    transform: translateY(100%);
  }
  to {
    transform: translateY(0);
  }
}

.hfam-search-sheet__form {
  display: flex;
  gap: 0.5rem;
}

.hfam-search-sheet__form input {
  flex: 1;
  min-height: 48px;
  border: 1px solid var(--hfam-line);
  border-radius: 999px;
  padding: 0 1rem;
  font: inherit;
  background: var(--hfam-paper);
}

.hfam-search-sheet__close {
  position: absolute;
  top: 0.55rem;
  right: 0.85rem;
  border: 0;
  background: transparent;
  font-size: 1.6rem;
  line-height: 1;
  color: var(--hfam-muted);
  cursor: pointer;
}

/* ----- Desktop / tablet site header ----- */
.hfam-site-header {
  position: sticky;
  top: 0;
  z-index: 900;
  background: rgba(255, 253, 251, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--hfam-line);
  transition: box-shadow 0.3s ease, background 0.3s ease;
}

.hfam-site-header.is-scrolled {
  box-shadow: 0 10px 30px rgba(42, 34, 32, 0.06);
}

.hfam-site-header__bar {
  width: min(1180px, calc(100% - 1.5rem));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 0.75rem 1rem;
  align-items: center;
  padding: 0.85rem 0 0.55rem;
}

@media (min-width: 900px) {
  .hfam-site-header__bar {
    grid-template-columns: auto 1fr auto;
    padding: 1rem 0 0.65rem;
  }
}

.hfam-site-header__search {
  display: none;
}

@media (min-width: 900px) {
  .hfam-site-header__search {
    display: block;
    width: min(420px, 100%);
    justify-self: center;
  }

  .hfam-site-header__search input {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--hfam-line);
    border-radius: 999px;
    padding: 0 1.1rem;
    background: var(--hfam-paper);
    font: inherit;
  }
}

.hfam-site-header__actions {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  justify-self: end;
  font-size: 0.88rem;
  font-weight: 600;
}

.hfam-site-header__actions a {
  color: var(--hfam-ink);
  text-decoration: none;
}

.hfam-site-header__cart {
  position: relative;
  padding-right: 0.35rem;
}

.hfam-site-header__nav {
  width: min(1180px, calc(100% - 1.5rem));
  margin: 0 auto;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 0.65rem;
}

.hfam-site-header__nav::-webkit-scrollbar {
  display: none;
}

.hfam-primary-menu {
  display: flex;
  gap: 0.25rem 1.15rem;
  margin: 0;
  padding: 0;
  list-style: none;
  white-space: nowrap;
}

.hfam-primary-menu a {
  color: var(--hfam-ink-soft);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hfam-primary-menu a:hover,
.hfam-primary-menu .current-menu-item > a {
  color: var(--hfam-rose);
}

/* Footer */
.hfam-site-footer {
  margin-top: 2rem;
  padding: 3rem 0 2rem;
  border-top: 1px solid var(--hfam-line);
  background: linear-gradient(180deg, transparent, rgba(239, 232, 225, 0.65));
}

.hfam-site-footer__inner {
  width: min(1180px, calc(100% - 1.5rem));
  margin: 0 auto 2rem;
  display: grid;
  gap: 2rem;
}

@media (min-width: 800px) {
  .hfam-site-footer__inner {
    grid-template-columns: 1.4fr 1fr;
  }
}

.hfam-site-footer__tag,
.hfam-site-footer__legal {
  color: var(--hfam-ink-soft);
  font-size: 0.92rem;
}

.hfam-site-footer__label {
  margin: 0 0 0.65rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--hfam-muted);
}

.hfam-footer-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0.45rem;
}

.hfam-footer-menu a {
  color: var(--hfam-ink);
  text-decoration: none;
  font-weight: 500;
}

.hfam-site-footer__legal {
  width: min(1180px, calc(100% - 1.5rem));
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.25rem;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--hfam-line);
}

.screen-reader-text {
  border: 0;
  clip: rect(1px, 1px, 1px, 1px);
  clip-path: inset(50%);
  height: 1px;
  margin: -1px;
  overflow: hidden;
  padding: 0;
  position: absolute;
  width: 1px;
  word-wrap: normal !important;
}

/* Desktop premium polish */
@media (min-width: 981px) {
  .site-header,
  .elementor-location-header {
    backdrop-filter: blur(12px);
  }
}
