/* Emerald Safar Smart Home – Elegant Classic Style CSS
   Responsive, Flexbox-based, Modern – All Layouts, Burger Menu, Cookie Banner
-----------------------------------------------------------
*/
/* --- CSS RESET / NORMALIZE --- */
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center, dl, dt, dd, ol, ul, li,
fieldset, form, label, legend, table, caption,
tbody, tfoot, thead, tr, th, td, article,
aside, canvas, details, embed, figure,
figcaption, footer, header, hgroup, menu, nav,
output, ruby, section, summary, time, mark,
audio, video {
  margin: 0;
  padding: 0;
  border: 0;
  font-size: 100%;
  font: inherit;
  vertical-align: baseline;
  box-sizing: border-box;
}
html {
  line-height: 1.5;
  height: 100%;
  scroll-behavior: smooth;
}
body {
  min-height: 100vh;
  font-family: 'Merriweather', 'Georgia', serif;
  color: #2B2D33;
  background: #FAFAF9;
  font-size: 16px;
  letter-spacing: 0.02em;
  -webkit-font-smoothing: antialiased;
}
@media (max-width: 600px) {
  body { font-size: 15px; }
}
a { color: inherit; text-decoration: none; transition: color 0.2s; }
a:focus, a:hover { color: #20614C; outline: none; }
img { max-width: 100%; display: block; border-style: none; }
ul, ol { list-style: none; }

/* --- FONT SETUP (Elegant Serif) --- */
@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@400;700&family=Montserrat:wght@500;700&display=swap');

:root {
  --emerald-primary: #20614C;
  --emerald-secondary: #2B2D33;
  --emerald-accent: #DFF6EA;
  --emerald-bg: #FAFAF9;
  --emerald-white: #FFF;
  --emerald-grey: #F4F4F0;
  --emerald-brown: #7D7461;
  --emerald-shadow: 0 6px 24px rgba(32,97,76,0.08), 0 1.5px 3px #E5E5E2;
  --font-display: 'Merriweather', 'Georgia', serif;
  --font-body: 'Merriweather', 'Georgia', serif;
  --transition-main: 0.2s cubic-bezier(0.43,0.13,0.23,0.96);
  --radius-main: 10px;
}

/* --- BASIC STRUCTURE & LAYOUT --- */
.container {
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 0;
}
.content-wrapper {
  margin: 0 auto;
  max-width: 800px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}
@media (max-width: 900px) {
  .container { max-width: 99vw; }
  .content-wrapper { max-width: 99vw; padding: 0; }
}

/* --- HEADER & NAVIGATION --- */
header {
  background: var(--emerald-white);
  border-bottom: 1px solid #e9ece5;
  box-shadow: 0 2px 16px 0 rgba(32,97,76,0.03);
}
header .container {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  min-height: 78px;
  gap: 32px;
}
.logo img { height: 48px; width: auto; }
.main-nav {
  display: flex;
  gap: 28px;
  align-items: center;
}
.main-nav a {
  font-family: var(--font-display);
  font-size: 17px;
  padding: 4px 0 4px 0;
  color: var(--emerald-secondary);
  position: relative;
  transition: color var(--transition-main);
}
.main-nav a.btn-primary {
  font-size: 16px;
  margin-left: 16px;
  border-radius: var(--radius-main);
}
.main-nav a:not(.btn-primary):hover::after {
  content: '';
  display: block;
  height: 2px;
  background: var(--emerald-primary);
  width: 80%;
  margin: 0 auto 0 auto;
  border-radius: 1px;
  transition: all 0.17s;
}
.main-nav a:focus-visible {
  outline: 2px solid var(--emerald-primary);
}

/* --- MOBILE NAVIGATION --- */
.mobile-menu-toggle {
  background: none;
  border: none;
  font-size: 32px;
  color: var(--emerald-primary);
  padding: 8px 16px;
  display: none;
  cursor: pointer;
  transition: background var(--transition-main);
  border-radius: 8px;
  z-index: 1001;
}
.mobile-menu-toggle:focus, .mobile-menu-toggle:hover {
  background: var(--emerald-accent);
}

.mobile-menu {
  position: fixed;
  top: 0; left: 0;
  width: 100vw; height: 100vh;
  background: rgba(44, 55, 50, 0.98);
  transform: translateX(-100vw);
  transition: transform 0.35s cubic-bezier(.53,.1,.29,1.18);
  z-index: 1200;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  padding-top: 32px;
}
.mobile-menu.open {
  transform: translateX(0);
}
.mobile-menu-close {
  background: none;
  border: none;
  font-size: 32px;
  color: #fff;
  position: relative;
  margin: 20px 0 20px 28px;
  z-index: 1210;
  cursor: pointer;
  padding: 4px 14px;
  border-radius: 8px;
  transition: background var(--transition-main);
}
.mobile-menu-close:hover, .mobile-menu-close:focus {
  background: #305a42;
}
.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin: 24px 0 0 32px;
}
.mobile-nav a {
  font-family: var(--font-display);
  font-size: 22px;
  padding: 12px 6px;
  color: #fff;
  border-radius: 8px;
  transition: background var(--transition-main), color 0.2s;
}
.mobile-nav a:hover, .mobile-nav a:focus {
  background: var(--emerald-accent);
  color: var(--emerald-primary);
}

