/*
Theme Name: The Green Wire
Theme URI: https://thegreenwire.com
Author: The Green Wire
Author URI: https://thegreenwire.com
Description: Premium KNX/DALI Home Automation WordPress Theme — Professional catalog and enquiry website for smart home & commercial automation solutions.
Version: 1.0.0
Requires at least: 5.8
Tested up to: 6.4
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: the-green-wire
Tags: business, automation, home-automation, KNX, catalog, dark, professional
*/

/* ----------------------------------------
   CSS CUSTOM PROPERTIES (DESIGN TOKENS)
---------------------------------------- */
:root {
  /* Primary — Green */
  --clr-primary-900: #1B5E20;
  --clr-primary-800: #2E7D32;
  --clr-primary-700: #388E3C;
  --clr-primary-600: #43A047;
  --clr-primary-500: #4CAF50;
  --clr-primary-100: #C8E6C9;
  --clr-primary-50:  #E8F5E9;

  /* Secondary — Grey */
  --clr-grey-900: #212121;
  --clr-grey-800: #424242;
  --clr-grey-700: #616161;
  --clr-grey-600: #757575;
  --clr-grey-400: #BDBDBD;
  --clr-grey-200: #EEEEEE;
  --clr-grey-100: #F5F5F5;

  /* Accent 1 — Violet/Purple */
  --clr-violet-900: #4A148C;
  --clr-violet-800: #6A1B9A;
  --clr-violet-700: #7B1FA2;
  --clr-violet-500: #9C27B0;
  --clr-violet-100: #E1BEE7;

  /* Accent 2 — Yellow */
  --clr-yellow-700: #F57F17;
  --clr-yellow-600: #F9A825;
  --clr-yellow-500: #FBC02D;
  --clr-yellow-300: #FFF176;

  /* Text */
  --clr-text-dark:  #333333;
  --clr-text-body:  #555555;
  --clr-text-light: #FFFFFF;
  --clr-text-muted: #888888;

  /* Typography */
  --font-heading: 'Poppins', 'Inter', sans-serif;
  --font-body: 'Inter', 'Poppins', sans-serif;

  /* Spacing */
  --space-xs:  0.5rem;
  --space-sm:  1rem;
  --space-md:  1.5rem;
  --space-lg:  2.5rem;
  --space-xl:  4rem;
  --space-2xl: 6rem;

  /* Border radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 16px;
  --radius-pill: 50px;

  /* Shadows */
  --shadow-sm: 0 2px 8px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 20px rgba(0,0,0,0.12);
  --shadow-lg: 0 8px 40px rgba(0,0,0,0.18);
  --shadow-card: 0 4px 24px rgba(46,125,50,0.10);

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-md: 0.35s ease;
  --transition-slow: 0.5s ease;

  /* Container */
  --container-max: 1280px;
  --container-padding: 1.5rem;

  /* Header height */
  --header-height: 80px;
}

/* ----------------------------------------
   GLOBAL RESET & BASE
---------------------------------------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; font-size: 16px; }

body {
  font-family: var(--font-body);
  color: var(--clr-text-dark);
  background: #fff;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
ul, ol { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, textarea, select { font-family: inherit; }

/* ----------------------------------------
   TYPOGRAPHY
---------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.25;
  color: var(--clr-text-dark);
}

h1 { font-size: clamp(2rem, 5vw, 3.5rem); }
h2 { font-size: clamp(1.6rem, 3.5vw, 2.5rem); }
h3 { font-size: clamp(1.2rem, 2.5vw, 1.75rem); }
h4 { font-size: 1.25rem; }
h5 { font-size: 1.1rem; }
h6 { font-size: 1rem; }

p { margin-bottom: 1em; color: var(--clr-text-body); }
p:last-child { margin-bottom: 0; }

/* ----------------------------------------
   UTILITY CLASSES
---------------------------------------- */
.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.section-padding { padding: var(--space-xl) 0; }
.section-padding-lg { padding: var(--space-2xl) 0; }

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

.text-primary { color: var(--clr-primary-800); }
.text-violet { color: var(--clr-violet-800); }
.text-yellow { color: var(--clr-yellow-500); }
.text-white { color: #fff; }
.text-muted { color: var(--clr-text-muted); }

.bg-dark { background: var(--clr-grey-900); }
.bg-light { background: var(--clr-grey-100); }
.bg-primary { background: var(--clr-primary-800); }
.bg-violet { background: var(--clr-violet-800); }
.bg-white { background: #fff; }

.section-label {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--clr-primary-800);
  background: var(--clr-primary-50);
  padding: 0.3em 0.9em;
  border-radius: var(--radius-pill);
  margin-bottom: 0.75rem;
}

.section-label.violet {
  color: var(--clr-violet-800);
  background: var(--clr-violet-100);
}

.section-title {
  margin-bottom: 0.5rem;
}

.section-subtitle {
  color: var(--clr-text-body);
  font-size: 1.05rem;
  max-width: 620px;
  margin: 0 auto;
}

/* ----------------------------------------
   BUTTONS
---------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.75rem;
  border-radius: var(--radius-pill);
  font-size: 0.95rem;
  font-weight: 600;
  font-family: var(--font-heading);
  transition: all var(--transition-fast);
  white-space: nowrap;
  cursor: pointer;
  letter-spacing: 0.02em;
}

.btn-primary {
  background: var(--clr-primary-800);
  color: #fff;
  box-shadow: 0 4px 14px rgba(46,125,50,0.30);
}
.btn-primary:hover {
  background: var(--clr-primary-700);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(46,125,50,0.40);
}

.btn-violet {
  background: var(--clr-violet-800);
  color: #fff;
  box-shadow: 0 4px 14px rgba(106,27,154,0.30);
}
.btn-violet:hover {
  background: var(--clr-violet-700);
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(106,27,154,0.40);
}

.btn-outline-primary {
  background: transparent;
  color: var(--clr-primary-800);
  border: 2px solid var(--clr-primary-800);
}
.btn-outline-primary:hover {
  background: var(--clr-primary-800);
  color: #fff;
  transform: translateY(-2px);
}

.btn-outline-violet {
  background: transparent;
  color: var(--clr-violet-800);
  border: 2px solid var(--clr-violet-800);
}
.btn-outline-violet:hover {
  background: var(--clr-violet-800);
  color: #fff;
  transform: translateY(-2px);
}

.btn-outline-white {
  background: transparent;
  color: #fff;
  border: 2px solid #fff;
}
.btn-outline-white:hover {
  background: #fff;
  color: var(--clr-primary-800);
  transform: translateY(-2px);
}

.btn-yellow {
  background: var(--clr-yellow-500);
  color: var(--clr-grey-900);
  box-shadow: 0 4px 14px rgba(251,192,45,0.35);
}

.btn-sm { padding: 0.5rem 1.2rem; font-size: 0.85rem; }
.btn-lg { padding: 1rem 2.25rem; font-size: 1.05rem; }
.btn-block { width: 100%; justify-content: center; }

/* ----------------------------------------
   CARDS
---------------------------------------- */
.card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform var(--transition-md), box-shadow var(--transition-md);
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
}

