/* Paleta alineada a KEYSPRO nod.keyspro.info — gradiente #667eea → #764ba2, fondo oscuro login */
:root {
  --kp-violet: #667eea;
  --kp-purple: #764ba2;
  --kp-gradient: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --kp-black: #0a0a0a;
  --kp-blue: #667eea;
  --kp-blue-dark: #5a67d8;
  --kp-gray-50: #f4f4f8;
  --kp-gray-100: #ececf4;
  --kp-gray-600: #475569;
  --kp-gray-900: #1e1b2e;
  --kp-radius: 12px;
  --kp-shadow: 0 10px 40px rgba(102, 126, 234, 0.12);
  --bs-primary: #667eea;
  --bs-primary-rgb: 102, 126, 234;
}

/* Base ligeramente menor (15px si el navegador usa 16px): escala tipografía y componentes en rem */
html {
  font-size: 93.75%;
}

body {
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  color: var(--kp-gray-900);
  background: var(--kp-gray-50);
}

/* Globo flotante WhatsApp */
@keyframes kp-wa-pulse-ring {
  0% {
    transform: scale(1);
    opacity: 0.65;
  }
  100% {
    transform: scale(1.5);
    opacity: 0;
  }
}

@keyframes kp-wa-float-glow {
  0%,
  100% {
    box-shadow:
      0 6px 22px rgba(37, 211, 102, 0.42),
      0 0 0 0 rgba(37, 211, 102, 0.4);
  }
  50% {
    box-shadow:
      0 10px 28px rgba(37, 211, 102, 0.5),
      0 0 0 12px rgba(37, 211, 102, 0);
  }
}

@keyframes kp-wa-icon-wave {
  0%,
  88%,
  100% {
    transform: rotate(0deg);
  }
  90% {
    transform: rotate(-10deg);
  }
  94% {
    transform: rotate(10deg);
  }
  97% {
    transform: rotate(0deg);
  }
}

.kp-wa-float {
  position: fixed;
  right: 1.15rem;
  bottom: 1.15rem;
  z-index: 1040;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  width: 3.5rem;
  height: 3.5rem;
  border-radius: 50%;
  border: none;
  background: #25d366;
  color: #fff !important;
  text-decoration: none;
  box-shadow: 0 6px 22px rgba(37, 211, 102, 0.42);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  overflow: visible;
  isolation: isolate;
  animation: kp-wa-float-glow 2.4s ease-in-out infinite;
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.kp-wa-float:focus {
  outline: none;
}

.kp-wa-float:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.95);
  outline-offset: 3px;
}

.kp-wa-float::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 2px solid rgba(37, 211, 102, 0.55);
  pointer-events: none;
  z-index: -1;
  animation: kp-wa-pulse-ring 2s ease-out infinite;
}

.kp-wa-float:hover {
  color: #fff !important;
  transform: scale(1.06);
  box-shadow: 0 10px 30px rgba(37, 211, 102, 0.55);
  animation: none;
}

.kp-wa-float:hover::before {
  animation: none;
  opacity: 0;
}

.kp-wa-float:hover .bi-whatsapp {
  animation: none;
}

.kp-wa-float .bi-whatsapp {
  font-size: 1.85rem;
  line-height: 1;
  display: inline-block;
  animation: kp-wa-icon-wave 4s ease-in-out infinite;
}

