/* ==========================================================================
   VARIABLES GLOBALES Y RESET BÁSICO
   ========================================================================== */
:root {
  --cp-primary: #e67e22;
  /* Color Principal del Tema */
  --cp-primary-hover: #d35400;
  --cp-text: #2c3e50;
  --cp-bg: #f9f9f9;
  --cp-border: #ecf0f1;
  --cp-whatsapp: #25D366;
  --cp-whatsapp-hover: #128C7E;
}

.cp-oculto {
  display: none !important;
}

/* ==========================================================================
   BUSCADOR PREDICTIVO (SHORTCODE 1) - DISEÑO OPTIMIZADO PARA HEADER
   ========================================================================== */
.cp-buscador-container {
  position: relative;
  width: 500px;
  max-width: 500px !important;
  margin: 0 auto;
  font-family: sans-serif;
}

.cp-input-wrapper {
  display: flex;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
  border-radius: 50px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.cp-input-wrapper input {
  flex: 1;
  padding: 12px 25px;
  border: none;
  background: transparent;
  font-size: 15px;
  outline: none;
  color: #2c3e50;
}

.cp-input-wrapper input::placeholder {
  color: #95a5a6;
}

.cp-input-wrapper button {
  background: #2c3e50;
  color: #fff;
  border: none;
  padding: 0 35px;
  font-weight: bold;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.cp-input-wrapper button:hover {
  background: var(--cp-primary);
}

/* Caja flotante de resultados predictivos */
#cp-resultados-predictivos {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  width: 100%;
  background: #fff;
  border: 1px solid var(--cp-border);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
  z-index: 999;
  border-radius: 12px;
  max-height: 380px;
  overflow-y: auto;
}

.cp-item-predictivo {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  cursor: pointer;
  border-bottom: 1px solid var(--cp-border);
  transition: 0.2s;
}

.cp-item-predictivo:last-child {
  border-bottom: none;
}

.cp-item-predictivo:hover {
  background: var(--cp-bg);
}

.cp-item-predictivo img {
  width: 45px;
  height: 45px;
  object-fit: contain;
  margin-right: 15px;
  background: #fff;
  border-radius: 4px;
  flex-shrink: 0;
}

.cp-item-predictivo-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.cp-item-predictivo-titulo {
  font-size: 14px;
  color: var(--cp-text);
  font-weight: bold;
  margin-bottom: 4px;
  transition: color 0.2s;
}

.cp-item-predictivo:hover .cp-item-predictivo-titulo {
  color: var(--cp-primary);
}

.cp-item-predictivo-meta {
  font-size: 11px;
  color: #7f8c8d;
}

.cp-item-predictivo-meta strong {
  color: #576574;
}

.cp-item-vacio {
  padding: 15px 20px;
  color: #7f8c8d;
  text-align: center;
  font-size: 14px;
}

/* ==========================================================================
   ESTRUCTURA DEL CATÁLOGO (SHORTCODE 3)
   ========================================================================== */
.cp-catalogo-layout {
  display: flex;
  gap: 40px;
  max-width: 1440px;
  margin: 0 auto;
  font-family: sans-serif;
  align-items: flex-start;
}

/* BARRA LATERAL (FILTROS) */
.cp-filtros-sidebar {
  width: 290px;
  flex-shrink: 0;
  background: #fff;
  padding: 25px 20px;
  border-radius: 8px;
  border: 1px solid var(--cp-border);
}

.cp-filtro-grupo {
  margin-bottom: 20px;
}

.cp-filtro-grupo:last-child {
  margin-bottom: 0;
}

.cp-filtro-grupo label {
  display: block;
  font-weight: bold;
  margin-bottom: 8px;
  color: var(--cp-text);
}

.cp-filtro-grupo input[type="text"],
.cp-filtro-grupo select {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 4px;
  outline: none;
}

.cp-filtro-desktop {
  display: block;
}

.cp-filtro-movil {
  display: none;
}

.cp-radio-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-right: 0;
}

.cp-radio-list label {
  font-weight: normal !important;
  cursor: pointer;
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14.5px;
  color: var(--cp-text);
  transition: 0.2s;
  text-align: left;
  line-height: 1.4;
  margin-bottom: 5px;
}

