/* ============================================================================
   QualiChart Static Site — Main CSS
   ============================================================================ */

/* ============================================================================
   1. GOOGLE FONTS IMPORT
   ============================================================================ */
@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;600;700;800&display=swap');

/* ============================================================================
   2. CSS CUSTOM PROPERTIES (Design Tokens)
   ============================================================================ */
:root {
  /* Colors */
  --color-primary: #AF0000;
  --color-primary-50: #f9ebeb;
  --color-primary-100: #f0d7d7;
  --color-primary-700: #8b0000;
  --color-accent: #1273B0;
  --color-accent-50: #e6f3ff;
  --color-accent-600: #0d5a8a;
  --color-secondary: #54595F;
  --color-heading: #0c0a1c;
  --color-body: #030107;
  --color-surface: #ffffff;

  /* Grays */
  --color-gray-50: #f9fafb;
  --color-gray-100: #f3f4f6;
  --color-gray-200: #e5e7eb;
  --color-gray-300: #d1d5db;
  --color-gray-500: #6b7280;
  --color-gray-600: #4b5563;
  --color-gray-700: #374151;

  /* Status */
  --color-green-50: #f0fdf4;
  --color-green-600: #16a34a;
  --color-green-700: #15803d;
  --color-blue-50: #eff6ff;

  /* Typography */
  --font-family: 'Manrope', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-size-xs: 0.75rem;
  --font-size-sm: 0.875rem;
  --font-size-base: 1rem;
  --font-size-lg: 1.125rem;
  --font-size-xl: 1.25rem;
  --font-size-2xl: 1.5rem;
  --font-size-3xl: 2rem;
  --font-size-4xl: 2.25rem;
  --font-size-5xl: 3rem;
  --font-size-6xl: 3.75rem;

  /* Spacing */
  --spacing-0: 0;
  --spacing-0-5: 0.125rem;
  --spacing-1: 0.25rem;
  --spacing-1-5: 0.375rem;
  --spacing-2: 0.5rem;
  --spacing-3: 0.75rem;
  --spacing-4: 1rem;
  --spacing-6: 1.5rem;
  --spacing-8: 2rem;
  --spacing-12: 3rem;
  --spacing-16: 4rem;
  --spacing-24: 6rem;
  --spacing-32: 8rem;

  /* Shadows */
  --shadow-sm: 0 1px 2px 0 rgba(0,0,0,0.05);
  --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0,0,0,0.1);
}

/* ============================================================================
   3. CSS RESET & BASE STYLES
   ============================================================================ */
* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: 1.5;
  color: var(--color-body);
  background-color: var(--color-surface);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  color: var(--color-heading);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 0.5rem;
}

h1 { font-size: var(--font-size-5xl); }
@media (min-width: 768px) { h1 { font-size: var(--font-size-6xl); } }

h2 { font-size: var(--font-size-4xl); }
@media (min-width: 768px) { h2 { font-size: var(--font-size-5xl); } }

h3 { font-size: var(--font-size-3xl); }
@media (min-width: 768px) { h3 { font-size: var(--font-size-4xl); } }

h4 { font-size: var(--font-size-2xl); }
@media (min-width: 768px) { h4 { font-size: var(--font-size-3xl); } }

h5 { font-size: var(--font-size-xl); }
@media (min-width: 768px) { h5 { font-size: var(--font-size-2xl); } }

h6 { font-size: var(--font-size-lg); }
@media (min-width: 768px) { h6 { font-size: var(--font-size-xl); } }

p {
  font-size: var(--font-size-base);
  margin-bottom: 1rem;
  line-height: 1.75;
}
@media (min-width: 768px) {
  p { font-size: var(--font-size-lg); }
}

a {
  color: var(--color-accent);
  text-decoration: none;
  transition: opacity 0.2s ease;
}
a:hover {
  opacity: 0.8;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

ul {
  list-style: none;
}

/* ============================================================================
   4. COMPONENT CLASSES
   ============================================================================ */

/* Sticky Header */
.sticky-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-gray-200);
  box-shadow: var(--shadow-sm);
}

/* Hero Section */
.hero-section {
  padding: 1rem;
  background: linear-gradient(135deg, var(--color-primary-50) 0%, var(--color-surface) 100%);
}
@media (min-width: 768px) {
  .hero-section { padding: 1.5rem; }
}
@media (min-width: 1024px) {
  .hero-section { padding: 2rem; }
}

