/* ============================================
   CATÁLOGO - DISEÑO MODERNO
   ============================================ */

:root {
  --primary-color: #667eea;
  --primary-dark: #5568d3;
  --secondary-color: #764ba2;
  --text-dark: #1a202c;
  --text-gray: #718096;
  --border-color: #e2e8f0;
  --bg-light: #f7fafc;
  --white: #ffffff;
}

/* Reset y Base */
body.woocommerce-page .site-main.fractal-catalog,
body.woocommerce-page .fractal-catalog-container {
  max-width: 100% !important;
  width: 100% !important;
  margin: 0;
}

.fractal-catalog {
  background: #f5f7fa;
  padding: 0;
}

.woocommerce nav.woocommerce-pagination ul, .woocommerce nav.woocommerce-pagination ul li {
    border: none;
}

/* ============================================
   HEADER DEL CATÁLOGO
   ============================================ */
.fractal-catalog-header {
  position: relative;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  height: 400px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.fractal-catalog-header::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.9) 0%, rgba(118, 75, 162, 0.9) 100%);
}

.fractal-catalog-header::after {
  content: "";
  position: absolute;
  inset: 0;
  background: url('data:image/svg+xml,<svg width="100" height="100" xmlns="http://www.w3.org/2000/svg"><defs><pattern id="grid" width="40" height="40" patternUnits="userSpaceOnUse"><path d="M 40 0 L 0 0 0 40" fill="none" stroke="rgba(255,255,255,0.1)" stroke-width="1"/></pattern></defs><rect width="100" height="100" fill="url(%23grid)"/></svg>');
  opacity: 0.3;
}

.fractal-catalog-title {
  position: relative;
  color: #fff;
  font-size: 48px;
  font-weight: 700;
  z-index: 1;
  text-shadow: 0 2px 6px rgba(0, 0, 0, 0.3);
  margin: 0;
  letter-spacing: -0.5px;
}

.term-description {
  position: relative;
  z-index: 1;
  font-size: 16px;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.6;
  max-width: 700px;
  margin: 16px auto 0;
  text-align: center;
}

/* ============================================
   LAYOUT PRINCIPAL
   ============================================ */
.fractal-catalog-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 30px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 20px 60px;
  align-items: flex-start;
}

/* ============================================
   SIDEBAR DE FILTROS
   ============================================ */
.fractal-filters-sidebar {
  background: var(--white);
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 20px;
}

.fractal-filter-section {
  margin-bottom: 30px;
  padding-bottom: 25px;
  border-bottom: 2px solid var(--border-color);
}

.fractal-filter-section:last-child {
  border-bottom: none;
  margin-bottom: 0;
  padding-bottom: 0;
}

.fractal-filter-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0 0 20px 0;
  display: flex;
  align-items: center;
  gap: 10px;
}

.fractal-filter-title svg {
  color: var(--primary-color);
}

.fractal-filter-subtitle {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0 0 15px 0;
}

/* Categorías */
.fractal-category-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.fractal-category-item {
  margin-bottom: 10px;
}

.fractal-category-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 12px;
  color: var(--text-gray);
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.3s;
  font-weight: 600;
  font-size: 14px;
}

.fractal-category-link:hover {
  background: rgba(102, 126, 234, 0.1);
  color: var(--primary-color);
}

.fractal-category-link.active {
  background: var(--primary-color);
  color: var(--white);
}

.fractal-category-link .count {
  font-size: 12px;
  opacity: 0.7;
}

/* Subcategorías */
.fractal-subcategory-list {
  list-style: none;
  padding: 8px 0 0 20px;
  margin: 0;
}

.fractal-subcategory-list li {
  margin-bottom: 6px;
}

.fractal-subcategory-list a {
  display: flex;
  justify-content: space-between;
  padding: 6px 10px;
  color: var(--text-gray);
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.3s;
  font-size: 13px;
}

.fractal-subcategory-list a:hover {
  background: rgba(102, 126, 234, 0.05);
  color: var(--primary-color);
}

.fractal-subcategory-list a.active {
  color: var(--primary-color);
  font-weight: 600;
}

/* Filtro de precio */
.widget_price_filter .widgettitle {
  display: none !important;
}

.widget_price_filter {
  margin: 0;
}

.widget_price_filter .price_slider_wrapper {
  padding: 10px 0;
}

.widget_price_filter .ui-slider {
  background: var(--border-color);
  border: none;
  height: 6px;
  border-radius: 3px;
}

.widget_price_filter .ui-slider-range {
  background: var(--primary-color);
}

.widget_price_filter .ui-slider-handle {
  background: var(--primary-color);
  border: 3px solid var(--white);
  width: 18px;
  height: 18px;
  border-radius: 50%;
  top: -6px;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
}

.widget_price_filter .price_slider_amount {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 15px;
}

.widget_price_filter .price_label {
  font-size: 14px;
  color: var(--text-gray);
  font-weight: 600;
}

.widget_price_filter .button {
  background: var(--primary-color);
  color: var(--white);
  border: none;
  padding: 8px 20px;
  font-size: 13px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
}

