/* ========================================== */
/* RESET Y ESTILOS BASE - MERTECH             */
/* ========================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

h1 {
  color: #d32f2f;
}

h2 {
  font-family: "Gill Sans", "Gill Sans MT", Calibri, "Trebuchet MS", sans-serif;
  font-size: 22px;
  color: #333333; /* Texto oscuro para el fondo claro */
}

/* MODO CLARO POR DEFECTO */
body {
  font-family: Arial, sans-serif;
  background-image: url('imagenes/fondoclaro.png'); /* FONDO CLARO */
  background-size: cover;
  background-position: center;
  background-attachment: fixed;
  background-color: #f4f4f4; 
  color: #333333; 
  transition: background 0.3s ease, color 0.3s ease;
  padding-top: 85px;
}

h3 {
  color: #d32f2f;
}

/* ========================================== */
/* HEADER FIJO                                */
/* ========================================== */

header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  background-color: rgba(255, 255, 255, 0.9); 
  backdrop-filter: blur(5px);
  color: #333333;
  padding: 15px 30px;
  z-index: 1000;
  transition: background-color 0.3s ease;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
  gap: 15px;
}

header img {
  height: 60px;
  margin-right: 5px;
  transition: height 0.3s ease;
}

header h1 {
  margin: 0;
  font-size: 26px;
  white-space: nowrap;
  transition: font-size 0.3s ease;
  color: #d32f2f;
}

header nav {
  margin: 0;
  flex: 1;
  display: flex;
  justify-content: flex-end;
}

.ul-nav {
  list-style: none;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 20px;
}

.li-nav {
  margin: 0;
}

.li-nav a {
  text-decoration: none;
  font-weight: bold;
  color: #333333;
  font-size: 16px;
  white-space: nowrap;
  transition: all 0.3s ease;
}

.li-nav a:hover {
  color: #d32f2f;
  transform: translateY(-2px);
}

.boton-todos {
  margin: 0;
}

.btn-todos {
  text-decoration: none;
  background-color: #d32f2f;
  color: white !important;
  padding: 8px 20px;
  border-radius: 25px;
  transition: all 0.3s ease;
  white-space: nowrap;
  font-size: 15px;
}

.btn-todos:hover {
  background-color: #8b0000;
  transform: scale(1.05);
  box-shadow: 0 4px 12px rgba(211, 47, 47, 0.5);
}

.dark-mode-btn {
  background: transparent;
  border: none;
  font-size: 26px;
  cursor: pointer;
  margin-left: 10px;
  padding: 6px 12px;
  border-radius: 50%;
  transition: all 0.3s ease;
  background-color: #e0e0e0;
  color: #333333;
  white-space: nowrap;
}

.dark-mode-btn:hover {
  transform: scale(1.1);
  background-color: #cccccc;
}

/* ========================================== */
/* SUBTÍTULO                                  */
/* ========================================== */

.subti {
  font-family: sans-serif;
  text-align: center;
  margin-top: 15px;
  margin-bottom: 10px;
  color: #333333;
  font-size: 18px;
  padding: 0 15px;
  text-shadow: 1px 1px 2px rgba(255,255,255,0.8);
}

/* ========================================== */
/* MENÚ / CATEGORÍAS                          */
/* ========================================== */

#menu {
  padding: 20px;
  background-color: rgba(255, 255, 255, 0.6); 
  border-radius: 15px;
  margin: 20px auto;
  max-width: 800px;
  margin-top: 20px;
  backdrop-filter: blur(4px);
  box-shadow: 0 5px 20px rgba(0,0,0,0.05);
}

#menu h2 {
  font-size: 24px;
  text-align: start;
  color: #333333;
  margin-bottom: 30px;
}

.menu-item {
  background-color: rgba(255, 255, 255, 0.8); 
  padding: 15px;
  margin-bottom: 10px;
  border-radius: 5px;
  transition: all 0.4s ease;
  color: #333333;
  border-left: 4px solid #d32f2f;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 120px;
  position: relative;
  overflow: hidden;
}

/* Filtro por defecto para apagar las fotos (SOLO ESCRITORIO) */
.item--1, .item--2, .item--3, .item--4 {
  background-blend-mode: multiply;
  filter: grayscale(80%) opacity(40%);
  transition: all 0.4s ease;
}

.menu-item h3, 
.menu-item p {
  background-color: rgba(255, 255, 255, 0.9); 
  padding: 8px 12px;
  border-radius: 5px;
  width: fit-content;
  transition: all 0.4s ease;
}

.menu-item h3 {
  margin-bottom: 8px;
  color: #d32f2f;
  font-size: 20px;
}

