/* ============================================================
   layout.css — Header, Footer, Search Popup, Side Menu
   LumiVeil B2B — Redesign V2
   ============================================================ */

/* === Skip Link (Accessibility) === */
.skip-link {
  position: absolute;
  top: -100%;
  left: 16px;
  z-index: var(--z-search);
  padding: 12px 20px;
  background: var(--color-gold-400);
  color: #000;
  font-weight: 600;
  font-size: 0.9rem;
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  transition: top 0.2s ease;
}

.skip-link:focus {
  top: 0;
}

/* === Header — Mileto-style three-zone layout === */
.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-header);
  height: var(--header-h);
  display: flex;
  align-items: center;
  padding: 0 30px;
  transition: all 0.5s ease;
  background: transparent;
}

.header.scrolled {
  background: rgba(8, 8, 8, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  height: var(--header-h-scrolled);
  border-bottom: 1px solid var(--color-border);
}

.header__inner {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
}

/* Logo */
.header__logo {
  flex-shrink: 0;
  transition: all 0.5s ease;
}

.header__logo svg {
  height: 44px;
  transition: height 0.5s ease;
}

.header.scrolled .header__logo svg { height: 34px; }

/* Desktop nav — centered */
.header__nav {
  display: flex;
  justify-content: center;
}

.header__nav-list {
  display: flex;
  gap: 2px;
}

.header__nav-list li a {
  display: block;
  padding: 8px 16px;
  font-size: 0.88rem;
  font-weight: 400;
  color: var(--color-text-secondary);
  transition: color 0.3s ease, font-size 0.5s ease;
  white-space: nowrap;
}

.header__nav-list li a:hover,
.header__nav-list li a.active { color: var(--color-text-primary); }

.header.scrolled .header__nav-list li a { font-size: 0.8rem; }

/* Dropdown */
.header__nav-item--dropdown { position: relative; }

.header__nav-chevron {
  display: inline-block;
  margin-left: 4px;
  transition: transform 0.3s ease;
  vertical-align: middle;
  opacity: 0.5;
}

.header__nav-item--dropdown:hover .header__nav-chevron {
  transform: rotate(180deg);
  opacity: 1;
}

.header__dropdown {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%) translateY(4px);
  min-width: 200px;
  background: rgba(20, 20, 20, 0.97);
  backdrop-filter: blur(20px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: 8px 0;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
}

.header__nav-item--dropdown:hover .header__dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.header__dropdown li a {
  display: block;
  padding: 9px 20px;
  font-size: 0.82rem;
  color: var(--color-text-secondary);
  transition: all 0.2s ease;
}

.header__dropdown li a:hover {
  color: var(--color-gold-400);
  background: rgba(229, 168, 48, 0.06);
}

/* Right side actions */
.header__actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 15px;
}

/* Header CTA button */
.header-cta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 235px;
  height: 40px;
  padding-left: 15px;
  padding-right: 2px;
  border-radius: 30px;
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: var(--gold-gradient);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 500;
  color: #fff;
  position: relative;
  overflow: hidden;
}

.header-cta::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 0%, rgba(255,255,255,0.12) 50%, transparent 100%);
  transform: translateX(-100%);
  pointer-events: none;
}

.header-cta:hover::before {
  animation: btn-shine 2.5s ease-in-out infinite;
}

.header-cta__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

.header-cta:hover .header-cta__icon {
  animation: pulse-icon 0.5s ease-in-out infinite alternate;
}

@keyframes pulse-icon {
  from { transform: scale(1); }
  to   { transform: scale(1.15); }
}

/* Header icon buttons */
.header__icon-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.header__icon-btn:hover { opacity: 0.8; }

.header__icon-btn svg { width: 20px; height: 20px; }

/* Hamburger */
.hamburger {
  position: relative;
  width: 30px;
  height: 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 1200;
  cursor: pointer;
}

.hamburger span {
  display: block;
  width: 26px;
  height: 1px;
  background: #fff;
  transition: all 0.3s ease;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
}

.hamburger span:nth-child(1) { top: calc(50% - 9px); }
.hamburger span:nth-child(2) { top: calc(50% - 1px); }
.hamburger span:nth-child(3) { top: calc(50% + 7px); }

.hamburger.active span:nth-child(1) {
  top: 50%;
  transform: translate(-50%, -50%) rotate(45deg);
  background: #212121;
}

.hamburger.active span:nth-child(2) { opacity: 0; }

.hamburger.active span:nth-child(3) {
  top: 50%;
  transform: translate(-50%, -50%) rotate(-45deg);
  background: #212121;
}

/* ============================================================
   Search Popup — Dark theme
   ============================================================ */
.search-popup {
  position: fixed;
  inset: 0;
  z-index: var(--z-search);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
}

.search-popup.active { display: flex; }

.search-popup__bg {
  position: absolute;
  inset: 0;
  background: rgba(8, 8, 8, 0.97);
  backdrop-filter: blur(12px);
}

.search-popup__panel {
  position: relative;
  width: 100%;
  max-width: 640px;
  z-index: 1;
}

.search-popup__close {
  position: absolute;
  top: -60px;
  right: 0;
  cursor: pointer;
  transition: opacity 0.3s ease;
}

.search-popup__close:hover { opacity: 0.7; }

.search-popup__form {
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 2px solid rgba(229, 168, 48, 0.4);
  padding-bottom: 12px;
  transition: border-color 0.3s ease;
}

.search-popup__form:focus-within {
  border-bottom-color: var(--color-gold-400);
}

.search-popup__form-icon { flex-shrink: 0; }