.cp-radio-list label:hover {
  color: var(--cp-primary);
}

/* Bloqueo de la interferencia del Tema Astra para Checkboxes */
.cp-radio-list input[type="checkbox"] {
  flex-shrink: 0;
  margin: 3px 0 0 0 !important;
  width: 16px !important;
  height: 16px !important;
  min-width: 16px !important;
  appearance: checkbox !important;
}

/* BOTÓN LIMPIAR FILTROS */
.cp-btn-limpiar {
  width: 100%;
  padding: 12px;
  margin-top: 25px;
  background: #f1f2f6;
  color: #747d8c;
  border: 1px solid #dfe4ea;
  border-radius: 6px;
  cursor: pointer;
  font-weight: bold;
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
}

.cp-btn-limpiar:hover {
  background: #dfe4ea;
  color: #2f3542;
  border-color: #ced6e0;
}

/* ==========================================================================
   FILTRO DE PRECIO (BARRA DESLIZABLE DUAL - FORZADO)
   ========================================================================== */
.cp-precio-valores {
  display: flex;
  justify-content: space-between;
  font-weight: bold;
  color: var(--cp-primary);
  margin-bottom: 15px;
  font-size: 14px;
}

.cp-rango-container {
  position: relative;
  width: 100%;
  height: 6px;
  background: #eaedf2;
  border-radius: 5px;
  margin-bottom: 25px;
}

.cp-rango-track {
  position: absolute;
  height: 100%;
  background: var(--cp-primary);
  border-radius: 5px;
  top: 0;
  z-index: 1;
}

.cp-rango-container input[type="range"] {
  position: absolute !important;
  width: 100% !important;
  height: 6px !important;
  top: 0 !important;
  left: 0 !important;
  background: transparent !important;
  pointer-events: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  margin: 0 !important;
  outline: none !important;
  border: none !important;
  z-index: 2 !important;
}

.cp-rango-container input[type="range"]::-webkit-slider-runnable-track {
  -webkit-appearance: none !important;
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  height: 0 !important;
}

.cp-rango-container input[type="range"]::-moz-range-track {
  background: transparent !important;
  border: none !important;
  box-shadow: none !important;
  height: 0 !important;
}

.cp-rango-container input[type="range"]::-webkit-slider-thumb {
  pointer-events: auto !important;
  -webkit-appearance: none !important;
  height: 20px !important;
  width: 20px !important;
  border-radius: 50% !important;
  background: #fff !important;
  border: 3px solid var(--cp-primary) !important;
  cursor: pointer !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15) !important;
  margin-top: -7px !important;
  transition: transform 0.1s !important;
}

.cp-rango-container input[type="range"]::-moz-range-thumb {
  pointer-events: auto !important;
  height: 20px !important;
  width: 20px !important;
  border-radius: 50% !important;
  background: #fff !important;
  border: 3px solid var(--cp-primary) !important;
  cursor: pointer !important;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15) !important;
  transform: translateY(-7px) !important;
  transition: transform 0.1s !important;
}

.cp-rango-container input[type="range"]::-webkit-slider-thumb:active {
  transform: scale(1.1) !important;
}

.cp-rango-container input[type="range"]::-moz-range-thumb:active {
  transform: translateY(-7px) scale(1.1) !important;
}

/* ÁREA PRINCIPAL */
.cp-catalogo-main {
  flex-grow: 1;
  position: relative;
  min-height: 400px;
}

#cp-loader {
  position: absolute;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--cp-primary);
  color: #fff;
  padding: 10px 20px;
  border-radius: 50px;
  font-weight: bold;
  z-index: 10;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

/* ==========================================================================
   GRILLA DE PRODUCTOS Y TARJETAS (3 COLUMNAS)
   ========================================================================== */
.cp-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 25px;
  transition: opacity 0.3s ease;
}

.cp-card {
  background: #ffffff;
  border: 1px solid #eaedf2;
  border-radius: 12px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s, box-shadow 0.3s, border-color 0.3s;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.04);
}

.cp-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.1);
  border-color: #d1d9e6;
}

