/* ══════════════════════════════════════════════════
   WMR — Portfolio page styles
   Stili specifici per pages/portfolio.html
   ══════════════════════════════════════════════════ */

/* ── PAGE HERO ── */
.page-hero {
  position: relative;
  height: 60vh;
  min-height: 420px;
  max-height: 600px;
  display: flex;
  align-items: flex-end;
  padding: 0 var(--page-pad) 80px;
  background: var(--bg-deep);
  overflow: hidden;
}
.page-hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 70% at 70% 30%, rgba(123,47,255,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 50% 80% at 20% 80%, rgba(123,47,255,0.06) 0%, transparent 60%);
  pointer-events: none;
}
.page-hero-content {
  position: relative;
  z-index: 2;
  max-width: 680px;
}
.page-hero-title {
  font-family: var(--font-display);
  font-size: clamp(64px, 8vw, 110px);
  line-height: 0.92;
  letter-spacing: 0.02em;
  color: var(--white);
  margin: 16px 0 24px;
}
.page-hero-sub {
  font-size: 16px;
  font-weight: 300;
  line-height: 1.7;
  color: rgba(245,245,245,0.55);
  max-width: 480px;
}

/* Counter in hero */
.page-hero-counter {
  position: absolute;
  bottom: 80px;
  right: var(--page-pad);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}
.counter-num {
  font-family: var(--font-display);
  font-size: 140px;
  line-height: 1;
  color: var(--white);
  opacity: 0.15;
}
.counter-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: -8px;
}

/* ── FILTER BAR ── */
.pf-filter-bar {
  position: sticky;
  top: var(--nav-height);
  z-index: 50;
  padding: 0 var(--page-pad);
  background: rgba(17,17,17,0.95);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.pf-filters {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.pf-filters::-webkit-scrollbar { display: none; }

.pf-filter {
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  background: none;
  border: none;
  padding: 20px 28px;
  cursor: pointer;
  position: relative;
  white-space: nowrap;
  transition: color var(--transition);
}
.pf-filter::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 28px;
  right: 28px;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transition: transform 0.3s var(--ease-out);
}
.pf-filter:hover { color: var(--white); }
.pf-filter.active {
  color: var(--white);
}
.pf-filter.active::after {
  transform: scaleX(1);
}

/* ── DROPDOWN FILTER BAR (single-row car-dealer style) ── */
.pf-dropdown-bar {
  position: sticky;
  top: var(--nav-height);
  z-index: 50;
  padding: 14px var(--page-pad);
  background: rgba(17,17,17,0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
}
.pf-dropdown-bar::-webkit-scrollbar { display: none; }

/* Filter count badge */
.pf-filter-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--white);
  background: var(--accent);
  border: none;
  border-radius: 24px;
  padding: 9px 18px;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background 0.2s;
}
.pf-filter-badge:hover { background: var(--accent-hover); }
.pf-filter-badge svg { width: 14px; height: 14px; }
.pf-filter-badge .pf-badge-count {
  background: var(--white);
  color: var(--accent);
  font-size: 10px;
  font-weight: 600;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}
.pf-filter-badge .pf-badge-count.hidden { display: none; }

/* Individual dropdown trigger */
.pf-dropdown {
  position: relative;
  flex-shrink: 0;
}
.pf-dropdown-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 24px;
  padding: 9px 16px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s;
}
.pf-dropdown-trigger:hover {
  color: var(--white);
  border-color: rgba(123,47,255,0.4);
}
.pf-dropdown-trigger.active {
  color: var(--white);
  border-color: var(--accent);
  background: rgba(123,47,255,0.1);
}
.pf-dropdown-trigger .pf-chevron {
  width: 8px;
  height: 5px;
  transition: transform 0.2s;
}
.pf-dropdown.open .pf-dropdown-trigger .pf-chevron { transform: rotate(180deg); }

/* Dropdown menu */
.pf-dropdown-menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  min-width: 180px;
  background: rgba(28,28,28,0.98);
  backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: all 0.2s var(--ease-out);
  box-shadow: 0 12px 40px rgba(0,0,0,0.5);
}
.pf-dropdown.open .pf-dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}
.pf-dropdown-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 18px;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 400;
  color: var(--muted);
  background: none;
  border: none;
  cursor: pointer;
  text-align: left;
  transition: all 0.15s;
}
.pf-dropdown-option:hover {
  background: rgba(123,47,255,0.08);
  color: var(--white);
}
.pf-dropdown-option.selected {
  color: var(--accent);
  font-weight: 500;
}
.pf-dropdown-option.selected::after {
  content: '✓';
  font-size: 11px;
  color: var(--accent);
}