.kp-wa-float__label {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

@media (min-width: 576px) {
  .kp-wa-float {
    width: auto;
    min-width: 3.5rem;
    height: 3.5rem;
    padding: 0 1rem 0 0.85rem;
    border-radius: 999px;
  }

  .kp-wa-float__label {
    position: static;
    opacity: 1;
    width: auto;
    height: auto;
    overflow: visible;
    clip: auto;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    white-space: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .kp-wa-float {
    animation: none;
  }

  .kp-wa-float::before {
    animation: none;
    opacity: 0;
  }

  .kp-wa-float .bi-whatsapp {
    animation: none;
  }

  .kp-wa-float:hover {
    transform: none;
  }

  .kp-wa-panel:not([hidden]) {
    animation: none;
  }
}

/* Widget: chatbot + globo WhatsApp */
.kp-wa-widget {
  position: fixed;
  right: 1.15rem;
  bottom: 1.15rem;
  z-index: 1040;
}

.kp-wa-widget .kp-wa-float {
  position: relative;
  right: auto;
  bottom: auto;
}

.kp-wa-panel {
  position: absolute;
  right: 0;
  bottom: calc(3.5rem + 0.65rem);
  width: min(100vw - 2rem, 340px);
  max-height: min(72vh, 520px);
  display: flex;
  flex-direction: column;
  padding-bottom: 14px;
  background: transparent;
  border: none;
  box-shadow: none;
  overflow: visible;
  transform-origin: 90% 100%;
}

.kp-wa-panel:not([hidden]) {
  animation: kp-wa-cloud-pop 0.32s cubic-bezier(0.34, 1.15, 0.64, 1) both;
}

@keyframes kp-wa-cloud-pop {
  from {
    opacity: 0;
    transform: translate3d(0, 12px, 0) scale(0.97);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0) scale(1);
  }
}

.kp-wa-panel__cloud {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-radius: 28px 28px 10px 28px;
  background: linear-gradient(165deg, #ffffff 0%, #f0fdf4 48%, #ecfdf5 100%);
  border: 1px solid rgba(34, 197, 94, 0.2);
  box-shadow:
    0 18px 44px rgba(34, 197, 94, 0.14),
    0 8px 22px rgba(15, 23, 42, 0.07);
  overflow: hidden;
}

/* Cola de burbuja hacia el globo (fuera del overflow del contenido) */
.kp-wa-panel::after {
  content: "";
  position: absolute;
  z-index: 5;
  bottom: 4px;
  right: 1.5rem;
  width: 15px;
  height: 15px;
  background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
  border-right: 1px solid rgba(34, 197, 94, 0.18);
  border-bottom: 1px solid rgba(34, 197, 94, 0.18);
  transform: rotate(45deg);
  border-radius: 0 0 2px 0;
  box-shadow: 4px 4px 14px rgba(34, 197, 94, 0.12);
  pointer-events: none;
}

.kp-wa-panel__head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.85rem 1rem;
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.08) 0%, rgba(118, 75, 162, 0.06) 100%);
  border-bottom: 1px solid #e8eef7;
}

.kp-wa-panel__title {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 0.15rem;
  color: var(--kp-gray-900);
}

.kp-wa-panel__subtitle {
  font-size: 0.75rem;
  line-height: 1.35;
}

.kp-wa-panel__messages {
  flex: 1;
  min-height: 140px;
  max-height: 280px;
  overflow-y: auto;
  padding: 0.75rem 1rem;
  background: #f8fafc;
}

.kp-wa-msg {
  display: flex;
  margin-bottom: 0.65rem;
}

.kp-wa-msg--bot {
  justify-content: flex-start;
}

.kp-wa-msg--user {
  justify-content: flex-end;
}

.kp-wa-msg__inner {
  max-width: 92%;
  padding: 0.55rem 0.75rem;
  border-radius: 12px;
  font-size: 0.88rem;
  line-height: 1.45;
}

.kp-wa-msg--bot .kp-wa-msg__inner {
  background: #fff;
  border: 1px solid #e8eef7;
  color: var(--kp-gray-900);
  border-bottom-left-radius: 4px;
}

.kp-wa-msg--user .kp-wa-msg__inner {
  background: var(--kp-gradient);
  color: #fff;
  border-bottom-right-radius: 4px;
}

.kp-wa-msg__stack {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.5rem;
  width: 100%;
}

.kp-wa-msg__stack .kp-wa-msg__text {
  white-space: pre-line;
}

.kp-wa-panel__quick {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  padding: 0.5rem 1rem 0.75rem;
  background: #fff;
  border-top: 1px solid #eef2f7;
}

.kp-wa-panel__foot {
  padding: 0 1rem 0.85rem;
  background: #fff;
}

@media (min-width: 576px) {
  .kp-wa-panel {
    bottom: calc(3.5rem + 0.85rem);
  }
}