@media (max-width: 1020px) {
  .main-nav { display: none; }
  .mobile-menu-toggle { display: block; }
}
@media (min-width: 1021px) {
  .mobile-menu { display: none !important; }
  .mobile-menu-toggle { display: none !important; }
}
/* Close mobile menu on larger screens, always show .main-nav above 1020px */


/* --- SECTION STYLES & LAYOUT UTILS --- */
section {
  background: transparent;
  margin-bottom: 60px;
  padding: 40px 0;
  position: relative;
}
.section { /* As per requirement */
  margin-bottom: 60px;
  padding: 40px 20px;
}
.section:last-child {
  margin-bottom: 0;
}


/* --- TYPOGRAPHY --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--emerald-primary);
  font-weight: 700;
  line-height: 1.16;
  letter-spacing: 0.01em;
}
h1 {
  font-size: 2.9rem;
  margin-bottom: 12px;
  margin-top: 0;
}
@media (max-width: 800px) {
  h1 { font-size: 2.2rem; }
}
@media (max-width: 580px) {
  h1 { font-size: 1.65rem; }
}
h2 {
  font-size: 2.1rem;
  margin-bottom: 12px;
}
h3 {
  font-size: 1.32rem;
  margin-bottom: 8px;
}
h4 {
  font-size: 1.08rem; }
p, ul, ol, li {
  font-family: var(--font-body);
  color: var(--emerald-secondary);
  font-size: 1em;
  line-height: 1.82;
  margin-bottom: 0.5em;
}
p.subtitle {
  color: var(--emerald-brown);
  font-size: 1.24rem;
  font-family: var(--font-display);
  margin-bottom: 22px;
}
strong, b {
  font-weight: 700;
  color: var(--emerald-primary);
}

/* --- BUTTONS --- */
.btn-primary, .btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-main);
  padding: 13px 32px;
  border: none;
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1rem;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 14px 0 rgba(32,97,76,.07);
  transition: all var(--transition-main);
  margin-bottom: 0;
}
.btn-primary {
  background: var(--emerald-primary);
  color: var(--emerald-white);
  border: 1.5px solid var(--emerald-primary);
  box-shadow: var(--emerald-shadow);
}
.btn-primary:hover, .btn-primary:focus {
  background: #388966;
  color: #fff;
}
.btn-secondary {
  background: var(--emerald-accent);
  color: var(--emerald-primary);
  border: 1.5px solid var(--emerald-primary);
}
.btn-secondary:hover, .btn-secondary:focus {
  background: var(--emerald-primary);
  color: var(--emerald-white);
}

/* --- CARDS & FLEX CONTAINERS --- */
.card-container {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: flex-start;
}
.card {
  background: var(--emerald-white);
  border-radius: var(--radius-main);
  box-shadow: var(--emerald-shadow);
  padding: 32px 28px;
  margin-bottom: 20px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 15px;
  min-width: 260px;
  max-width: 360px;
  flex: 1 1 320px;
  transition: box-shadow var(--transition-main), transform 0.20s;
}
.card:hover {
  box-shadow: 0 10px 28px 0 rgba(32,97,76,0.18);
  transform: translateY(-2px) scale(1.03);
}