/* Standard Section */
.section {
  padding: 3rem 1rem;
}
@media (min-width: 768px) {
  .section { padding: 4rem 1rem; }
}
@media (min-width: 1024px) {
  .section { padding: 5rem 1rem; }
}

/* Container */
.container {
  max-width: 80rem;
  margin-left: auto;
  margin-right: auto;
}

/* Card */
.card {
  background: var(--color-surface);
  border: 1px solid var(--color-gray-200);
  border-radius: 0.5rem;
  padding: 1.5rem;
  box-shadow: var(--shadow-md);
  transition: box-shadow 0.2s ease;
}
.card:hover {
  box-shadow: var(--shadow-lg);
}

/* Buttons */
.btn-primary,
.btn-secondary,
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 0.375rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.2s ease;
  font-size: var(--font-size-sm);
}

.btn-primary {
  background-color: var(--color-primary);
  color: var(--color-surface);
}
.btn-primary:hover {
  background-color: var(--color-primary-700);
}
.btn-primary:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

.btn-secondary {
  background-color: var(--color-accent);
  color: var(--color-surface);
}
.btn-secondary:hover {
  background-color: var(--color-accent-600);
}

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

/* Button Sizes */
.btn-sm {
  padding: 0.5rem 1rem;
  font-size: var(--font-size-sm);
}

.btn-md {
  padding: 0.75rem 1.5rem;
  font-size: var(--font-size-base);
}

.btn-lg {
  padding: 1rem 2rem;
  font-size: var(--font-size-lg);
}

/* ============================================================================
   5. LAYOUT UTILITIES
   ============================================================================ */

/* Display */
.flex { display: flex; }
.flex-col { flex-direction: column; }
.flex-row { flex-direction: row; }
.flex-wrap { flex-wrap: wrap; }
.flex-1 { flex: 1 1 0%; }
.flex-shrink-0 { flex-shrink: 0; }

.grid { display: grid; }
.hidden { display: none; }
.block { display: block; }
.inline-block { display: inline-block; }
.inline-flex { display: inline-flex; }

/* Justify Content */
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.justify-start { justify-content: flex-start; }
.justify-end { justify-content: flex-end; }

/* Align Items */
.items-center { align-items: center; }
.items-start { align-items: flex-start; }
.items-end { align-items: flex-end; }

/* Grid Columns */
.grid-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); }
.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }

.lg-col-span-1 { grid-column: span 1; }

/* Gaps & Spacing */
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.gap-12 { gap: 3rem; }

.space-y-2 > * + * { margin-top: 0.5rem; }
.space-y-3 > * + * { margin-top: 0.75rem; }
.space-y-4 > * + * { margin-top: 1rem; }
.space-y-6 > * + * { margin-top: 1.5rem; }
.space-y-8 > * + * { margin-top: 2rem; }

/* Margin Auto */
.mx-auto { margin-left: auto; margin-right: auto; }
.mt-auto { margin-top: auto; }

/* ============================================================================
   6. SPACING UTILITIES (Padding & Margin)
   ============================================================================ */

/* Padding X-axis */
.px-2 { padding-left: 0.5rem; padding-right: 0.5rem; }
.px-3 { padding-left: 0.75rem; padding-right: 0.75rem; }
.px-4 { padding-left: 1rem; padding-right: 1rem; }
.px-6 { padding-left: 1.5rem; padding-right: 1.5rem; }
.px-8 { padding-left: 2rem; padding-right: 2rem; }

/* Padding Y-axis */
.py-2 { padding-top: 0.5rem; padding-bottom: 0.5rem; }
.py-3 { padding-top: 0.75rem; padding-bottom: 0.75rem; }
.py-4 { padding-top: 1rem; padding-bottom: 1rem; }
.py-6 { padding-top: 1.5rem; padding-bottom: 1.5rem; }
.py-8 { padding-top: 2rem; padding-bottom: 2rem; }
.py-12 { padding-top: 3rem; padding-bottom: 3rem; }
.py-16 { padding-top: 4rem; padding-bottom: 4rem; }
.py-24 { padding-top: 6rem; padding-bottom: 6rem; }
.py-32 { padding-top: 8rem; padding-bottom: 8rem; }

