/* Perpa Builder Grid System */
.perpa-layout {
  --perpa-gap: 24px;
  --perpa-max: 1200px;
}

.perpa-row {
  width: 100%;
  position: relative;
}

.perpa-row__inner {
  display: grid;
  gap: var(--perpa-gap);
  max-width: var(--perpa-max);
  margin: 0 auto;
  padding: 0 20px;
}

.perpa-row[data-cols="12"] .perpa-row__inner { grid-template-columns: 1fr; }
.perpa-row[data-cols="6-6"] .perpa-row__inner { grid-template-columns: 1fr 1fr; }
.perpa-row[data-cols="8-4"] .perpa-row__inner { grid-template-columns: 2fr 1fr; }
.perpa-row[data-cols="4-8"] .perpa-row__inner { grid-template-columns: 1fr 2fr; }
.perpa-row[data-cols="4-4-4"] .perpa-row__inner { grid-template-columns: repeat(3, 1fr); }
.perpa-row[data-cols="3-3-3-3"] .perpa-row__inner { grid-template-columns: repeat(4, 1fr); }
.perpa-row[data-cols="9-3"] .perpa-row__inner { grid-template-columns: 3fr 1fr; }
.perpa-row[data-cols="3-9"] .perpa-row__inner { grid-template-columns: 1fr 3fr; }
.perpa-row[data-cols="3-6-3"] .perpa-row__inner { grid-template-columns: 1fr 2fr 1fr; }

.perpa-row--dark {
  color: #e2e8f0;
}
.perpa-row--dark .perpa-heading,
.perpa-row--dark .perpa-text,
.perpa-row--dark .perpa-icon-box__title,
.perpa-row--dark .perpa-icon-box__text {
  color: #e2e8f0;
}

.perpa-col {
  min-width: 0;
}

/* Widget base */
.perpa-widget {
  margin-bottom: 0;
}

/* Heading */
.perpa-heading {
  line-height: 1.2;
  font-weight: 700;
}

/* Text */
.perpa-text { line-height: 1.7; }
.perpa-text p { margin-bottom: 1em; }
.perpa-text p:last-child { margin-bottom: 0; }

/* Image */
.perpa-image img { width: 100%; height: auto; border-radius: 8px; }
.perpa-image--contain img { object-fit: contain; }

/* Video */
.perpa-video__wrap {
  position: relative;
  padding-bottom: 56.25%;
  height: 0;
}
.perpa-video__wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border-radius: 8px;
}

/* Button */
.perpa-btn-wrap { display: flex; }

/* Icon Box */
.perpa-icon-box {
  text-align: center;
  padding: 24px;
}
.perpa-icon-box__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 16px;
  background: rgba(37, 99, 235, 0.1);
  color: #2563eb;
  margin-bottom: 16px;
}
.perpa-icon-box__title {
  font-size: 1.5rem;
  font-weight: 700;
  margin-bottom: 4px;
}
.perpa-icon-box__text {
  font-size: 0.875rem;
  opacity: 0.7;
}

/* FAQ */
.perpa-faq { max-width: 800px; margin: 0 auto; }
.perpa-faq__item {
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  margin-bottom: 8px;
  overflow: hidden;
}
.perpa-faq__q {
  padding: 16px 20px;
  cursor: pointer;
  font-weight: 600;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.perpa-faq__q::after {
  content: '+';
  font-size: 1.25rem;
  font-weight: 300;
  transition: transform 0.2s;
}
.perpa-faq__item[open] .perpa-faq__q::after { content: '−'; }
.perpa-faq__a {
  padding: 0 20px 16px;
  line-height: 1.6;
  color: #64748b;
}

/* Posts grid */
.perpa-posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.perpa-post-card {
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  background: #fff;
}
.perpa-post-card__img { width: 100%; height: 180px; object-fit: cover; }
.perpa-post-card__body { padding: 16px; }
.perpa-post-card__date { font-size: 0.75rem; color: #94a3b8; }
.perpa-post-card__title { margin: 8px 0; font-size: 1rem; }
.perpa-post-card__title a { color: inherit; text-decoration: none; }
.perpa-post-card__title a:hover { color: #2563eb; }

/* Form */
.perpa-form { max-width: 600px; }
.perpa-form__title { font-size: 1.5rem; font-weight: 700; margin-bottom: 24px; }
.perpa-form__field { margin-bottom: 16px; }
.perpa-form__label { display: block; font-size: 0.875rem; font-weight: 500; margin-bottom: 4px; }
.perpa-form input[type="text"],
.perpa-form input[type="email"],
.perpa-form input[type="tel"],
.perpa-form textarea,
.perpa-form select {
  width: 100%;
  padding: 10px 14px;
  border: 1px solid #cbd5e1;
  border-radius: 8px;
  font-size: 0.875rem;
  background: #fff;
  transition: border-color 0.2s;
}
.perpa-form input:focus,
.perpa-form textarea:focus,
.perpa-form select:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}
.perpa-form__submit {
  margin-top: 8px;
  width: 100%;
  padding: 12px;
  font-size: 1rem;
}
.perpa-form__status { margin-top: 12px; font-size: 0.875rem; }
.perpa-form__status--success { color: #16a34a; }
.perpa-form__status--error { color: #dc2626; }

/* Map */
.perpa-map iframe { border-radius: 12px; }

/* Cards */
.perpa-cards .perpa-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  padding: 24px;
  text-align: center;
}
.perpa-cards .perpa-card img { width: 100%; height: 150px; object-fit: cover; border-radius: 8px; margin-bottom: 12px; }
.perpa-cards .perpa-card h3 { font-size: 1.125rem; margin-bottom: 8px; }

/* Builder Slider — non-Swiper fallback */
.hero-slider-wrap .hero-slide { display: none; }
.hero-slider-wrap .hero-slide.is-active { display: flex; }
.hero-slider__nav {
  display: flex;
  justify-content: center;
  gap: 8px;
  position: absolute;
  bottom: 24px;
  left: 0;
  right: 0;
  z-index: 10;
}
.hero-slider__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: rgba(255,255,255,0.3);
  border: none;
  cursor: pointer;
  transition: background 0.3s;
}
.hero-slider__dot.active { background: #fff; }

/* Device cards */
.device-card {
  display: block;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid #e2e8f0;
  text-decoration: none;
  color: inherit;
  transition: transform 0.2s, box-shadow 0.2s;
}
.device-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.1);
}
.device-card__media { overflow: hidden; }
.device-card__img { width: 100%; height: 200px; object-fit: cover; display: block; transition: transform 0.4s; }
.device-card:hover .device-card__img { transform: scale(1.05); }
.device-card__body { padding: 20px; }
.device-card__title { font-size: 1.125rem; font-weight: 700; margin: 0 0 4px; }
.device-card__price { font-size: 0.8rem; color: #2563eb; font-weight: 600; display: block; margin-bottom: 8px; }
.device-card__desc { font-size: 0.875rem; color: #64748b; line-height: 1.5; margin: 0; }

/* Custom HTML */
.perpa-html { overflow: hidden; }

/* Responsive */
@media (max-width: 768px) {
  .perpa-row__inner { grid-template-columns: 1fr !important; }
  .perpa-posts-grid { grid-template-columns: 1fr; }
}