.content-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: space-between;
}
.text-image-section {
  display: flex;
  align-items: center;
  gap: 30px;
  flex-wrap: wrap;
}
.testimonial-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  background: var(--emerald-accent);
  color: #222;
  border-radius: var(--radius-main);
  box-shadow: 0 4px 22px 0 rgba(32,97,76,.09);
  padding: 20px 28px 20px 28px;
  margin-bottom: 20px;
  min-width: 230px;
  max-width: 470px;
  flex: 1 1 320px;
  cursor: default;
}
.testimonial-meta {
  font-family: var(--font-display);
  font-size: 1.02em;
  color: var(--emerald-primary);
  opacity: 0.90;
  margin-top: 8px;
}
.star-rating {
  color: #F2CB05;
  font-size: 1.35rem;
  letter-spacing: 2px;
  user-select: none;
}

/* --- BLOG PREVIEW, SERVICES, FEATURES --- */
.blog-preview-list, .features-grid, .services-cards, .testimonials-list, .project-overview {
  display: flex;
  flex-wrap: wrap;
  gap: 24px;
  justify-content: flex-start;
}
.blog-preview-card {
  background: var(--emerald-white);
  border-radius: var(--radius-main);
  box-shadow: var(--emerald-shadow);
  padding: 26px 24px;
  flex: 1 1 320px;
  max-width: 340px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 20px;
  transition: box-shadow .23s, transform .19s;
}
.blog-preview-card:hover {
  box-shadow: 0 11px 32px 0 rgba(32,97,76,0.16);
  transform: translateY(-3px) scale(1.035);
}
.chip {
  display: inline-flex;
  align-items: center;
  padding: 7px 20px;
  color: var(--emerald-primary);
  background: var(--emerald-accent);
  border-radius: 999px;
  font-size: 1em;
  font-family: var(--font-display);
  margin-right: 8px;
  margin-bottom: 8px;
  border: 1px solid var(--emerald-primary);
}
.chip:last-child { margin-right: 0; }

.blog-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.features-grid > div, .services-cards > div, .project-overview > div {
  background: var(--emerald-grey);
  border-radius: var(--radius-main);
  box-shadow: 0 3px 12px 0 rgba(32,97,76,.02);
  padding: 28px 18px 24px 18px;
  flex: 1 1 290px;
  max-width: 330px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: 20px;
  transition: box-shadow .18s, transform .16s;
}
.features-grid > div:hover, .services-cards > div:hover, .project-overview > div:hover {
  box-shadow: 0 8px 23px 0 rgba(32,97,76,0.14);
  transform: scale(1.023);
}
.features-grid img, .services-cards img, .project-overview img {
  height: 50px; width: 50px;
  margin-bottom: 15px;
}

/* --- LAYOUT HELPERS --- */
.feature-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 15px;
}

.text-section {
  margin-bottom: 24px;
  font-size: 1.06rem;
  color: var(--emerald-secondary);
}
.benefits-callout {
  margin: 28px 0 0 0;
  background: var(--emerald-accent);
  border-radius: var(--radius-main);
  padding: 22px 24px;
  font-family: var(--font-display);
  color: var(--emerald-primary);
  font-size: 1.09em;
  box-shadow: 0 6px 18px rgba(32,97,76,0.04);
}

