/* Catalog Header */
.catalog-container {
  max-width: 1100px;
  margin: 100px auto 40px; /* top spacing for fixed nav */
  padding: 0 16px;
}

.breadcrumb {
  font-size: 14px;
  color: #666;
  margin-bottom: 8px;
}
.breadcrumb a { color: #666; text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

.catalog-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.catalog-title {
  font-size: 28px;
  font-weight: 700;
  margin: 0;
}
.catalog-meta { color: #777; font-size: 14px; }

.controls-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}
.controls-bar select, .controls-bar .order-select {
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 8px;
  background: #fff;
}

.filters-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 16px 0 24px;
}
.chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: #f4f4f6;
  border: 1px solid #e5e5ea;
  color: #333;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease-in-out;
}
.chip:hover { background: #ececf1; }
.chip.active {
  background: #f0f7ff;
  border-color: #9ec4ff;
  color: #0c4a9e;
}

/* Dropdown chips (mega menu) */
.chip.has-dropdown { position: relative; }
.chip-dropdown {
  position: absolute;
  z-index: 50;
  min-width: 560px;
  background: #fff;
  border: 1px solid #e5e5ea;
  box-shadow: 0 10px 24px rgba(0,0,0,0.08);
  border-radius: 12px;
  padding: 14px;
  display: none;
}
.chip-toggle.active + .chip-dropdown { display: block; }
.chip-columns {
  display: grid;
  grid-template-columns: repeat(3, minmax(140px, 1fr));
  gap: 16px;
}
.chip-col-title { font-weight: 700; margin-bottom: 8px; }
.chip-link { display: block; padding: 6px 8px; color: #333; text-decoration: none; border-radius: 8px; }
.chip-link:hover { background: #f7f7f9; }

@media (max-width: 768px) {
  .chip-dropdown { min-width: 90vw; }
  .chip-columns { grid-template-columns: 1fr 1fr; }
}

/* Product Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
@media (max-width: 1024px) { .product-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 768px) { .product-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .product-grid { grid-template-columns: 1fr; } }

.product-card {
  border: 1px solid #eee;
  border-radius: 12px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(0,0,0,0.08);
}

.image-box {
  position: relative;
  width: 100%;
  padding-top: 125%; /* 4:5 ratio */
  background: #fafafa;
}
.image-box img {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100%; height: 100%;
  object-fit: cover;
}

.card-body { padding: 12px; }
.product-name {
  font-weight: 600; font-size: 16px; margin: 0 0 6px;
}
.product-desc { color: #666; font-size: 13px; margin: 0 0 10px; min-height: 34px; }
.product-price { font-size: 18px; font-weight: 700; color: #111; }
.product-meta { color: #777; font-size: 12px; }

.card-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 10px;
}
.whatsapp-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: #25D366;
  color: #fff;
  border: none;
  border-radius: 8px;
  padding: 10px 12px;
  cursor: pointer;
  text-decoration: none;
  font-weight: 600;
}
.whatsapp-btn:hover { filter: brightness(1.05); }

/* Pagination */
.pagination { display: flex; gap: 8px; align-items: center; justify-content: center; margin: 24px 0; }
.pagination a, .pagination span {
  padding: 8px 12px;
  border-radius: 6px;
  border: 1px solid #e5e5ea;
  text-decoration: none;
  color: #333;
}
.pagination .current { background: #f0f7ff; border-color: #9ec4ff; color: #0c4a9e; }
/* Estado activo (Bootstrap .page-item.active .page-link) -> verde del club */
.pagination .page-item.active .page-link {
  background-color: #87CC3E;
  border-color: #87CC3E;
  color: #fff;
}
/* Ajuste de hover para enlaces no activos */
.pagination .page-item:not(.active) .page-link:hover {
  border-color: #87CC3E;
  color: #087f23; /* tono más oscuro para hover */
}

/* Hero elegante para catálogo */
.catalog-hero {
  position: relative;
  border-radius: 16px;
  padding: 20px;
  background: radial-gradient(1200px 600px at 10% 10%, #f7fbff 0%, #f3f6fa 40%, #eef3f8 100%);
  border: 1px solid #e6edf5;
  box-shadow: 0 8px 24px rgba(12, 74, 158, 0.06);
}
.catalog-hero .hero-content {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: end;
}
.catalog-hero .hero-left .breadcrumb { margin-bottom: 6px; }
.catalog-hero .hero-title {
  font-size: 32px;
  font-weight: 800;
  margin: 0;
  letter-spacing: -0.02em;
  color: #111;
}
.catalog-hero .hero-meta {
  margin: 6px 0 0;
  color: #6b7280;
  font-size: 14px;
}
.catalog-hero .hero-right .hero-controls {
  display: flex;
  align-items: center;
  gap: 12px;
  background: rgba(255,255,255,0.65);
  border: 1px solid #e6edf5;
  border-radius: 14px;
  padding: 10px;
  backdrop-filter: blur(10px);
}
.catalog-hero .control { display: flex; flex-direction: column; gap: 6px; }
.catalog-hero .control label { font-size: 12px; color: #6b7280; }
.catalog-hero .hero-select {
  min-width: 200px;
  border-radius: 10px;
  border: 1px solid #dbe7f3;
  background: #fff;
  box-shadow: 0 2px 8px rgba(12, 74, 158, 0.05);
}
.catalog-hero .btn-apply {
  border-radius: 999px;
  padding: 10px 16px;
  font-weight: 700;
  color: #1f2937;
  background: linear-gradient(90deg, #d7f3b5 0%, #b7e778 100%);
  border: 1px solid #aee165;
  box-shadow: 0 6px 18px rgba(135, 204, 62, 0.25);
}
.catalog-hero .btn-apply:hover { filter: brightness(1.05); }

/* Responsive hero */
@media (max-width: 768px) {
  .catalog-hero .hero-content { grid-template-columns: 1fr; align-items: start; }
  .catalog-hero .hero-right .hero-controls { width: 100%; }
  .catalog-hero .hero-select { min-width: 100%; }
}

/* Banner + Sidebar + Sorting (nuevo layout) */
.catalog-banner { background: linear-gradient(90deg,#f6f8fb,#eef6ff); border-radius: 8px; padding: 18px 22px; display:flex; align-items:center; justify-content:space-between; border:1px solid #e6edf5; }
.catalog-banner .banner-content { display:flex; flex-direction:column; }
.catalog-banner .banner-title { font-weight:800; font-size:20px; color:#0b3b6f; }
.catalog-banner .banner-sub { color:#3b3b3b; font-size:14px; }

.catalog-layout { display:flex; gap:24px; align-items:flex-start; }
.filters-sidebar { width: 240px; border-right:1px solid #eee; padding-right:18px; }
.filters-title { font-size:16px; margin-bottom:8px; font-weight:700; }
.filters-list { display:flex; flex-direction:column; gap:8px; }
.filter-link { padding:10px 12px; border-radius:8px; display:block; color:#333; text-decoration:none; border:1px solid transparent; }
.filter-link.active { background:#f1f6ff; border-color:#dbeeff; color:#0b3b6f; font-weight:700; }
/* Botones-radio elegantes */
.filters-form input[type="radio"] { display:none; }
.filters-form .filter-option { display:flex; align-items:center; gap:8px; padding:10px 12px; border:1px solid #e6e6e6; border-radius:10px; cursor:pointer; user-select:none; color:#333; }
.filters-form .filter-option:hover { background:#f7f9fc; }
.filters-form input[type="radio"]:checked + span { font-weight:700; color:#0b3b6f; }
.filters-form .btn-outline-secondary { border:1px solid #ccc; background:#fff; color:#333; border-radius:8px; padding:8px 12px; text-decoration:none; }
.filters-form .btn-outline-secondary:hover { background:#f7f7f7; }

/* Chips de filtros aplicados */
.applied-filters { display:flex; flex-wrap:wrap; gap:8px; align-items:center; }
.applied-chip { display:inline-flex; align-items:center; gap:6px; background:#f0f7ff; border:1px solid #9ec4ff; color:#0c4a9e; padding:6px 10px; border-radius:999px; text-decoration:none; }
.applied-chip .chip-x { font-weight:700; }
.applied-chip.clear-all { background:#fff; border-color:#ddd; color:#333; }

/* Sidebar estilo acordeón con líneas separadoras */
.filter-group { padding:12px 0; border-bottom:1px solid #e6e6e6; }
.filter-header { display:flex; align-items:center; justify-content:space-between; cursor:pointer; font-weight:700; color:#333; }
.filter-header .chevron { transition: transform .2s ease; font-size:14px; }
.filter-header .chevron.rotate { transform: rotate(180deg); }
.filter-body { display:none; padding-top:10px; }
.filter-body.open { display:block; }
.filter-body .filter-option { border:0; padding:6px 0; border-radius:0; }
.filter-body input[type="checkbox"] { margin-right:8px; }

.products-content { flex:1; }
.sorting-toolbar { display:flex; justify-content:space-between; align-items:center; gap:16px; margin:12px 0 16px; }
.sorting-left .content-title { margin:0; font-size:22px; }
.sorting-left .content-meta { margin:2px 0 0; color:#6b7280; font-size:13px; }
.sorting-controls { display:flex; gap:12px; align-items:center; flex-wrap: wrap; }
.sorting-controls .control { display:flex; flex-direction:row; align-items:center; gap:8px; }
.sorting-controls .control label { font-size:12px; color:#6b7280; margin:0; white-space:nowrap; }
.sorting-select { min-width: 140px; padding:6px 10px; border-radius:10px; border:1px solid #dbe7f3; background:#fff; }
.btn-apply { background:#2b8aef; color:#fff; border-radius:8px; padding:8px 12px; border:none; }

/* Topbar móvil */
.mobile-topbar { display:none; gap:16px; align-items:center; margin-bottom:10px; }
.mobile-topbar .mobile-btn { display:inline-flex; align-items:center; gap:8px; padding:8px 12px; border:1px solid #e6e6e6; border-radius:10px; background:#fff; color:#111; }
.mobile-topbar .mobile-btn i { font-size:16px; }

/* Breadcrumb móvil visible solo en pantallas pequeñas */
.mobile-breadcrumb { display:none; }

/* Overlay modal básico */
:root { --nav-height: 60px; }
.overlay { position:fixed; inset:0; background:rgba(0,0,0,0.35); display:none; z-index:2000; }
.overlay[aria-hidden="false"] { display:block; }
.overlay-panel { position:fixed; top:var(--nav-height); right:0; bottom:0; width:90vw; max-width:560px; background:#fff; box-shadow:-8px 0 24px rgba(0,0,0,0.15); display:flex; flex-direction:column; border-top-left-radius:12px; border-bottom-left-radius:12px; }
.overlay-header { display:flex; align-items:center; justify-content:space-between; padding:12px 16px; border-bottom:1px solid #eee; font-weight:700; }
.overlay-close { background:transparent; border:none; font-size:20px; line-height:1; cursor:pointer; }
.overlay-body { padding:10px 16px; overflow:auto; }

/* Recuadros de filtros dentro del overlay */
.overlay .filter-group { border:1px solid #e6e6e6; border-radius:10px; padding:0; margin:10px 0; }
.overlay .filter-header { padding:12px 14px; }
.overlay .filter-body { padding:10px 14px; }

/* Botones de ordenar en overlay */
.sort-options { display:flex; flex-direction:column; gap:10px; }
.sort-option { display:block; width:100%; padding:12px; background:#111; color:#fff; border:none; border-radius:8px; font-weight:700; }
.sort-option[data-active="true"] { background:#555; }

@media (max-width: 900px) {
    .catalog-layout { flex-direction:column; }
    /* En móviles, ocultamos la barra lateral de filtros: se reemplaza por overlay */
    .filters-sidebar { display:none; }
    .products-content { order:1; }
    /* Mantenemos título y meta, pero ocultamos el select de ordenar: se usa overlay */
    .sorting-toolbar { flex-direction: column; align-items: flex-start; gap: 8px; }
    .sorting-controls { display:none; }
    .mobile-topbar { display:flex; }
    .mobile-breadcrumb { display:block; margin-bottom:8px; }
}

@media (max-width: 600px) {
    .sorting-select { min-width: 120px; }
}

/* Ajuste de altura del navbar para móviles */
@media (max-width: 991.98px) {
  :root { --nav-height: 70px; }
}

/* --- Flip de imágenes en tarjetas --- */
.product-card .product-image.front { opacity: 1; transition: opacity 0.18s ease; }
.product-card .product-image.back { opacity: 0; transition: opacity 0.18s ease; }

/* Hover flip en desktop */
.product-card:hover .product-image.front { opacity: 0; }
.product-card:hover .product-image.back { opacity: 1; }

/* Tap flip en móvil: clase aplicada por JS */
.image-box.tap-flip .product-image.front { opacity: 0; }
.image-box.tap-flip .product-image.back { opacity: 1; }

/* --- Listing card hover flip and clickable styles --- */
.product-card { cursor: pointer; }
.product-card .image-box { position: relative; overflow: hidden; }
.product-card .image-box .product-image { position: absolute; top:0; left:0; width:100%; height:100%; object-fit:cover; transition: opacity 0.2s ease; }
.product-card .image-box .product-image.back { opacity: 0; }
.product-card:hover .image-box .product-image.front { opacity: 0; }
.product-card:hover .image-box .product-image.back { opacity: 1; }

/* Hide any legacy viewer controls inside cards */
.product-card .viewer-controls,
.product-card .viewer-indicator,
.product-card .zoom-hint { display: none !important; }
/* Banner de catálogo como imagen */
.catalog-banner-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
}

/* Carrusel detalle de producto */
.detail-gallery {
  position: relative;
}
.detail-main {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #ffffff;
  border-radius: 12px;
  padding: 10px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
  overflow: hidden; /* recorta la imagen ampliada dentro del recuadro */
}
.detail-main .nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: #000000;
  color: #ffffff;
  border: 1px solid #000000;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  z-index: 5;
  transition: all .2s ease;
}
.detail-main .nav-btn.prev { left: 8px; }
.detail-main .nav-btn.next { right: 8px; }

.detail-main .nav-btn:hover {
  background: #ffffff;
  color: #000000;
  border-color: #000000;
}

.detail-thumbs {
  display: flex;
  gap: 10px;
}
.detail-main img {
  max-width: 100%;
  height: auto;
  max-height: 70vh;
  object-fit: contain;
  border-radius: 8px;
  transition: transform .25s ease;
  will-change: transform;
  cursor: zoom-in;
}

/* Zoom al hover, excepto cuando el cursor está en flechas */
.detail-main:not(.hovering-nav):hover img {
  transform: scale(1.08);
}

/* Zoom al clic (se mantiene hasta nuevo clic) */
.detail-main.clicked-zoom img {
  transform: scale(1.8);
  cursor: grab; /* indica que se puede arrastrar */
}
.detail-main.clicked-zoom img:active { cursor: grabbing; }

.detail-thumbs {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 6px;
}
.detail-thumb {
  border: none;
  background: #fff;
  padding: 6px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0,0,0,0.1);
  cursor: pointer;
  box-sizing: border-box; /* evita recortes al aplicar resaltado */
  position: relative; /* necesario para overlay del borde activo */
  border: 2px solid transparent; /* reservar espacio para borde activo sin saltos */
}
.detail-thumb img {
  width: 80px;
  height: 80px;
  object-fit: cover;
  border-radius: 6px;
}
.detail-thumb.active { border-color: #87CC3E; }

@media (max-width: 768px) {
  .detail-main img {
    max-height: 55vh;
  }
  .detail-thumb img {
    width: 72px;
    height: 72px;
  }
}

/* ---- Opciones de producto ---- */
.product-options .size-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.product-options .size-chip {
  border: 1px solid #ddd;
  background: #fff;
  padding: 6px 10px;
  border-radius: 8px;
  cursor: pointer;
  min-width: 44px;
}
.product-options .size-chip.selected { border-color: #87CC3E; background: #f2fae8; }
.product-options .color-swatch { width: 24px; height: 24px; border-radius: 50%; border: 1px solid #ddd; cursor: pointer; }
.product-options .color-swatch.selected { outline: 2px solid #87CC3E; outline-offset: 2px; }
.product-options .color-swatch.fixed { cursor: default; }
.product-options .qty-control { display:flex; align-items:center; gap:8px; max-width:220px; }
.product-options .qty-input { text-align:center; max-width:90px; }
.product-options .qty-btn { width:36px; height:36px; border:1px solid #ddd; border-radius:8px; background:#fff; cursor:pointer; font-size:20px; line-height:1; display:flex; align-items:center; justify-content:center; }
.product-options .qty-btn:hover { background:#f7f7f7; }