/* ============================================================
   Integral Weighing Solutions — Premium Hybrid Theme CSS
   ============================================================ */
:root {
  /* Core Palette - Light Theme (Default Body) */
  --color-bg: #f8f9fa;
  --color-bg-card: #ffffff;
  --color-text: #1a1a1a;
  --color-text-muted: #555555;
  --color-border: #e0e0e0;

  /* Industrial Yellow Accent */
  --color-primary: #FFC107;
  --color-primary-hover: #ffca2c;
  --color-primary-text: #111111;

  /* Dark Theme Palette */
  --color-dark-bg: #0b0c10;
  --color-dark-surface: rgba(31, 40, 51, 0.7);
  --color-dark-text: #ffffff;
  --color-dark-text-muted: #a0aab2;
  --color-dark-border: rgba(255, 255, 255, 0.1);

  /* Typography */
  --font-heading: 'Barlow Condensed', sans-serif;
  --font-body: 'Inter', sans-serif;
  
  /* Radii & Shadows */
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 20px;
  --shadow-sm: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  --shadow-glow: 0 0 20px rgba(255, 193, 7, 0.3);

  /* Transitions */
  --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  --transition-smooth: 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

/* Dark Theme Overrides */
body.dark-theme {
  --color-bg: var(--color-dark-bg);
  --color-bg-card: rgba(20, 25, 30, 0.6);
  --color-text: var(--color-dark-text);
  --color-text-muted: var(--color-dark-text-muted);
  --color-border: var(--color-dark-border);
}

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

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

body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  transition: background-color var(--transition-smooth), color var(--transition-smooth);
  overflow-x: hidden;
}

a {
  color: inherit;
  text-decoration: none;
}

ul {
  list-style: none;
}

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

.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2rem;
}

.section {
  padding: 6rem 0;
}

/* ================== TYPOGRAPHY ================== */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.1;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

h1 {
  font-size: clamp(3rem, 5vw, 4.5rem);
  margin-bottom: 1.5rem;
  background: linear-gradient(to right, #ffffff, #a0aab2);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 1rem;
}

h3 {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.eyebrow {
  display: inline-block;
  font-size: 0.875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--color-primary);
  margin-bottom: 1rem;
}

/* ================== BUTTONS ================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-heading);
  font-size: 1.125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 1px;
  border-radius: var(--radius-sm);
  border: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition-fast);
  text-align: center;
}

.btn-primary {
  background-color: var(--color-primary);
  color: var(--color-primary-text);
  border-color: var(--color-primary);
}

.btn-primary:hover {
  background-color: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
}

.btn-ghost {
  background-color: transparent;
  color: var(--color-dark-text);
  border-color: rgba(255,255,255,0.3);
}

.btn-ghost:hover {
  background-color: rgba(255,255,255,0.1);
  border-color: #fff;
}

/* Card Button Overrides */
.btn-dark {
  background-color: #111 !important;
  color: #fff !important;
  border-color: #111 !important;
}
.btn-dark:hover {
  background-color: #333 !important;
  border-color: #333 !important;
}

.btn-wa {
  background-color: var(--color-primary) !important;
  color: var(--color-primary-text) !important;
  border-color: var(--color-primary) !important;
}
.btn-wa:hover {
  background-color: var(--color-primary-hover) !important;
  border-color: var(--color-primary-hover) !important;
  box-shadow: var(--shadow-glow);
}

.glow-effect {
  position: relative;
  overflow: hidden;
}
.glow-effect::after {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.3) 0%, transparent 60%);
  opacity: 0;
  transform: scale(0.5);
  transition: opacity 0.3s, transform 0.3s;
}
.glow-effect:hover::after {
  opacity: 1;
  transform: scale(1);
}

/* ================== LAYOUT & VIEWS ================== */
.view {
  display: none;
  opacity: 0;
  transition: opacity var(--transition-smooth);
}
.view.is-active {
  display: block;
  opacity: 1;
  animation: fadeIn 0.5s ease forwards;
}

/* Dark Sections (Hero & Footer) */
.dark-section {
  background-color: var(--color-dark-bg);
  color: var(--color-dark-text);
  position: relative;
  z-index: 1;
}