.cp-card-img {
  width: 100%;
  height: 220px;
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #fcfcfc;
  border-bottom: 1px solid #f0f2f5;
  padding: 15px;
  position: relative;
}

.cp-card-info {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
  text-align: center;
}

.cp-categoria-badge {
  display: inline-block;
  font-size: 10px;
  text-transform: uppercase;
  font-weight: bold;
  letter-spacing: 0.5px;
  background: #f0f4f8;
  color: #64748b;
  padding: 6px 12px;
  border-radius: 20px;
  margin-bottom: 12px;
  align-self: center;
}

.cp-card-info h3 {
  font-size: 16px;
  margin: 0 0 8px 0;
  color: var(--cp-text);
  line-height: 1.3;
}

/* ==========================================================================
   ESTILOS MEJORADOS PARA LA MARCA (DISEÑO TIPO ETIQUETA)
   ========================================================================== */
.cp-marca-producto {
  display: inline-block;
  align-self: center;
  font-size: 11px;
  color: #747d8c;
  background-color: #f8f9fa;
  border: 1px solid #dfe4ea;
  padding: 5px 12px;
  border-radius: 6px;
  margin-bottom: 18px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.cp-marca-producto strong {
  color: #2b2d3f;
  font-weight: 900;
  margin-left: 3px;
}

.cp-precio {
  font-size: 20px;
  font-weight: 900;
  color: var(--cp-primary);
  margin-bottom: 20px;
}

/* Botón WhatsApp */
.cp-btn-wa {
  display: inline-block;
  background: var(--cp-whatsapp);
  color: #fff;
  text-decoration: none;
  padding: 12px;
  border-radius: 4px;
  font-weight: bold;
  margin-top: auto;
  transition: 0.3s;
}

.cp-btn-wa:hover {
  background: var(--cp-whatsapp-hover);
  color: #fff;
}

/* ==========================================================================
   PAGINACIÓN
   ========================================================================== */
.cp-paginacion {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-top: 40px;
}

.cp-page-btn {
  background: #fff;
  border: 1px solid var(--cp-border);
  color: var(--cp-text);
  padding: 8px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-weight: bold;
  transition: 0.2s;
}

.cp-page-btn:hover {
  background: var(--cp-bg);
}

.cp-page-btn.activo {
  background: var(--cp-primary);
  color: #fff;
  border-color: var(--cp-primary);
}

.cp-no-resultados {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px;
  background: #fff;
  border: 1px dashed #ccc;
  color: #7f8c8d;
  border-radius: 8px;
}

/* ==========================================================================
   DISEÑO DE LA ETIQUETA "NUEVO"
   ========================================================================== */
.cp-badge-nuevo {
  position: absolute;
  top: 15px;
  right: 15px;
  color: #e74c3c;
  font-size: 11px;
  font-weight: 900;
  padding: 5px 12px;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 1px;
  z-index: 2;
  animation: cp-pulse 2s infinite;
}

@keyframes cp-pulse {
  0% {
    transform: scale(1);
  }

  50% {
    transform: scale(1.05);
  }

  100% {
    transform: scale(1);
  }
}

/* ==========================================================================
   ADAPTACIÓN PARA MÓVILES Y TABLETS (RESPONSIVE)
   ========================================================================== */
@media (max-width: 1024px) {
  .cp-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .cp-catalogo-layout {
    flex-direction: column;
    align-items: stretch;
  }

  .cp-catalogo-main {
    width: 100%;
  }

  .cp-filtros-sidebar {
    width: 100%;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
  }

  .cp-filtro-grupo {
    flex: 1;
    min-width: 150px;
    margin-bottom: 0;
  }

  .cp-filtro-desktop {
    display: none;
  }

  .cp-filtro-movil {
    display: block;
  }
}

@media (max-width: 480px) {
  .cp-filtro-grupo {
    flex: 100%;
  }

  .cp-grid {
    grid-template-columns: 1fr;
    width: 100%;
  }

  .cp-card {
    width: 100%;
    max-width: 100%;
    margin: 0;
  }
}

/* ==========================================================================
   DESPLEGABLE MÚLTIPLE PREMIUM PARA MÓVIL (UN SOLO CAMPO)
   ========================================================================== */
.cp-multiselect-dropdown {
  position: relative;
  width: 100%;
  font-family: sans-serif;
}

.cp-multiselect-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 15px;
  border: 1px solid #ccc;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  font-size: 14.5px;
  color: var(--cp-text);
  user-select: none;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02);
}

