@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,100..1000;1,9..40,100..1000&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Material+Symbols+Outlined:opsz,wght,FILL,GRAD@20..48,100..700,0..1,-50..200&display=block');

:root {
  /* Brand Colors strictly from the provided Design System Board */
  --primary: #2B1810; 
  --on-primary: #FFFFFF; 
  
  --secondary: #CBB279; 
  --on-secondary: #2B1810;
  
  --tertiary: #A45A48; 
  --on-tertiary: #FFFFFF;
  
  --neutral: #F4EFEA;
  
  --surface: #F4EFEA; /* Using Neutral for Backgrounds */
  --surface-container: #EAE2D7; /* Slightly darker for contrast if needed */
  
  --on-surface: #2B1810; /* Primary for text */
  --on-surface-variant: #4A3B32; 
  
  --outline: #CBB279; 
  --outline-variant: #CBB279; 
  
  --background: #F4EFEA;
  --on-background: #2B1810;
  
  --error: #ba1a1a;
  --on-error: #ffffff;
  
  /* Fallbacks for existing CSS that used Material Design 3 naming */
  --primary-container: #2B1810;
  --on-primary-container: #FFFFFF;
  --secondary-container: #CBB279;
  --tertiary-container: #A45A48;
  
  --inverse-surface: #2B1810;
  --inverse-on-surface: #F4EFEA;
  --surface-dim: #EAE2D7;
  --surface-bright: #F4EFEA;

  /* Typography */
  --font-display: 'DM Sans', sans-serif;
  --font-body: 'DM Sans', sans-serif;

  /* Fluid Typography (General Text) */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.8rem + 0.375vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1rem + 0.625vw, 1.25rem);
  --text-xl: clamp(1.25rem, 1.1rem + 0.75vw, 1.5rem);
  --text-2xl: clamp(1.5rem, 1.25rem + 1.25vw, 2rem);
  --text-3xl: clamp(1.875rem, 1.5rem + 1.875vw, 2.5rem);
  --text-4xl: clamp(2.25rem, 1.75rem + 2.5vw, 3.5rem);
  --text-5xl: clamp(2.5rem, 2rem + 4vw, 4.5rem);
  --text-6xl: clamp(3rem, 2.5rem + 5vw, 6rem);

  /* Semantic Heading Scale */
  --heading-h1: clamp(2.25rem, 1.7rem + 2.75vw, 4.25rem);
  --heading-h2: clamp(2rem, 1.5rem + 2.5vw, 3.25rem);
  --heading-h3: clamp(1.75rem, 1.4rem + 1.375vw, 2.5rem);
  --heading-h4: clamp(1.5rem, 1.25rem + 0.9375vw, 2rem);
  --heading-h5: clamp(1.25rem, 1.15rem + 0.5vw, 1.5rem);
  --heading-h6: clamp(1.125rem, 1.1rem + 0.125vw, 1.25rem);

  /* Fluid Spacing */
  --space-2xs: clamp(0.125rem, 0.1rem + 0.1vw, 0.25rem);
  --space-xs: clamp(0.25rem, 0.2rem + 0.25vw, 0.5rem);
  --space-sm: clamp(0.5rem, 0.4rem + 0.5vw, 0.75rem);
  --space-md: clamp(1rem, 0.8rem + 1vw, 1.5rem);
  --space-lg: clamp(1.5rem, 1.2rem + 1.5vw, 2.5rem);
  --space-xl: clamp(2rem, 1.5rem + 2.5vw, 3.5rem);
  --space-2xl: clamp(3rem, 2.5rem + 2.5vw, 4.5rem);
  --space-3xl: clamp(4.5rem, 3.5rem + 4vw, 6.5rem);
  --space-4xl: clamp(6rem, 4.5rem + 6vw, 9rem);
  --gutter: clamp(1rem, 0.5rem + 2vw, 2.5rem);
}

/* Reset & Base */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Web Components Base */
dharohaa-announcement,
dharohaa-header,
dharohaa-footer {
  display: block;
  width: 100%;
}

html, body {
  margin: 0;
  padding: 0;
  background-color: var(--surface);
  color: var(--on-surface);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
  overflow-x: clip;
}

/* Modern Typography (Text Wrap Balance & Pretty) */
h1, h2, h3, h4, h5, h6, .display-text {
  font-family: var(--font-display);
  font-weight: 400;
  text-wrap: balance;
  margin: 0;
}

h1, .heading-h1 { font-size: var(--heading-h1); line-height: 1.1; }
h2, .heading-h2 { font-size: var(--heading-h2); line-height: 1.15; }
h3, .heading-h3 { font-size: var(--heading-h3); line-height: 1.2; }
h4, .heading-h4 { font-size: var(--heading-h4); line-height: 1.25; }
h5, .heading-h5 { font-size: var(--heading-h5); line-height: 1.25; }
h6, .heading-h6 { font-size: var(--heading-h6); line-height: 1.25; }

