* { margin: 0; padding: 0; box-sizing: border-box; }

    html { overflow-x: hidden; width: 100%; }

    body {
      font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
      background: #1a1a1a;
      color: #e0e0e0;
      line-height: 1.6;
      overflow-x: hidden;
      width: 100%;
    }

    /* =========================
       HEADER — responsive
       ========================= */
    .header-nav {
      background: #2d2d2d;
      padding: 16px 40px;
      display: flex;
      justify-content: space-between;
      align-items: center;
      box-shadow: 0 5px 20px rgba(0,0,0,0.3);
      position: sticky;
      top: 0;
      z-index: 1000;
      flex-wrap: wrap;
      gap: 10px;
      min-height: 64px;
    }

    .logo {
      font-size: 28px;
      font-weight: bold;
      color: #8b7355;
      text-shadow: 2px 2px 4px rgba(0,0,0,0.3);
      flex-shrink: 0;
    }

    .nav-links {
      display: flex;
      gap: 28px;
      align-items: center;
      transition: .3s;
      flex-shrink: 0;
    }

    .nav-links a {
      color: #e0e0e0;
      text-decoration: none;
      transition: color 0.3s;
      font-weight: 500;
      white-space: nowrap;
    }

    .nav-links a:hover { color: #8b7355; }

    .login-btn {
      background: #8b7355;
      color: white;
      padding: 10px 25px;
      border-radius: 8px;
      border: none;
      cursor: pointer;
      transition: all 0.3s;
      text-decoration: none;
      font-weight: 600;
      display: inline-block;
      white-space: nowrap;
    }

    .login-btn:hover {
      background: #a0865f;
      transform: scale(1.05);
    }

    .cart-icon {
      position: relative;
      text-decoration: none;
      font-size: 22px;
      color: #fff;
      display: inline-flex;
      align-items: center;
      flex-shrink: 0;
    }

    .cart-badge {
      position: absolute;
      top: -6px;
      right: -10px;
      background: #c0392b;
      color: white;
      font-size: 12px;
      padding: 2px 6px;
      border-radius: 50%;
      font-weight: 600;
    }

    /* Botón hamburguesa — oculto por defecto */
    .menu-toggle {
      display: none;
      background: transparent;
      border: 2px solid #3d3d3d;
      color: #e0e0e0;
      font-size: 22px;
      padding: 8px 12px;
      border-radius: 10px;
      cursor: pointer;
      transition: .3s;
      margin-left: auto;
      font-family: inherit;
    }

    .menu-toggle:hover {
      border-color: #8b7355;
      color: #8b7355;
    }

    /* =========================
       CONTENIDO
       ========================= */
    .container {
      width: 100%;
      max-width: 100%;
      margin: 0 auto;
      padding: 40px clamp(20px, 4vw, 80px);
    }

    .page-title {
      color: #8b7355;
      font-size: clamp(24px, 4vw, 36px);
      margin-bottom: 40px;
      text-align: center;
      position: relative;
      padding-bottom: 15px;
    }

    .page-title::after {
      content: '';
      position: absolute;
      bottom: 0;
      left: 50%;
      transform: translateX(-50%);
      width: 100px;
      height: 3px;
      background: #8b7355;
    }

    /* Catalog Header */
    .catalog-header {
      margin-bottom: 30px;
    }

    .search-bar { flex: 1; min-width: 250px; display: flex; gap: 10px; align-items: center; }

    .search-bar input {
      flex: 1;
      padding: 13px 16px;
      background: #3d3d3d;
      border: 2px solid #4a4a4a;
      border-radius: 10px;
      color: #e0e0e0;
      font-size: 15px;
      transition: .3s;
    }

    .search-bar input:focus {
      outline: none;
      border-color: #8b7355;
      box-shadow: 0 0 0 3px rgba(139,115,85,.18);
    }

    .search-bar input::placeholder { color: #888; }

    .btn-buscar {
      padding: 13px 20px;
      background: #8b7355;
      color: white;
      border: none;
      border-radius: 10px;
      cursor: pointer;
      font-size: 15px;
      font-weight: 600;
      transition: all .3s;
      white-space: nowrap;
      display: flex;
      align-items: center;
      gap: 8px;
    }

    .btn-buscar:hover {
      background: #a0865f;
      transform: translateY(-2px);
      box-shadow: 0 5px 15px rgba(139,115,85,.35);
    }

    /* === FILTERS ROW (filtros + ordenar) === */

    .select-ordenar {
      padding: 11px 16px;
      background: #3d3d3d;
      border: 2px solid #4a4a4a;
      border-radius: 10px;
      color: #e0e0e0;
      font-size: 14px;
      cursor: pointer;
      transition: .3s;
      appearance: none;
      background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%238b7355' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
      background-repeat: no-repeat;
      background-position: right 12px center;
      padding-right: 36px;
    }

    .select-ordenar:focus {
      outline: none;
      border-color: #8b7355;
      box-shadow: 0 0 0 3px rgba(139,115,85,.18);
    }

    .select-ordenar option {
      background: #2d2d2d;
      color: #e0e0e0;
    }

    /* === CATALOGO META (contador de resultados) === */
    .catalogo-meta {
      color: #888;
      font-size: 14px;
      margin-bottom: 20px;
      padding: 8px 0;
    }

    /* === BOTÓN AGOTADO === */
    .btn-agotado {
      background: #3d3d3d;
      color: #666;
      padding: 10px 18px;
      border-radius: 10px;
      border: 2px solid #4a4a4a;
      cursor: not-allowed;
      font-weight: 600;
      font-size: 14px;
      display: inline-flex;
      align-items: center;
      gap: 6px;
    }

    .btn-agotado:disabled { opacity: 0.6; }

    /* === LOADING STATE === */
    .loading-state {
      grid-column: 1 / -1;
      display: flex;
      flex-direction: column;
      align-items: center;
      justify-content: center;
      padding: 60px 20px;
      color: #888;
      gap: 16px;
    }

    .spinner {
      width: 42px;
      height: 42px;
      border: 3px solid #3d3d3d;
      border-top-color: #8b7355;
      border-radius: 50%;
      animation: spin .8s linear infinite;
    }

    @keyframes spin { to { transform: rotate(360deg); } }

    /* === SIN RESULTADOS === */
    .empty-state {
      grid-column: 1 / -1;
      text-align: center;
      padding: 60px 20px;
      color: #888;
    }

    .empty-state i { font-size: 48px; color: #4a4a4a; margin-bottom: 16px; }

    /* === CATEGORÍAS PRINCIPALES (Baños / Cocinas / Closets) === */
    .catalog-main-categories {
      display: flex;
      flex-wrap: wrap;
      gap: 14px;
      margin-bottom: 22px;
    }

    .main-cat-btn {
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 10px;
      flex: 1 1 180px;
      padding: 16px 24px;
      background: #2d2d2d;
      border: 2px solid #3d3d3d;
      border-radius: 14px;
      color: #e0e0e0;
      cursor: pointer;
      transition: all 0.25s;
      font-weight: 700;
      font-size: 16px;
    }

    .main-cat-btn i { font-size: 19px; color: #8b7355; transition: color 0.25s; }

    .main-cat-btn:hover {
      border-color: #8b7355;
      transform: translateY(-2px);
    }

    .main-cat-btn.active {
      background: #8b7355;
      border-color: #8b7355;
      color: #fff;
      box-shadow: 0 6px 20px rgba(139,115,85,0.35);
    }

    .main-cat-btn.active i { color: #fff; }

    @media (hover: none) {
      .main-cat-btn:hover { transform: none; }
    }

    @media (max-width: 600px) {
      .main-cat-btn { flex: 1 1 100%; padding: 13px 18px; font-size: 15px; }
    }

    .filter-btn {
      padding: 12px 14px;
      background: #2d2d2d;
      border: 2px solid #3d3d3d;
      border-radius: 10px;
      color: #e0e0e0;
      cursor: pointer;
      transition: all 0.3s;
      font-weight: 600;
    }

    .filter-btn:hover {
      border-color: #8b7355;
      color: #8b7355;
    }

    .filter-btn.active {
      background: #8b7355;
      border-color: #8b7355;
      color: white;
    }

    /* Product Grid — JS renders cards directly; CSS grid used for auto-fill layout */
    .product-grid {
      display: grid;
      grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
      gap: 25px;
    }

    .product-card {
      background: #2d2d2d;
      border-radius: 15px;
      overflow: hidden;
      cursor: pointer;
      transition: all 0.3s;
      border: 2px solid #3d3d3d;
      display: flex;
      flex-direction: column;
    }

    .product-card:hover {
      transform: translateY(-8px);
      box-shadow: 0 15px 40px rgba(139, 115, 85, 0.3);
      border-color: #8b7355;
    }

    .product-image {
      width: 100%;
      aspect-ratio: 4/3;            /* ratio 4:3 horizontal - no corta los muebles */
      background: linear-gradient(135deg, #2a2a2a, #1e1e1e);
      position: relative;
      overflow: hidden;
    }

    .product-image img {
      width: 100%;
      height: 100%;
      object-fit: contain;          /* contain: muestra la imagen completa sin cortar */
      object-position: center;
      display: block;
      padding: 4px;                 /* pequeño padding para que no toque los bordes */
      transition: transform 0.4s ease;
    }

    .product-card:hover .product-image img {
      transform: scale(1.06);
    }

    .placeholder-imagen {
      width: 100%;
      height: 100%;
      display: flex;
      align-items: center;
      justify-content: center;
      color: #555;
      font-size: 48px;
    }

    .product-badge {
      position: absolute;
      top: 10px;
      right: 10px;
      background: #8b7355;
      color: white;
      padding: 4px 12px;
      border-radius: 12px;
      font-size: 11px;
      font-weight: 700;
      z-index: 2;
      backdrop-filter: blur(4px);
    }

    .product-info {
      padding: 16px 18px 18px;
      flex: 1;
      display: flex;
      flex-direction: column;
      gap: 8px;
    }

    .product-name {
      color: #e0e0e0;
      font-size: 16px;
      font-weight: 700;
      line-height: 1.3;
    }

    .product-category {
      color: #8b7355;
      font-size: 12px;
      font-weight: 600;
      text-transform: uppercase;
      letter-spacing: 0.5px;
    }

    .product-specs {
      color: #a0a0a0;
      font-size: 13px;
      line-height: 1.5;
    }

    .product-price-section {
      display: flex;
      justify-content: space-between;
      align-items: center;
      gap: 12px;
      margin-top: 4px;
    }

    .price {
      font-size: 20px;
      color: #8b7355;
      font-weight: bold;
    }

    .product-actions {
      display: flex;
      gap: 8px;
      margin-top: 8px;
    }

    .btn-details {
      background: #8b7355;
      color: white;
      padding: 10px 18px;
      border-radius: 10px;
      border: none;
      cursor: pointer;
      transition: all 0.3s;
      text-decoration: none;
      display: inline-block;
      font-weight: 700;
    }

    .btn-details:hover {
      background: #a0865f;
      transform: translateY(-2px);
      box-shadow: 0 5px 20px rgba(139, 115, 85, 0.35);
    }


    .product-actions {
      display: flex;
      gap: 8px;
      margin-top: 12px;
      flex-wrap: wrap;
    }

    .btn-add-cart {
      flex: 1;
      background: #2d2d2d;
      color: #8b7355;
      border: 2px solid #8b7355;
      padding: 10px 14px;
      border-radius: 10px;
      cursor: pointer;
      font-weight: 700;
      font-size: 13px;
      transition: all 0.3s;
      display: flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      white-space: nowrap;
    }

    .btn-add-cart:hover {
      background: #8b7355;
      color: #fff;
      transform: translateY(-2px);
      box-shadow: 0 5px 20px rgba(139, 115, 85, 0.35);
    }

    .btn-add-cart:active {
      transform: translateY(0);
    }

    /* Toast notification */
    .wh-toast {
      position: fixed;
      top: 90px;
      right: 20px;
      padding: 14px 20px;
      border-radius: 10px;
      z-index: 10000;
      font-weight: 600;
      font-size: 14px;
      box-shadow: 0 4px 20px rgba(0,0,0,0.35);
      display: flex;
      align-items: center;
      gap: 10px;
      animation: toastIn 0.3s ease;
      max-width: 320px;
      pointer-events: none;
    }
    .wh-toast.success { background: #1a1a1a; color: #fff; border-left: 4px solid #8b7355; }
    .wh-toast.error   { background: #1a1a1a; color: #fff; border-left: 4px solid #ef4444; }
    .wh-toast.success i { color: #8b7355; font-size: 18px; }
    .wh-toast.error   i { color: #ef4444; font-size: 18px; }
    @keyframes toastIn {
      from { opacity: 0; transform: translateX(30px); }
      to   { opacity: 1; transform: translateX(0); }
    }

    /* Footer */
    .footer {
      background: #2d2d2d;
      padding: 40px;
      text-align: center;
      border-top: 3px solid #8b7355;
      margin-top: 60px;
    }

    .footer p { color: #666; font-size: 14px; margin: 5px 0; }

    @media (max-width: 992px) {
      .footer { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
    }

    /* =========================
       RESPONSIVE + HAMBURGUESA
       ========================= */
    @media (max-width: 900px) {
      .nav-links { display: none !important; }
    }

    @media (max-width: 992px) {
      .header-nav { padding: 10px 16px; }
      .container { padding: 16px 14px; }
      /* !important necesario porque Bootstrap usa utilidades con !important (d-flex, align-items-center, etc.) */
      .catalog-header { flex-direction: column !important; align-items: stretch !important; gap: 12px !important; }
      .search-bar { width: 100%; min-width: 0; }
      .filters-row { width: 100%; justify-content: center !important; }
      .filters { justify-content: center; }
    }

    /* ── Tablets (640px – 992px): 2 columnas ──────────────────── */
    @media (max-width: 768px) {
      .product-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
      .product-name { font-size: 14px; }
      .price { font-size: 17px; }
      .product-actions { flex-direction: column; gap: 6px; }
      .btn-details, .btn-add-cart { width: 100%; justify-content: center; }
    }

    /* ── Teléfonos (≤ 480px): 1 columna para que las tarjetas se vean completas ── */
    @media (max-width: 480px) {
      .container { padding: 12px 10px 80px; }
      .page-title { font-size: 20px; margin-bottom: 10px; }
      .product-grid { grid-template-columns: 1fr; gap: 12px; }
      .product-card { border-radius: 12px; }
      .product-info { padding: 12px; }
      .product-image { aspect-ratio: 16/9; }
      .product-actions { flex-direction: row; gap: 8px; }
      .btn-details, .btn-add-cart { width: auto; flex: 1; justify-content: center; }
      .search-bar { gap: 8px; }
      .search-bar input { font-size: 14px; padding: 10px 12px; }
      .btn-buscar { padding: 10px 14px; font-size: 13px; }
      .filter-btn { padding: 7px 12px; font-size: 12px; }
      .select-ordenar { font-size: 13px; padding: 8px 10px; }
    }

    /* Quitar hover-transform en táctil */
    @media (hover: none) {
      .product-card:hover { transform: none !important; }
    }