/* --- FOOTER --- */
footer {
  background: #f7faf8;
  padding: 54px 0 28px 0;
  border-top: 1px solid #e4efe5;
  font-size: 1em;
}
footer .container {
  flex-direction: row;
  justify-content: space-between;
  align-items: flex-start;
  gap: 42px;
  flex-wrap: wrap;
}
.footer-brand img {
  height: 44px; width: auto;
  margin-bottom: 16px;
}
.footer-main-nav, .footer-utility-nav {
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.footer-main-nav a, .footer-utility-nav a {
  color: var(--emerald-primary);
  font-family: var(--font-display);
  font-size: 1em;
  padding: 2px 0;
  border-radius: 5px;
  transition: background .18s, color .15s;
}
.footer-main-nav a:hover, .footer-utility-nav a:hover {
  background: var(--emerald-accent);
  color: var(--emerald-secondary);
}
.footer-contact {
  font-size: 0.95em;
}
.footer-contact a {
  color: var(--emerald-secondary);
  text-decoration: underline;
}

@media (max-width: 850px) {
  footer .container {
    flex-direction: column;
    justify-content: flex-start;
    gap: 26px;
  }
}

/* --- RESPONSIVENESS (MOBILE FIRST) --- */
@media (max-width: 860px) {
  .card-container, .content-grid, .features-grid, .blog-preview-list,.services-cards,.testimonials-list,.project-overview {
    flex-direction: column;
    gap: 20px;
  }
  .testimonials-preview {
    flex-direction: column;
    gap: 20px;
  }
}
@media (max-width: 768px) {
  .content-wrapper { padding: 0 6px; }
  .text-image-section { flex-direction: column; gap: 18px; align-items: flex-start; }
  .main-nav { display: none; }
  .features-grid, .blog-preview-list,.services-cards,.testimonials-list,.project-overview {
    gap: 18px;
  }
  .section, section { padding: 28px 8px; }
}
@media (max-width: 520px) {
  .card, .testimonial-card, .features-grid > div, .services-cards > div, .blog-preview-card, .project-overview > div {
    padding: 20px 10px;
  }
  .btn-primary, .btn-secondary { padding: 11px 13px; font-size: 0.97rem; }
  .section, section { padding: 17px 1vw; }
}

/* --- UL / OL / LI Styling --- */
ul, ol {
  margin-left: 0;
  margin-bottom: 1.2em;
  list-style-position: outside;
  padding-left: 20px;
}
ul li, ol li {
  position: relative;
  margin-bottom: 10px;
  font-size: 1em;
  padding-left: 14px;
}
ul li::before {
  content: "\2022";
  color: var(--emerald-primary);
  font-size: 1.1em;
  position: absolute;
  left: 0;
  line-height: 1.2;
}
ol li {
  list-style-type: decimal;
}


/* --- TABLES (if any appear) --- */
table { border-collapse: collapse; width:100%; margin-bottom: 24px; }
th, td { padding: 12px 8px; border-bottom: 1px solid #e6ebee; font-family: var(--font-body); }
th { background: var(--emerald-accent); font-family: var(--font-display); text-align: left; }

/* --- FORM ELEMENTS --- */
input, textarea, select, button {
  font-family: var(--font-body);
  font-size: 1em;
  border-radius: var(--radius-main);
  outline: none;
}
input, textarea, select {
  padding: 12px;
  background: #fff;
  border: 1.3px solid #b5c8bc;
  color: var(--emerald-secondary);
  transition: border .2s, box-shadow .17s;
  margin-bottom: 18px;
}
input:focus, textarea:focus, select:focus {
  border: 1.6px solid var(--emerald-primary);
  box-shadow: 0 6px 22px 0 rgba(32,97,76,.10);
}

/* --- COOKIE CONSENT BANNER --- */
.cookie-banner {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  width: 100vw;
  background: var(--emerald-accent);
  color: var(--emerald-primary);
  padding: 29px 18px 22px 18px;
  box-shadow: 0 -6px 30px rgba(43,45,51,.12);
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  z-index: 1700;
  transition: transform .35s cubic-bezier(.62,.12,.25,1.07);
  font-family: var(--font-body);
  font-size: 1.08em;
}
.cookie-banner.closed {
  transform: translateY(110%);
}
.cookie-banner .cookie-actions {
  display: flex;
  gap: 10px;
}
.cookie-banner button, .cookie-banner .btn-primary, .cookie-banner .btn-secondary {
  padding: 8px 20px;
  font-size: 1em;
  border-radius: 8px;
  margin: 0 2px;
  border: 1.5px solid var(--emerald-primary);
  background: var(--emerald-white);
  color: var(--emerald-primary);
  font-family: var(--font-display);
  cursor: pointer;
  transition: background .2s, color .18s;
}
.cookie-banner .btn-primary {
  background: var(--emerald-primary);
  color: #fff;
}
.cookie-banner .btn-primary:hover, .cookie-banner .btn-primary:focus {
  background: #388966;
  color: #fff;
}
.cookie-banner .btn-secondary:hover, .cookie-banner .btn-secondary:focus {
  background: var(--emerald-primary);
  color: #fff;
}

/* Cookie Modal --- */
.cookie-modal-overlay {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100vw; height: 100vh;
  background: rgba(34,38,35,0.45);
  z-index: 2001;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s;
}
.cookie-modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}
.cookie-modal {
  background: var(--emerald-white);
  color: var(--emerald-primary);
  max-width: 430px;
  width: 90vw;
  border-radius: 14px;
  box-shadow: 0 13px 38px 0 rgba(32,97,76,0.22);
  padding: 34px 22px 20px 22px;
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  animation: modalIn .29s;
}
@keyframes modalIn {
  0% { transform: translateY(32px); opacity: 0; }
  85% { transform: translateY(-7px); }
  100% { transform: translateY(0); opacity: 1; }
}
.cookie-modal-close {
  position: absolute;
  right: 22px;
  top: 18px;
  font-size: 1.9em;
  color: var(--emerald-secondary);
  background: none;
  border: none;
  cursor: pointer;
  padding: 3px 10px;
  border-radius: 8px;
  opacity: 0.75;
}
.cookie-modal-close:hover, .cookie-modal-close:focus {
  background: var(--emerald-accent);
}
.cookie-modal .cookie-category {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--emerald-accent);
  padding: 10px 13px;
  border-radius: 8px;
  font-size: 1em;
  margin-bottom: 4px;
  font-family: var(--font-display);
}
.cookie-modal .category-label {
  font-weight: 600;
}
.cookie-toggle {
  display: inline-flex;
  align-items: center;
}
.cookie-toggle input[type='checkbox'] {
  appearance: none;
  width: 36px; height: 19px;
  background: #dae8e0;
  border-radius: 9.5px;
  position: relative;
  outline: 0;
  transition: background 0.19s;
  margin-right: 7px;
  cursor: pointer;
}
.cookie-toggle input[type='checkbox']:checked {
  background: var(--emerald-primary);
}
.cookie-toggle input[type='checkbox']::before {
  content: '';
  position: absolute;
  left: 2px; top: 2px;
  width: 15px;
  height: 15px;
  background: #fff;
  border-radius: 50%;
  transition: left .17s;
}
.cookie-toggle input[type='checkbox']:checked::before {
  left: 19px;
}
.cookie-toggle label {
  font-size: 1em;
  cursor: pointer;
}
/* Essential cookies switch (disabled): */
.cookie-toggle input[disabled] {
  opacity: 0.45;
  pointer-events: none;
}