/* Marca KEYSPRO (Rajdhani se carga en layout) */
.font-brand {
  font-family: "Rajdhani", system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.navbar-kp {
  background: var(--kp-black) !important;
  border-bottom: 1px solid rgba(102, 126, 234, 0.35);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

/* Por encima del catálogo al hacer scroll (Bootstrap sticky-top ya fija top:0) */
.navbar-kp.sticky-top {
  z-index: 1030;
}

@media (min-width: 992px) {
  .navbar-kp .navbar-collapse {
    flex-grow: 1;
    align-items: center;
  }
}

.navbar-kp .navbar-brand {
  font-family: "Rajdhani", system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: 0.14em;
  font-size: 1.35rem;
  color: #fff !important;
}

.navbar-kp .nav-link {
  color: rgba(255, 255, 255, 0.88) !important;
  font-weight: 500;
}

.navbar-kp .nav-link:hover {
  color: #c4b5fd !important;
}

.navbar-kp .navbar-toggler {
  border-color: rgba(255, 255, 255, 0.35);
}

.navbar-kp .navbar-toggler-icon {
  filter: invert(1);
}

.kp-badge-cart {
  background: var(--kp-gradient) !important;
  color: #fff !important;
  font-weight: 600;
}

.hero {
  background: var(--kp-gradient);
  color: #fff;
  border-radius: var(--kp-radius);
  padding: 3rem 2rem;
  box-shadow: var(--kp-shadow);
}

/* Carrusel hero — inicio */
.home-hero-carousel {
  border-radius: var(--kp-radius);
  overflow: hidden;
  box-shadow: var(--kp-shadow);
}

/* Carrusel a todo el ancho de la ventana (sale del .container del main) */
.home-hero-carousel--fullbleed {
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  width: 100vw;
  max-width: 100vw;
  box-sizing: border-box;
  border-radius: 0;
  box-shadow: none;
}

.home-hero-carousel--fullbleed .carousel,
.home-hero-carousel--fullbleed .carousel-inner {
  border-radius: 0;
}

.home-hero-carousel .carousel {
  border-radius: var(--kp-radius);
}

.home-hero-carousel:not(.home-hero-carousel--fullbleed) .carousel-inner {
  border-radius: var(--kp-radius);
}

.home-hero-carousel--fullbleed .carousel-inner {
  border-radius: 0;
}

.home-hero-carousel__img {
  height: min(52vh, 520px);
  object-fit: cover;
  object-position: center;
}

.home-hero-carousel .carousel-caption {
  left: 0;
  right: 0;
  bottom: 0;
  top: 0;
  padding: 1.75rem 0;
  text-align: left;
  display: flex;
  align-items: center;
  max-width: 100%;
  background: linear-gradient(
    105deg,
    rgba(10, 10, 14, 0.92) 0%,
    rgba(10, 10, 14, 0.55) 45%,
    rgba(10, 10, 14, 0.12) 78%,
    transparent 95%
  );
}

@media (min-width: 768px) {
  .home-hero-carousel .carousel-caption {
    padding: 2.5rem 0;
  }
}

.home-hero-carousel__copy {
  max-width: 38rem;
}

.home-hero-carousel__badge {
  display: inline-block;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #e9d5ff;
  background: rgba(102, 126, 234, 0.4);
  border: 1px solid rgba(196, 181, 253, 0.5);
  padding: 0.35rem 0.9rem;
  border-radius: 999px;
  margin-bottom: 0.85rem;
}

.home-hero-carousel__title {
  font-family: "Rajdhani", system-ui, sans-serif;
  letter-spacing: 0.02em;
  color: #fff;
  text-shadow: 0 2px 24px rgba(0, 0, 0, 0.45);
}

.home-hero-carousel__lead {
  color: rgba(248, 250, 252, 0.94);
  text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
}

.home-hero-carousel .carousel-indicators {
  margin-bottom: 1rem;
  z-index: 3;
}

.home-hero-carousel .carousel-indicators [data-bs-target] {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.45);
}

.home-hero-carousel .carousel-indicators .active {
  background: #fff;
  box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.8);
}

.home-hero-carousel .carousel-control-prev,
.home-hero-carousel .carousel-control-next {
  width: 8%;
  min-width: 2.5rem;
  z-index: 3;
}

.home-hero-carousel .carousel-control-prev-icon,
.home-hero-carousel .carousel-control-next-icon {
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, 0.6));
}

@media (prefers-reduced-motion: reduce) {
  .home-hero-carousel .carousel-item {
    transition: none;
  }
}

/* Redes sociales (inicio) */
.home-social__inner {
  padding: 1.75rem 1.25rem;
  border-radius: var(--kp-radius);
  border: 1px solid rgba(102, 126, 234, 0.12);
  background: linear-gradient(180deg, rgba(248, 250, 252, 0.9) 0%, rgba(255, 255, 255, 0.55) 100%);
  box-shadow: var(--kp-shadow);
}

.home-social__title {
  font-family: "Rajdhani", system-ui, sans-serif;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--kp-text, #1e1b2e);
}

.home-social__link {
  width: 3rem;
  height: 3rem;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  line-height: 1;
  border-color: rgba(102, 126, 234, 0.35);
  color: #4f46e5;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.home-social__link:hover {
  transform: translateY(-2px);
  background: rgba(102, 126, 234, 0.08);
  border-color: rgba(79, 70, 229, 0.45);
  color: #4338ca;
}

