/* === VARIABLES & RESET === */
:root {
  --primary-color: #0078d4;
  --primary-dark: #005fa3;
  --text-dark: #333333;
  --text-light: #666666;
  --bg-white: #ffffff;
  --bg-light: #f4f7f6;
  --white: #ffffff;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.12);
  --radius: 12px;
  --transition: all 0.3s ease;
  --font-main: 'Poppins', sans-serif;
  /* Dark Mode Variables */
  --bg-dark: #1a1a1a;
  --bg-card-dark: #2d2d2d;
  --text-primary-dark: #f0f0f0;
  --text-secondary-dark: #a0a0a0;

  --container-width: 1200px;
}



/* Theme Toggle Button */
/* Switch Container */
.theme-switch-wrapper {
  display: flex;
  align-items: center;
  margin-right: 15px;
}

.theme-switch {
  display: inline-block;
  height: 26px;
  position: relative;
  width: 50px;
}

.theme-switch input {
  display: none;
}

.switch-slider {
  background-color: #ccc;
  bottom: 0;
  cursor: pointer;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
  transition: .4s;
  border-radius: 34px;
}

.switch-slider:before {
  background-color: #fff;
  bottom: 4px;
  content: "";
  height: 18px;
  left: 4px;
  position: absolute;
  transition: .4s;
  width: 18px;
  border-radius: 50%;
}

/* Checked State */
input:checked+.switch-slider {
  background-color: var(--primary-color);
}

input:checked+.switch-slider:before {
  transform: translateX(24px);
}

/* Icons inside slider (optional) */
.slider-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 12px;
  color: #fff;
}

.icon-sun {
  left: 6px;
  opacity: 0;
  transition: .3s;
}

.icon-moon {
  right: 6px;
  opacity: 1;
  transition: .3s;
}

input:checked+.switch-slider .icon-sun {
  opacity: 1;
}

input:checked+.switch-slider .icon-moon {
  opacity: 0;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: var(--font-main);
  color: var(--text-dark);
  background-color: var(--bg-white);
  line-height: 1.6;
  overflow-x: hidden;
  /* Prevent horizontal scroll */
  width: 100%;
}

img {
  max-width: 100%;
  display: block;
  height: auto;
  /* Ensure aspect ratio */
}

a {
  text-decoration: none;
  color: inherit;
}

ul {
  list-style: none;
}

/* === UTILITIES === */
.container {
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 20px;
}

.btn,
.btn-primary {
  display: inline-block;
  background: var(--primary-color);
  color: var(--white);
  padding: 12px 24px;
  border-radius: 6px;
  font-weight: 500;
  transition: var(--transition);
  border: none;
  cursor: pointer;
}

.btn:hover,
.btn-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.btn-sm {
  display: inline-block;
  background: var(--primary-color);
  color: var(--white);
  padding: 6px 14px;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 500;
  transition: var(--transition);
  text-decoration: none;
  margin-top: 10px;
}

.btn-sm:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.section-title {
  text-align: center;
  color: var(--primary-color);
  font-size: 2.5rem;
  margin-bottom: 1rem;
  font-weight: 600;
}

.section-lead {
  text-align: center;
  max-width: 800px;
  margin: 0 auto 3rem auto;
  color: var(--text-light);
  font-size: 1.125rem;
}

/* === HEADER / HERO === */
.hero {
  position: relative;
  color: var(--white);
  text-align: center;
  padding: 180px 20px 140px;
  min-height: 90vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  overflow: hidden;
}

/* Gradient Text Effect */
.gradient-text {
  background: linear-gradient(135deg, #ffffff 0%, #e0e0e0 100%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  animation: heroBg 20s infinite ease-in-out;
  z-index: -2;
}

.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.5));
  z-index: -1;
}

@keyframes heroBg {
  0% {
    background-image: url('../img/banner_1.jpg.jpg');
  }

  33% {
    background-image: url('../img/banner_2.png');
  }

  66% {
    background-image: url('../img/banner_3.webp');
  }

  100% {
    background-image: url('../img/banner_4.jpg');
  }
}

/* Sticky Navbar */
.navbar {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 1200px;
  padding: 15px 30px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-radius: 50px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  transition: var(--transition);
}

.logo {
  height: 45px;
  filter: none;
}

