* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Arial, sans-serif;
  background: #fff;
  color: #111;
}

/* HEADER */
.site-header {
  background: #111;
  color: white;
}

.header-top {
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 16px 24px;
}

.logo {
  font-size: 22px;
  font-weight: bold;
  color: white;
  text-decoration: none;
}

.logo:hover {
  text-decoration: none;
  opacity: 0.9;
}


.search-bar input {
  padding: 8px;
  width: 300px;
}

.header-actions button {
  margin-left: 8px;
  padding: 8px 12px;
}

/* NAV */
.main-nav {
  display: flex;
  gap: 20px;
  padding: 10px 24px;
  background: #0077ff;
}

/* LINKS DESKTOP */
.nav-links {
  display: flex;
  gap: 20px;
}

.main-nav a {
  color: white;
  text-decoration: none;
  font-weight: bold;
}

/* BREADCRUMB */
.breadcrumb {
  padding: 12px 24px;
  background: #f2f2f2;
  font-size: 14px;
}

/* LAYOUT */
.shop-layout {
  display: flex;
  gap: 30px;
  padding: 24px;
  max-width: 1400px;
  margin: 0 auto;
}

/* SIDEBAR */
.sidebar {
  width: 260px;
}

.filter-block {
  margin-bottom: 24px;
}

.filter-block h4 {
  margin-bottom: 10px;
}

.filter-block label {
  display: block;
  margin-bottom: 6px;
}

/* CONTENT */
.shop-content {
  flex: 1;
}

.category-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.results-count {
  font-size: 14px;
  color: #666;
}

/* GRID */
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 24px;
}

.product-card {
  border: 1px solid #ddd;
  padding: 14px;
  display: flex;
  flex-direction: column;
}

.product-image {
  height: 180px;
  background: #eee;
  margin-bottom: 10px;
}

.product-card h3 {
  font-size: 15px;
  margin-bottom: 4px;
}

.brand {
  font-size: 13px;
  color: #777;
}

.price {
  font-size: 18px;
  font-weight: bold;
  margin: 10px 0;
}

.product-card button {
  margin-top: auto;
  padding: 10px;
  background: #0077ff;
  color: white;
  border: none;
  cursor: pointer;
}

/* PAGINATION */
.pagination {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 30px 0;
}

.pagination button {
  padding: 6px 10px;
}

.pagination .active {
  background: #0077ff;
  color: white;
}

/* FOOTER */
.site-footer {
  background: #111;
  color: white;
  padding: 40px 24px;
  margin-top: 40px;
}

.footer-columns {
  display: flex;
  gap: 40px;
}

/* ================= HOME ================= */

.home section {
  padding: 40px 24px;
}

.hero {
  position: relative;
  min-height: 360px;
  display: flex;
  align-items: center;
  color: white;

  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;

  transition: background-image 0.8s ease-in-out;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to right, rgba(0,0,0,0.6), rgba(0,0,0,0.3));
}


.hero-content {
  position: relative;
  z-index: 2;
  max-width: 600px;
}


.hero-content h1 {
  font-size: 42px;
  margin-bottom: 10px;
}

.hero-content p {
  font-size: 18px;
  margin-bottom: 20px;
}

.hero-btn {
  display: inline-block;
  background: #0077ff;
  color: white;
  padding: 12px 20px;
  text-decoration: none;
  font-weight: bold;
}

/* CATEGORÍAS HOME */
.home-categories h2 {
  margin-bottom: 20px;
}

.categories-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 20px;
}

.category-card {
  border: 1px solid #ddd;
  padding: 20px;
  text-align: center;
  text-decoration: none;
  color: #111;
  background: white;
}

.category-card:hover {
  border-color: #0077ff;
}

/* DESTACADOS HOME */
.home-featured h2 {
  margin-bottom: 20px;
}

/* BLOQUES POR CATEGORÍA */
.home-category-block .block-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}

