/* Tofoli Madeiras — design system (preview) */
:root {
  --tf-primary: #3e4096;
  --tf-primary-deep: #001449;
  --tf-secondary: #61a229;
  --tf-cream: #f3efe6;
  --tf-ink: #14131a;
  --tf-muted: #6b7280;
  --tf-radius: 1.25rem;
  --tf-radius-lg: 1.75rem;
  --tf-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --tf-header-h: 5rem;
}

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--tf-header-h) + 1rem);
}

body {
  font-family: "Outfit", system-ui, sans-serif;
  background:
    radial-gradient(1200px 500px at 10% -10%, rgba(62, 64, 150, 0.12), transparent 60%),
    radial-gradient(900px 400px at 90% 0%, rgba(97, 162, 41, 0.1), transparent 55%),
    #f6f6f7;
  color: var(--tf-ink);
}

h1, h2, h3, .font-display {
  font-family: "Fraunces", Georgia, serif;
  letter-spacing: -0.02em;
}

/* Header */
.tf-header {
  min-height: var(--tf-header-h) !important;
  height: auto !important;
  backdrop-filter: blur(14px) saturate(1.2);
  background: #001449 !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  transition: box-shadow 0.35s var(--tf-ease), background 0.35s var(--tf-ease);
  overflow: visible;
}

.tf-header.is-scrolled {
  box-shadow: 0 12px 40px rgba(0, 20, 73, 0.32);
  background: #001449 !important;
}

.tf-nav-link {
  position: relative;
  color: rgba(255, 255, 255, 0.86);
  font-weight: 600;
  font-size: 0.875rem;
  letter-spacing: 0.01em;
  transition: color 0.25s var(--tf-ease);
}

.tf-nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.35rem;
  width: 100%;
  height: 2px;
  border-radius: 999px;
  background: var(--tf-secondary);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.35s var(--tf-ease);
}

.tf-nav-link:hover,
.tf-nav-link.is-active {
  color: #fff;
}

.tf-nav-link:hover::after,
.tf-nav-link.is-active::after {
  transform: scaleX(1);
}

/* Dropdown */
.tf-dropdown {
  position: absolute;
  right: 0;
  top: calc(100% + 0.75rem);
  min-width: 17rem;
  padding: 0.5rem;
  border-radius: var(--tf-radius);
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 24px 50px rgba(2, 23, 86, 0.18);
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.98);
  transition:
    opacity 0.28s var(--tf-ease),
    transform 0.28s var(--tf-ease),
    visibility 0.28s;
  z-index: 60;
}

.tf-dropdown-trigger:hover .tf-dropdown,
.tf-dropdown-trigger:focus-within .tf-dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
}

.tf-dropdown a {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  padding: 0.75rem 0.9rem;
  border-radius: 0.9rem;
  color: #1e293b;
  font-size: 0.875rem;
  font-weight: 500;
  transition: background 0.2s var(--tf-ease), color 0.2s var(--tf-ease), transform 0.2s var(--tf-ease);
}

.tf-dropdown a:hover {
  background: rgba(62, 64, 150, 0.08);
  color: var(--tf-primary);
  transform: translateX(3px);
}

.tf-dropdown a .dot {
  width: 0.4rem;
  height: 0.4rem;
  border-radius: 999px;
  background: var(--tf-secondary);
  opacity: 0.55;
  transition: opacity 0.2s, transform 0.2s;
}

.tf-dropdown a:hover .dot {
  opacity: 1;
  transform: scale(1.25);
}

/* Mobile menu */
.tf-mobile-panel {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  margin-left: -1rem;
  margin-right: -1rem;
  padding-left: 1rem;
  padding-right: 1rem;
  background: #001449 !important;
  transition: max-height 0.45s var(--tf-ease), opacity 0.3s ease, padding 0.3s ease;
}

.tf-mobile-panel.is-open {
  max-height: min(80vh, 36rem) !important;
  opacity: 1;
  padding-bottom: 1.25rem;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  background: #001449 !important;
}

.tf-mobile-panel nav {
  background: #001449 !important;
}

.tf-mobile-panel nav a {
  color: #fff !important;
  background: rgba(255, 255, 255, 0.06);
}