.cp-multiselect-header .cp-arrow {
  font-size: 10px;
  transition: transform 0.3s ease;
  color: #7f8c8d;
}

.cp-multiselect-dropdown.open .cp-arrow {
  transform: rotate(180deg);
}

.cp-multiselect-options {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background: #fff;
  border: 1px solid #ced6e0;
  border-top: none;
  border-radius: 0 0 6px 6px;
  max-height: 240px;
  overflow-y: auto;
  z-index: 9999;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.08);
}

.cp-multiselect-dropdown.open .cp-multiselect-options {
  display: block;
}

.cp-multiselect-option {
  display: flex !important;
  align-items: center;
  gap: 12px;
  padding: 12px 15px;
  cursor: pointer;
  border-bottom: 1px solid #f1f2f6;
  margin: 0 !important;
  transition: background 0.2s;
  text-align: left;
}

.cp-multiselect-option:last-child {
  border-bottom: none;
}

.cp-multiselect-option:hover {
  background: #f8f9fa;
}

.cp-multiselect-option input[type="checkbox"] {
  flex-shrink: 0;
  margin: 0 !important;
  width: 18px !important;
  height: 18px !important;
  min-width: 18px !important;
  appearance: checkbox !important;
  accent-color: var(--cp-primary);
}

.cp-multiselect-option span {
  font-size: 14px;
  font-weight: normal !important;
  color: var(--cp-text);
}

/* ==========================================================================
   ESTILOS PARA LOS CHIPS VISUALES DE FILTROS SELECCIONADOS
   ========================================================================== */
.cp-filtros-activos-container {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 5px;
}

.cp-chip {
  display: inline-flex;
  align-items: center;
  background: #f0f4f8;
  color: #4b6584;
  font-size: 12px;
  font-weight: bold;
  padding: 4px 8px 4px 10px;
  border-radius: 4px;
  border: 1px solid #d1d9e6;
  text-transform: capitalize;
}

