/* ============================================================
   KHP STL Library
   ============================================================ */

.khp-stl-wrapper {
  max-width: 1200px;
  margin: 0 auto;
}

/* === TABS === */
.khp-stl-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 32px;
  padding-bottom: 20px;
  border-bottom: 2px solid rgba(240, 160, 0, 0.12);
}

.khp-stl-tab {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  background: transparent;
  border: 1px solid rgba(240, 160, 0, 0.25);
  border-radius: 8px;
  color: #8a95a3;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
}

.khp-stl-tab:hover {
  color: #f0a000;
  border-color: #f0a000;
  background: rgba(240, 160, 0, 0.07);
}

.khp-stl-tab.active {
  background: rgba(240, 160, 0, 0.12);
  border-color: #f0a000;
  color: #f0a000;
  font-weight: 600;
}

.khp-stl-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  background: rgba(240, 160, 0, 0.2);
  border-radius: 11px;
  font-size: 11px;
  font-weight: 700;
}

/* === PANELS === */
.khp-stl-panel {
  display: none;
}

.khp-stl-panel.active {
  display: block;
  animation: khp-fade-in 0.2s ease;
}

@keyframes khp-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

/* === CARD === */
.khp-stl-card {
  background: #171d28;
  border: 1px solid rgba(240, 160, 0, 0.12);
  border-radius: 14px;
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}

.khp-stl-card:hover {
  transform: translateY(-4px);
  border-color: rgba(240, 160, 0, 0.4);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.4);
}

/* === IMAGEN DE CARD === */
.khp-stl-card__img {
  background: #ddd8cc;
  aspect-ratio: 1 / 1.1;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

/* Botón que cubre toda la imagen para el lightbox */
.khp-stl-card__img-btn {
  display: block;
  width: 100%;
  height: 100%;
  padding: 0;
  margin: 0;
  border: none;
  background: none;
  cursor: zoom-in;
  position: absolute;
  inset: 0;
}

.khp-stl-card__img-btn img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  pointer-events: none;
}

.khp-stl-card__zoom-icon {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  opacity: 0;
  transition: opacity 0.2s;
  pointer-events: none;
}

.khp-stl-card__img-btn:hover .khp-stl-card__zoom-icon {
  opacity: 1;
}

.khp-stl-card__no-img {
  color: #a0977f;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

/* === BODY CARD === */
.khp-stl-card__body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  text-align: center;
  flex: 1;
}

.khp-stl-card__title {
  color: #e8e8e8;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  margin: 0;
  flex: 1;
}

.khp-stl-price {
  color: #f0a000;
  font-size: 15px;
  font-weight: 700;
}

/* === BOTONES === */
.khp-stl-btn {
  display: block;
  width: 100%;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  transition: filter 0.2s ease, transform 0.15s ease;
  box-sizing: border-box;
}

.khp-stl-btn--buy {
  background: linear-gradient(135deg, #ff9c0f, #e07000);
  color: #fff !important;
  border: none;
}

.khp-stl-btn--buy:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
  color: #fff !important;
  text-decoration: none;
}

.khp-stl-btn--dl {
  background: transparent;
  border: 1px solid rgba(240, 160, 0, 0.45);
  color: #f0a000 !important;
}

.khp-stl-btn--dl:hover {
  background: rgba(240, 160, 0, 0.1);
  color: #f0a000 !important;
  text-decoration: none;
}

/* === VACÍO === */
.khp-stl-empty {
  color: #8a95a3;
  text-align: center;
  padding: 48px 0;
  font-size: 15px;
}

/* === LIGHTBOX === */
.khp-lightbox {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 99999;
  align-items: center;
  justify-content: center;
}

.khp-lightbox.active {
  display: flex;
  animation: khp-fade-in 0.2s ease;
}

.khp-lightbox__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
}

.khp-lightbox__content {
  position: relative;
  z-index: 1;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.khp-lightbox__img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6);
}

.khp-lightbox__caption {
  color: #e8e8e8;
  font-size: 15px;
  font-weight: 600;
  text-align: center;
  margin: 0;
}

.khp-lightbox__close {
  position: absolute;
  top: -44px;
  right: 0;
  background: transparent;
  border: none;
  color: #e8e8e8;
  font-size: 32px;
  cursor: pointer;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s, color 0.2s;
  line-height: 1;
}

.khp-lightbox__close:hover {
  background: rgba(240, 160, 0, 0.2);
  color: #f0a000;
}

/* === RESPONSIVE === */
@media (max-width: 768px) {
  .khp-stl-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 16px;
  }
  .khp-stl-tab {
    padding: 8px 14px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .khp-stl-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}