.menu-item p {
  color: #444444;
  font-size: 14px;
  line-height: 1.4;
  opacity: 1;
}

/* IMÁGENES DE FONDO */
.item--1 { background-image: url("imagenes/perifericos.png"); background-size: cover; background-position: center; }
.item--2 { background-image: url("imagenes/insumos.png"); background-size: cover; background-position: center; }
.item--3 { background-image: url("imagenes/cables.png"); background-size: cover; background-position: center; }
.item--4 { background-image: url("imagenes/reparacion.png"); background-size: cover; background-position: center; }

/* HOVER ESCRITORIO */
@media (min-width: 769px) {
  .menu-item:hover {
    padding: 60px 15px; 
    background-color: rgba(255, 255, 255, 0.1); 
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    opacity: 1;
    cursor: pointer;
    z-index: 10;
  }

  .menu-item:hover.item--1, 
  .menu-item:hover.item--2, 
  .menu-item:hover.item--3, 
  .menu-item:hover.item--4 {
    filter: grayscale(0%) opacity(100%);
  }

  .menu-item:hover h3, 
  .menu-item:hover p {
    background-color: transparent;
    text-shadow: 1px 1px 3px #ffffff, 0 0 10px #ffffff; 
  }
}

.menu-item-link {
  text-decoration: none;
}

/* ========================================== */
/* SECCIONES (SOBRE NOSOTROS Y CONTACTO)      */
/* ========================================== */

#about, 
#contact {
  background-color: rgba(255, 255, 255, 0.7); 
  backdrop-filter: blur(10px);
  border: 1px solid rgba(0, 0, 0, 0.05);
  border-left: 5px solid #d32f2f;
  border-radius: 15px;
  padding: 40px 30px;
  max-width: 800px;
  margin: 60px auto;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
  text-align: center;
  animation: fadeInUp 0.8s ease-out forwards;
  opacity: 0;
  transform: translateY(20px);
}

#contact {
  display: flex;
  flex-direction: column;
  align-items: center;
}

#about h2, 
#contact h2 {
  margin-bottom: 25px;
  font-size: 28px;
  color: #333333;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.texto-ajustado {
  max-width: 650px;
  margin: 0 auto;
}

#about p {
  font-size: 16px;
  line-height: 1.7;
  color: #555555;
  text-align: center;
  margin: 0;
}

#contact .contact-buttons {
  justify-content: center;
  margin-top: 10px;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ========================================== */
/* BOTÓN PRINCIPAL "VER TODOS"                */
/* ========================================== */

.container-boton-todos {
  text-align: center;
  margin-top: 200px;
  margin-bottom: 20px;
}