/* All Padding */
.p-4 { padding: 1rem; }
.p-6 { padding: 1.5rem; }
.p-8 { padding: 2rem; }

/* Margin Bottom */
.mb-2 { margin-bottom: 0.5rem; }
.mb-3 { margin-bottom: 0.75rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mb-12 { margin-bottom: 3rem; }

/* Margin Top */
.mt-1 { margin-top: 0.25rem; }
.mt-2 { margin-bottom: 0.5rem; }
.mt-3 { margin-top: 0.75rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.mt-8 { margin-top: 2rem; }
.mt-12 { margin-top: 3rem; }

/* ============================================================================
   7. TYPOGRAPHY UTILITIES
   ============================================================================ */

/* Font Sizes */
.text-xs { font-size: var(--font-size-xs); }
.text-sm { font-size: var(--font-size-sm); }
.text-base { font-size: var(--font-size-base); }
.text-lg { font-size: var(--font-size-lg); }
.text-xl { font-size: var(--font-size-xl); }
.text-2xl { font-size: var(--font-size-2xl); }
.text-3xl { font-size: var(--font-size-3xl); }
.text-4xl { font-size: var(--font-size-4xl); }
.text-5xl { font-size: var(--font-size-5xl); }
.text-6xl { font-size: var(--font-size-6xl); }

/* Font Weight */
.font-bold { font-weight: 700; }
.font-semibold { font-weight: 600; }
.font-medium { font-weight: 500; }
.font-normal { font-weight: 400; }

/* Text Alignment */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* Text Style */
.italic { font-style: italic; }
.leading-relaxed { line-height: 1.75; }
.leading-tight { line-height: 1.25; }

/* ============================================================================
   8. COLOR UTILITIES
   ============================================================================ */

/* Text Colors */
.text-heading { color: var(--color-heading); }
.text-secondary { color: var(--color-secondary); }
.text-body { color: var(--color-body); }
.text-primary { color: var(--color-primary); }
.text-accent { color: var(--color-accent); }
.text-white { color: var(--color-surface); }

.text-gray-300 { color: var(--color-gray-300); }
.text-gray-500 { color: var(--color-gray-500); }
.text-gray-600 { color: var(--color-gray-600); }
.text-gray-700 { color: var(--color-gray-700); }

.text-green-600 { color: var(--color-green-600); }
.text-green-700 { color: var(--color-green-700); }

/* ============================================================================
   9. BACKGROUND UTILITIES
   ============================================================================ */

.bg-white { background-color: var(--color-surface); }
.bg-gray-50 { background-color: var(--color-gray-50); }
.bg-gray-100 { background-color: var(--color-gray-100); }
.bg-primary { background-color: var(--color-primary); }
.bg-primary-50 { background-color: var(--color-primary-50); }
.bg-primary-100 { background-color: var(--color-primary-100); }
.bg-accent { background-color: var(--color-accent); }
.bg-accent-50 { background-color: var(--color-accent-50); }
.bg-blue-50 { background-color: var(--color-blue-50); }
.bg-green-50 { background-color: var(--color-green-50); }
.bg-heading { background-color: var(--color-heading); }

/* Gradients */
.bg-gradient-to-r.from-primary-50.to-white {
  background: linear-gradient(to right, var(--color-primary-50), var(--color-surface));
}
.bg-gradient-to-r.from-primary-50.to-accent-50 {
  background: linear-gradient(to right, var(--color-primary-50), var(--color-accent-50));
}
.bg-gradient-to-r.from-accent-50.to-white {
  background: linear-gradient(to right, var(--color-accent-50), var(--color-surface));
}

/* ============================================================================
   10. BORDER UTILITIES
   ============================================================================ */

.border { border: 1px solid var(--color-gray-200); }
.border-2 { border: 2px solid var(--color-gray-200); }

.border-t { border-top: 1px solid var(--color-gray-200); }
.border-b { border-bottom: 1px solid var(--color-gray-200); }
.border-l-4 { border-left: 4px solid var(--color-primary); }

.border-gray-200 { border-color: var(--color-gray-200); }
.border-gray-300 { border-color: var(--color-gray-300); }
.border-gray-700 { border-color: var(--color-gray-700); }
.border-primary { border-color: var(--color-primary); }
.border-accent { border-color: var(--color-accent); }
.border-white { border-color: var(--color-surface); }
.border-green-200 { border-color: #dcfce7; }

/* Border Radius */
.rounded { border-radius: 0.25rem; }
.rounded-md { border-radius: 0.375rem; }
.rounded-lg { border-radius: 0.5rem; }
.rounded-full { border-radius: 9999px; }

/* ============================================================================
   11. SHADOW UTILITIES
   ============================================================================ */

.shadow-sm { box-shadow: var(--shadow-sm); }
.shadow-md { box-shadow: var(--shadow-md); }
.shadow-lg { box-shadow: var(--shadow-lg); }
.shadow-xl { box-shadow: var(--shadow-xl); }

.hover\:shadow-lg:hover { box-shadow: var(--shadow-lg); }

/* ============================================================================
   12. SIZING UTILITIES
   ============================================================================ */

.w-full { width: 100%; }
.w-fit { width: fit-content; }
.w-6 { width: 1.5rem; }
.w-10 { width: 2.5rem; }
.w-12 { width: 3rem; }
.w-16 { width: 4rem; }

.h-0-5 { height: 0.125rem; }
.h-0\.5 { height: 0.125rem; }
.h-10 { height: 2.5rem; }
.h-12 { height: 3rem; }
.h-16 { height: 4rem; }
.h-48 { height: 12rem; }

.max-w-2xl { max-width: 42rem; }
.max-w-3xl { max-width: 48rem; }
.max-w-4xl { max-width: 56rem; }
.max-w-7xl { max-width: 80rem; }

.min-h-screen { min-height: 100vh; }

/* ============================================================================
   13. EFFECTS & TRANSITIONS
   ============================================================================ */

.transition-colors { transition: color 0.2s ease, background-color 0.2s ease, border-color 0.2s ease; }
.transition-shadow { transition: box-shadow 0.2s ease; }
.transition-opacity { transition: opacity 0.2s ease; }
.transition-all { transition: all 0.2s ease; }

.hover\:text-primary:hover { color: var(--color-primary); }
.hover\:text-white:hover { color: var(--color-surface); }
.hover\:opacity-80:hover { opacity: 0.8; }
.hover\:bg-primary-50:hover { background-color: var(--color-primary-50); }
.hover\:bg-primary-700:hover { background-color: var(--color-primary-700); }
.hover\:bg-accent-600:hover { background-color: var(--color-accent-600); }

.opacity-75 { opacity: 0.75; }
.opacity-80 { opacity: 0.8; }
.opacity-90 { opacity: 0.9; }
.opacity-95 { opacity: 0.95; }

.lg\:scale-105 { transform: scale(1.05); }

/* ============================================================================
   14. FORM STYLES
   ============================================================================ */

input[type="text"],
input[type="email"],
input[type="tel"],
select,
textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-gray-300);
  border-radius: 0.375rem;
  font-family: inherit;
  font-size: var(--font-size-base);
  transition: all 0.2s ease;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(175, 0, 0, 0.1);
}

input:disabled,
textarea:disabled,
select:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

textarea {
  resize: none;
  font-family: inherit;
}

.resize-none { resize: none; }

label {
  display: block;
  font-size: var(--font-size-sm);
  font-weight: 600;
  color: var(--color-heading);
  margin-bottom: 0.5rem;
}

/* ============================================================================
   15. TABLE STYLES
   ============================================================================ */

table {
  width: 100%;
  border-collapse: collapse;
}

thead {
  border-bottom: 2px solid var(--color-gray-300);
}

th {
  padding: 1rem;
  text-align: left;
  font-weight: 700;
  color: var(--color-heading);
}

td {
  padding: 1rem;
  border-bottom: 1px solid var(--color-gray-200);
}

tbody tr:last-child td {
  border-bottom: none;
}

/* ============================================================================
   16. ANIMATIONS
   ============================================================================ */

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

.fade-in-left {
  animation: fadeInLeft 0.6s ease-out;
}

.animate-on-scroll {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.animate-on-scroll.animated {
  opacity: 1;
  transform: translateY(0);
}

/* ============================================================================
   17. MISCELLANEOUS
   ============================================================================ */

.overflow-x-auto { overflow-x: auto; }
.overflow-hidden { overflow: hidden; }
.object-cover { object-fit: cover; }
.whitespace-nowrap { white-space: nowrap; }

.list-disc { list-style-type: disc; }
.list-inside { list-style-position: inside; }

/* ============================================================================
   18. RESPONSIVE BREAKPOINTS
   ============================================================================ */

/* Small screens: 640px and up */
@media (min-width: 640px) {
  .sm\:flex { display: flex; }
  .sm\:flex-row { flex-direction: row; }
  .sm\:inline { display: inline; }
  .sm\:gap-2 { gap: 0.5rem; }
  .sm\:gap-3 { gap: 0.75rem; }
  .sm\:gap-4 { gap: 1rem; }
}

/* Medium screens: 768px and up */
@media (min-width: 768px) {
  .md\:flex { display: flex; }
  .md\:hidden { display: none; }
  .md\:flex-row { flex-direction: row; }
  .md\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .md\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .md\:gap-4 { gap: 1rem; }
  .md\:gap-6 { gap: 1.5rem; }
  .md\:gap-8 { gap: 2rem; }
  .md\:px-8 { padding-left: 2rem; padding-right: 2rem; }
  .md\:py-16 { padding-top: 4rem; padding-bottom: 4rem; }
  .md\:py-24 { padding-top: 6rem; padding-bottom: 6rem; }
  .md\:text-lg { font-size: var(--font-size-lg); }
  .md\:text-6xl { font-size: var(--font-size-6xl); }
  .md\:text-5xl { font-size: var(--font-size-5xl); }
  .md\:justify-end { justify-content: flex-end; }
  .md\:col-span-1 { grid-column: span 1; }
  .md\:col-span-2 { grid-column: span 2; }
}

/* Large screens: 1024px and up */
@media (min-width: 1024px) {
  .lg\:flex { display: flex; }
  .lg\:hidden { display: none; }
  .lg\:grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lg\:grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .lg\:grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .lg\:grid-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
  .lg\:grid-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }
  .lg\:col-span-1 { grid-column: span 1; }
  .lg\:gap-8 { gap: 2rem; }
  .lg\:px-16 { padding-left: 4rem; padding-right: 4rem; }
  .lg\:py-32 { padding-top: 8rem; padding-bottom: 8rem; }
  .lg\:text-5xl { font-size: var(--font-size-5xl); }
  .lg\:text-6xl { font-size: var(--font-size-6xl); }
  .lg\:scale-105 { transform: scale(1.05); }
}

/* ============================================================================
   19. CUSTOM SCROLLBAR
   ============================================================================ */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
  background: #888;
  border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
  background: #555;
}