/* Publicidad / servicio — instalación remota (inicio) */
.home-promo-remote {
  border-radius: var(--kp-radius);
  overflow: hidden;
  box-shadow: 0 12px 40px rgba(102, 126, 234, 0.22);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.home-promo-remote__inner {
  background: linear-gradient(135deg, #1a1530 0%, #2d2650 45%, #4c3d78 100%);
  color: #f1f5f9;
  padding: 2rem 2.25rem;
}

@media (min-width: 768px) {
  .home-promo-remote__inner {
    padding: 2.5rem 3rem;
  }
}

.home-promo-remote__badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #e9d5ff;
  background: rgba(102, 126, 234, 0.35);
  border: 1px solid rgba(196, 181, 253, 0.45);
  padding: 0.35rem 0.85rem;
  border-radius: 999px;
  margin-bottom: 1rem;
}

.home-promo-remote__title {
  font-family: "Rajdhani", system-ui, sans-serif;
  font-weight: 700;
  font-size: clamp(1.5rem, 3vw, 2rem);
  letter-spacing: 0.04em;
  color: #fff;
  margin-bottom: 0.75rem;
  line-height: 1.2;
}

.home-promo-remote__lead {
  color: rgba(241, 245, 249, 0.88);
  font-size: 1.05rem;
  max-width: 42rem;
  margin-bottom: 1.25rem;
}

.home-promo-remote__list {
  list-style: none;
  padding: 0;
  margin: 0 0 1.5rem;
  display: grid;
  gap: 0.5rem;
}

@media (min-width: 576px) {
  .home-promo-remote__list {
    grid-template-columns: 1fr 1fr;
    gap: 0.35rem 1.5rem;
  }
}

.home-promo-remote__list li {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 0.95rem;
  color: rgba(226, 232, 240, 0.92);
}

.home-promo-remote__list .bi {
  color: #a5b4fc;
  flex-shrink: 0;
  margin-top: 0.15rem;
}

.home-promo-remote .btn-light {
  font-weight: 600;
}

.home-promo-remote .btn-outline-light {
  border-color: rgba(255, 255, 255, 0.45);
  color: #fff;
}

.home-promo-remote .btn-outline-light:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: #fff;
  color: #fff;
}

.card-kp {
  border: none;
  border-radius: var(--kp-radius);
  box-shadow: var(--kp-shadow);
  border: 1px solid rgba(102, 126, 234, 0.08);
}