/* ----------------------------------------
   GRID HELPERS
---------------------------------------- */
.grid { display: grid; gap: var(--space-md); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.grid-6 { grid-template-columns: repeat(6, 1fr); }

.flex { display: flex; }
.flex-center { display: flex; align-items: center; justify-content: center; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }

/* ----------------------------------------
   FORM BASE
---------------------------------------- */
.form-group { margin-bottom: 1.2rem; }
.form-label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--clr-text-dark);
  margin-bottom: 0.4rem;
}
.form-control {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1.5px solid var(--clr-grey-200);
  border-radius: var(--radius-md);
  font-size: 0.95rem;
  color: var(--clr-text-dark);
  background: #fff;
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  outline: none;
}
.form-control:focus {
  border-color: var(--clr-primary-600);
  box-shadow: 0 0 0 3px rgba(46,125,50,0.13);
}
textarea.form-control { resize: vertical; min-height: 120px; }
select.form-control { appearance: none; cursor: pointer; }

/* ----------------------------------------
   BADGE
---------------------------------------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.25em 0.75em;
  border-radius: var(--radius-pill);
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-green { background: var(--clr-primary-50); color: var(--clr-primary-800); }
.badge-violet { background: var(--clr-violet-100); color: var(--clr-violet-800); }
.badge-yellow { background: var(--clr-yellow-300); color: var(--clr-grey-900); }

/* ----------------------------------------
   DIVIDER
---------------------------------------- */
.divider {
  height: 3px;
  width: 60px;
  background: linear-gradient(90deg, var(--clr-primary-800), var(--clr-violet-800));
  border-radius: 2px;
  margin: 1rem auto;
}
.divider.left { margin-left: 0; }

/* ----------------------------------------
   PRELOADER
---------------------------------------- */
#preloader {
  position: fixed;
  inset: 0;
  background: var(--clr-grey-900);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition: opacity 0.5s ease, visibility 0.5s ease;
}
#preloader.hide { opacity: 0; visibility: hidden; }
.preloader-ring {
  width: 52px; height: 52px;
  border: 4px solid rgba(46,125,50,0.2);
  border-top-color: var(--clr-primary-800);
  border-radius: 50%;
  animation: spin 0.9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ----------------------------------------
   BACK TO TOP
---------------------------------------- */
#back-to-top {
  position: fixed;
  bottom: 2rem;
  right: 2rem;
  width: 46px;
  height: 46px;
  background: var(--clr-primary-800);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  box-shadow: var(--shadow-md);
  cursor: pointer;
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px);
  transition: all var(--transition-fast);
  z-index: 100;
  border: none;
}
#back-to-top.visible { opacity: 1; visibility: visible; transform: translateY(0); }
#back-to-top:hover { background: var(--clr-primary-700); transform: translateY(-3px); }

/* ----------------------------------------
   BREADCRUMB
---------------------------------------- */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.85rem;
  color: rgba(255,255,255,0.75);
  padding: 1rem 0;
}
.breadcrumb a { color: rgba(255,255,255,0.85); }
.breadcrumb a:hover { color: #fff; }
.breadcrumb .sep { opacity: 0.5; }

/* ----------------------------------------
   ANIMATIONS (AOS-style)
---------------------------------------- */
[data-aos] {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
[data-aos].aos-animate {
  opacity: 1;
  transform: translateY(0);
}
[data-aos="fade-left"] { transform: translateX(-24px); }
[data-aos="fade-left"].aos-animate { transform: translateX(0); }
[data-aos="fade-right"] { transform: translateX(24px); }
[data-aos="fade-right"].aos-animate { transform: translateX(0); }
[data-aos="zoom-in"] { transform: scale(0.9); }
[data-aos="zoom-in"].aos-animate { transform: scale(1); }

/* ----------------------------------------
   RESPONSIVE MEDIA QUERIES
---------------------------------------- */
@media (max-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-6 { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 768px) {
  :root {
    --space-xl: 3rem;
    --space-2xl: 4rem;
  }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .grid-6 { grid-template-columns: repeat(2, 1fr); }
  .section-subtitle { font-size: 0.95rem; }
}

@media (max-width: 480px) {
  .grid-6 { grid-template-columns: 1fr; }
  .btn { padding: 0.65rem 1.4rem; font-size: 0.9rem; }
}
