/* Reset & Normalize */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: Arial, Helvetica, sans-serif; color: #2D3A45; background-color: #FFFDFB; line-height: 1.6; }
img, svg { max-width: 100%; height: auto; vertical-align: middle; }
img { border-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: #2D3A45; text-decoration: underline; text-underline-offset: 3px; }
a:hover { color: #9a4a1e; }
:focus { outline: none; }
:focus-visible { outline: 3px solid rgba(197,104,44,0.4); outline-offset: 2px; border-radius: 6px; }

/* Theme Variables (with fallbacks) */
:root {
  --color-primary: #2D3A45;
  --color-secondary: #C5682C;
  --color-accent: #F5F7FA;
  --color-bg: #FFFDFB; /* warm off-white */
  --color-surface: #FFFFFF;
  --color-muted: #6B7A86;
  --color-border: #E8E3DE;
  --shadow-soft: 0 6px 18px rgba(45,58,69,0.08), 0 2px 6px rgba(45,58,69,0.06);
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
}

/* Typography */
h1, h2, h3, h4 { font-family: "Trebuchet MS", "Segoe UI", Arial, sans-serif; color: var(--color-primary); margin: 0 0 14px; line-height: 1.25; }
h1 { font-size: 32px; }
h2 { font-size: 24px; margin-top: 8px; }
h3 { font-size: 18px; }
h4 { font-size: 16px; }
p { margin: 0 0 14px; color: var(--color-primary); }
.subheadline { color: var(--color-muted); font-size: 16px; margin-bottom: 18px; }
.text-muted { color: var(--color-muted); }
strong { color: var(--color-primary); }
ul, ol { padding-left: 20px; margin: 0 0 14px; }
li { margin: 6px 0; }

/* Containers & Layout (Flexbox only) */
.container { width: 100%; max-width: 1200px; padding: 0 16px; margin: 0 auto; display: flex; flex-direction: column; }
.content-wrapper { display: flex; flex-direction: column; gap: 20px; align-items: flex-start; }
section { padding: 32px 0; }

/* Mandatory Spacing & Alignment Patterns */
.section { margin-bottom: 60px; padding: 40px 20px; }
.card-container { display: flex; flex-wrap: wrap; gap: 24px; }
.card { margin-bottom: 20px; position: relative; background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); box-shadow: var(--shadow-soft); padding: 20px; }
.content-grid { display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; }
.content-grid > * { flex: 1 1 280px; }
.text-image-section { display: flex; align-items: center; gap: 30px; flex-wrap: wrap; }
.text-image-section .text { flex: 1 1 320px; }
.text-image-section .media { flex: 1 1 320px; }
.testimonial-card { display: flex; align-items: center; gap: 20px; padding: 20px; background: #FFF9F4; border: 1px solid #F1E6DE; border-left: 6px solid var(--color-secondary); border-radius: var(--radius-lg); box-shadow: var(--shadow-soft); }
.feature-item { display: flex; flex-direction: column; align-items: flex-start; gap: 15px; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 1000; background: var(--color-surface); border-bottom: 1px solid var(--color-border); box-shadow: 0 4px 12px rgba(45,58,69,0.06); }
.site-header .content-wrapper { flex-direction: row; align-items: center; justify-content: space-between; gap: 14px; min-height: 64px; }
.logo img { height: 40px; width: auto; display: block; }
.main-nav { display: none; align-items: center; gap: 16px; }
.main-nav a { text-decoration: none; color: var(--color-primary); padding: 8px 12px; border-radius: 999px; transition: background-color 0.25s ease, color 0.25s ease, transform 0.15s ease; }
.main-nav a[aria-current="page"], .main-nav a:hover { background: #FFF1E6; color: #9a4a1e; }
.mobile-menu-toggle { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border: 1px solid var(--color-border); background: var(--color-surface); color: var(--color-primary); border-radius: 10px; cursor: pointer; transition: box-shadow 0.25s ease, transform 0.15s ease; }
.mobile-menu-toggle:hover { box-shadow: var(--shadow-soft); transform: translateY(-1px); }

/* Hero */
.hero { background: #FFF7F1; border-bottom: 1px solid #F1E6DE; }
.hero .content-wrapper { padding: 24px 0; }
.hero h1 { font-size: 32px; }
.hero .text-section, .hero p { max-width: 900px; }

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; padding: 12px 18px; border-radius: 999px; border: 1px solid transparent; text-decoration: none; font-weight: 600; transition: background-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease, transform 0.15s ease; }
.btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-soft); }
.btn:active { transform: translateY(0); }
.btn-primary { background: var(--color-secondary); color: #FFFFFF; border-color: var(--color-secondary); }
.btn-primary:hover { background: #AF5C28; border-color: #AF5C28; }
.btn-secondary { background: #FFEFE2; color: #9a4a1e; border-color: #FFDCC5; }
.btn-secondary:hover { background: #FFE4D0; }

/* Text blocks */
.text-section { background: var(--color-surface); border: 1px solid var(--color-border); border-radius: var(--radius-md); padding: 16px; box-shadow: var(--shadow-soft); }
.text-section h3 { margin-top: 4px; }

/* Lists inside text-sections */
.text-section ul, .text-section ol { margin: 4px 0 8px; }

/* Testimonials - ensure readability */
.testimonial-card p { margin: 0; color: var(--color-primary); }
.testimonial-card strong { color: var(--color-primary); }

/* Footer */
.site-footer { background: var(--color-primary); color: #E9EEF3; margin-top: 20px; }
.site-footer a { color: #E9EEF3; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer section { padding: 28px 0; }
.site-footer .content-wrapper { flex-direction: column; gap: 18px; }
.footer-nav, .legal-nav { display: flex; flex-wrap: wrap; gap: 12px 16px; }
.footer-nav a, .legal-nav a { background: rgba(255,255,255,0.06); padding: 8px 12px; border-radius: 999px; }
.footer-nav a[aria-current="page"], .legal-nav a[aria-current="page"] { background: rgba(255,255,255,0.12); }

/* Navigation - Mobile Menu Overlay */
.mobile-menu { position: fixed; inset: 0; background: rgba(45,58,69,0.3); display: flex; align-items: stretch; justify-content: flex-end; transform: translateX(100%); transition: transform 0.35s ease; z-index: 1500; }
.mobile-menu .mobile-nav { width: 86%; max-width: 360px; background: #FFFFFF; border-left: 1px solid var(--color-border); display: flex; flex-direction: column; padding: 68px 18px 18px; gap: 6px; box-shadow: -8px 0 24px rgba(45,58,69,0.12); }
.mobile-menu .mobile-nav a { display: flex; padding: 12px 10px; border-radius: 10px; color: var(--color-primary); text-decoration: none; border: 1px solid transparent; }
.mobile-menu .mobile-nav a:hover { background: #FFF1E6; border-color: #FFE3D1; color: #9a4a1e; }
.mobile-menu .mobile-nav a[aria-current="page"] { background: #FFEFE2; border-color: #FFDCC5; color: #9a4a1e; }
.mobile-menu.active { transform: translateX(0); }
.mobile-menu[aria-hidden="true"] { pointer-events: none; }
.mobile-menu-close { position: absolute; top: 14px; right: 14px; width: 40px; height: 40px; border-radius: 10px; border: 1px solid var(--color-border); background: #FFFFFF; color: var(--color-primary); cursor: pointer; display: inline-flex; align-items: center; justify-content: center; transition: box-shadow 0.25s ease, transform 0.15s ease; }
.mobile-menu-close:hover { box-shadow: var(--shadow-soft); transform: translateY(-1px); }

/* Utility spacing to prevent overlaps */
.container + .container, .text-section + .text-section, .testimonial-card + .testimonial-card { margin-top: 16px; }

/* Icons inside paragraphs */
p img[alt] { margin-right: 8px; opacity: 0.9; }

/* Tables (if any) */
table { width: 100%; border-collapse: collapse; }
th, td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--color-border); }

/* Cookie Consent Banner */
.cookie-banner { position: fixed; left: 0; right: 0; bottom: 0; z-index: 1400; display: flex; justify-content: center; transform: translateY(100%); transition: transform 0.35s ease; }
.cookie-banner .cookie-inner { width: 100%; max-width: 1200px; margin: 0 16px 16px; background: #FFFFFF; border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: 0 12px 28px rgba(45,58,69,0.16); padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.cookie-banner.is-visible { transform: translateY(0); }
.cookie-title { font-weight: 700; font-family: "Trebuchet MS", Arial, sans-serif; }
.cookie-text { color: var(--color-primary); }
.cookie-buttons { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.cookie-buttons .btn-accept { background: var(--color-secondary); color: #fff; border: 1px solid var(--color-secondary); border-radius: 999px; padding: 10px 16px; cursor: pointer; }
.cookie-buttons .btn-accept:hover { background: #AF5C28; border-color: #AF5C28; }
.cookie-buttons .btn-reject { background: #FFF1E6; color: #9a4a1e; border: 1px solid #FFDCC5; border-radius: 999px; padding: 10px 16px; cursor: pointer; }
.cookie-buttons .btn-settings { background: #F5F7FA; color: var(--color-primary); border: 1px solid var(--color-border); border-radius: 999px; padding: 10px 16px; cursor: pointer; }
.cookie-buttons button { transition: box-shadow 0.25s ease, transform 0.15s ease; }
.cookie-buttons button:hover { box-shadow: var(--shadow-soft); transform: translateY(-1px); }

/* Cookie Preferences Modal */
.cookie-modal { position: fixed; inset: 0; background: rgba(45,58,69,0.45); display: none; align-items: center; justify-content: center; padding: 20px; z-index: 1600; }
.cookie-modal.open { display: flex; }
.cookie-modal .cookie-modal-content { width: 100%; max-width: 720px; background: #FFFFFF; border: 1px solid var(--color-border); border-radius: var(--radius-lg); box-shadow: 0 16px 36px rgba(45,58,69,0.18); display: flex; flex-direction: column; gap: 16px; padding: 18px; }
.cookie-modal .cookie-modal-header { display: flex; align-items: center; justify-content: space-between; }
.cookie-modal .cookie-modal-body { display: flex; flex-direction: column; gap: 12px; }
.cookie-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 12px; border: 1px solid var(--color-border); border-radius: var(--radius-md); background: #FDF8F3; }
.cookie-row .label { font-weight: 600; color: var(--color-primary); }
.cookie-row .toggle { display: inline-flex; align-items: center; gap: 8px; }
/* Toggle style (CSS only) */
.switch { position: relative; width: 46px; height: 26px; border-radius: 999px; background: #D9DEE3; transition: background 0.25s ease; border: 1px solid #C9D1D8; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 22px; height: 22px; background: #FFFFFF; border-radius: 50%; box-shadow: 0 1px 2px rgba(45,58,69,0.2); transition: transform 0.25s ease; }
.switch.is-on { background: #C5682C; }
.switch.is-on::after { transform: translateX(20px); }
.cookie-modal .cookie-modal-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }

/* Forms & Inputs (generic) */
input[type="text"], input[type="email"], input[type="tel"], textarea { width: 100%; padding: 12px 14px; border-radius: 10px; border: 1px solid var(--color-border); background: #FFFFFF; color: var(--color-primary); transition: box-shadow 0.2s ease, border-color 0.2s ease; }
input:focus, textarea:focus { border-color: #E3C1AA; box-shadow: 0 0 0 4px rgba(197,104,44,0.12); }
label { font-weight: 600; color: var(--color-primary); }

/* Accessibility helpers */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* Cards (generic appearance for any .card) */
.card:hover { box-shadow: 0 10px 24px rgba(45,58,69,0.12), 0 4px 10px rgba(45,58,69,0.08); }

/* Content alignment helpers */
.align-center { display: flex; align-items: center; justify-content: center; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.row { display: flex; flex-wrap: wrap; gap: 16px; }

/* Readability in review/testimonial sections */
section:has(.testimonial-card) { background: #FFFBF7; border-top: 1px solid #F1E6DE; border-bottom: 1px solid #F1E6DE; }

/* Responsive */
@media (min-width: 480px) {
  .hero h1 { font-size: 36px; }
}
@media (min-width: 768px) {
  .hero h1 { font-size: 42px; }
  .content-wrapper { gap: 24px; }
  .text-image-section { flex-direction: row; }
  .main-nav { display: flex; }
  .mobile-menu-toggle { display: none; }
  .hero .content-wrapper { padding: 36px 0; }
}
@media (min-width: 992px) {
  h1 { font-size: 44px; }
  h2 { font-size: 28px; }
  h3 { font-size: 20px; }
  .content-grid > * { flex: 1 1 calc(50% - 20px); }
  .site-footer .content-wrapper { flex-direction: row; align-items: flex-start; justify-content: space-between; }
}
@media (min-width: 1200px) {
  h1 { font-size: 48px; }
  .hero .content-wrapper { padding: 44px 0; }
}

/* Ensure adequate gaps between all major blocks */
main > section .content-wrapper > * + * { margin-top: 6px; }

/* Warm friendly micro-interactions for links */
a { transition: color 0.2s ease, background-color 0.2s ease; }
a.btn { text-decoration: none; }

/* Print adjustments (basic) */
@media print {
  .site-header, .site-footer, .mobile-menu, .cookie-banner, .cookie-modal { display: none !important; }
  a { text-decoration: none; }
}