/* Results counter (inline in the bar) */
.pf-bar-count {
  margin-left: auto;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}
.pf-bar-count span {
  color: var(--white);
  font-family: var(--font-display);
  font-size: 18px;
  margin-right: 4px;
}

/* Reset button */
.pf-reset-btn {
  font-family: var(--font-body);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  background: none;
  border: none;
  cursor: pointer;
  padding: 9px 12px;
  white-space: nowrap;
  flex-shrink: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s;
}
.pf-reset-btn.visible { opacity: 1; pointer-events: auto; }
.pf-reset-btn:hover { text-decoration: underline; }

/* Empty state */
.pf-empty {
  display: none;
  text-align: center;
  padding: 100px var(--page-pad);
  grid-column: 1 / -1;
}
.pf-empty-icon {
  font-size: 48px;
  opacity: 0.3;
  margin-bottom: 20px;
}
.pf-empty h3 {
  font-family: var(--font-display);
  font-size: 28px;
  color: var(--white);
  margin-bottom: 12px;
}
.pf-empty p {
  font-size: 14px;
  color: var(--muted);
  max-width: 400px;
  margin: 0 auto;
}

@keyframes pfFadeIn {
  from { opacity: 0; transform: scale(0.97); }
  to   { opacity: 1; transform: scale(1); }
}

/* ── HUB CARDS (portfolio overview page) ── */
.pf-hub-section {
  padding: var(--space-lg) var(--page-pad) var(--space-2xl);
  background: var(--bg);
}
.pf-hub-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}
.pf-hub-card {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3/4;
  cursor: pointer;
  display: block;
}
.pf-hub-card-bg {
  position: absolute;
  inset: 0;
}
.pf-hub-card-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out);
}
.pf-hub-card:hover .pf-hub-card-bg img {
  transform: scale(1.05);
}
.pf-hub-card-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 40px;
  background: linear-gradient(to top, rgba(10,10,10,0.92) 0%, rgba(10,10,10,0.3) 50%, transparent 100%);
  transition: background 0.4s;
}
.pf-hub-card:hover .pf-hub-card-overlay {
  background: linear-gradient(to top, rgba(10,10,10,0.95) 0%, rgba(10,10,10,0.5) 60%, rgba(123,79,255,0.08) 100%);
}
.pf-hub-card-tag {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent-light);
  margin-bottom: 12px;
}
.pf-hub-card-title {
  font-family: var(--font-display);
  font-size: clamp(36px, 3.5vw, 56px);
  line-height: 0.95;
  letter-spacing: 0.02em;
  color: var(--white);
  margin-bottom: 12px;
}
.pf-hub-card-sub {
  font-size: 14px;
  font-weight: 300;
  line-height: 1.6;
  color: rgba(245,245,245,0.55);
  max-width: 280px;
  margin-bottom: 24px;
}
.pf-hub-card-cta {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  transition: color 0.3s;
}
.pf-hub-card:hover .pf-hub-card-cta {
  color: var(--accent);
}

/* ── PORTFOLIO GRID ── */
.pf-grid-section {
  padding: var(--space-lg) var(--page-pad) var(--space-2xl);
  background: var(--bg);
}
.pf-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2px;
}

/* Portfolio item */
.pf-item {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  aspect-ratio: 4/3;
  cursor: pointer;
}
.pf-item::before {
  content: '';
  position: absolute;
  inset: 0;
  box-shadow: inset 0 0 80px 30px rgba(10,10,10,0.7);
  pointer-events: none;
  z-index: 1;
}
.pf-item.pf-large {
  grid-column: span 2;
  aspect-ratio: 16/9;
}

.pf-item-bg {
  position: absolute;
  inset: 0;
}
.pf-item-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--ease-out);
}
.pf-item:hover .pf-item-bg img {
  transform: scale(1.04);
}