.tf-mobile-panel nav a:hover,
.tf-mobile-panel nav a:active {
  background: rgba(255, 255, 255, 0.14);
}

.tf-mobile-acc {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.tf-mobile-acc__row {
  display: flex;
  align-items: stretch;
  gap: 0.35rem;
}

.tf-mobile-acc__link {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 0.75rem 0.85rem;
  border-radius: 0.75rem;
  color: #fff !important;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
}

.tf-mobile-acc__toggle {
  flex: 0 0 2.75rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
}

.tf-mobile-acc__toggle .material-symbols-outlined {
  transition: transform 0.3s var(--tf-ease);
}

.tf-mobile-acc.is-open .tf-mobile-acc__toggle .material-symbols-outlined {
  transform: rotate(180deg);
}

.tf-mobile-acc__panel {
  display: none;
  flex-direction: column;
  gap: 0.25rem;
  padding: 0.35rem 0 0.25rem 0.5rem;
  margin-left: 0.35rem;
  border-left: 2px solid rgba(97, 162, 41, 0.55);
}

.tf-mobile-acc.is-open .tf-mobile-acc__panel {
  display: flex;
}

.tf-mobile-acc__item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.65rem 0.85rem;
  border-radius: 0.75rem;
  color: #fff !important;
  font-size: 0.9rem;
  font-weight: 500;
  background: rgba(255, 255, 255, 0.05);
}

.tf-burger span {
  display: block;
  width: 1.35rem;
  height: 2px;
  background: #fff;
  border-radius: 999px;
  transition: transform 0.3s var(--tf-ease), opacity 0.25s ease;
}

.tf-burger span + span {
  margin-top: 0.3rem;
}

.tf-burger.is-open span:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}

.tf-burger.is-open span:nth-child(2) {
  opacity: 0;
}

.tf-burger.is-open span:nth-child(3) {
  transform: translateY(-5px) rotate(-45deg);
}

/* Product cards */
.tf-card {
  border-radius: var(--tf-radius-lg);
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.06);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
  transition:
    transform 0.4s var(--tf-ease),
    box-shadow 0.4s var(--tf-ease),
    border-color 0.3s ease;
}

.tf-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 22px 50px rgba(2, 23, 86, 0.14);
  border-color: rgba(62, 64, 150, 0.2);
}

.tf-card__media {
  position: relative;
  aspect-ratio: 16 / 11;
  overflow: hidden;
}

.tf-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.7s var(--tf-ease);
}

.tf-card:hover .tf-card__media img {
  transform: scale(1.07);
}

.tf-card__media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 40%, rgba(2, 23, 86, 0.55));
  opacity: 0.85;
  pointer-events: none;
}

.tf-chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.55rem 1rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 600;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: #fff;
  color: #334155;
  transition: background 0.25s, color 0.25s, border-color 0.25s, transform 0.25s;
  white-space: nowrap;
  flex: 0 0 auto;
}

.tf-chip:hover,
.tf-chip.is-active {
  background: var(--tf-primary);
  border-color: var(--tf-primary);
  color: #fff;
  transform: translateY(-1px);
}

.tf-cat-nav {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(15, 23, 42, 0.08);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(12px);
}

.tf-cat-track {
  flex: 1;
  min-width: 0;
  overflow: hidden;
}

.tf-cat-track__inner {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  width: max-content;
  transition: transform 0.35s var(--tf-ease);
  will-change: transform;
}

.tf-cat-arrow {
  flex: 0 0 auto;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: #fff;
  color: var(--tf-primary);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s, color 0.2s, opacity 0.2s, border-color 0.2s;
  cursor: pointer;
}

.tf-cat-arrow:hover:not(:disabled) {
  background: var(--tf-primary);
  border-color: var(--tf-primary);
  color: #fff;
}

.tf-cat-arrow:disabled {
  opacity: 0.35;
  cursor: default;
}

.tf-cat-arrow .material-symbols-outlined {
  font-size: 1.35rem;
  line-height: 1;
}

.tf-pill-nav {
  display: none;
}

.tf-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s var(--tf-ease), transform 0.7s var(--tf-ease);
}