p {
  text-wrap: pretty;
  line-height: 1.6;
}

/* Cross-Document View Transitions */
@view-transition {
  navigation: auto;
}

/* Custom View Transition Animations */
::view-transition-old(root) {
  animation: fade-out 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}
::view-transition-new(root) {
  animation: fade-in 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

@keyframes fade-in {
  from { opacity: 0; filter: blur(4px); transform: translateY(10px); }
  to { opacity: 1; filter: blur(0); transform: translateY(0); }
}

@keyframes fade-out {
  from { opacity: 1; }
  to { opacity: 0; }
}

/* Layout Classes */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container-wide {
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.grid-cols-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); gap: var(--gutter); }
.grid-cols-3 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(280px, 100%), 1fr)); gap: var(--gutter); }
.grid-cols-4 { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(250px, 100%), 1fr)); gap: var(--gutter); }

/* Header & Nav */
header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--surface-container-high);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) var(--space-lg);
  view-transition-name: site-header;
}

header img {
  height: 4rem;
}

nav {
  display: flex;
  gap: var(--space-xl);
}

nav a {
  text-decoration: none;
  color: var(--on-surface-variant);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  transition: color 0.2s ease;
}

nav a:hover, nav a.active {
  color: var(--primary);
  border-bottom: 1px solid var(--primary);
  padding-bottom: 2px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-family: var(--font-body);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  padding: var(--space-sm) var(--space-lg);
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.btn-primary {
  background-color: var(--primary-container);
  color: var(--on-primary);
}
.btn-primary:hover {
  background-color: var(--primary);
}

.btn-outline {
  background-color: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}
.btn-outline:hover {
  background-color: var(--primary);
  color: var(--on-primary);
}

.btn-sm {
  padding: var(--space-xs) var(--space-md);
  font-size: 0.8rem;
}

/* Scroll-driven animations (Parallax images) */
@supports (animation-timeline: view()) {
  .parallax-img {
    animation: parallax linear both;
    animation-timeline: view();
    animation-range: entry-crossing 0% exit-crossing 100%;
    transform-origin: center;
  }
  
  @keyframes parallax {
    0% { transform: scale(1.1) translateY(5%); }
    100% { transform: scale(1) translateY(-5%); }
  }

  .reveal-up {
    animation: reveal linear both;
    animation-timeline: view();
    animation-range: entry 10% cover 30%;
  }

  @keyframes reveal {
    0% { opacity: 0; transform: translateY(40px); }
    100% { opacity: 1; transform: translateY(0); }
  }
}

/* Forms & Dialog (Modern UI/UX) */
.popover-inquiry {
  margin: auto;
  padding: var(--space-2xl);
  border: none;
  background: var(--surface);
  color: var(--on-surface);
  max-width: 500px;
  width: 90%;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.popover-inquiry::backdrop {
  background: rgba(43, 24, 16, 0.5);
  backdrop-filter: blur(4px);
  animation: backdrop-fade 0.3s ease forwards;
}

@keyframes backdrop-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

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

label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--on-surface-variant);
}

input, textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: var(--space-xs);
  border: none;
  border-bottom: 1px solid var(--outline-variant);
  background: transparent;
  color: var(--on-surface);
  transition: border-color 0.2s ease;
}

input:focus, textarea:focus {
  outline: none;
  border-bottom-color: var(--primary);
}

/* Field-sizing content for textarea */
textarea {
  field-sizing: content;
  min-height: 2lh;
}

/* User-invalid feedback */
input:not(:placeholder-shown):user-invalid {
  border-bottom-color: var(--error);
}
.error-msg {
  display: none;
  color: var(--error);
  font-size: 0.75rem;
}
input:not(:placeholder-shown):user-invalid ~ .error-msg {
  display: block;
}

/* Utility Classes */
.text-center { text-align: center; }
.my-xl { margin-top: var(--space-xl); margin-bottom: var(--space-xl); }
.py-2xl { padding-top: var(--space-2xl); padding-bottom: var(--space-2xl); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.text-3xl { font-size: var(--text-3xl); }
.text-4xl { font-size: var(--text-4xl); }
.text-5xl { font-size: var(--text-5xl); }
.text-6xl { font-size: var(--text-6xl); }

.text-secondary { color: var(--secondary); }
  top: 0;
  z-index: 100;
  background: color-mix(in srgb, var(--surface) 90%, transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--surface-container-high);
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-sm) var(--space-lg);
  view-transition-name: site-header;
}