/* ============================================================================
   20. PROSE/MARKDOWN STYLES
   ============================================================================ */

.prose,
.prose-lg {
  font-size: var(--font-size-base);
  line-height: 1.75;
}

.prose-lg {
  font-size: var(--font-size-lg);
}

.prose ul,
.prose ol {
  margin-bottom: 1.5rem;
  margin-left: 1.5rem;
}

.prose li {
  margin-bottom: 0.5rem;
}

.prose ul li {
  list-style-type: disc;
  list-style-position: outside;
}

.prose ol li {
  list-style-type: decimal;
  list-style-position: outside;
}

/* ============================================================================
   21. UTILITY CLASSES FOR SPECIFIC PATTERNS
   ============================================================================ */

/* Success State Colors */
.bg-green-50 { background-color: var(--color-green-50); }
.text-green-600 { color: var(--color-green-600); }
.text-green-700 { color: var(--color-green-700); }
.border-green-200 { border-color: #dcfce7; }

/* Hamburger Menu Animation */
.hamburger-bar {
  display: block;
  transition: all 0.3s ease;
  transform-origin: center;
}

#hamburger-btn.open .hamburger-bar:nth-child(1) {
  transform: rotate(45deg) translateY(8px);
}

#hamburger-btn.open .hamburger-bar:nth-child(2) {
  opacity: 0;
}