/* Wave Divider */
.custom-shape-divider-bottom-16899 {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  overflow: hidden;
  line-height: 0;
  transform: rotate(180deg);
}

.custom-shape-divider-bottom-16899 svg {
  position: relative;
  display: block;
  width: calc(100% + 1.3px);
  height: 50px;
  /* Reduced height for mobile by default, query can increase it */
}

@media (min-width: 768px) {
  .custom-shape-divider-bottom-16899 svg {
    height: 100px;
  }
}

.custom-shape-divider-bottom-16899 .shape-fill {
  fill: var(--bg-light);
}

.hero-content {
  max-width: 800px;
  z-index: 1;
}

.hero-content h1 {
  font-size: 3.5rem;
  margin-bottom: 20px;
  font-weight: 700;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.hero-content p {
  font-size: 1.25rem;
  margin-bottom: 40px;
  opacity: 0.95;
}

/* === SECTIONS GENERAL === */
section {
  padding: 100px 0;
}

/* === QUIENES SOMOS === */
.quienes-somos-section {
  background-color: var(--bg-light);
  text-align: center;
}

.quienes-somos-section .descripcion {
  font-size: 1.25rem;
  color: var(--text-light);
  line-height: 1.8;
  max-width: 900px;
  margin: 0 auto;
}

.quienes-somos-section strong {
  color: var(--primary-color);
}

/* === PRODUCTOS (Solutions) === */
.productos {
  background-color: var(--bg-white);
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 40px;
  margin-top: 40px;
}

.card {
  background: var(--white);
  border-radius: 16px;
  padding: 40px 30px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.05);
  transition: all 0.4s ease;
  text-align: center;
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
}

.card:hover {
  transform: translateY(-15px) scale(1.02);
  box-shadow: 0 20px 40px rgba(0, 120, 212, 0.15);
  border-color: rgba(0, 120, 212, 0.1);
}

.card img {
  height: 220px;
  object-fit: contain;
  margin-bottom: 30px;
  width: 100%;
  transition: transform 0.5s ease;
}

.card:hover img {
  transform: scale(1.1);
}

.card h3 {
  font-size: 1.6rem;
  margin-bottom: 15px;
  color: var(--text-dark);
}

.card p {
  color: var(--text-light);
  font-size: 0.95rem;
}

/* === DMR INFO === */
#dmr-info {
  background-color: var(--bg-light);
}

.dmr-columns {
  display: flex;
  flex-wrap: wrap;
  gap: 60px;
  margin-bottom: 80px;
}

.dmr-column {
  flex: 1;
  min-width: 300px;
  background: var(--white);
  padding: 40px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

.dmr-column h3 {
  color: var(--primary-color);
  font-size: 1.5rem;
  margin-bottom: 25px;
  padding-bottom: 15px;
  border-bottom: 2px solid var(--bg-light);
}

.dmr-list li {
  margin-bottom: 20px;
  padding-left: 30px;
  position: relative;
}

.dmr-list li::before {
  content: "✔";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--primary-color);
  font-weight: bold;
}

.dmr-list li strong {
  display: block;
  color: var(--text-dark);
  font-size: 1.05rem;
  margin-bottom: 4px;
}

/* DMR Product Grid */
.dmr-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 30px;
  margin-bottom: 80px;
}

.dmr-product-card {
  background: var(--white);
  padding: 20px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: var(--transition);
  text-align: center;
}

.dmr-product-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.dmr-product-card h4 {
  margin-top: 15px;
  color: var(--text-dark);
}

/* === RESOURCES / BROCHURES === */
.video-section {
  display: flex;
  gap: 30px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 40px;
}

.video-minimal {
  flex: 1;
  min-width: 300px;
  text-align: center;
}

.video-minimal h3 {
  color: var(--primary-color);
  margin-bottom: 20px;
  font-size: 1.75rem;
}

.video-minimal video {
  width: 100%;
  height: 350px;
  object-fit: cover;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
}

/* === BANNER === */
.banner-dinamico {
  width: 100%;
  height: 400px;
  overflow: hidden;
  margin: 60px 0;
}

.slider .slides {
  display: flex;
  width: 50%;
  /* Adjust based on image count */
  animation: slideShow 25s linear infinite;
}

