/* ============================================================
   GLOBAL STYLESHEET — B2B Architectural Cabinetry & Smart Living
   Strict Token Adherence · Zero Hardcoded Values
   ============================================================ */

/* ── 1. CSS Reset ──────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 17px;
  scroll-behavior: smooth;
  scroll-padding-top: 110px;
  -webkit-text-size-adjust: 100%;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  width: 100%;
}

/* User-adjustable font size modes */
html[data-font-size="sm"] {
  font-size: 15.5px;
}

html[data-font-size="md"] {
  font-size: 17px;
}

html[data-font-size="lg"] {
  font-size: 19px;
}

html[data-font-size="xl"] {
  font-size: 21px;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-text-body);
  background-color: var(--color-surface-white);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

img, picture, video, canvas, svg {
  display: block;
  max-width: 100%;
  height: auto;
}

input, button, textarea, select {
  font: inherit;
  font-size: 16px; /* Prevents auto-zoom on iOS Safari */
  touch-action: manipulation;
}

button, a {
  touch-action: manipulation;
}

button {
  cursor: pointer;
  background: none;
  border: none;
}

a {
  color: inherit;
  text-decoration: none;
}

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  color: var(--color-text-heading);
  line-height: var(--leading-tight);
}

/* ── 2. Layout & Containers ────────────────────────────────── */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-pad);
  padding-right: var(--container-pad);
}

.section-padding {
  padding-top: var(--section-pad-y-sm);
  padding-bottom: var(--section-pad-y-sm);
}

@media (min-width: 768px) {
  .section-padding {
    padding-top: var(--section-pad-y);
    padding-bottom: var(--section-pad-y);
  }
}

/* ── 3. Buttons ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--tracking-wide);
  border-radius: var(--radius-md);
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: all var(--transition-base);
}

.btn--primary {
  background-color: var(--color-accent-500);
  color: var(--color-surface-white);
  border: 1px solid var(--color-accent-500);
  box-shadow: 0 4px 12px rgba(201, 169, 110, 0.25);
}

.btn--primary:hover {
  background-color: var(--color-accent-600);
  border-color: var(--color-accent-600);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(201, 169, 110, 0.35);
}

.btn--secondary {
  background-color: transparent;
  color: var(--color-primary-800);
  border: 1px solid var(--color-primary-700);
}

.btn--secondary:hover {
  background-color: var(--color-primary-700);
  color: var(--color-surface-white);
  transform: translateY(-2px);
}

.btn--secondary-light {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--color-surface-white);
  border: 1px solid rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(8px);
}

.btn--secondary-light:hover {
  background-color: var(--color-surface-white);
  color: var(--color-primary-950);
  border-color: var(--color-surface-white);
  transform: translateY(-2px);
}

.btn--large {
  padding: var(--space-4) var(--space-8);
  font-size: var(--text-base);
}

/* ── 4. Standard Header & Navigation ───────────────────────── */
.announcement-bar {
  background-color: var(--color-primary-950);
  color: var(--color-accent-300);
  font-size: var(--text-xs);
  text-align: center;
  padding: var(--space-2) var(--container-pad);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.announcement-bar a {
  color: var(--color-surface-white);
  text-decoration: underline;
  margin-left: var(--space-2);
}

.header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background-color: rgba(17, 27, 38, 0.94);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  transition: background-color var(--transition-base), box-shadow var(--transition-base);
}

.header--scrolled {
  background-color: rgba(17, 27, 38, 0.98);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  max-width: 1440px;
  margin-left: auto;
  margin-right: auto;
  padding-left: clamp(16px, 2.5vw, 40px);
  padding-right: clamp(16px, 2.5vw, 40px);
  gap: clamp(12px, 1.8vw, 32px);
}

.header__logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  margin-right: clamp(12px, 1.6vw, 28px);
}

.header__logo-img {
  height: 38px;
  max-height: 40px;
  width: auto;
  transition: opacity var(--transition-fast);
}

.header__logo-img:hover {
  opacity: 0.9;
}

/* Desktop Navigation */
.header__nav {
  display: none;
  flex: 1 1 auto;
  justify-content: center;
}

@media (min-width: 1040px) {
  .header__nav {
    display: flex;
    align-items: center;
  }
}

.header__nav-list {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(8px, 1.2vw, 22px);
  margin: 0;
  padding: 0;
  list-style: none;
}

