  /* Estructura principal de la página */
  .page-content {
    margin-left: 260px;
    padding: 20px;
    min-height: calc(100vh - 70px);
    overflow: auto;
    transition: margin-left 0.4s cubic-bezier(0.77, 0, 0.175, 1);
    background-color: var(--light-gray);
    position: relative;
    z-index: 1;
  }

  .page-content.sidebar-hidden {
    margin-left: 0;
  }

  /* Overlay para fondos */
  .w3-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 998; /* Below content but above sidebar */
    display: none;
    background-color: rgba(0, 0, 0, 0.4);
    transition: all 0.3s ease;
    pointer-events: none; /* By default, allow clicks to pass through */
  }

  .w3-overlay.active {
    display: block;
    pointer-events: auto; /* Only capture clicks when active */
  }

  /* Ensure content is above overlay */
  .page-content {
    position: relative;
    z-index: 999; /* Above overlay */
  }

  /* Ensure product cards are clickable */
  .product-card,
  .category-card {
    position: relative;
    z-index: 1000; /* Above page-content */
  }

  .product-link,
  .category-link {
    position: relative;
    z-index: 1001; /* Above cards */
    cursor: pointer; /* Ensure cursor shows it's clickable */
  }

  /* For small screens, adjust overlay behavior */
  @media (max-width: 992px) {
    .w3-overlay.active {
      z-index: 1002; /* Above content on small screens */
      pointer-events: auto; /* Capture clicks when active on small screens */
    }
  }
  /* Ajuste para pantallas pequeñas */
  .content-push-small {
    margin-top: 64px;
  }

  /* Secciones de contenido */
  .content-section {
    padding: 30px;
    background-color: white;
    border-radius: 10px;
    box-shadow: var(--box-shadow);
    position: relative;
    z-index: 2;
  }

  /* Encabezado de páginas */
  .top-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 20px;
    margin-bottom: 30px;
    border-bottom: 1px solid var(--medium-gray);
  }

  .top-header .w3-left {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--secondary-color);
  }

  .categoria-title {
    font-size: 24px;
    margin-bottom: 5px;
    font-weight: bold;
  }

  .categoria-general {
    font-size: 14px;
    color: #666;
    margin-bottom: 20px;
  }

  /* Mensaje de no productos */
  .no-products {
    padding: 30px;
    text-align: center;
    background-color: #f8f9fa;
    border-radius: 5px;
    margin: 20px auto;
    max-width: 600px;
    color: #6c757d;
    font-size: 18px;
  }

  .no-products i {
    display: block;
    margin-bottom: 15px;
    color: #adb5bd;
  }

  /* Grids para productos y categorías */
  .product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-top: 20px;
    position: relative;
    z-index: 3;
  }

  .category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 20px;
    position: relative;
    z-index: 3;
  }

  /* Secciones de rebajados y categorías */
  .rebajados-section,
  .categorias-section {
    margin: 30px 0;
    position: relative;
  }

  /* Estilos de tarjetas de producto con tamaño fijo */
  .product-card {
    background-color: white;
    border-radius: 8px;
    box-shadow: var(--box-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    height: var(--card-height);
    overflow: hidden;
    position: relative;
    padding: 0;
    margin: 0;
    z-index: 4;
  }

  .product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
  }

  .product-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    position: relative;
    z-index: 5;
  }

  /* Contenedor para la imagen */
  .image-container {
    width: 100%;
    height: var(--image-height);
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #f9f9f9;
  }

  .product-link img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Contener la imagen sin recortar */
  }

  /* Contenedor para el nombre y precio */
  .product-info {
    padding: 15px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
  }

  .product-name {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 12px;
    color: var(--text-color);
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 60px;
  }

  .product-price {
    margin-top: auto;
  }

  .original-price {
    text-decoration: line-through;
    color: #888;
    font-size: 14px;
  }

  .discount-price {
    color: var(--accent-color);
    font-weight: bold;
    font-size: 18px;
  }

  .regular-price {
    font-weight: bold;
    font-size: 18px;
    color: var(--secondary-color);
  }

  /* Estilos de tarjetas de categoría */
  .category-card {
    background-color: white;
    border-radius: 10px;
    box-shadow: var(--box-shadow);
    text-align: center;
    overflow: hidden;
    transition: transform 0.3s;
    height: 200px;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 4;
  }

  .category-card:hover {
    transform: scale(1.05);
  }

  .category-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
    position: relative;
    z-index: 5;
  }

  .category-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
  }

  .category-card h3 {
    padding: 10px;
    margin: 0;
    font-weight: 600;
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .search-term {
    color: var(--primary-color);
    font-weight: 600;
  }

  /* Ajustes responsivos */
  @media (max-width: 1024px) {
    .page-content {
      margin-left: 0;
    }

    :root {
      --card-height: 340px;
      --image-height: 200px;
    }
  }

  @media (max-width: 768px) {
    .page-content {
      padding: 15px;
    }

    .content-section {
      padding: 20px;
    }

    .product-grid {
      grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    }

    .category-grid {
      grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    }

    :root {
      --card-height: 320px;
      --image-height: 180px;
    }
  }

  @media (max-width: 480px) {
    .content-section {
      padding: 15px;
    }

    .product-grid {
      grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
      gap: 15px;
    }

    .category-grid {
      grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
      gap: 15px;
    }

    :root {
      --card-height: 300px;
      --image-height: 160px;
    }

    .product-name {
      font-size: 14px;
      height: 50px;
    }
  }