.btn-todos-principal {
  display: inline-block;
  background: linear-gradient(135deg, #d32f2f, #8b0000);
  color: white;
  text-decoration: none;
  padding: 12px 28px;
  border-radius: 50px;
  font-size: 16px;
  font-weight: bold;
  transition: all 0.3s ease;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
}

.btn-todos-principal:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 25px rgba(211, 47, 47, 0.4);
  background: linear-gradient(135deg, #e53935, #b71c1c);
}

/* ========================================== */
/* FOOTER                                     */
/* ========================================== */

footer {
  background-color: rgba(0, 0, 0, 0.9);
  color: #ffffff;
  text-align: center;
  padding: 10px;
  margin-top: 20px;
  transition: background-color 0.3s ease;
}

/* ========================================== */
/* BOTONES DE CONTACTO                        */
/* ========================================== */

.btn-whatsapp, .btn-instagram, .btn-email {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background-color: transparent;
  border: none;
  padding: 12px 25px;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.3s ease;
  margin: 10px 0;
}

.btn-whatsapp img, .btn-instagram img, .btn-email img {
  width: 64px;
  height: 64px;
  background: transparent;
  mix-blend-mode: multiply; 
}

.btn-whatsapp:hover { background-color: rgba(37, 211, 102, 0.1); transform: scale(1.05); box-shadow: 0 5px 15px rgba(37, 211, 101, 0.5); }
.btn-instagram:hover { background-color: rgba(225, 48, 108, 0.1); transform: scale(1.05); box-shadow: 0 5px 15px rgba(225, 48, 108, 0.2); }
.btn-email:hover { background-color: rgba(211, 47, 47, 0.1); transform: scale(1.05); box-shadow: 0 5px 15px rgba(211, 47, 47, 0.3); }

.contact-buttons {
  display: flex;
  gap: 20px;
  align-items: center;
  flex-wrap: wrap;
  margin: 10px 0;
}

/* ========================================== */
/* TARJETAS DE PRODUCTO (MODO CLARO)          */
/* ========================================== */

.producto-card {
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(211, 47, 47, 0.2);
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

@media (min-width: 769px) {
  .producto-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 35px rgba(211, 47, 47, 0.2);
    border: 1px solid rgba(211, 47, 47, 0.5);
  }
  .producto-card:hover .producto-imagen {
    transform: scale(1.05);
  }
}

.producto-imagen {
  height: 250px;
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  transition: transform 0.5s ease;
  background-color: #ffffff;
  margin: 10px;
  border-radius: 10px;
}

.producto-info h3 { color: #d32f2f; }
.producto-categoria { color: #666666; }

/* ========================================== */
/* MODO OSCURO                                */
/* ========================================== */

body.dark-mode {
  background-image: url('imagenes/fondopage.png'); 
  background-color: #111111;
  color: #f5f5f5;
}

body.dark-mode header {
  background-color: rgba(17, 17, 17, 0.95);
  color: #ffffff;
  box-shadow: 0 2px 10px rgba(211, 47, 47, 0.3);
}

body.dark-mode header h1 { color: #d32f2f; }
body.dark-mode .li-nav a { color: #ffffff; }
body.dark-mode .li-nav a:hover { color: #ff6b6b; }

body.dark-mode .dark-mode-btn {
  background-color: #222222;
  color: #ffd700;
}
body.dark-mode .dark-mode-btn:hover { background-color: #333333; }

body.dark-mode .subti {
  color: #ffffff;
  text-shadow: 1px 1px 3px rgba(0,0,0,0.8);
}

body.dark-mode #menu {
  background-color: rgba(0, 0, 0, 0.4);
  box-shadow: none;
}

body.dark-mode #menu h2 { color: #ffffff; }

body.dark-mode .menu-item {
  background-color: rgba(17, 17, 17, 0.8);
  color: #ffffff;
}

body.dark-mode .menu-item h3 { color: #ff5252; }
body.dark-mode .menu-item p { color: #f5f5f5; }

body.dark-mode .menu-item h3, 
body.dark-mode .menu-item p {
  background-color: rgba(0, 0, 0, 0.6);
}

body.dark-mode .menu-item:hover h3, 
body.dark-mode .menu-item:hover p {
  background-color: transparent;
  text-shadow: 2px 2px 4px #000000, 0 0 10px #000000; 
}

body.dark-mode #about,
body.dark-mode #contact {
  background-color: rgba(17, 17, 17, 0.7);
  border: 1px solid rgba(211, 47, 47, 0.2);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
}

body.dark-mode #about h2,
body.dark-mode #contact h2 { color: #ffffff; text-shadow: 0 0 10px rgba(211, 47, 47, 0.5); }
body.dark-mode #about p { color: #dddddd; }

body.dark-mode .btn-todos-principal { background: linear-gradient(135deg, #d32f2f, #8b0000); box-shadow: 0 4px 15px rgba(0, 0, 0, 0.4); }
body.dark-mode .btn-todos { background-color: #d32f2f; color: #ffffff !important; }

body.dark-mode footer { background-color: rgba(0, 0, 0, 0.9); color: #ffffff; }

body.dark-mode .btn-whatsapp img,
body.dark-mode .btn-instagram img,
body.dark-mode .btn-email img {
  mix-blend-mode: screen;
  filter: brightness(0.9);
}

body.dark-mode .productos-header h2 { color: #ff6b6b; }
body.dark-mode .productos-header p { color: #cccccc; }
body.dark-mode .filtros-container { background: rgba(17, 17, 17, 0.9); box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3); }
body.dark-mode .filtros-group label { color: #ff6b6b; }
body.dark-mode .filtros-group select { background-color: #1a1a1a; color: #f0f0f0; border-color: #d32f2f; }
body.dark-mode .producto-card { background: rgba(17, 17, 17, 0.9); border: 1px solid rgba(211, 47, 47, 0.3); box-shadow: 0 5px 20px rgba(0, 0, 0, 0.5); }
body.dark-mode .producto-info h3 { color: #ff6b6b; }
body.dark-mode .producto-info p { color: #cccccc; }
body.dark-mode .contador-productos { background-color: #1a1a1a; color: #cccccc; }
body.dark-mode .no-productos { color: #cccccc; }

/* ========================================== */
/* RESPONSIVE - TABLETS MEDIANAS              */
/* ========================================== */

@media (max-width: 1024px) and (min-width: 769px) {
  body { padding-top: 75px; }
  header { padding: 10px 20px; gap: 12px; }
  header img { height: 45px; }
  header h1 { font-size: 22px; }
  .li-nav a { font-size: 14px; }
  .btn-todos { padding: 6px 16px; font-size: 13px; }
  .dark-mode-btn { font-size: 22px; padding: 5px 10px; }
}

/* ========================================== */
/* RESPONSIVE - MÓVILES                       */
/* ========================================== */

@media (max-width: 768px) {
  body { padding-top: 85px; }
  header { padding: 6px 12px; gap: 8px; }
  header img { height: 28px; }
  header h1 { font-size: 14px; }
  .ul-nav { gap: 8px; }
  .li-nav a { font-size: 11px; }
  .li-nav a:active { color: #d32f2f; transform: scale(0.98); }
  .btn-todos { padding: 4px 8px; font-size: 10px; }
  .btn-todos:active { transform: scale(0.96); background-color: #8b0000; }
  .dark-mode-btn { font-size: 16px; padding: 3px 6px; }
  .dark-mode-btn:active { transform: scale(0.95); }
  .subti { margin-top: 5px; font-size: 15px; }
  #menu { margin-top: 15px; }
  
  /* ========================================== */
  /* MAGIA PARA CELULARES: IMÁGENES A TODO COLOR */
  /* ========================================== */
  
  .menu-item { 
    transition: all 0.2s ease; 
    cursor: pointer; 
    padding: 15px; 
  }

  /* Anulamos el filtro gris SOLO en celulares */
  .item--1, .item--2, .item--3, .item--4 {
    filter: grayscale(0%) opacity(100%);
  }

  /* El texto mantiene su fondo oscuro para que se lea sobre la foto viva */
  .menu-item h3, 
  .menu-item p {
    background-color: rgba(0, 0, 0, 0.75); 
    color: #ffffff;
  }
  
  /* Efecto al tocar la tarjeta: hace un mini zoom */
  .menu-item:active { 
    transform: scale(0.98); 
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5); 
  }
  
  .btn-todos-principal { padding: 10px 20px; font-size: 14px; transition: all 0.15s ease; }
  .btn-todos-principal:active { transform: scale(0.97); box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2); background: linear-gradient(135deg, #e53935, #b71c1c); }
  .btn-whatsapp:active { transform: scale(0.96); background-color: rgba(37, 211, 102, 0.15); }
  .btn-instagram:active { transform: scale(0.96); background-color: rgba(225, 48, 108, 0.15); }
  .btn-email:active { transform: scale(0.96); background-color: rgba(211, 47, 47, 0.15); }
  .producto-card { transition: all 0.2s ease; cursor: pointer; }
  .producto-card:active { transform: scale(0.99); box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2); }
  .btn-comprar:active { transform: scale(0.96); background: linear-gradient(135deg, #e53935, #b71c1c); }
  
  #about, #contact { margin: 40px 15px; padding: 30px 20px; }
  #about h2, #contact h2 { font-size: 24px; }
  #about p { font-size: 15px; text-align: left; }
  
  /* Ajuste para modo oscuro en celular */
  body.dark-mode .menu-item h3, 
  body.dark-mode .menu-item p {
    background-color: rgba(0, 0, 0, 0.85);
  }
}

/* ========================================== */
/* RESPONSIVE - CELULARES PEQUEÑOS            */
/* ========================================== */

@media (max-width: 550px) {
  body { padding-top: 70px; }
  header { flex-direction: row; flex-wrap: wrap; justify-content: center; padding: 5px 10px; gap: 6px; }
  header img { height: 25px; }
  header h1 { font-size: 12px; }
  .ul-nav { gap: 6px; }
  .li-nav a { font-size: 10px; }
  .btn-todos { padding: 3px 6px; font-size: 9px; }
  .dark-mode-btn { font-size: 14px; padding: 2px 5px; }
  .subti { font-size: 13px; margin-top: 5px; line-height: 1.4; }
  .btn-todos-principal { padding: 8px 16px; font-size: 12px; white-space: normal; }
  .container-boton-todos { margin-top: 30px; }
  .menu-item:active { transform: scale(0.99); }
}

@media (max-width: 400px) {
  body { padding-top: 65px; }
  .subti { font-size: 12px; margin-top: 3px; }
  header h1 { font-size: 11px; }
  .li-nav a { font-size: 9px; }
  .btn-todos { padding: 2px 5px; font-size: 8px; }
}

/* ========================================== */
/* LOGO CENTRAL                               */
/* ========================================== */

.logo-central-container {
  text-align: center;
  margin-top: 30px;
  margin-bottom: 10px;
}

.logo-central {
  max-width: 160px;
  height: auto;
  display: inline-block;
  filter: drop-shadow(0px 0px 15px rgba(211, 47, 47, 0.4)); 
  transition: transform 0.3s ease;
}

.logo-central:hover {
  transform: scale(1.05);
}

@media (max-width: 768px) {
  .logo-central {
    max-width: 120px;
  }
}