.header__nav-item {
  position: relative;
  flex-shrink: 0;
}

.header__nav-link {
  font-size: clamp(12.5px, 0.92vw, 14px);
  font-weight: var(--font-weight-medium);
  color: var(--color-surface-white);
  padding: 8px 4px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap !important;
  letter-spacing: 0.01em;
  transition: color var(--transition-fast);
}

.header__nav-link:hover,
.header__nav-link--active {
  color: var(--color-accent-400);
}

/* Dropdown Menu */
.header__dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: -12px;
  min-width: 230px;
  background-color: var(--color-primary-900);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.4);
  padding: var(--space-2) 0;
  z-index: 1050;
}

.header__nav-item--dropdown:hover .header__dropdown,
.header__nav-item--dropdown:focus-within .header__dropdown {
  display: block;
}

.header__dropdown-link {
  display: block;
  padding: var(--space-2) var(--space-4);
  font-size: var(--text-sm);
  color: var(--color-neutral-200);
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.header__dropdown-link:hover {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--color-accent-300);
}

/* Right-side Actions */
.header__actions {
  display: flex;
  align-items: center;
  gap: clamp(8px, 1vw, 16px);
  flex-shrink: 0;
}

/* Language Switcher */
.lang-switcher {
  position: relative;
}

.lang-switcher__toggle {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--color-surface-white);
  border: 1px solid rgba(255, 255, 255, 0.25);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  background: transparent;
  transition: border-color var(--transition-fast);
}

.lang-switcher__toggle:hover {
  border-color: var(--color-accent-400);
  color: var(--color-accent-400);
}

.lang-switcher__menu {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 6px;
  min-width: 110px;
  background-color: var(--color-primary-900);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-md);
  padding: 4px 0;
  z-index: 1050;
}

.lang-switcher__menu--open {
  display: block;
}

.lang-switcher__item {
  display: block;
  padding: 6px 12px;
  font-size: var(--text-xs);
  color: var(--color-neutral-200);
}

.lang-switcher__item:hover,
.lang-switcher__item--active {
  background-color: rgba(255, 255, 255, 0.08);
  color: var(--color-accent-300);
}

.header__cta {
  display: none;
}

@media (min-width: 640px) {
  .header__cta {
    display: inline-flex;
    white-space: nowrap;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    border-radius: var(--radius-sm);
  }
}

/* Mobile Hamburger */
.nav-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 32px;
  height: 32px;
  padding: 4px;
  cursor: pointer;
}

@media (min-width: 1040px) {
  .nav-toggle {
    display: none;
  }
}

.nav-toggle__bar {
  display: block;
  width: 100%;
  height: 2px;
  background-color: var(--color-surface-white);
  border-radius: 2px;
  transition: transform var(--transition-base), opacity var(--transition-base);
}

/* Mobile Drawer (nav-open) */
@media (max-width: 1039px) {
  .header__nav {
    display: none;
    position: fixed;
    top: 72px;
    left: 0;
    right: 0;
    background-color: var(--color-primary-950);
    padding: var(--space-6) var(--container-pad);
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
    max-height: calc(100vh - 80px);
    overflow-y: auto;
    z-index: 1000;
  }

  .nav-open .header__nav {
    display: block;
  }

  .header__nav-list {
    flex-direction: column;
    align-items: flex-start;
    gap: var(--space-4);
  }

  .header__nav-link {
    font-size: var(--text-base);
  }

  .header__dropdown {
    position: static;
    display: block;
    box-shadow: none;
    border: none;
    padding-left: var(--space-4);
    background: transparent;
  }

  .header__dropdown-link {
    padding: var(--space-2) 0;
    font-size: var(--text-sm);
  }

  .nav-open .nav-toggle__bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
  }
  .nav-open .nav-toggle__bar:nth-child(2) {
    opacity: 0;
  }
  .nav-open .nav-toggle__bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
  }
}

/* ── 5. Standard Footer ────────────────────────────────────── */
.footer {
  background-color: var(--color-primary-950);
  color: var(--color-neutral-300);
  padding: var(--space-16) 0 var(--space-8);
  margin-top: auto;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

.footer__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-8);
  margin-bottom: var(--space-12);
}

@media (min-width: 640px) {
  .footer__grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .footer__grid {
    grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
  }
}

.footer__logo-img {
  height: 48px;
  width: auto;
  margin-bottom: var(--space-4);
}