.widget_price_filter .button:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

/* Filtro de tallas */
.fractal-size-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.fractal-size-checkbox {
  position: relative;
  cursor: pointer;
}

.fractal-size-checkbox input {
  position: absolute;
  opacity: 0;
}

.fractal-size-checkbox span {
  display: block;
  padding: 8px 14px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-gray);
  transition: all 0.3s;
  text-align: center;
  min-width: 40px;
}

.fractal-size-checkbox input:checked + span {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: var(--white);
}

.fractal-size-checkbox:hover span {
  border-color: var(--primary-color);
}

/* Botón limpiar filtros */
.fractal-clear-filters {
  display: block;
  width: 100%;
  padding: 12px;
  text-align: center;
  background: transparent;
  border: 2px solid var(--border-color);
  color: var(--text-gray);
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s;
}

.fractal-clear-filters:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

/* ============================================
   CONTENIDO DEL CATÁLOGO
   ============================================ */
.fractal-catalog-content {
  background: var(--white);
  border-radius: 16px;
  padding: 32px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Barra de herramientas */
.fractal-catalog-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 20px;
  border-bottom: 2px solid var(--border-color);
  flex-wrap: wrap;
  gap: 15px;
}

.fractal-results-count {
  font-size: 14px;
  color: var(--text-gray);
  font-weight: 600;
}

.fractal-ordering select {
  padding: 10px 35px 10px 15px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  color: var(--text-gray);
  background: var(--white);
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23718096' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  font-weight: 600;
  transition: all 0.2s;
}

.fractal-ordering select:focus {
  outline: none;
  border-color: var(--primary-color);
}

/* Grid de productos */
.products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.woocommerce ul.products li.product.desktop-align-left, .woocommerce-page ul.products li.product.desktop-align-left {
    padding: 10px;
}

.woocommerce .products .product {
  border: 2px solid var(--border-color);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s;
  position: relative;
  background: var(--white);
  padding: 20px;
  display: flex;
  flex-direction: column;
}

.products .product:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  border-color: var(--primary-color);
}

.products .product .woocommerce-loop-product__link {
  display: block;
  margin-bottom: 15px;
}

.products .product img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

.products .product .woocommerce-loop-product__title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-dark);
  padding: 0;
  margin: 0 0 10px 0;
  line-height: 1.4;
}

.products .product .price {
  padding: 0;
  margin: 0 0 15px 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--primary-color);
  display: block;
}

.products .product .price del {
  font-size: 14px;
  color: var(--text-gray);
  margin-right: 6px;
}

.products .product .price ins {
  text-decoration: none;
}

/* Botón añadir al carrito */
.products .product .button {
  width: 100%;
  background: var(--primary-color);
  color: var(--white);
  border: none;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.3s;
  text-align: center;
  margin-top: auto;
}

.products .product .button:hover {
  background: var(--primary-dark);
  transform: translateY(-2px);
}

/* Badge de oferta */
.products .product .onsale {
  position: absolute;
  top: 30px;
  right: 30px;
  background: var(--primary-color);
  color: var(--white);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 10;
}

/* ============================================
   PAGINACIÓN
   ============================================ */
.fractal-pagination {
  margin-top: 40px;
  padding-top: 30px;
  border-top: 2px solid var(--border-color);
}

.woocommerce-pagination {
  text-align: center;
}

.woocommerce-pagination ul {
  display: inline-flex;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.woocommerce-pagination ul li {
  margin: 0;
}

.woocommerce-pagination ul li a,
.woocommerce-pagination ul li span {
  display: block;
  padding: 10px 16px;
  border: 2px solid var(--border-color);
  border-radius: 8px;
  color: var(--text-gray);
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s;
}

.woocommerce-pagination ul li a:hover {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: var(--white);
}

.woocommerce-pagination ul li span.current {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: var(--white);
}

/* ============================================
   NO HAY PRODUCTOS
   ============================================ */
.fractal-no-products {
  text-align: center;
  padding: 80px 20px;
}

.fractal-no-products svg {
  color: var(--text-gray);
  margin-bottom: 20px;
  opacity: 0.5;
}

.fractal-no-products h2 {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0 0 10px 0;
}

.fractal-no-products p {
  font-size: 16px;
  color: var(--text-gray);
  margin: 0 0 25px 0;
}

.fractal-btn-primary {
  display: inline-block;
  background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
  color: var(--white);
  padding: 14px 32px;
  border-radius: 12px;
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  transition: all 0.3s;
  box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.fractal-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
  .fractal-catalog-layout {
    grid-template-columns: 1fr;
  }

  .fractal-filters-sidebar {
    position: relative;
    top: 0;
  }
}

@media (max-width: 768px) {
  .fractal-catalog-title {
    font-size: 32px;
  }

  .fractal-catalog-header {
    height: 300px;
  }

  .fractal-catalog-content {
    padding: 20px;
  }

  .products {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
  }

  .fractal-catalog-toolbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .fractal-ordering {
    width: 100%;
  }

  .fractal-ordering select {
    width: 100%;
  }
}