.tf-reveal.is-in {
  opacity: 1;
  transform: none;
}

.tf-hero-products {
  position: relative;
  overflow: hidden;
  background:
    linear-gradient(120deg, rgba(2, 23, 86, 0.94), rgba(62, 64, 150, 0.78)),
    url("../img/hero-fallback.jpg") center/cover;
}

.tf-hero-products::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 80% 20%, rgba(97, 162, 41, 0.35), transparent 40%),
    linear-gradient(180deg, transparent, rgba(2, 23, 86, 0.35));
  pointer-events: none;
}

.tf-detail {
  border-radius: var(--tf-radius-lg);
  border: 1px solid rgba(15, 23, 42, 0.07);
  background: #fff;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(15, 23, 42, 0.06);
}

.tf-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.45rem 0.9rem;
  border-radius: 999px;
  font-size: 0.8rem;
  font-weight: 500;
  background: rgba(62, 64, 150, 0.08);
  color: var(--tf-primary);
  transition: background 0.2s, transform 0.2s;
}

.tf-tag:hover {
  background: rgba(62, 64, 150, 0.14);
  transform: translateY(-1px);
}

.tf-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  border-radius: 999px;
  font-weight: 700;
  font-size: 0.875rem;
  transition: transform 0.25s var(--tf-ease), box-shadow 0.25s, background 0.25s;
}

.tf-btn:hover {
  transform: translateY(-2px);
}

.tf-btn-primary {
  background: var(--tf-primary);
  color: #fff;
  box-shadow: 0 10px 24px rgba(62, 64, 150, 0.28);
}

.tf-btn-primary:hover {
  background: #34368a;
  box-shadow: 0 14px 28px rgba(62, 64, 150, 0.35);
}

.tf-btn-ghost {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.tf-btn-ghost:hover {
  background: rgba(255, 255, 255, 0.2);
}

/* Product gallery */
.tf-product-card {
  border-radius: 1.25rem;
  overflow: hidden;
  background: #fff;
  border: 1px solid rgba(15, 23, 42, 0.07);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
  transition: transform 0.35s var(--tf-ease), box-shadow 0.35s var(--tf-ease);
  display: flex;
  flex-direction: column;
}

.tf-product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 40px rgba(2, 23, 86, 0.12);
}

.tf-product-media {
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: #eef1f6;
}

.tf-product-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--tf-ease);
}

.tf-product-card:hover .tf-product-media img {
  transform: scale(1.06);
}

.tf-product-zoom {
  position: absolute;
  right: 0.75rem;
  top: 0.75rem;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(2, 23, 86, 0.55);
  color: #fff;
  font-size: 1.1rem;
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.25s, transform 0.25s;
}

.tf-product-card:hover .tf-product-zoom {
  opacity: 1;
  transform: scale(1);
}

.tf-product-card--quote-only {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 7.5rem;
  padding: 1rem 0.5rem;
}

.tf-product-card--quote-only .tf-product-wa {
  margin: 0.75rem 1rem;
  width: calc(100% - 2rem);
}

.tf-product-wa {
  margin: 0 1rem 1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 0.55rem 0.9rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--tf-primary);
  background: rgba(62, 64, 150, 0.08);
  transition: background 0.25s, color 0.25s;
}

.tf-product-wa:hover {
  background: var(--tf-primary);
  color: #fff;
}

.line-clamp-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Lightbox */
.tf-lightbox {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(2, 12, 40, 0.84);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
}

.tf-lightbox[hidden] {
  display: none !important;
}

.tf-lightbox__figure {
  max-width: min(920px, 100%);
  max-height: 90vh;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.tf-lightbox__img {
  max-height: 72vh;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  border-radius: 1.25rem;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  background: #0b1228;
}

.tf-lightbox__caption {
  color: #fff;
  text-align: center;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.tf-lightbox__title {
  font-family: "Fraunces", Georgia, serif;
  font-size: 1.25rem;
}

.tf-lightbox__desc {
  color: rgba(255, 255, 255, 0.72);
  font-size: 0.9rem;
}

.tf-lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1.25rem;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s;
}

.tf-lightbox__close:hover {
  background: rgba(255, 255, 255, 0.18);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}