.search-popup__form input {
  flex: 1;
  border: none;
  padding: 12px 0;
  font-family: var(--font-body);
  font-size: 22px;
  font-weight: 400;
  background: none;
  color: var(--color-text-primary);
  outline: none;
}

.search-popup__form input::placeholder { color: var(--color-text-muted); }

/* ============================================================
   Side Menu (off-canvas right)
   ============================================================ */
.side-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 1100;
}

.side-menu-overlay.active { opacity: 1; visibility: visible; }

.side-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  height: 100vh;
  background: var(--color-bg-secondary);
  z-index: 1150;
  overflow-y: auto;
  transition: right 0.3s ease;
  box-shadow: -2px 0 10px rgba(0, 0, 0, 0.3);
  padding: 80px 40px 40px;
}

.side-menu.active { right: 0; }

.side-menu__section { margin-bottom: 32px; }

.side-menu__title {
  font-family: var(--font-body);
  font-size: 1.8rem;
  font-weight: 500;
  color: var(--color-text-primary);
  margin-bottom: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--color-border);
}

.side-menu__links { display: flex; flex-direction: column; }

.side-menu__links li a {
  display: block;
  padding: 8px 0;
  font-size: 1.1rem;
  color: var(--color-text-secondary);
  transition: all 0.2s ease;
}

.side-menu__links li a:hover { color: var(--color-gold-400); }

@media (min-width: 768px) {
  .side-menu { width: 420px; right: -420px; }
  .side-menu.active { right: 0; }
}

/* ============================================================
   Footer
   ============================================================ */
.site-footer {
  background-color: var(--color-bg-secondary);
  border-top: 1px solid var(--color-border);
  padding: 80px 30px 30px;
}

.footer-grid {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  padding-bottom: var(--space-xl);
}

.footer-col h4 {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-primary);
  margin-bottom: 1rem;
}

.footer-col p {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  line-height: 1.65;
  margin-bottom: 1rem;
}

.footer-col ul { display: flex; flex-direction: column; gap: 0.35rem; }

.footer-col ul li a {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  transition: color 0.2s ease;
}

.footer-col ul li a:hover { color: var(--color-gold-400); }

.footer-certifications {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: var(--space-sm);
}

.footer-cert-badge {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  padding: 4px 10px;
  border: 1px solid rgba(229, 168, 48, 0.22);
  border-radius: var(--radius-full);
  color: var(--color-gold-400);
  background: rgba(229, 168, 48, 0.06);
  width: auto;
  height: auto;
}

.social-links {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.social-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: var(--color-text-muted);
  transition: all 0.3s ease;
  background: transparent;
}

.social-link:hover {
  color: var(--color-gold-400);
  border-color: rgba(229, 168, 48, 0.3);
  background: transparent;
}

.footer-bottom {
  max-width: var(--max-width);
  margin: 3rem auto 0;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.8rem;
  font-size: 0.8rem;
  color: var(--color-text-muted);
}

.footer-bottom a {
  color: var(--color-text-muted);
  transition: color 0.2s ease;
}

.footer-bottom a:hover { color: var(--color-gold-400); }

.footer-bottom-links { display: flex; gap: var(--space-md); }

.footer-description {
  font-size: 0.85rem;
  color: var(--color-text-secondary);
  line-height: 1.65;
  margin-bottom: 1rem;
}

/* ============================================================
   Back to Top
   ============================================================ */
.back-to-top {
  position: fixed;
  bottom: var(--space-lg);
  right: var(--space-lg);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background-color: var(--color-bg-elevated);
  border: 1px solid rgba(229, 168, 48, 0.30);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-gold-400);
  z-index: var(--z-dropdown);
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
  cursor: pointer;
}

.back-to-top.visible { opacity: 1; visibility: visible; }

.back-to-top:hover {
  border-color: var(--color-gold-400);
  color: var(--color-gold-400);
  transform: translateY(-2px);
}

/* ============================================================
   Image Placeholder
   ============================================================ */
.img-placeholder {
  background: linear-gradient(135deg, var(--color-bg-tertiary) 0%, var(--color-bg-secondary) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: var(--text-caption);
  text-align: center;
  overflow: hidden;
  position: relative;
}

.img-placeholder::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(229, 168, 48, 0.05) 0%, transparent 70%);
  pointer-events: none;
}

/* ============================================================
   Responsive — Desktop/Tablet/Mobile
   ============================================================ */

/* Tablet: hide desktop nav */
@media (max-width: 1024px) {
  .header__nav { display: none; }
  .header__inner { grid-template-columns: 1fr auto; }
  .header-cta { width: auto; padding: 0 12px; font-size: 0.75rem; }
  .header-cta__text--full { display: none; }
  .header-cta__text--short { display: inline; }
  .header__actions { gap: 10px; }

  .footer-grid { grid-template-columns: 1fr 1fr; gap: var(--space-lg); }

  .projects-scroll { grid-template-columns: repeat(2, 1fr); }
  .grid-2, .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1025px) {
  .header-cta__text--full { display: inline; }
  .header-cta__text--short { display: none; }
}

/* Mobile */
@media (max-width: 767px) {
  :root { --header-h: 64px; --header-h-scrolled: 56px; }
  .header { padding: 0 16px; }
  .header__logo svg { height: 32px; }
  .header.scrolled .header__logo svg { height: 26px; }
  .section { padding: 60px 16px; }
  .section--sm { padding: 40px 16px; }
  .gold-divider { padding: 40px 16px; }

  .footer-grid { grid-template-columns: 1fr; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .projects-scroll { grid-template-columns: 1fr; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .footer-grid { grid-template-columns: 1fr; }
}
