
    /* RESET */
    *, *::before, *::after {
      margin: 0; padding: 0; box-sizing: border-box;
    }
    body {
      font-family: 'Poppins', sans-serif;
      background: var(--bg);
      color: var(--text);
      min-height: 100vh;
      display: flex;
      flex-direction: column;
      line-height: 1.5;
      transition: background-color 0.3s ease, color 0.3s ease;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
    }

    :root {
      --blue: #007BFF;
      --blue-light: #a9d1ff;
      --bg: #fff;
      --text: #222;
      --card-bg: #fefefe;
      --shadow: rgba(0,0,0,0.08);
      --btn-bg: var(--blue);
      --btn-hover: #0056b3;
    }
    body.dark {
      --bg: #121212;
      --text: #ddd;
      --card-bg: #1f1f1f;
      --shadow: rgba(255,255,255,0.08);
      --btn-bg: #3399ff;
      --btn-hover: #1177ff;
    }

    header {
      display: flex;
      justify-content: space-between;
      align-items: center;
      padding: 1rem 1.5rem;
      background: var(--blue);
      color: white;
      position: sticky;
      top: 0;
      z-index: 100;
      box-shadow: 0 2px 6px var(--shadow);
      flex-wrap: wrap;
      gap: 1rem;
      transition: background-color 0.3s ease;
    }
    nav ul {
      list-style: none;
      display: flex;
      gap: 1.5rem;
      flex-wrap: wrap;
      margin-left: auto;
    }
    nav a {
      color: white;
      text-decoration: none;
      font-weight: 500;
      transition: color 0.3s ease;
    }
    nav a:hover,
    nav a:focus {
      color: var(--blue-light);
      outline: none;
    }
    .logo {
      font-weight: 700;
      font-size: 1.3rem;
      user-select: none;
      text-decoration: none;
      color: #ffffff;
      
    }

    @media (max-width: 600px) {
      nav ul {
        justify-content: center;
        width: 100%;
        margin-left: 0;
      }
      header {
        justify-content: center;
        text-align: center;
      }
    }

    main {
      flex: 1;
      max-width: 900px;
      margin: 2rem auto 3rem;
      padding: 0 1rem;
      width: 100%;
    }

    .hero {
      text-align: center;
      margin-bottom: 3rem;
      color: var(--blue);
    }
    .hero h1 {
      font-size: 2rem;
      font-weight: 700;
      margin-bottom: 0.3rem;
      letter-spacing: 1px;
    }
    .hero p {
      font-weight: 400;
      color: var(--text);
      font-size: 1.1rem;
    }

    h2 {
      font-weight: 600;
      font-size: 1.6rem;
      color: var(--blue);
      margin-bottom: 1rem;
      border-bottom: 2px solid var(--blue);
      padding-bottom: 0.3rem;
    }

    .products-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
      gap: 1.8rem;
      margin-bottom: 3rem;
      opacity: 0;
      transform: translateY(30px);
      animation: fadeInUp 0.6s forwards;
      animation-delay: 0.2s;
    }

    @keyframes fadeInUp {
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    .card {
      background: var(--card-bg);
      border-radius: 12px;
      box-shadow: 0 4px 10px var(--shadow);
      padding: 1.3rem 1rem 2rem;
      display: flex;
      flex-direction: column;
      align-items: center;
      cursor: pointer;
      user-select: none;
      transition: transform 0.25s ease, box-shadow 0.25s ease;
    }
    .card:hover,
    .card:focus-within {
      transform: translateY(-6px);
      box-shadow: 0 14px 30px var(--shadow);
      outline: none;
    }

    .card img {
      width: 160px;
      height: 160px;
      object-fit: contain;
      border-radius: 14px;
      box-shadow: 0 4px 10px rgba(0,0,0,0.1);
      transition: transform 0.3s ease;
      margin-bottom: 1rem;
    }
    .card:hover img,
    .card:focus-within img {
      transform: scale(1.06);
    }

    .card h3 {
      font-weight: 600;
      font-size: 1.2rem;
      margin-bottom: 0.4rem;
      color: var(--blue);
      text-align: center;
    }
    .card p {
      font-weight: 500;
      font-size: 1.05rem;
      margin-bottom: 1.2rem;
      color: var(--text);
      text-align: center;
    }

    .btn-buy {
      background: var(--btn-bg);
      color: white;
      border: none;
      border-radius: 25px;
      padding: 0.7rem 2rem;
      font-weight: 600;
      font-size: 1rem;
      text-align: center;
      cursor: pointer;
      text-decoration: none;
      transition: background-color 0.3s ease, box-shadow 0.3s ease;
      box-shadow: 0 5px 15px rgb(0 123 255 / 0.4);
      user-select: none;
      display: inline-block;
    }
    .btn-buy:hover,
    .btn-buy:focus {
      background-color: var(--btn-hover);
      box-shadow: 0 8px 25px rgb(0 86 179 / 0.6);
      outline: none;
    }
    .btn-buy:active {
      transform: scale(0.97);
      box-shadow: 0 4px 12px rgb(0 86 179 / 0.5);
    }

    .back-link {
      margin-top: 3rem;
      text-align: center;
      font-weight: 600;
      color: var(--blue);
      text-decoration: none;
      display: inline-block;
      transition: color 0.3s ease;
    }
    .back-link:hover,
    .back-link:focus {
      color: var(--btn-hover);
      outline: none;
    }

    footer {
      text-align: center;
      padding: 1.8rem 1rem;
      font-size: 0.9rem;
      color: #666;
      user-select: none;
      border-top: 1px solid #eee;
      background: var(--bg);
      transition: background-color 0.3s ease;
    }

    /* MODAL */
    .modal-overlay {
      position: fixed;
      inset: 0;
      background: rgba(0,0,0,0.6);
      display: flex;
      justify-content: center;
      align-items: center;
      opacity: 0;
      pointer-events: none;
      transition: opacity 0.3s ease;
      z-index: 200;
    }
    .modal-overlay.active {
      opacity: 1;
      pointer-events: auto;
    }

    .modal {
      background: var(--card-bg);
      border-radius: 12px;
      max-width: 500px;
      width: 90%;
      padding: 2rem 2rem 2.5rem;
      position: relative;
      box-shadow: 0 12px 35px var(--shadow);
      animation: modalIn 0.4s ease forwards;
      color: var(--text);
    }
    @keyframes modalIn {
      from {
        opacity: 0;
        transform: translateY(50px);
      }
      to {
        opacity: 1;
        transform: translateY(0);
      }
    }

    .modal-close {
      position: absolute;
      top: 1rem;
      right: 1rem;
      background: transparent;
      border: none;
      font-size: 1.8rem;
      color: var(--text);
      cursor: pointer;
      user-select: none;
      transition: color 0.2s ease;
    }
    .modal-close:hover,
    .modal-close:focus {
      color: var(--btn-hover);
      outline: none;
    }

    .modal img {
      width: 100%;
      border-radius: 12px;
      margin-bottom: 1rem;
      object-fit: contain;
      max-height: 250px;
    }

    .modal h3 {
      margin-bottom: 0.3rem;
      color: var(--blue);
      font-weight: 700;
      font-size: 1.5rem;
      text-align: center;
    }
    .modal p.price {
      font-weight: 700;
      font-size: 1.3rem;
      color: var(--btn-bg);
      text-align: center;
      margin-bottom: 1rem;
    }
    .modal p.desc {
      font-weight: 400;
      font-size: 1rem;
      margin-bottom: 1rem;
      text-align: center;
      color: var(--text);
    }
    .modal .btn-buy {
      width: 100%;
      font-size: 1.1rem;
      padding: 1rem 0;
      border-radius: 30px;
    }

    /* Opiniones */
    .reviews {
      margin-top: 1.8rem;
    }
    .reviews h4 {
      font-weight: 600;
      font-size: 1.2rem;
      margin-bottom: 0.6rem;
      color: var(--blue);
      text-align: center;
    }
    .review {
      background: var(--bg);
      border-radius: 8px;
      box-shadow: 0 2px 8px var(--shadow);
      padding: 0.8rem 1rem;
      margin-bottom: 1rem;
      font-size: 0.9rem;
      color: var(--text);
      user-select: none;
    }
    .review .stars {
      color: #f5b50a;
      margin-bottom: 0.3rem;
      font-size: 1.1rem;
      user-select: none;
    }

    /* Ofertas */
    .offers {
      background: var(--blue);
      color: white;
      padding: 1.5rem 1rem;
      border-radius: 10px;
      margin-bottom: 2.5rem;
      text-align: center;
      box-shadow: 0 6px 18px rgba(0,123,255,0.3);
      user-select: none;
    }
    .offers h2 {
      margin-bottom: 0.7rem;
    }
    .offers p {
      font-size: 1.1rem;
      font-weight: 600;
      user-select: none;
    }

    /* Modo oscuro toggle */
    .dark-mode-toggle {
      background: transparent;
      border: 2px solid white;
      color: white;
      font-weight: 600;
      font-size: 0.9rem;
      padding: 0.3rem 0.9rem;
      border-radius: 20px;
      cursor: pointer;
      user-select: none;
      transition: background-color 0.3s ease, color 0.3s ease;
    }
    .dark-mode-toggle:hover,
    .dark-mode-toggle:focus {
      background-color: white;
      color: var(--blue);
      outline: none;
    }

    @media (max-width: 500px) {
      .card img {
        width: 120px;
        height: 120px;
      }
      .btn-buy {
        padding: 0.6rem 1.5rem;
        font-size: 0.9rem;
      }
      .product-category {
  margin-bottom: 3.5rem;
}
.product-category h2 {
  color: var(--blue);
  border-bottom: 3px solid var(--blue);
  padding-bottom: 0.3rem;
  margin-bottom: 1.2rem;
  font-weight: 700;
}

    }
    .filter-buttons {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  justify-content: center;
}

.filter-btn {
  background: var(--blue-light);
  border: none;
  padding: 0.5rem 1.5rem;
  border-radius: 25px;
  cursor: pointer;
  font-weight: 600;
  color: var(--blue);
  transition: background-color 0.3s ease, color 0.3s ease;
  user-select: none;
}

.filter-btn.active,
.filter-btn:hover,
.filter-btn:focus {
  background: var(--btn-bg);
  color: white;
  outline: none;
}

.card img {
  width: 100%;       /* Ocupa todo el ancho del contenedor */
  max-width: 200px;  /* Tamaño máximo que quieres darle */
  height: auto;      /* Mantiene proporción */
  display: block;
}
.modal img#modal-img {
  max-width: 90vw; /* 90% del ancho de la ventana */
  max-height: 70vh; /* 70% de la altura de la ventana */
  cursor: pointer;  /* Para que el usuario sepa que puede hacer clic */
  border-radius: 8px;
  transition: transform 0.3s ease;
}

.modal img#modal-img:hover {
  transform: scale(1.05);
}
.modal {
  max-height: 100vh;
  overflow-y: auto;
}

.filter-buttons {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  justify-content: center;
  flex-wrap: wrap; /* <-- agrega esto */
}