.slider .slides img {
  width: 100%;
  height: 400px;
  object-fit: cover;
}

@keyframes slideShow {
  0% {
    transform: translateX(0);
  }

  100% {
    transform: translateX(-100%);
  }
}

/* === CONTACT === */
.contacto {
  background-color: var(--bg-white);
  padding: 100px 0;
}

form {
  max-width: 600px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

input,
textarea {
  padding: 15px 20px;
  border: 2px solid #eee;
  border-radius: 8px;
  font-family: inherit;
  font-size: 1rem;
  transition: var(--transition);
}

input:focus,
textarea:focus {
  border-color: var(--primary-color);
  outline: none;
}

/* === FOOTER === */
footer {
  background: #222;
  color: #aaa;
  padding: 60px 20px;
  text-align: center;
}

footer h3 {
  color: var(--white);
  margin-bottom: 10px;
}

footer p strong {
  color: var(--white);
}



/* === PRODUCT FEATURE IMAGES === */
.product-feature-img {
  width: 100%;
  height: 300px;
  /* Increased height for better visibility */
  object-fit: contain;
  /* Ensures the WHOLE image is visible */
  border-radius: var(--radius);
  margin-bottom: 20px;
  background-color: #fff;
  /* Clean background for transparent images */
  border: 1px solid #eee;
  /* Subtle border to define the area */
  display: block;
}

/* === PRODUCT TABS === */
.product-detail-container {
  margin-top: 20px;
  text-align: left;
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid #eee;
}

.tabs {
  display: flex;
  background: #f8f9fa;
  border-bottom: 1px solid #ddd;
}

.tab-btn {
  flex: 1;
  padding: 15px 10px;
  border: none;
  background: none;
  cursor: pointer;
  font-weight: 600;
  color: var(--text-light);
  transition: all 0.3s;
  font-family: var(--font-main);
  font-size: 0.9rem;
}

.tab-btn:hover {
  background: #e9e9e9;
  color: var(--primary-color);
}

.tab-btn.active {
  background: var(--white);
  color: var(--primary-color);
  border-top: 3px solid var(--primary-color);
  border-bottom: 1px solid transparent;
  margin-bottom: -1px;
}

.tab-content {
  display: none;
  padding: 20px;
  font-size: 0.9rem;
  color: var(--text-dark);
  max-height: 400px;
  /* Scrollable if too long */
  overflow-y: auto;
}

.tab-content.active {
  display: block;
  animation: fadeIn 0.3s ease-in;
}

.tab-content p {
  margin-bottom: 1em;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(5px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === SPECS TABLE === */
.specs-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.85rem;
}

.specs-section-header {
  background-color: #eef4fa;
  font-weight: 700;
  padding: 10px;
  color: var(--primary-dark);
  text-align: center;
}

.specs-table td {
  padding: 8px 12px;
  border-bottom: 1px solid #f0f0f0;
  vertical-align: top;
}

.specs-table tr:hover td {
  background-color: #fafafa;
}

.specs-label {
  font-weight: 600;
  color: #555;
  width: 40%;
}

/* Feature List in Tabs */
.feature-item {
  margin-bottom: 20px;
}

.feature-item h4 {
  color: var(--primary-color);
  font-size: 1rem;
  margin-bottom: 5px;
  font-weight: 600;
}

.feature-item p {
  font-size: 0.9rem;
  color: #666;
  margin-bottom: 0;
  line-height: 1.5;
}

/* === RESPONSIVE === */
@media (max-width: 1024px) {
  .hero-content h1 {
    font-size: 3rem;
  }

  section {
    padding: 80px 0;
  }
}

@media (max-width: 768px) {

  /* Navigation */
  .navbar {
    width: 95%;
    padding: 10px 20px;
    flex-direction: column;
    gap: 15px;
    background: rgba(255, 255, 255, 0.98);
  }

  /* Hero */
  .hero {
    padding: 140px 20px 80px;
    min-height: auto;
  }

  .hero-content h1 {
    font-size: 2.2rem;
  }

  .hero-content p {
    font-size: 1rem;
    margin-bottom: 30px;
  }

  /* Typography */
  .section-title {
    font-size: 2rem;
  }

  .section-lead {
    font-size: 1rem;
    margin-bottom: 2rem;
  }

  /* DMR Section */
  .dmr-columns {
    gap: 30px;
  }

  .dmr-column {
    padding: 30px;
  }

  /* Video Section */
  .video-section {
    flex-direction: column;
  }

  .video-minimal video {
    height: auto;
    aspect-ratio: 16/9;
  }

  /* Tabs */
  .tabs {
    flex-wrap: wrap;
  }

  .tab-btn {
    flex: 1 1 50%;
    /* 2 per row */
    font-size: 0.85rem;
    padding: 12px 5px;
    text-align: center;
  }
}

@media (max-width: 480px) {

  /* Navbar adjustments for very small screens */
  .navbar .logo {
    height: 35px;
  }

  .btn {
    padding: 10px 20px;
    font-size: 0.9rem;
  }

  /* Hero */
  .hero-content h1 {
    font-size: 1.8rem;
  }

  /* Cards */
  .card {
    padding: 25px 20px;
  }

  .card img {
    height: 180px;
  }

  /* Tabs */
  .tab-btn {
    flex: 1 1 100%;
    /* Stack vertically */
  }

  .tab-content {
    padding: 15px;
  }

  /* Specs Table */
  .specs-table {
    display: block;
    overflow-x: auto;
    /* Scroll horizontally */
    white-space: nowrap;
  }

  .specs-label {
    width: auto;
    padding-right: 15px;
  }

  /* Banner */
  .banner-dinamico {
    height: 250px;
  }

  .slider .slides img {
    height: 250px;
  }
}

/* ============================
   DARK MODE OVERRIDES (Global)
   ============================ */
body.dark-mode {
  --bg-white: var(--bg-dark);
  --bg-light: #252525;
  --white: var(--bg-card-dark);
  --text-dark: var(--text-primary-dark);
  --text-light: var(--text-secondary-dark);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
}

body.dark-mode .navbar {
  background: rgba(30, 30, 30, 0.95) !important;
  border-bottom: 1px solid #444;
}

body.dark-mode .theme-toggle {
  color: #fff;
}

body.dark-mode .theme-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
}

body.dark-mode .product-feature-img {
  background-color: transparent;
  border-color: #444;
}

/* Fix for specific sections failing to update */
body.dark-mode .quienes-somos-section,
body.dark-mode #dmr-info,
body.dark-mode .specs-section-header,
body.dark-mode .tabs {
  background-color: var(--bg-light) !important;
}

body.dark-mode .product-detail-container,
body.dark-mode .tab-btn.active {
  background-color: var(--white) !important;
  border-color: #444;
}

body.dark-mode .tab-btn {
  color: #aaa;
}

body.dark-mode .tab-btn:hover {
  background-color: #333;
}

body.dark-mode .card,
body.dark-mode .dmr-column,
body.dark-mode .dmr-product-card {
  border: 1px solid #444;
}

body.dark-mode input,
body.dark-mode textarea {
  background-color: #333;
  color: #fff;
  border-color: #555;
}

body.dark-mode .shape-fill {
  fill: var(--bg-light);
}

/* Ensure tabs content text is readable */
body.dark-mode .tab-content {
  color: var(--text-dark);
}

body.dark-mode .specs-table td {
  border-color: #444;
}

body.dark-mode .specs-table tr:hover td {
  background-color: #333;
}

/* Fix text contrast in Tabs (Features & Specs) */
body.dark-mode .feature-item h4,
body.dark-mode .specs-label {
  color: var(--primary-color);
  /* Keep primary or make lighter if needed */
}

body.dark-mode .feature-item p,
body.dark-mode .specs-table td {
  color: #e0e0e0;
}

/* Invert DMR Product Images to White */
body.dark-mode .dmr-product-card img {
  filter: brightness(0) invert(1);
  opacity: 0.9;
}

/* Fix Footer Text in Dark Mode */
body.dark-mode footer,
body.dark-mode footer h3,
body.dark-mode footer p,
body.dark-mode footer strong {
  color: #ffffff !important;
}

/* Fix Hero Text & Button in Dark Mode */
body.dark-mode .hero-content p {
  color: #ffffff !important;
  opacity: 1;
}

body.dark-mode .btn-primary {
  color: #ffffff !important;
}