header img {
  height: 4rem;
}

nav {
  display: flex;
  gap: var(--space-xl);
}

nav a {
  text-decoration: none;
  color: var(--on-surface-variant);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  transition: color 0.2s ease;
}

nav a:hover, nav a.active {
  color: var(--primary);
  border-bottom: 1px solid var(--primary);
  padding-bottom: 2px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-family: var(--font-body);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  padding: var(--space-sm) var(--space-lg);
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
}

.btn-primary {
  background-color: var(--primary-container);
  color: var(--on-primary);
}
.btn-primary:hover {
  background-color: var(--primary);
}

.btn-outline {
  background-color: transparent;
  color: var(--primary);
  border: 1px solid var(--primary);
}
.btn-outline:hover {
  background-color: var(--primary);
  color: var(--on-primary);
}

.btn-sm {
  padding: var(--space-xs) var(--space-md);
  font-size: 0.8rem;
}

/* Scroll-driven animations (Parallax images) */
@supports (animation-timeline: view()) {
  .parallax-img {
    animation: parallax linear both;
    animation-timeline: view();
    animation-range: entry-crossing 0% exit-crossing 100%;
    transform-origin: center;
  }
  
  @keyframes parallax {
    0% { transform: scale(1.1) translateY(5%); }
    100% { transform: scale(1) translateY(-5%); }
  }

  .reveal-up {
    animation: reveal linear both;
    animation-timeline: view();
    animation-range: entry 10% cover 30%;
  }

  @keyframes reveal {
    0% { opacity: 0; transform: translateY(40px); }
    100% { opacity: 1; transform: translateY(0); }
  }
}

/* Forms & Dialog (Modern UI/UX) */
.popover-inquiry {
  margin: auto;
  padding: var(--space-2xl);
  border: none;
  background: var(--surface);
  color: var(--on-surface);
  max-width: 500px;
  width: 90%;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

.popover-inquiry::backdrop {
  background: rgba(43, 24, 16, 0.5);
  backdrop-filter: blur(4px);
  animation: backdrop-fade 0.3s ease forwards;
}

@keyframes backdrop-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

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

label {
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--on-surface-variant);
}

input, textarea {
  font-family: var(--font-body);
  font-size: 1rem;
  padding: var(--space-xs);
  border: none;
  border-bottom: 1px solid var(--outline-variant);
  background: transparent;
  color: var(--on-surface);
  transition: border-color 0.2s ease;
}

input:focus, textarea:focus {
  outline: none;
  border-bottom-color: var(--primary);
}

/* Field-sizing content for textarea */
textarea {
  field-sizing: content;
  min-height: 2lh;
}

/* User-invalid feedback */
input:not(:placeholder-shown):user-invalid {
  border-bottom-color: var(--error);
}
.error-msg {
  display: none;
  color: var(--error);
  font-size: 0.75rem;
}
input:not(:placeholder-shown):user-invalid ~ .error-msg {
  display: block;
}

/* Utility Classes */
.text-center { text-align: center; }
.mx-auto { margin-left: auto; margin-right: auto; }
.my-xl { margin-top: var(--space-xl); margin-bottom: var(--space-xl); }
.py-2xl { padding-top: var(--space-2xl); padding-bottom: var(--space-2xl); }
.text-sm { font-size: var(--text-sm); }
.text-base { font-size: var(--text-base); }
.text-lg { font-size: var(--text-lg); }
.text-xl { font-size: var(--text-xl); }
.text-2xl { font-size: var(--text-2xl); }
.text-3xl { font-size: var(--text-3xl); }
.text-4xl { font-size: var(--text-4xl); }
.text-5xl { font-size: var(--text-5xl); }
.text-6xl { font-size: var(--text-6xl); }

.text-secondary { color: var(--secondary); }
.text-primary-container { color: var(--primary-container); }
.uppercase { text-transform: uppercase; }
.tracking-widest { letter-spacing: 0.15em; }
.italic { font-style: italic; }
.w-full { width: 100%; }
.h-full { height: 100%; }
.object-cover { object-fit: cover; }
.aspect-3-4 { aspect-ratio: 3/4; overflow: hidden; }
.shadow-md { box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1); }

/* Floating WhatsApp Button */
.floating-whatsapp {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 60px;
  height: 60px;
  z-index: 9999;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  display: flex;
  align-items: center;
  justify-content: center;
}
.floating-whatsapp:hover {
  transform: scale(1.1);
}
.floating-whatsapp img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

@media (max-width: 768px) {
  .floating-whatsapp {
    bottom: 16px;
    right: 16px;
    width: 50px;
    height: 50px;
  }
}