.hero-bg-mesh {
  position: absolute;
  top: 0; left: 0; width: 100%; height: 100%;
  background: 
    radial-gradient(circle at 15% 50%, rgba(255, 193, 7, 0.08), transparent 50%),
    radial-gradient(circle at 85% 30%, rgba(255, 255, 255, 0.05), transparent 50%);
  z-index: -1;
  pointer-events: none;
  animation: meshPulse 10s ease-in-out infinite alternate;
}

.opacity-50 { opacity: 0.5; }

/* ================== HEADER ================== */
.site-header {
  position: fixed;
  top: 0; left: 0; width: 100%;
  z-index: 100;
  padding: 1rem 0;
  transition: background-color var(--transition-fast), padding var(--transition-fast), backdrop-filter var(--transition-fast);
  background: rgba(11, 12, 16, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid rgba(255,255,255,0.05);
}

.site-header.scrolled {
  padding: 0.5rem 0;
  background: rgba(11, 12, 16, 0.95);
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.logo-text {
  font-family: var(--font-heading);
  font-size: 1.75rem;
  font-weight: 800;
  color: #fff;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}

.main-nav {
  display: flex;
  gap: 2rem;
}

.main-nav a {
  font-size: 0.9375rem;
  font-weight: 500;
  color: rgba(255,255,255,0.8);
  position: relative;
  transition: color var(--transition-fast);
}

.main-nav a:hover,
.main-nav a.active {
  color: #fff;
}

.main-nav a::after {
  content: '';
  position: absolute;
  bottom: -4px; left: 0;
  width: 0%;
  height: 2px;
  background-color: var(--color-primary);
  transition: width var(--transition-fast);
}
.main-nav a:hover::after { width: 100%; }

.header-actions {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* Theme Toggle */
.theme-toggle {
  background: transparent;
  border: none;
  color: rgba(255,255,255,0.8);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color var(--transition-fast), transform var(--transition-fast);
}
.theme-toggle:hover {
  color: var(--color-primary);
  transform: scale(1.1);
}

/* Mobile Nav Toggle */
.nav-toggle {
  display: none;
  background: transparent;
  border: none;
  width: 30px; height: 24px;
  position: relative;
  cursor: pointer;
  z-index: 101;
}
.nav-toggle span {
  position: absolute;
  height: 2px; width: 100%;
  background: #fff;
  border-radius: 2px;
  left: 0;
  transition: var(--transition-fast);
}
.nav-toggle span:nth-child(1) { top: 0; }
.nav-toggle span:nth-child(2) { top: 11px; }
.nav-toggle span:nth-child(3) { top: 22px; }

.main-nav.open ~ .header-actions .nav-toggle span:nth-child(1) { top: 11px; transform: rotate(45deg); }
.main-nav.open ~ .header-actions .nav-toggle span:nth-child(2) { opacity: 0; }
.main-nav.open ~ .header-actions .nav-toggle span:nth-child(3) { top: 11px; transform: rotate(-45deg); }


/* ================== HERO ================== */
.hero {
  padding: 10rem 0 6rem;
  min-height: 85vh;
  display: flex;
  align-items: center;
}

.hero-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.hero-copy p {
  font-size: 1.125rem;
  color: var(--color-dark-text-muted);
  margin-bottom: 2.5rem;
  max-width: 90%;
}

.hero-cta {
  display: flex;
  gap: 1rem;
  margin-bottom: 3rem;
}

.hero-points {
  display: flex;
  gap: 2.5rem;
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 2rem;
}

.stat-number {
  font-family: var(--font-heading);
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-primary);
  line-height: 1;
  margin-bottom: 0.25rem;
}

.stat-label {
  font-size: 0.875rem;
  color: var(--color-dark-text-muted);
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* Floating Image Animation */
.floating-img {
  animation: float 6s ease-in-out infinite;
  filter: drop-shadow(0 20px 30px rgba(0,0,0,0.5));
}

@keyframes float {
  0% { transform: translateY(0px); }
  50% { transform: translateY(-20px); }
  100% { transform: translateY(0px); }
}

@keyframes meshPulse {
  0% { opacity: 0.6; transform: scale(1); }
  100% { opacity: 1; transform: scale(1.05); }
}

/* ================== PRODUCT GRIDS ================== */
.section-head {
  text-align: center;
  margin-bottom: 4rem;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}
.section-head-left {
  text-align: left;
  margin-left: 0;
  margin-bottom: 2rem;
}

.cat-grid, .product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 2rem;
}

/* Glassmorphic Cards */
.cat-card, .p-card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.4s ease, border-color 0.4s ease;
  transform-style: preserve-3d;
  will-change: transform;
}

/* For dark mode specifically, enhance the glass effect */
body.dark-theme .cat-card, body.dark-theme .p-card {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.cat-card:hover, .p-card:hover {
  transform: translateY(-10px) scale(1.02);
  box-shadow: var(--shadow-lg);
  border-color: var(--color-primary);
  z-index: 2;
}

.cat-media, .p-media {
  background: rgba(0,0,0,0.03);
  padding: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  height: 250px;
}

body.dark-theme .cat-media, body.dark-theme .p-media {
  background: rgba(255,255,255,0.02);
}

.cat-media img, .p-media img {
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.5s ease;
  filter: drop-shadow(0 10px 15px rgba(0,0,0,0.1));
}

body.dark-theme .cat-media img, body.dark-theme .p-media img {
  filter: drop-shadow(0 10px 15px rgba(0,0,0,0.5));
}

.cat-card:hover img, .p-card:hover img {
  transform: scale(1.1) translateZ(20px);
}

.cat-badge {
  position: absolute;
  top: 1rem; left: 1rem;
  background: var(--color-primary);
  color: var(--color-primary-text);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  padding: 0.25rem 0.75rem;
  border-radius: 20px;
  z-index: 10;
  box-shadow: var(--shadow-sm);
}

.cat-body, .p-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.cat-body p, .p-body p {
  color: var(--color-text-muted);
  font-size: 0.9375rem;
  margin-bottom: 1.5rem;
  flex-grow: 1;
}

.cat-body .btn { width: 100%; }

.p-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.p-actions .btn {
  font-size: 0.875rem;
  padding: 0.5rem;
}

/* ================== CONTACT SECTION ================== */
.contact-wrap {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  align-items: center;
}

.contact-list li {
  display: flex;
  flex-direction: column;
  margin-bottom: 1.5rem;
}
.contact-list span {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--color-text-muted);
  font-weight: 600;
  margin-bottom: 0.25rem;
}
.contact-list a, .contact-list {
  font-size: 1.25rem;
  font-weight: 500;
}

/* Glass Form */
.glass-form {
  background: var(--color-bg-card);
  padding: 2.5rem;
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-md);
}

body.dark-theme .glass-form {
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  background: rgba(30, 35, 40, 0.4);
}

.field { margin-bottom: 1.5rem; }
.field label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

input, select, textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: rgba(0,0,0,0.02);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  color: var(--color-text);
  font-family: inherit;
  font-size: 1rem;
  transition: all var(--transition-fast);
}