/* --- MICRO-INTERACTIONS & GENERAL TRANSITIONS --- */
.card, .testimonial-card, .blog-preview-card, .features-grid > div, .services-cards > div, .project-overview > div {
  transition: box-shadow .2s, transform .17s;
}
.btn-primary, .btn-secondary, .footer-main-nav a, .footer-utility-nav a {
  transition: background .17s, color .16s, box-shadow .19s;
}

/* --- UTILITIES --- */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0,0,0,0) !important;
  border: 0 !important;
}

/* --- Z-INDEX LAYERING --- */
header { z-index: 1000; position: relative; }
.mobile-menu { z-index: 1200; }
.cookie-banner { z-index: 1700; }
.cookie-modal-overlay { z-index: 2001; }

/* --- SCROLLBAR --- */
body, html {
  scrollbar-width: thin;
  scrollbar-color: var(--emerald-primary) var(--emerald-accent);
}
body::-webkit-scrollbar {
  width: 8px;
  background: var(--emerald-accent);
}
body::-webkit-scrollbar-thumb {
  background: var(--emerald-primary);
  border-radius: 4px;
}

/* --- PRINT (minimal) --- */
@media print {
  header, .mobile-menu, footer, .cookie-banner, .cookie-modal-overlay { display: none !important; }
  body { color: #000; background: #fff; }
}