.footer__desc {
  font-size: var(--text-sm);
  color: var(--color-neutral-400);
  line-height: var(--leading-relaxed);
}

.footer__title {
  font-family: var(--font-heading);
  font-size: var(--text-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-surface-white);
  margin-bottom: var(--space-4);
}

.footer__links {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
}

.footer__links a {
  font-size: var(--text-sm);
  color: var(--color-neutral-400);
  transition: color var(--transition-fast);
}

.footer__links a:hover {
  color: var(--color-accent-400);
}

.footer__bottom {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  align-items: center;
  justify-content: space-between;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: var(--space-6);
  font-size: var(--text-xs);
  color: var(--color-neutral-500);
}

@media (min-width: 640px) {
  .footer__bottom {
    flex-direction: row;
  }
}

/* ── Font Resizer Control ─────────────────────────────────── */
.font-resizer {
  display: inline-flex;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: var(--radius-full);
  padding: 2px 4px;
  gap: 2px;
  flex-shrink: 0;
}

.font-resizer__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 22px;
  font-family: var(--font-body);
  font-size: 11px;
  font-weight: var(--font-weight-medium);
  color: var(--color-neutral-300);
  border-radius: var(--radius-full);
  transition: all var(--transition-fast);
  cursor: pointer;
  line-height: 1;
}

.font-resizer__btn:hover {
  color: var(--color-surface-white);
  background-color: rgba(255, 255, 255, 0.14);
}

.font-resizer__btn--active {
  color: var(--color-primary-950) !important;
  background-color: var(--color-accent-400) !important;
  font-weight: var(--font-weight-bold);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

/* Hide extra 4th button (A++) on compact desktop screens to keep header spacious */
.font-resizer__btn[data-size="xl"] {
  display: none !important;
}

@media (max-width: 639px) {
  .header__inner {
    padding-left: max(var(--space-3), env(safe-area-inset-left));
    padding-right: max(var(--space-3), env(safe-area-inset-right));
  }

  .header__logo-img {
    height: 38px;
  }

  .header__actions {
    gap: var(--space-2);
  }

  .font-resizer__btn {
    width: 22px;
    height: 22px;
    font-size: 10px;
  }
}

/* ── 6. FLOATING ACTION WIDGETS (WhatsApp & Email) ─────────── */
.fab-container {
  position: fixed;
  bottom: calc(var(--space-6) + env(safe-area-inset-bottom, 0px));
  right: calc(var(--space-6) + env(safe-area-inset-right, 0px));
  z-index: 990;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: var(--space-3);
  pointer-events: none;
}

.fab-container > * {
  pointer-events: auto;
}

/* WhatsApp Floating Group */
.fab-whatsapp {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

/* Floating Consultation Hover Card (Smooth Fade-In / Fade-Out) */
.fab-whatsapp__card {
  position: absolute;
  bottom: calc(100% + 14px);
  right: 0;
  width: 290px;
  background: rgba(13, 34, 64, 0.96);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(201, 169, 110, 0.35);
  border-radius: var(--radius-lg);
  padding: var(--space-4) var(--space-5);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.08);
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  color: var(--color-surface-white);
  text-decoration: none;
  cursor: pointer;
  
  /* Fade out animation state */
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.96);
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.35s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.35s;
  pointer-events: none;
}

/* Speech bubble caret */
.fab-whatsapp__card::after {
  content: "";
  position: absolute;
  bottom: -7px;
  right: 22px;
  width: 14px;
  height: 14px;
  background: rgba(13, 34, 64, 0.96);
  border-right: 1px solid rgba(201, 169, 110, 0.35);
  border-bottom: 1px solid rgba(201, 169, 110, 0.35);
  transform: rotate(45deg);
}

/* Smooth Fade In on Hover & Focus */
.fab-whatsapp:hover .fab-whatsapp__card,
.fab-whatsapp:focus-within .fab-whatsapp__card,
.fab-whatsapp--open .fab-whatsapp__card {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.fab-whatsapp__card-header {
  display: flex;
  align-items: center;
  gap: 8px;
}

.fab-whatsapp__status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: #25D366;
  box-shadow: 0 0 8px #25D366;
  animation: pulseDot 2s infinite ease-in-out;
}

@keyframes pulseDot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.3); opacity: 0.7; }
}

.fab-whatsapp__status-text {
  font-size: 11px;
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: #25D366;
}