.block-header a {
  text-decoration: none;
  font-size: 14px;
  color: #0077ff;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.modal-content {
  background: white;
  padding: 24px;
  width: 300px;
  position: relative;
}

.modal-content input {
  width: 100%;
  margin-bottom: 10px;
  padding: 8px;
}

.close-modal {
  position: absolute;
  top: 10px;
  right: 10px;
  cursor: pointer;
}

/* OCULTAR ELEMENTOS MOBILE EN DESKTOP */
.btn-categories,
.categories-dropdown {
  display: none;
}


/* ===============================
   MOBILE FIXES
================================ */
@media (max-width: 768px) {

  /* 1) NO SCROLL LATERAL */
  html, body {
    overflow-x: hidden;
    width: 100%;
  }

  /* 2) HEADER COMPACTO */
  .header-top {
    gap: 10px;
    padding: 12px 14px;
  }

  /* 3) BUSCADOR MÁS CHICO */
  .search-bar input {
    width: 140px;
    padding: 6px;
    font-size: 14px;
  }

  .header-actions button {
    padding: 6px 8px;
    font-size: 13px;
  }

/* 4) NAV MOBILE: ocultar barra azul */
.main-nav {
  background: transparent;
  padding: 0;
  flex-direction: column;
  gap: 0;
}

  
  /* OCULTAR LINKS DESKTOP EN MOBILE */
.nav-links {
  display: none;
}

  .btn-categories {
    background: white;
    color: #0077ff;
    border: none;
    font-weight: bold;
    padding: 12px 16px;
    width: 100%;
    text-align: left;
    display: block;
  }

  .categories-dropdown {
    display: none;
    flex-direction: column;
    background: #0077ff;
  }

  .categories-dropdown a {
    padding: 12px 16px;
    color: white;
    text-decoration: none;
    border-top: 1px solid rgba(255,255,255,.2);
  }

  .categories-dropdown.show {
    display: flex;
  }

  /* 5) HERO MÁS CHICO */
  .hero {
    min-height: 240px;
    padding: 24px 16px;
  }

  .hero-content h1 {
    font-size: 26px;
  }

  .hero-content p {
    font-size: 15px;
  }

  /* 6) OCULTAR TEXTO QUE SOBRA */
  .home-categories h2 {
    display: none;
  }

  /* CATEGORÍAS HOME EN COLUMNA (MOBILE) */
.categories-grid {
  grid-template-columns: 1fr;
}

  /* 7) SLIDERS HORIZONTALES EN HOME */
  .products-grid {
    display: flex;
    overflow-x: auto;
    gap: 16px;
    scroll-snap-type: x mandatory;
    padding-bottom: 10px;
  }

  .product-card {
    min-width: 220px;
    max-width: 220px;
    scroll-snap-align: start;
  }

  /* 8) FOOTER EN COLUMNA */
  .footer-columns {
    flex-direction: column;
    gap: 20px;
  }
}

.product-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  padding: 40px 0;
}

.product-gallery .main-image {
  background: #f5f5f5;
  height: 400px;
  border-radius: 8px;
}

.thumbnail-list {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.thumb {
  width: 70px;
  height: 70px;
  background: #eee;
  border-radius: 6px;
  cursor: pointer;
}

.product-info h1 {
  margin: 10px 0;
}

.product-info .price {
  font-size: 24px;
  font-weight: bold;
  margin: 15px 0;
}

.quantity-selector {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 20px 0;
}

.add-to-cart-btn {
  width: 100%;
  padding: 12px;
  background: black;
  color: white;
  border: none;
  cursor: pointer;
}

.related-products {
  padding: 40px 0;
}

/* ===============================
   FIX PAGINACIÓN CATEGORÍA
================================ */

.shop-content .products-grid {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important;
  overflow-x: hidden !important;
}

@media (max-width: 768px) {
  .shop-content .products-grid {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)) !important;
    overflow-x: hidden !important;
  }
}