#hamburger-btn.open .hamburger-bar:nth-child(3) {
  transform: rotate(-45deg) translateY(-8px);
}

/* ============================================================================
   22. MOBILE MENU STYLES
   ============================================================================ */

/* Mobile: show hamburger, hide menu by default */
@media (max-width: 767px) {
  /* Show hamburger - override BeTheme's high-specificity display:none */
  #Top_bar a.responsive-menu-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0 !important;
    position: absolute;
    right: 10px;
    top: 50%;
    margin-top: -20px;
    z-index: 300;
  }

  /* Hide the broken font icon (mfn-icons font missing) */
  #Top_bar a.responsive-menu-toggle i {
    display: none !important;
  }

  /* CSS-only hamburger icon (3 lines) */
  #Top_bar a.responsive-menu-toggle::before,
  #Top_bar a.responsive-menu-toggle::after {
    content: '';
    display: block;
    width: 24px;
    height: 3px;
    background-color: #333;
    border-radius: 2px;
    position: absolute;
    left: 8px;
    transition: all 0.3s ease;
  }

  #Top_bar a.responsive-menu-toggle::before {
    top: 10px;
    box-shadow: 0 9px 0 #333;
  }

  #Top_bar a.responsive-menu-toggle::after {
    bottom: 10px;
  }

  /* Animate to X when open */
  #Top_bar a.responsive-menu-toggle.open::before {
    top: 18px;
    transform: rotate(45deg);
    box-shadow: none;
  }

  #Top_bar a.responsive-menu-toggle.open::after {
    bottom: 18px;
    transform: rotate(-45deg);
  }

  /* Hide menu by default on mobile */
  #Top_bar #menu {
    display: none !important;
    background-color: #ffffff;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    z-index: 1000;
  }

  /* Show menu when JS adds .open class */
  #Top_bar #menu.open {
    display: block !important;
  }

  /* Menu item layout on mobile */
  #Top_bar #menu ul.menu-main > li {
    display: block;
    width: 100%;
    border-bottom: 1px solid #eee;
  }

  #Top_bar #menu ul.menu-main > li > a {
    display: block;
    padding: 12px 16px;
  }

  /* Submenu */
  #Top_bar #menu .sub-menu {
    background-color: #f5f5f5;
    padding-left: 16px;
    display: none;
  }
}

