/* Namespace everything to avoid clashing with host site styles */
#wcpa-app,
#wcpa-app * {
  box-sizing: border-box;
}

#wcpa-app {
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: #111;
}

#wcpa-app .wcpa-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

#wcpa-app .wcpa-btn {
  appearance: none;
  border: 1px solid #e8e8e8;
  background: #fff;
  padding: 10px 12px;
  border-radius: 10px;
  cursor: pointer;
  font-weight: 600;
}

#wcpa-app .wcpa-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

#wcpa-app .wcpa-muted {
  color: #666;
  font-size: 14px;
}

#wcpa-app .wcpa-h2 {
  margin: 14px 0 8px;
  font-size: 16px;
}

/* Grid */
#wcpa-app .wcpa-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

@media (max-width: 980px) {
  #wcpa-app .wcpa-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  #wcpa-app .wcpa-grid {
    grid-template-columns: 1fr;
  }
}

#wcpa-app .wcpa-card {
  border: 1px solid #e8e8e8;
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: transform 0.08s ease, box-shadow 0.08s ease;
  background: #fff;
}

#wcpa-app .wcpa-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.06);
}

#wcpa-app .wcpa-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  background: #f6f6f6;
}

#wcpa-app .wcpa-card-body {
  padding: 14px;
}

#wcpa-app .wcpa-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.25;
  margin: 0 0 10px;
}

#wcpa-app .wcpa-price {
  font-weight: 700;
}

/* Single product */
#wcpa-app .wcpa-single {
  border: 1px solid #e8e8e8;
  border-radius: 16px;
  padding: 18px;
  background: #fff;
}

#wcpa-app .wcpa-single-top {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 22px;
  align-items: start;
}

@media (max-width: 880px) {
  #wcpa-app .wcpa-single-top {
    grid-template-columns: 1fr;
  }
}

#wcpa-app .wcpa-single-img {
  width: 100%;
  border-radius: 14px;
  object-fit: cover;
  background: #f6f6f6;
  max-height: 520px;
  cursor: zoom-in;
}

#wcpa-app .wcpa-single h1 {
  margin: 0 0 10px;
  font-size: 26px;
  line-height: 1.15;
}

#wcpa-app .wcpa-single-price {
  font-size: 18px;
  font-weight: 800;
  margin: 10px 0 14px;
}

#wcpa-app .wcpa-panel {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid #e8e8e8;
}

#wcpa-app .wcpa-panel h2 {
  margin: 0 0 10px;
  font-size: 18px;
}

#wcpa-app .wcpa-attrs {
  display: grid;
  gap: 10px;
}

#wcpa-app .wcpa-attr {
  border: 1px solid #e8e8e8;
  border-radius: 12px;
  padding: 10px 12px;
  background: #fafafa;
}

#wcpa-app .wcpa-attr b {
  display: block;
  margin-bottom: 6px;
}

#wcpa-app .wcpa-loading {
  padding: 14px;
  border: 1px dashed #e8e8e8;
  border-radius: 14px;
  background: #fcfcfc;
}

#wcpa-app .wcpa-error {
  color: #b00020;
  font-weight: 700;
}

/* Lightbox */
#wcpa-app .wcpa-lightbox {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.75);
  z-index: 999999;
}

#wcpa-app .wcpa-lightbox.open {
  display: flex;
}

#wcpa-app .wcpa-lightbox-inner {
  position: relative;
  max-width: min(1100px, 92vw);
  max-height: 88vh;
}

#wcpa-app .wcpa-lightbox-img {
  max-width: 100%;
  max-height: 88vh;
  display: block;
  border-radius: 14px;
  background: #111;
}

#wcpa-app .wcpa-lightbox-close {
  position: absolute;
  top: -10px;
  right: -10px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(0,0,0,0.6);
  color: #fff;
  width: 40px;
  height: 40px;
  cursor: pointer;
  font-size: 18px;
  line-height: 40px;
}

#wcpa-app .button br {
  display: none;
}