.cp-chip-remove {
  margin-left: 8px;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  color: #95a5a6;
  transition: color 0.2s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.cp-chip-remove:hover {
  color: #e74c3c;
}

.cp-titulo-filtros-activos {
  width: 100%;
  font-weight: bold;
  color: var(--cp-text);
  font-size: 14.5px;
  margin-bottom: 6px;
  margin-top: 5px;
}

/* ==========================================================================
   TOGGLE PARA FILTROS DE ESCRITORIO (+ / -)
   ========================================================================== */
.cp-filtro-header-toggle {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  margin-bottom: 12px;
  user-select: none;
  padding-right: 5px;
}

.cp-filtro-header-toggle label {
  margin-bottom: 0 !important;
  cursor: pointer;
}

.cp-toggle-icon {
  font-size: 18px;
  font-weight: bold;
  color: var(--cp-primary);
  background-color: #ffffff;
  border: 1px solid #d1d9e6;
  border-radius: 4px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  transition: all 0.2s ease;
}

.cp-filtro-header-toggle:hover .cp-toggle-icon {
  background-color: #f8f9fa;
  border-color: var(--cp-primary);
  transform: scale(1.05);
}

/* ==========================================================================
   VISTA INDIVIDUAL DEL PRODUCTO (SINGLE)
   ========================================================================== */
.cp-single-container {
  max-width: 1200px;
  margin: 50px auto;
  padding: 0 20px;
  font-family: sans-serif;
}

.cp-back-btn {
  margin-bottom: 25px;
}

.cp-back-btn a {
  color: #7f8c8d;
  text-decoration: none;
  font-weight: bold;
  font-size: 14px;
  transition: color 0.2s;
}

.cp-back-btn a:hover {
  color: var(--cp-primary);
}

.cp-single-layout {
  display: flex;
  gap: 50px;
  background: #fff;
  padding: 40px;
  border-radius: 12px;
  border: 1px solid var(--cp-border);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
}

.cp-single-media {
  flex: 1;
  max-width: 500px;
}

.cp-single-main-img {
  width: 100%;
  height: auto;
  border-radius: 8px;
  border: 1px solid #f0f2f5;
  margin-bottom: 20px;
}

.cp-single-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.cp-single-title {
  font-size: 32px;
  margin: 0 0 15px 0;
  color: var(--cp-text);
  line-height: 1.2;
}

.cp-precio-single {
  font-size: 36px;
  font-weight: 900;
  color: var(--cp-primary);
  margin-bottom: 30px;
}

.cp-btn-wa-single {
  width: 100%;
  text-align: center;
  padding: 18px;
  font-size: 16px;
  border-radius: 8px;
  margin-bottom: 40px;
  margin-top: 0;
}

.cp-single-description {
  width: 100%;
  border-top: 1px solid #f1f2f6;
  padding-top: 30px;
}

.cp-single-description h3 {
  font-size: 18px;
  color: var(--cp-text);
  margin-bottom: 15px;
}

.cp-description-content {
  color: #576574;
  line-height: 1.6;
}

.cp-description-content .wp-block-gallery {
  margin-top: 25px;
}

.cp-related-section {
  margin-top: 80px;
}

.cp-related-title {
  font-size: 26px;
  margin-bottom: 30px;
  color: var(--cp-text);
  text-align: center;
  font-weight: bold;
}

@media (max-width: 768px) {
  .cp-single-layout {
    flex-direction: column;
    padding: 25px;
  }

  .cp-single-media {
    max-width: 100%;
  }
}

/* ==========================================================================
   BOTÓN "VER DETALLES" (GRILLA DE CATÁLOGO)
   ========================================================================== */
.cp-btn-detalle {
  display: inline-block;
  background: var(--cp-primary);
  color: #fff;
  text-decoration: none;
  padding: 12px;
  border-radius: 4px;
  font-weight: bold;
  margin-top: auto;
  text-align: center;
  transition: all 0.3s ease;
}

.cp-btn-detalle:hover {
  background: var(--cp-primary-hover);
  color: #fff;
  transform: translateY(-2px);
}

/* ==========================================================================
   ESTRUCTURA EN LÍNEA: VISTA INDIVIDUAL DEL PRODUCTO
   ========================================================================== */
.cp-single-header-inline {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 20px;
  margin-bottom: 20px;
  border-bottom: 1px solid #eaedf2;
  padding-bottom: 15px;
  width: 100%;
}

.cp-single-title {
  font-size: 25px;
  font-weight: 800;
  margin: 0 !important;
  letter-spacing: -0.5px;
  color: var(--cp-text);
  flex: 1;
}

.cp-precio-inline {
  font-size: 30px;
  font-weight: 900;
  color: var(--cp-primary);
  margin: 0 !important;
  white-space: nowrap;
}

.cp-single-meta-inline {
  display: flex;
  align-items: center;
  gap: 15px;
  margin-bottom: 30px;
  flex-wrap: wrap;
}

.cp-single-meta-inline .cp-marca-producto,
.cp-single-meta-inline .cp-categoria-badge {
  margin: 0 !important;
}

.cp-single-actions-inline {
  display: flex;
  align-items: center;
  gap: 20px;
  margin-bottom: 45px;
  flex-wrap: wrap;
}

.cp-btn-cotizar-small {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 24px;
  font-size: 15px;
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(37, 211, 102, 0.2);
}

.cp-btn-cotizar-small:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 15px rgba(37, 211, 102, 0.3);
}

.cp-btn-back-new {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 11px 20px;
  background-color: #f1f2f6;
  color: #576574;
  border: 1px solid #dfe4ea;
  border-radius: 6px;
  text-decoration: none;
  font-weight: bold;
  font-size: 14px;
  transition: all 0.3s ease;
}

.cp-btn-back-new:hover {
  background-color: #dfe4ea;
  color: var(--cp-primary);
  border-color: #ced6e0;
  transform: translateY(-2px);
}

@media (max-width: 768px) {
  .cp-single-header-inline {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
  }
}