/* Desktop: hide hamburger, show menu */
@media (min-width: 768px) {
  #Top_bar a.responsive-menu-toggle {
    display: none !important;
  }

  #Top_bar #menu {
    display: flex !important;
  }
}

/* ============================================================================
   23. FIX ELEMENTOR STRETCHED SECTIONS
   ============================================================================ */

@media (max-width: 1024px) {
  .elementor-section.elementor-section-stretched {
    width: 100% !important;
    left: 0 !important;
  }
}

/* ============================================================================
   24. GLOBAL CONTAINER FIXES (Tablet + Mobile)
   ============================================================================ */

@media (max-width: 1024px) {
  body {
    min-width: 0 !important;
  }

  html,
  body {
    overflow-x: hidden;
  }

  #Wrapper {
    max-width: 100% !important;
    overflow-x: hidden !important;
  }

  .container,
  .section_wrapper {
    max-width: 100% !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
    box-sizing: border-box !important;
  }
}

/* ============================================================================
   25. COLUMN STACKING
   ============================================================================ */

/* Mobile: all columns stack to full width */
@media (max-width: 767px) {
  .elementor-column {
    width: 100% !important;
    flex-basis: 100% !important;
  }

  .elementor-section .elementor-container {
    flex-wrap: wrap !important;
  }

  .elementor-inner-section .elementor-container {
    flex-wrap: wrap !important;
  }

  /* Hide spacer columns (16% side columns) */
  .elementor-column.elementor-col-16 {
    display: none !important;
  }
}

/* Tablet: preserve 2-col layouts, but stack narrow/wide */
@media (min-width: 768px) and (max-width: 1024px) {
  .elementor-section .elementor-container {
    flex-wrap: wrap !important;
  }

  /* Spacer columns hidden on tablet too */
  .elementor-column.elementor-col-16 {
    display: none !important;
  }

  /* 66% column becomes full width when spacers are hidden */
  .elementor-column.elementor-col-66 {
    width: 100% !important;
    flex-basis: 100% !important;
  }

  /* 33% columns become 50% on tablet */
  .elementor-column.elementor-col-33 {
    width: 50% !important;
    flex-basis: 50% !important;
  }
}

/* ============================================================================
   26. IMAGE RESPONSIVENESS
   ============================================================================ */

@media (max-width: 1024px) {
  .elementor-widget-image img,
  .elementor-image img,
  .content_wrapper img,
  img.scale-with-grid {
    max-width: 100% !important;
    height: auto !important;
  }
}