body.dark-theme input, body.dark-theme select, body.dark-theme textarea {
  background: rgba(0,0,0,0.2);
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.1);
}

input.invalid {
  border-color: #ef4444;
  background: rgba(239, 68, 68, 0.05);
}

.form-note {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  text-align: center;
  margin-top: 1rem;
}

/* ================== CATEGORY VIEW ================== */
.category-hero {
  padding: 8rem 0 3rem;
  margin-bottom: 3rem;
}

.breadcrumb {
  font-size: 0.875rem;
  color: var(--color-dark-text-muted);
  margin-bottom: 2rem;
}
.breadcrumb a { transition: color var(--transition-fast); }
.breadcrumb a:hover { color: #fff; }
.breadcrumb b { color: var(--color-primary); }

.back-row {
  margin-top: 4rem;
  text-align: center;
}

/* ================== FOOTER ================== */
.site-footer {
  padding: 4rem 0 2rem;
  border-top: 1px solid rgba(255,255,255,0.05);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1.5fr;
  gap: 3rem;
  margin-bottom: 3rem;
}

.footer-grid h3 {
  color: #fff;
  font-size: 1.25rem;
  margin-bottom: 1.5rem;
}

.footer-about, .footer-legal, address, .footer-links a {
  color: var(--color-dark-text-muted);
  font-size: 0.9375rem;
}
.footer-legal { margin-top: 1rem; font-size: 0.8125rem; }

address { font-style: normal; line-height: 1.8; }
address a { color: #fff; }
address a:hover { color: var(--color-primary); }

.footer-links li { margin-bottom: 0.75rem; }
.footer-links a:hover { color: var(--color-primary); padding-left: 5px; }

.glass-wrap {
  background: rgba(255,255,255,0.05);
  padding: 0.5rem;
  border-radius: var(--radius-sm);
}

.footer-bottom {
  border-top: 1px solid rgba(255,255,255,0.1);
  padding-top: 1.5rem;
  display: flex;
  justify-content: space-between;
  color: var(--color-dark-text-muted);
  font-size: 0.875rem;
}

/* ================== MODAL ================== */
.modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal[hidden] { display: none; }

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
}

.modal-card {
  position: relative;
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  display: flex;
  flex-direction: column;
  animation: scaleUp 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

body.dark-theme .modal-card {
  background: var(--color-dark-bg);
  border: 1px solid var(--color-dark-border);
}

@keyframes scaleUp {
  from { transform: scale(0.95); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}

.modal-close {
  position: absolute;
  top: 1rem; right: 1rem;
  width: 32px; height: 32px;
  background: rgba(0,0,0,0.1);
  border: none;
  border-radius: 50%;
  font-size: 1.5rem;
  line-height: 1;
  color: var(--color-text);
  cursor: pointer;
  z-index: 10;
  transition: all var(--transition-fast);
}
.modal-close:hover {
  background: #ef4444;
  color: #fff;
  transform: rotate(90deg);
}

body.dark-theme .modal-close {
  background: rgba(255,255,255,0.1);
}

.modal-body {
  overflow-y: auto;
  padding: 2rem;
}

.modal-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  align-items: center;
  margin-bottom: 2rem;
}
.modal-head img {
  background: rgba(0,0,0,0.03);
  border-radius: var(--radius-md);
  padding: 1rem;
}
body.dark-theme .modal-head img { background: rgba(255,255,255,0.02); }

.spec-title {
  border-bottom: 2px solid var(--color-border);
  padding-bottom: 0.5rem;
  margin-bottom: 1rem;
}

.table-scroll { overflow-x: auto; }
.spec {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}
.spec th, .spec td {
  padding: 0.75rem;
  border-bottom: 1px solid var(--color-border);
  text-align: left;
}
.spec th {
  font-weight: 600;
  color: var(--color-text-muted);
  width: 40%;
}

/* ================== FLOATING WA ================== */
.wa-float {
  position: fixed;
  bottom: 2rem; right: 2rem;
  background: #25D366;
  color: #fff;
  width: 60px; height: 60px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(37, 211, 102, 0.4);
  z-index: 100;
  transition: transform var(--transition-fast);
}
.wa-float:hover {
  transform: scale(1.1) rotate(-5deg);
}

/* ================== ANIMATIONS (SCROLL) ================== */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: opacity, transform;
}
.reveal-on-scroll.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.delay-1 { transition-delay: 0.1s; }
.delay-2 { transition-delay: 0.2s; }
.delay-3 { transition-delay: 0.3s; }

@keyframes fadeIn {
  to { opacity: 1; }
}

/* ================== RESPONSIVE ================== */
@media (max-width: 992px) {
  .hero-inner, .contact-wrap, .modal-head {
    grid-template-columns: 1fr;
    gap: 2rem;
  }
  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .main-nav {
    position: fixed;
    top: 70px; left: 0; width: 100%;
    background: rgba(11, 12, 16, 0.98);
    backdrop-filter: blur(10px);
    flex-direction: column;
    align-items: center;
    padding: 2rem 0;
    gap: 1.5rem;
    transform: translateY(-150%);
    transition: transform var(--transition-smooth);
    border-bottom: 1px solid rgba(255,255,255,0.1);
  }
  .main-nav.open {
    transform: translateY(0);
  }
  .hero { padding: 8rem 0 4rem; text-align: center; }
  .hero-cta, .hero-points { justify-content: center; flex-wrap: wrap; }
  .footer-grid { grid-template-columns: 1fr; }
  
  .p-actions { grid-template-columns: 1fr; }
}