/* Overlay */
.pf-item-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 32px;
  background: linear-gradient(to top, rgba(10,10,10,0.9) 0%, rgba(10,10,10,0.15) 50%, transparent 100%);
  opacity: 0;
  transition: opacity 0.4s var(--ease-out);
}
.pf-item:hover .pf-item-overlay {
  opacity: 1;
}

.pf-item-tag {
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--accent-light);
  margin-bottom: 8px;
}
.pf-item-title {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: 0.03em;
  color: var(--white);
  line-height: 1;
}
.pf-large .pf-item-title {
  font-size: 40px;
}
.pf-item-sub {
  font-size: 12px;
  font-weight: 300;
  color: var(--muted);
  margin-top: 6px;
}

/* ── CTA (shared pattern) ── */
.cta-section {
  position: relative;
  padding: 120px var(--page-pad);
  background: var(--accent);
  overflow: hidden;
  text-align: center;
}
.cta-section::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 100% at 20% 0%, rgba(255,255,255,0.12) 0%, transparent 60%),
    radial-gradient(ellipse 60% 80% at 80% 100%, rgba(0,0,0,0.25) 0%, transparent 60%);
  pointer-events: none;
}
.cta-inner {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.cta-section .section-label {
  color: rgba(255,255,255,0.7);
}
.cta-section .section-label::before {
  background: rgba(255,255,255,0.5);
}
.cta-title {
  font-family: var(--font-display);
  font-size: clamp(64px, 8vw, 120px);
  line-height: 0.9;
  letter-spacing: 0.02em;
  margin: 20px 0 28px;
  color: var(--white);
}
.cta-sub {
  font-size: 16px;
  font-weight: 300;
  line-height: 1.7;
  color: rgba(255,255,255,0.75);
  max-width: 480px;
  margin-bottom: 48px;
}
.cta-actions {
  display: flex;
  align-items: center;
  gap: 24px;
}
.cta-section .btn-primary.btn-xl {
  background: var(--white);
  color: var(--accent);
  font-weight: 600;
}
.cta-section .btn-primary.btn-xl:hover {
  background: #fff;
  box-shadow: 0 0 40px rgba(255,255,255,0.3);
}
.cta-whatsapp {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.8);
  padding: 14px 24px;
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 4px;
  transition: all var(--transition);
}
.cta-whatsapp:hover {
  color: #fff;
  border-color: #fff;
  background: rgba(255,255,255,0.1);
}

/* ── FOOTER (shared pattern) ── */
.footer {
  background: var(--bg-deep);
  padding: 80px var(--page-pad) 40px;
  border-top: 1px solid var(--border);
}
.footer-top {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 80px;
  margin-bottom: 60px;
}
.footer-brand .nav-logo { display: inline-flex; margin-bottom: 20px; }
.footer-brand .nav-logo img { height: 40px; }
.footer-brand p { font-size: 13px; font-weight: 300; line-height: 1.7; color: var(--muted); max-width: 280px; }
/* Footer quick actions */
.footer-actions { display: flex; gap: 24px; margin-top: 20px; }
.footer-action-link { display: inline-flex; align-items: center; gap: 8px; font-size: 12px; font-weight: 400; color: var(--muted); transition: color var(--transition); }
.footer-action-link:hover { color: var(--accent); }
.footer-action-link svg { opacity: 0.5; transition: opacity var(--transition); }
.footer-action-link:hover svg { opacity: 1; }
/* Column separators */
.footer-col { border-left: 1px solid var(--border); padding-left: 40px; }
/* Business/legal info row */
.footer-legal { display: flex; align-items: center; gap: 12px; font-size: 11px; font-weight: 300; color: rgba(245,245,245,0.3); padding: 20px 0 0; margin-bottom: 24px; flex-wrap: wrap; }
.footer-legal-sep { opacity: 0.3; }
.footer-col h4 { font-family: var(--font-display); font-size: 18px; font-weight: 400; letter-spacing: 0.12em; text-transform: uppercase; color: var(--white); margin-bottom: 20px; }
.footer-col li { margin-bottom: 10px; }
.footer-col a { font-size: 13px; font-weight: 300; color: var(--muted); transition: color var(--transition); }
.footer-col a:hover { color: var(--white); }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; padding-top: 32px; border-top: 1px solid var(--border); }
.footer-bottom p { font-size: 12px; color: var(--muted); }
.footer-frd { font-size: 12px; color: var(--muted); }
.footer-frd a { color: var(--accent); }
.footer-frd a:hover { text-decoration: underline; }