@media (max-width: 767px) {
  .elementor-widget-image img {
    margin: 0 auto !important;
    display: block !important;
  }

  /* Constrain hero image height */
  .elementor-widget-image img[src*="qualichart_controle_interno"] {
    max-height: 350px !important;
    width: auto !important;
  }
}

/* ============================================================================
   27. VIDEO EMBED RESPONSIVENESS
   ============================================================================ */

@media (max-width: 1024px) {
  .elementor-widget-video .elementor-wrapper,
  .elementor-widget-video .elementor-wrapper iframe {
    width: 100% !important;
    max-width: 100% !important;
  }
}

/* ============================================================================
   28. COUNTER SECTION
   ============================================================================ */

@media (max-width: 767px) {
  .elementor-counter .elementor-counter-number-wrapper {
    font-size: 36px !important;
    justify-content: center !important;
  }

  .elementor-counter .elementor-counter-title {
    font-size: 14px !important;
  }

  .elementor-widget-counter .elementor-widget-container {
    text-align: center;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .elementor-counter .elementor-counter-number-wrapper {
    font-size: 42px !important;
  }
}

/* ============================================================================
   29. CLIENT LOGO GALLERY
   ============================================================================ */

@media (max-width: 767px) {
  .gallery.gallery-columns-4 .gallery-item,
  [id^="sc_gallery"] .gallery-item {
    width: 50% !important;
    float: left !important;
  }
}

/* ============================================================================
   30. TYPOGRAPHY
   ============================================================================ */

@media (max-width: 767px) {
  .elementor-heading-title {
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
  }

  .elementor-widget-container {
    word-wrap: break-word;
    overflow-wrap: break-word;
  }

  /* Prevent large headings from overflowing */
  h1.elementor-heading-title,
  .elementor-size-xxl {
    font-size: 28px !important;
    line-height: 1.3 !important;
  }

  h2.elementor-heading-title,
  .elementor-size-xl {
    font-size: 22px !important;
    line-height: 1.3 !important;
  }

  h3.elementor-heading-title {
    font-size: 18px !important;
    line-height: 1.4 !important;
  }

  .elementor-widget-text-editor {
    font-size: 15px;
    line-height: 1.6;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  h1.elementor-heading-title,
  .elementor-size-xxl {
    font-size: 34px !important;
    line-height: 1.2 !important;
  }

  h2.elementor-heading-title,
  .elementor-size-xl {
    font-size: 28px !important;
    line-height: 1.3 !important;
  }
}

/* ============================================================================
   31. CTA BUTTONS
   ============================================================================ */

@media (max-width: 767px) {
  .elementor-button {
    padding: 14px 24px !important;
    font-size: 14px !important;
    width: 100% !important;
    text-align: center !important;
    box-sizing: border-box !important;
    min-height: 44px !important;
  }

  .elementor-button-wrapper {
    text-align: center !important;
  }

  /* Top bar CTA button */
  .top_bar_right .action_button {
    display: block !important;
    float: none !important;
    text-align: center !important;
    margin: 8px auto !important;
    width: auto !important;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .elementor-button {
    padding: 16px 32px !important;
  }
}

/* ============================================================================
   32. FOOTER RESPONSIVE
   ============================================================================ */

@media (max-width: 767px) {
  #Footer .widgets_wrapper .container {
    padding: 0 16px !important;
  }

  #Footer .widgets_wrapper .column {
    width: 100% !important;
    padding: 16px 0 !important;
    float: none !important;
  }

  #Footer .widgets_wrapper {
    text-align: center;
  }
}

/* ============================================================================
   33. SECTION PADDING & SPACING
   ============================================================================ */

@media (max-width: 767px) {
  .elementor-section > .elementor-container {
    padding: 0 8px;
  }

  .elementor-column > .elementor-element-populated {
    padding: 10px 8px;
  }

  /* Reduce excessive section padding */
  .elementor-section {
    padding-left: 0 !important;
    padding-right: 0 !important;
  }
}

@media (min-width: 768px) and (max-width: 1024px) {
  .elementor-column > .elementor-element-populated {
    padding: 15px 10px !important;
  }
}

/* ============================================================================
   34. RESPONSIVE TEXT UTILITIES
   ============================================================================ */

@media (max-width: 767px) {
  .hide-mobile { display: none; }
}

@media (min-width: 1024px) {
  .hide-desktop { display: none; }
}