.fab-whatsapp__card-body strong {
  display: block;
  font-family: var(--font-heading);
  font-size: var(--text-base);
  color: var(--color-surface-white);
  margin-bottom: 2px;
}

.fab-whatsapp__card-body p {
  font-size: var(--text-xs);
  color: var(--color-neutral-300);
  line-height: 1.4;
}

.fab-whatsapp__card-action {
  font-size: var(--text-xs);
  font-weight: var(--font-weight-semibold);
  color: var(--color-accent-400);
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 4px;
  transition: transform var(--transition-fast);
}

.fab-whatsapp__card:hover .fab-whatsapp__card-action {
  transform: translateX(4px);
  color: var(--color-accent-300);
}

/* Main WhatsApp Floating Pill / Button */
.fab-whatsapp__btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 54px;
  padding: 0 20px 0 14px;
  background-color: #25D366;
  color: #FFFFFF;
  border-radius: var(--radius-full);
  box-shadow: 0 6px 20px rgba(37, 211, 102, 0.4), 0 2px 8px rgba(0, 0, 0, 0.25);
  text-decoration: none;
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: var(--font-weight-semibold);
  letter-spacing: 0.02em;
  transition: transform var(--transition-base), box-shadow var(--transition-base), background-color var(--transition-base);
  touch-action: manipulation;
  overflow: visible;
}

.fab-whatsapp__btn:hover {
  background-color: #20BA5A;
  transform: translateY(-3px) scale(1.02);
  box-shadow: 0 10px 28px rgba(37, 211, 102, 0.5), 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Pulsing radar waves behind button */
.fab-whatsapp__pulse {
  position: absolute;
  top: 50%;
  left: 28px;
  width: 50px;
  height: 50px;
  margin-top: -25px;
  margin-left: -25px;
  border-radius: 50%;
  background-color: rgba(37, 211, 102, 0.55);
  z-index: -1;
  pointer-events: none;
  animation: radarWave 2.8s infinite cubic-bezier(0.25, 1, 0.5, 1);
}

.fab-whatsapp__pulse--delay {
  animation-delay: 1.4s;
}

@keyframes radarWave {
  0% {
    transform: scale(0.9);
    opacity: 0.8;
  }
  60% {
    transform: scale(1.8);
    opacity: 0;
  }
  100% {
    transform: scale(2);
    opacity: 0;
  }
}

.fab-whatsapp__icon {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
}

.fab-whatsapp__label {
  white-space: nowrap;
}

/* Floating Email Button */
.fab-email__btn {
  width: 44px;
  height: 44px;
  border-radius: var(--radius-full);
  background-color: rgba(13, 34, 64, 0.95);
  color: var(--color-surface-white);
  border: 1px solid rgba(255, 255, 255, 0.16);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
  transition: transform var(--transition-base), box-shadow var(--transition-base), background-color var(--transition-base);
  touch-action: manipulation;
}

.fab-email__btn:hover {
  background-color: var(--color-primary-800);
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  color: var(--color-accent-400);
}

/* Mobile adjustments for FAB */
@media (max-width: 639px) {
  .fab-container {
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
    right: calc(16px + env(safe-area-inset-right, 0px));
    gap: 8px;
  }
  
  .fab-whatsapp__btn {
    height: 48px;
    padding: 0 16px 0 12px;
    font-size: var(--text-xs);
  }
  
  .fab-whatsapp__card {
    width: 260px;
    right: -4px;
  }
  
  .fab-email__btn {
    width: 40px;
    height: 40px;
  }
}

/* ── 7. Section Shared Typography ──────────────────────────── */
.section__eyebrow {
  display: block;
  font-size: var(--text-xs);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  color: var(--color-accent-500);
  margin-bottom: var(--space-2);
}

.section__title {
  font-family: var(--font-heading);
  /* Fluid Typography: Continuously scales with viewport width & user font preference */
  font-size: clamp(1.65rem, 1.2rem + 1.5vw, 2.75rem);
  font-weight: var(--font-weight-bold);
  color: var(--color-text-heading);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
  margin-bottom: var(--space-3);
  text-wrap: balance;
  transition: font-size var(--transition-fast);
}

.section__subtitle {
  font-size: var(--text-base);
  color: var(--color-text-muted);
  line-height: var(--leading-relaxed);
  max-width: 650px;
  margin-left: auto;
  margin-right: auto;
}

.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