.btn-kp-primary {
  background: var(--kp-gradient);
  border: none;
  color: #fff;
  border-radius: 10px;
  padding: 0.5rem 1.25rem;
  font-weight: 600;
  box-shadow: 0 4px 14px rgba(102, 126, 234, 0.35);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.btn-kp-primary:hover {
  filter: brightness(1.06);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 10px 25px rgba(102, 126, 234, 0.4);
}

.badge-soft {
  background: var(--kp-gray-100);
  color: var(--kp-gray-600);
  font-weight: 500;
}

.admin-shell {
  min-height: 100vh;
  background: #12121a;
}

.admin-sidebar {
  width: 260px;
  background: var(--kp-black);
  border-right: 1px solid rgba(102, 126, 234, 0.25);
  min-height: 100vh;
  position: sticky;
  top: 0;
}

.admin-sidebar .nav-link {
  color: rgba(226, 232, 240, 0.88);
  border-radius: 8px;
  margin: 2px 12px;
  padding: 0.55rem 0.9rem;
  font-weight: 500;
}

.admin-sidebar .nav-link:hover,
.admin-sidebar .nav-link.active {
  background: rgba(102, 126, 234, 0.18);
  color: #e9d5ff;
}

.admin-sidebar .fw-bold.text-dark,
.admin-sidebar a.text-decoration-none.fw-bold {
  color: #fff !important;
}

.admin-sidebar .text-muted {
  color: rgba(148, 163, 184, 0.9) !important;
}

.admin-content {
  flex: 1;
  padding: 1.5rem 2rem;
  background: #f4f4f8;
  min-height: 100vh;
}

.stat-card {
  background: #fff;
  border-radius: var(--kp-radius);
  padding: 1.25rem;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
  border: 1px solid #e2e8f0;
}

.table-admin {
  background: #fff;
  border-radius: var(--kp-radius);
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
}

.table-admin .admin-product-thumb {
  width: 52px;
  height: 52px;
  object-fit: contain;
  background: #f1f5f9;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  padding: 2px;
  vertical-align: middle;
}

.table-admin .admin-product-thumb-wrap {
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  border: 1px dashed #cbd5e1;
  border-radius: 8px;
  color: #94a3b8;
  font-size: 0.7rem;
}

.admin-product-thumb-trigger {
  cursor: zoom-in;
  line-height: 0;
}

.admin-product-thumb-trigger:focus-visible {
  outline: 2px solid var(--bs-primary);
  outline-offset: 2px;
  border-radius: 8px;
}

.admin-product-preview-modal__img {
  max-height: min(70vh, 720px);
  width: auto;
  max-width: 100%;
  object-fit: contain;
}

footer.site-footer {
  border-top: 1px solid rgba(102, 126, 234, 0.2);
  background: linear-gradient(180deg, #0f0f14 0%, var(--kp-black) 100%);
  margin-top: 4rem;
  padding: 2rem 0;
  color: rgba(226, 232, 240, 0.85);
  font-size: 0.9rem;
}

footer.site-footer .text-muted {
  color: rgba(148, 163, 184, 0.95) !important;
}

footer.site-footer a {
  color: #c4b5fd;
  text-decoration: none;
}

footer.site-footer a:hover {
  color: #e9d5ff;
  text-decoration: underline;
}

footer.site-footer strong {
  font-family: "Rajdhani", system-ui, sans-serif;
  letter-spacing: 0.06em;
  color: #fff;
}

/* Carrusel de marcas — fondo transparente, scroll infinito */
.brands-section {
  background: transparent;
}

.brands-marquee-wrap {
  overflow: hidden;
  width: 100%;
  background: transparent;
  mask-image: linear-gradient(
    to right,
    transparent,
    #000 8%,
    #000 92%,
    transparent
  );
  -webkit-mask-image: linear-gradient(
    to right,
    transparent,
    #000 8%,
    #000 92%,
    transparent
  );
}

.brands-marquee {
  width: 100%;
  overflow: hidden;
}

.brands-track {
  display: flex;
  width: max-content;
  animation: brands-marquee-scroll 45s linear infinite;
  gap: 0;
}

.brands-set {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 3rem;
  padding-right: 3rem;
}

.brands-item {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 56px;
  background: transparent;
}

.brands-item img {
  max-height: 48px;
  width: auto;
  max-width: 140px;
  object-fit: contain;
  background: transparent !important;
  filter: none;
}

@keyframes brands-marquee-scroll {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(-50%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .brands-track {
    animation: none;
    justify-content: center;
    flex-wrap: wrap;
    width: 100%;
    max-width: 100%;
    transform: none;
  }

  .brands-marquee-wrap {
    mask-image: none;
    -webkit-mask-image: none;
  }

  .brands-set {
    padding-right: 0;
  }

  .brands-set[aria-hidden="true"] {
    display: none;
  }
}

/* ——— Catálogo estilo WebMatryx / B2B ——— */
.catalog-page {
  margin-top: -1.5rem;
}

.catalog-hero {
  background: var(--kp-gradient);
  color: #fff;
  padding: 2rem 0 2.5rem;
  margin-left: calc(50% - 50vw);
  margin-right: calc(50% - 50vw);
  width: 100vw;
  max-width: 100vw;
  box-sizing: border-box;
}

.catalog-breadcrumb .breadcrumb-item a {
  color: rgba(255, 255, 255, 0.75);
  text-decoration: none;
}

.catalog-breadcrumb .breadcrumb-item a:hover {
  color: #fff;
  text-decoration: underline;
}

.catalog-breadcrumb .breadcrumb-item.active {
  color: rgba(255, 255, 255, 0.95);
}

.catalog-breadcrumb .breadcrumb-item + .breadcrumb-item::before {
  color: rgba(255, 255, 255, 0.45);
}

.catalog-hero__title {
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.35rem;
}

.catalog-hero__subtitle {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 1rem;
}

.catalog-layout {
  align-items: flex-start;
}

.catalog-sidebar__inner {
  background: #fff;
  border-radius: 14px;
  border: 1px solid #e8eef7;
  padding: 1.15rem 1rem;
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.06);
  position: sticky;
  top: 1rem;
}

@media (max-width: 991.98px) {
  .catalog-sidebar__inner {
    position: static;
  }
}

.catalog-sidebar__title {
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #64748b;
  margin-bottom: 0.85rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e2e8f0;
}

.catalog-sidebar__title--sub {
  margin-top: 0;
}

.catalog-sidebar__title--sub:not(:first-child) {
  padding-top: 0.25rem;
}

.catalog-sidebar__nav {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.catalog-sidebar__link {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.55rem 0.75rem;
  border-radius: 10px;
  text-decoration: none;
  color: #334155;
  font-weight: 500;
  font-size: 0.95rem;
  transition: background 0.15s ease, color 0.15s ease;
}

.catalog-sidebar__link:hover {
  background: #f1f5f9;
  color: var(--kp-blue);
}

.catalog-sidebar__link--active {
  background: linear-gradient(135deg, rgba(102, 126, 234, 0.12) 0%, rgba(118, 75, 162, 0.1) 100%);
  color: var(--kp-violet);
  font-weight: 600;
}

.catalog-main {
  min-width: 0;
}

.catalog-toolbar {
  border-radius: var(--kp-radius);
}

.catalog-search__group .input-group-text {
  border-radius: 10px 0 0 10px;
}

.catalog-search__group .form-control {
  border-radius: 0;
  box-shadow: none;
}

.catalog-search__group .form-control:focus {
  box-shadow: 0 0 0 0.2rem rgba(102, 126, 234, 0.2);
  border-color: var(--kp-violet);
}

.catalog-search__group .btn-kp-primary {
  border-radius: 0 10px 10px 0;
}

.catalog-chip {
  border-radius: 999px;
  font-weight: 500;
  padding: 0.35rem 1rem;
}

.catalog-chip--active {
  background: var(--kp-blue) !important;
  border-color: var(--kp-blue) !important;
  color: #fff !important;
}

.catalog-card {
  background: #fff;
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.07);
  border: 1px solid #e8eef7;
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.catalog-card:hover {
  box-shadow: 0 12px 40px rgba(102, 126, 234, 0.2);
  transform: translateY(-3px);
}

.catalog-card__link {
  display: block;
  text-decoration: none;
  color: inherit;
  height: 100%;
}

.catalog-card__link:hover .catalog-card__title {
  color: var(--kp-blue);
}

.catalog-card__media {
  position: relative;
  aspect-ratio: 4 / 3;
  min-height: 200px;
  height: auto;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

@media (max-width: 575.98px) {
  .catalog-grid:not(.catalog-grid--lista) .catalog-card__media {
    min-height: 0;
    aspect-ratio: 1 / 1;
  }

  .catalog-grid:not(.catalog-grid--lista) .catalog-card__img {
    min-height: 0;
    padding: 0.25rem 0.35rem;
  }

  .catalog-grid:not(.catalog-grid--lista) .catalog-card__body {
    padding: 0.65rem 0.55rem 0.75rem;
  }

  .catalog-grid:not(.catalog-grid--lista) .catalog-card__title {
    font-size: 0.82rem;
    -webkit-line-clamp: 2;
  }

  .catalog-grid:not(.catalog-grid--lista) .catalog-card__sku {
    font-size: 0.68rem;
    margin-bottom: 0.35rem;
  }

  .catalog-grid:not(.catalog-grid--lista) .catalog-card__badge {
    font-size: 0.58rem;
    padding: 0.12rem 0.4rem;
    top: 0.4rem;
    left: 0.4rem;
  }

  .catalog-grid:not(.catalog-grid--lista) .catalog-card__price {
    font-size: 1rem;
  }

  .catalog-grid:not(.catalog-grid--lista) .catalog-card__letter {
    font-size: clamp(2rem, 12vw, 2.75rem);
  }
}

@media (min-width: 992px) {
  .catalog-card__media {
    min-height: 260px;
  }
}

.catalog-card__media--photo {
  background: transparent;
}

.catalog-card__img {
  width: 100%;
  height: 100%;
  min-height: 180px;
  object-fit: contain;
  object-position: center;
  padding: 0.35rem 0.5rem;
  transition: transform 0.45s cubic-bezier(0.33, 1, 0.68, 1);
  transform: scale(1);
  transform-origin: center center;
}

.catalog-card:hover .catalog-card__img {
  transform: scale(1.08);
}

@media (prefers-reduced-motion: reduce) {
  .catalog-card__img {
    transition: none;
  }

  .catalog-card:hover .catalog-card__img {
    transform: scale(1);
  }
}

.catalog-card__letter {
  font-size: clamp(3rem, 8vw, 4.5rem);
  font-weight: 800;
  color: var(--kp-blue);
  opacity: 0.35;
  line-height: 1;
  user-select: none;
}

.catalog-card__badge {
  position: absolute;
  top: 0.65rem;
  left: 0.65rem;
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--kp-blue-dark);
  background: rgba(255, 255, 255, 0.92);
  padding: 0.2rem 0.55rem;
  border-radius: 6px;
}

.catalog-card__body {
  padding: 1rem 1.1rem 1.15rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.catalog-card__title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 0.35rem;
  color: var(--kp-gray-900);
  transition: color 0.15s ease;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.catalog-card__sku {
  font-size: 0.75rem;
  color: var(--kp-gray-600);
  margin-bottom: 0.5rem;
  font-family: ui-monospace, monospace;
}

.catalog-card__desc {
  font-size: 0.82rem;
  color: #64748b;
  line-height: 1.45;
  margin-bottom: 1rem;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.catalog-card--with-wa {
  overflow: hidden;
}

.catalog-card__wa {
  flex-shrink: 0;
  background: rgba(248, 250, 252, 0.6);
}

.catalog-card__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-top: auto;
  padding-top: 0.25rem;
}

.catalog-card__price {
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--kp-blue);
  letter-spacing: -0.02em;
}

.catalog-card__cta {
  pointer-events: none;
  white-space: nowrap;
}

.catalog-empty {
  background: #fff;
  border-radius: var(--kp-radius);
  border: 1px dashed #cbd5e1;
}

.catalog-grid .col {
  display: flex;
}

/* Catálogo: vista lista (imagen compacta; sin WS en plantilla) */
.catalog-card--lista .catalog-card__link--lista {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  min-height: 0;
}

.catalog-card--lista .catalog-card__media {
  aspect-ratio: 4 / 3;
  min-height: 0;
  max-height: 96px;
  background: transparent;
}

.catalog-card--lista .catalog-card__img {
  min-height: 0;
  padding: 0.2rem 0.35rem;
}

.catalog-card--lista .catalog-card__letter {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
}

@media (min-width: 576px) {
  .catalog-card--lista .catalog-card__link--lista {
    flex-direction: row;
  }

  .catalog-card--lista .catalog-card__media {
    width: 112px;
    max-width: 112px;
    min-width: 112px;
    max-height: none;
    flex-shrink: 0;
    aspect-ratio: 4 / 3;
    align-self: center;
    background: transparent;
  }

  .catalog-card--lista .catalog-card__img {
    min-height: 72px;
    padding: 0.2rem 0.3rem;
  }

  .catalog-card--lista:hover {
    transform: translateY(-2px);
  }
}

.catalog-card--lista .catalog-card__body {
  flex: 1;
  min-width: 0;
  justify-content: center;
  padding: 0.75rem 0.85rem;
}

.catalog-card--lista .catalog-card__desc {
  -webkit-line-clamp: 2;
  margin-bottom: 0.75rem;
}

.catalog-card--lista .catalog-card__footer {
  flex-wrap: wrap;
  gap: 0.5rem;
}

.catalog-body .pagination .page-link {
  border: 1px solid #e2e8f0;
  color: var(--kp-gray-600);
}

.catalog-body .pagination .page-item.active .page-link {
  background: var(--kp-gradient);
  border-color: transparent;
  color: #fff;
}

.product-detail-hero {
  background: #f8fafc;
  border-radius: 12px;
  padding: 1.25rem 1.5rem;
  text-align: center;
  border: 1px solid #e8eef7;
  min-height: 260px;
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 768px) {
  .product-detail-media-col .product-detail-hero {
    min-height: 400px;
  }
}

@media (min-width: 992px) {
  .product-detail-media-col .product-detail-hero {
    min-height: 460px;
  }
}

.product-detail-hero__img {
  max-height: min(540px, 72vh);
  width: auto;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

.product-detail-gallery .carousel-inner {
  min-height: 260px;
}

@media (min-width: 768px) {
  .product-detail-gallery .carousel-inner {
    min-height: 400px;
  }
}

@media (min-width: 992px) {
  .product-detail-gallery .carousel-inner {
    min-height: 460px;
  }
}

.product-detail-gallery .carousel-control-prev-icon,
.product-detail-gallery .carousel-control-next-icon {
  filter: invert(0.45);
}

.product-detail-thumbs {
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  padding-bottom: 0.25rem;
}

@media (min-width: 768px) {
  .product-detail-thumbs {
    flex-wrap: wrap;
    overflow: visible;
  }
}

.product-detail-thumb {
  flex: 0 0 auto;
  width: 76px;
  height: 76px;
  padding: 0;
  border: 2px solid var(--kp-gray-100);
  border-radius: 10px;
  background: #fff;
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease, opacity 0.15s ease;
  opacity: 0.9;
}

.product-detail-thumb:hover,
.product-detail-thumb:focus-visible {
  opacity: 1;
  border-color: #cbd5e1;
  outline: none;
}

.product-detail-thumb--active {
  border-color: var(--kp-violet);
  box-shadow: 0 0 0 1px var(--kp-violet);
  opacity: 1;
}

.product-detail-thumb__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  pointer-events: none;
}

.product-recent-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.product-recent-card:hover {
  transform: translateY(-2px);
}

.product-recent-card a:hover .card-title {
  color: var(--kp-violet);
}

.product-description-body a {
  color: var(--kp-violet);
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.product-description-body a:hover {
  color: var(--kp-purple);
}

.product-description-body p:last-child {
  margin-bottom: 0;
}

.product-description-body ul,
.product-description-body ol {
  padding-left: 1.25rem;
  margin-bottom: 0.5rem;
}

.admin-quill-editor .ql-editor {
  min-height: 140px;
}

.admin-quill-editor--tall .ql-editor {
  min-height: 260px;
}

.admin-quill-editor .ql-toolbar {
  border-top-left-radius: 8px;
  border-top-right-radius: 8px;
  border-color: #dee2e6;
}

.admin-quill-editor .ql-container {
  border-bottom-left-radius: 8px;
  border-bottom-right-radius: 8px;
  border-color: #dee2e6;
  font-size: 0.95rem;
}

.home-featured-row .home-featured-thumb {
  width: 100%;
  aspect-ratio: 3 / 4;
  min-height: 148px;
  height: auto;
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.home-featured-row .home-featured-thumb__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 0.4rem 0.35rem;
  transition: transform 0.45s cubic-bezier(0.33, 1, 0.68, 1);
  transform: scale(1);
  transform-origin: center center;
}

.home-featured-row .home-featured-card:hover .home-featured-thumb__img {
  transform: scale(1.08);
}

@media (prefers-reduced-motion: reduce) {
  .home-featured-row .home-featured-thumb__img {
    transition: none;
  }

  .home-featured-row .home-featured-card:hover .home-featured-thumb__img {
    transform: scale(1);
  }
}

.home-featured-card__body {
  padding: 0.7rem 0.65rem 0.85rem;
  flex: 1;
}

.home-featured-card__badge {
  font-size: 0.65rem;
  padding: 0.15rem 0.45rem;
}

.home-featured-card__title {
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.35;
  margin: 0 0 0.35rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
  min-height: 0;
}

.home-featured-row .home-featured-card .btn-sm {
  padding: 0.2rem 0.5rem;
  font-size: 0.8rem;
}

.home-featured-row .home-featured-card .btn-success.btn-sm {
  padding: 0.3rem 0.45rem;
  font-size: 0.75rem;
}

/* Carrusel — Productos destacados */
.home-featured-thumb-link {
  color: inherit;
  border-radius: var(--kp-radius) var(--kp-radius) 0 0;
  outline-offset: 2px;
}

.home-featured-thumb-link:focus-visible {
  outline: 2px solid var(--kp-violet);
  z-index: 1;
  position: relative;
}

.home-featured-carousel {
  position: relative;
}

.home-featured-carousel .home-featured-card--bounded {
  max-width: 240px;
}

.home-featured-carousel .home-featured-thumb {
  aspect-ratio: 4 / 5;
  min-height: 118px;
}

.home-featured-carousel .home-featured-thumb__img {
  padding: 0.25rem 0.3rem;
}

.home-featured-carousel .home-featured-card__body {
  padding: 0.5rem 0.55rem 0.6rem;
}

.home-featured-carousel .home-featured-card__badge {
  font-size: 0.58rem;
  padding: 0.1rem 0.35rem;
  margin-bottom: 0.35rem !important;
}

.home-featured-carousel .home-featured-card__title {
  font-size: 0.78rem;
  line-height: 1.3;
  -webkit-line-clamp: 2;
}

.home-featured-carousel .home-featured-card .btn-sm {
  padding: 0.12rem 0.38rem;
  font-size: 0.72rem;
}

.home-featured-carousel .home-featured-card .btn-success.btn-sm {
  padding: 0.22rem 0.32rem;
  font-size: 0.68rem;
}

.home-featured-carousel .home-featured-card__body .mt-auto.pt-2 {
  padding-top: 0.35rem !important;
}

.home-featured-carousel__indicators {
  margin-bottom: 0.25rem;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.35rem;
  row-gap: 0.35rem;
  max-width: 100%;
  padding-left: 0;
}

.home-featured-carousel__indicators [data-bs-target] {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--kp-violet);
  opacity: 0.35;
}

.home-featured-carousel__indicators [data-bs-target].active {
  opacity: 1;
}

.home-featured-carousel__control {
  width: 2.5rem;
  opacity: 0.9;
}

.home-featured-carousel .carousel-item {
  transition: transform 0.5s ease-in-out;
}

@media (max-width: 575.98px) {
  .home-featured-carousel__control {
    width: 2rem;
  }

  .home-featured-carousel .home-featured-thumb {
    aspect-ratio: 1 / 1;
    min-height: 0;
    max-height: 100px;
  }

  .home-featured-carousel .home-featured-thumb__img {
    padding: 0.2rem;
  }

  .home-featured-carousel .home-featured-card__title {
    font-size: 0.72rem;
    -webkit-line-clamp: 2;
  }

  .home-featured-carousel .home-featured-card__body {
    padding: 0.4rem 0.45rem 0.5rem;
  }

  .home-featured-carousel .home-featured-row {
    --bs-gutter-x: 0.5rem;
    --bs-gutter-y: 0.5rem;
  }
}