/* ── DESKTOP WIDE (1440px+) ── */
@media (min-width: 1440px) {
  .page-hero { padding: 0 8vw 80px; }
  .page-hero-counter { right: 8vw; }
  .pf-filter-bar { padding: 0 8vw; }
  .pf-dropdown-bar { padding: 14px 8vw; }
  .pf-grid-section { padding: var(--space-lg) 8vw var(--space-2xl); }
  .pf-hub-section { padding: var(--space-lg) 8vw var(--space-2xl); }
  .cta-section { padding: 160px 8vw; }
  .footer { padding: 80px 8vw 40px; }
}

/* ── ULTRA WIDE (1920px+) ── */
@media (min-width: 1920px) {
  .page-hero { padding: 0 12vw 80px; }
  .page-hero-counter { right: 12vw; }
  .pf-filter-bar { padding: 0 12vw; }
  .pf-dropdown-bar { padding: 14px 12vw; }
  .pf-grid-section { padding: var(--space-lg) 12vw var(--space-2xl); }
  .pf-hub-section { padding: var(--space-lg) 12vw var(--space-2xl); }
  .cta-section { padding: 160px 12vw; }
  .footer { padding: 80px 12vw 40px; }
}

/* ── TABLET ── */
@media (max-width: 1024px) {
  .pf-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .pf-item.pf-large {
    grid-column: span 2;
  }
  .pf-hub-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .pf-hub-card:last-child {
    grid-column: span 2;
    aspect-ratio: 16/9;
  }
}

/* ── MOBILE ── */
@media (max-width: 768px) {
  .page-hero {
    height: auto;
    min-height: 0;
    padding: calc(var(--nav-height) + 40px) var(--page-pad-mobile) 60px;
  }
  .page-hero-title { font-size: 56px; }
  .page-hero-counter {
    position: relative;
    bottom: auto;
    right: auto;
    flex-direction: row;
    align-items: baseline;
    gap: 12px;
    margin-top: 32px;
  }
  .counter-num { font-size: 80px; }

  .pf-filter-bar { padding: 0 var(--page-pad-mobile); }
  .pf-filter { padding: 16px 20px; font-size: 10px; }

  .pf-dropdown-bar { padding: 12px var(--page-pad-mobile); gap: 8px; }
  .pf-dropdown-trigger { font-size: 10px; padding: 8px 14px; }
  .pf-filter-badge { font-size: 10px; padding: 8px 14px; }
  .pf-bar-count { font-size: 10px; }
  .pf-bar-count span { font-size: 14px; }
  .pf-dropdown-menu { min-width: 160px; }

  .pf-grid-section { padding: var(--space-md) var(--page-pad-mobile) 80px; }
  .pf-grid {
    grid-template-columns: 1fr;
  }
  .pf-item.pf-large {
    grid-column: span 1;
    aspect-ratio: 4/3;
  }

  .pf-hub-section { padding: var(--space-md) var(--page-pad-mobile) 80px; }
  .pf-hub-grid { grid-template-columns: 1fr; }
  .pf-hub-card { aspect-ratio: 4/3; }
  .pf-hub-card:last-child { grid-column: span 1; aspect-ratio: 4/3; }
  .pf-hub-card-overlay { padding: 28px; }
  .pf-hub-card-title { font-size: 32px; }
  .pf-item-overlay {
    opacity: 1;
  }
  .pf-large .pf-item-title { font-size: 28px; }

  .cta-section { padding: 80px var(--page-pad-mobile); }
  .cta-actions {
    flex-direction: column;
    width: 100%;
    gap: 16px;
  }

  .footer { padding: 60px var(--page-pad-mobile) 32px; }
  .footer-top { grid-template-columns: 1fr 1fr; gap: 40px; }
  .footer-brand { grid-column: span 2; }
  .footer-col { border-left: none; padding-left: 0; border-top: 1px solid var(--border); padding-top: 24px; }
  .footer-actions { flex-direction: column; gap: 12px; }
  .footer-legal { flex-direction: column; align-items: flex-start; gap: 4px; }
  .footer-legal-sep { display: none; }
}
