/**
 * Coupontkom Builder Front-end Styles (RTL-First, CSS Logical Properties)
 */

:root {
  --ctk-primary: #4F46E5;
  --ctk-primary-hover: #3730A3;
  --ctk-secondary: #0F172A;
  --ctk-accent-orange: #F97316;
  --ctk-accent-green: #0F766E;
  --ctk-bg: #F8FAFC;
  --ctk-surface: #FFFFFF;
  --ctk-border: #E2E8F0;
  --ctk-text: #0F172A;
  --ctk-text-muted: #64748B;
  --ctk-radius-sm: 8px;
  --ctk-radius-md: 12px;
  --ctk-radius-lg: 16px;
  --ctk-shadow-sm: 0 1px 3px rgba(0,0,0,0.06);
  --ctk-shadow-md: 0 8px 30px rgba(15,23,42,0.07);
}

/* Coupon Card & Grid */
.ctk-coupon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 20px;
  margin-block: 24px;
}

.ctk-coupon-card {
  background: var(--ctk-surface);
  border: 1px solid var(--ctk-border);
  border-radius: var(--ctk-radius-lg);
  padding: 20px;
  box-shadow: var(--ctk-shadow-sm);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  position: relative;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ctk-coupon-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--ctk-shadow-md);
}

.ctk-coupon-card__header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}

.ctk-coupon-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  border-radius: var(--ctk-radius-sm);
  font-size: 0.78rem;
  font-weight: 700;
}

.ctk-coupon-badge--verified {
  background: #dcfce7;
  color: #166534;
}

.ctk-coupon-badge--deal {
  background: #e0e7ff;
  color: #3730a3;
}

.ctk-discount-tag {
  background: #fee2e2;
  color: var(--ctk-accent-red);
  padding: 4px 12px;
  border-radius: 9999px;
  font-size: 0.95rem;
  font-weight: 800;
}

.ctk-coupon-card__title {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--ctk-text);
  line-height: 1.5;
  margin: 0 0 8px 0;
}

.ctk-coupon-card__store {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.88rem;
  color: var(--ctk-text-muted);
  margin-bottom: 14px;
}

.ctk-coupon-card__footer {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px dashed var(--ctk-border);
}

/* Reveal Code CTA */
.ctk-reveal-btn-wrap {
  position: relative;
  display: flex;
  width: 100%;
}

.ctk-reveal-btn {
  width: 100%;
  background: var(--ctk-primary);
  color: #ffffff !important;
  text-decoration: none !important;
  padding: 12px 18px;
  border-radius: var(--ctk-radius-md);
  font-weight: 800;
  font-size: 0.95rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  cursor: pointer;
  border: none;
  transition: background 0.2s ease;
}

.ctk-reveal-btn:hover {
  background: var(--ctk-primary-hover);
}

.ctk-reveal-code-preview {
  position: absolute;
  inset-inline-start: 0;
  top: 0;
  bottom: 0;
  width: 75px;
  background: rgba(255,255,255,0.25);
  border-inline-end: 2px dashed rgba(255,255,255,0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: monospace;
  font-weight: 800;
  font-size: 0.9rem;
  letter-spacing: 1px;
}

/* Store Hero Block */
.ctk-store-hero {
  background: linear-gradient(135deg, #1e1b4b 0%, #312e81 100%);
  color: #ffffff;
  padding: 36px 28px;
  border-radius: var(--ctk-radius-lg);
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 30px;
}

.ctk-store-hero__logo {
  width: 90px;
  height: 90px;
  background: #ffffff;
  border-radius: var(--ctk-radius-md);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  flex-shrink: 0;
}

.ctk-store-hero__logo img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.ctk-store-hero__content h1 {
  color: #ffffff;
  font-size: 1.75rem;
  font-weight: 800;
  margin: 0 0 8px 0;
}

.ctk-store-hero__content p {
  color: #cbd5e1;
  font-size: 0.95rem;
  margin: 0;
  line-height: 1.6;
}

/* Reveal Modal */
.ctk-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.7);
  backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 999999;
  padding: 16px;
}

.ctk-modal-backdrop.is-active {
  display: flex;
}

.ctk-modal-content {
  background: #ffffff;
  border-radius: var(--ctk-radius-lg);
  max-width: 480px;
  width: 100%;
  padding: 28px;
  text-align: center;
  position: relative;
  box-shadow: 0 20px 25px -5px rgba(0,0,0,0.2);
  animation: ctkModalIn 0.25s ease-out;
}

@keyframes ctkModalIn {
  from { opacity: 0; transform: scale(0.92); }
  to { opacity: 1; transform: scale(1); }
}

.ctk-modal-close {
  position: absolute;
  top: 14px;
  inset-inline-end: 16px;
  background: none;
  border: none;
  font-size: 1.4rem;
  color: var(--ctk-text-muted);
  cursor: pointer;
}

.ctk-modal-code-box {
  background: #f1f5f9;
  border: 2px dashed #cbd5e1;
  border-radius: var(--ctk-radius-md);
  padding: 14px;
  margin: 18px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.ctk-modal-code-text {
  font-family: monospace;
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--ctk-primary);
  letter-spacing: 2px;
}

.ctk-copy-btn {
  background: var(--ctk-primary);
  color: #fff;
  border: none;
  padding: 8px 16px;
  border-radius: var(--ctk-radius-sm);
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s ease;
}

.ctk-copy-btn.is-copied {
  background: var(--ctk-accent-green);
}

/* FAQ Accordion */
.ctk-faq-accordion {
  border: 1px solid var(--ctk-border);
  border-radius: var(--ctk-radius-md);
  overflow: hidden;
  margin-block: 20px;
}

.ctk-faq-item {
  border-bottom: 1px solid var(--ctk-border);
}

.ctk-faq-item:last-child {
  border-bottom: none;
}

.ctk-faq-question {
  width: 100%;
  text-align: start;
  padding: 16px 20px;
  background: #ffffff;
  border: none;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--ctk-text);
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.ctk-faq-answer {
  display: none;
  padding: 14px 20px 20px 20px;
  color: var(--ctk-text-muted);
  line-height: 1.7;
  font-size: 0.95rem;
  background: #f8fafc;
}

.ctk-faq-item.is-open .ctk-faq-answer {
  display: block;
}

/* Category Chips */
.ctk-category-chips {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 10px 0;
  scrollbar-width: none;
}

.ctk-category-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: var(--ctk-surface);
  border: 1px solid var(--ctk-border);
  border-radius: 9999px;
  text-decoration: none;
  color: var(--ctk-text);
  font-weight: 600;
  font-size: 0.9rem;
  white-space: nowrap;
  transition: all 0.2s ease;
}

.ctk-category-chip:hover, .ctk-category-chip.is-active {
  background: var(--ctk-primary);
  color: #ffffff;
  border-color: var(--ctk-primary);
}
