/* Digitem AI Prompts Pro v2.0 — React 18 Prompt Studio CSS (RTL + Dark Mode + GTmetrix Grade-A) */
.dtpr2-shell {
  --p2-bg: #f8fafc;
  --p2-card: #ffffff;
  --p2-border: #e2e8f0;
  --p2-text: #0f172a;
  --p2-muted: #475569;
  --p2-primary: #4f46e5;
  --p2-gold: #d97706;
  max-width: 1240px;
  margin-inline: auto;
  padding: 16px 0 56px;
  color: var(--p2-text);
  box-sizing: border-box;
}

body.sp-night-mode-on .dtpr2-shell {
  --p2-bg: #0b1120;
  --p2-card: #111827;
  --p2-border: #1f2937;
  --p2-text: #f8fafc;
  --p2-muted: #94a3b8;
}

.dtpr2-hero {
  background: linear-gradient(135deg, #0f172a 0%, #312e81 65%, #4f46e5 130%);
  color: #ffffff;
  border-radius: 20px;
  padding: 28px;
  margin-bottom: 20px;
}

.dtpr2-hero-top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.dtpr2-pill { background: rgba(255, 255, 255, 0.14); border: 1px solid rgba(255, 255, 255, 0.28); color: #fef3c7; padding: 5px 14px; border-radius: 999px; font-size: 12px; font-weight: 700; }
.dtpr2-mode-tabs { display: flex; gap: 8px; }
.dtpr2-mode-btn { min-height: 38px; padding: 6px 14px; border-radius: 10px; border: 1px solid rgba(255, 255, 255, 0.25); background: rgba(255, 255, 255, 0.1); color: #ffffff; font-weight: 700; font-size: 13px; cursor: pointer; }
.dtpr2-mode-btn.is-active { background: #ffffff; color: #0f172a; border-color: #ffffff; }

.dtpr2-title { margin: 0 0 8px; font-size: clamp(22px, 3vw, 31px); line-height: 1.4; color: #ffffff; }
.dtpr2-sub { margin: 0 0 18px; color: #e2e8f0; font-size: 15px; max-width: 820px; line-height: 1.7; }

.dtpr2-mega-bar {
  background: rgba(15, 23, 42, 0.55);
  border: 1px solid rgba(251, 191, 36, 0.45);
  border-radius: 14px;
  padding: 16px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
}
.dtpr2-mega-tag { display: block; font-size: 13px; color: #fde68a; font-weight: 700; margin-bottom: 6px; }
.dtpr2-mega-prices { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.dtpr2-mega-prices s { color: #94a3b8; font-size: 15px; }
.dtpr2-mega-prices strong { color: #34d399; font-size: 22px; font-weight: 800; }
.dtpr2-off { background: #dc2626; color: #ffffff; font-size: 12px; font-weight: 800; padding: 3px 10px; border-radius: 999px; }

.dtpr2-toolbar { background: var(--p2-card); border: 1px solid var(--p2-border); border-radius: 16px; padding: 18px; margin-bottom: 18px; }
.dtpr2-search-row { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.dtpr2-input, .dtpr2-select { min-height: 44px; padding: 8px 14px; border-radius: 10px; border: 1px solid var(--p2-border); background: var(--p2-bg); color: var(--p2-text); font-size: 14px; flex: 1 1 180px; box-sizing: border-box; }
.dtpr2-cat-pills { display: flex; gap: 8px; flex-wrap: wrap; }
.dtpr2-cat-pill { min-height: 36px; padding: 6px 13px; border-radius: 999px; border: 1px solid var(--p2-border); background: var(--p2-bg); color: var(--p2-muted); font-size: 13px; font-weight: 600; cursor: pointer; }
.dtpr2-cat-pill.is-active { background: var(--p2-primary); color: #ffffff; border-color: var(--p2-primary); }

.dtpr2-cat-upsell { margin-top: 14px; padding: 14px 16px; border-radius: 12px; background: rgba(217, 119, 6, 0.1); border: 1px solid rgba(217, 119, 6, 0.35); display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px; }
.dtpr2-up-price { font-size: 13px; margin-top: 4px; }

.dtpr2-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.dtpr2-card { background: var(--p2-card); border: 1px solid var(--p2-border); border-radius: 16px; padding: 18px; display: flex; flex-direction: column; gap: 12px; transition: transform 0.16s ease, box-shadow 0.16s ease; }
.dtpr2-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08); }
.dtpr2-card-top { display: flex; gap: 10px; align-items: flex-start; }
.dtpr2-icon { width: 46px; height: 46px; border-radius: 10px; flex-shrink: 0; }
.dtpr2-card-head { flex: 1; }
.dtpr2-badges { display: flex; gap: 5px; flex-wrap: wrap; margin-bottom: 6px; }
.dtpr2-chip { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--p2-bg); border: 1px solid var(--p2-border); color: var(--p2-muted); font-weight: 700; }
.dtpr2-off-chip { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: #fee2e2; color: #b91c1c; font-weight: 800; }
.dtpr2-hot-chip { font-size: 11px; padding: 2px 8px; border-radius: 999px; background: #fef3c7; color: #92400e; font-weight: 700; }
.dtpr2-card-head h3 { margin: 0; font-size: 15px; line-height: 1.5; }
.dtpr2-card-head h3 a { color: var(--p2-text); text-decoration: none; }
.dtpr2-card-head h3 a:hover { color: var(--p2-primary); }
.dtpr2-star { background: none; border: none; font-size: 20px; cursor: pointer; color: var(--p2-muted); padding: 0 4px; }
.dtpr2-star.is-fav { color: #f59e0b; }

.dtpr2-price-row { display: flex; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 8px; border-top: 1px solid var(--p2-border); }
.dtpr2-strike { display: block; font-size: 12px; color: var(--p2-muted); }
.dtpr2-sale { font-size: 17px; font-weight: 800; color: #059669; }
.dtpr2-dl-tag { font-size: 12px; color: var(--p2-muted); font-weight: 600; }

.dtpr2-actions { display: flex; gap: 8px; }
.dtpr2-btn { min-height: 42px; padding: 8px 14px; border-radius: 10px; border: 1px solid transparent; font-weight: 700; font-size: 13px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 6px; text-decoration: none; }
.dtpr2-btn-sm { flex: 1; min-height: 38px; font-size: 12px; padding: 6px 10px; }
.dtpr2-btn-primary { background: var(--p2-primary); color: #ffffff !important; }
.dtpr2-btn-secondary { background: #1e293b; color: #ffffff !important; }
.dtpr2-btn-gold { background: linear-gradient(135deg, #f59e0b, #d97706); color: #ffffff !important; }
.dtpr2-btn-outline { background: transparent; border-color: var(--p2-border); color: var(--p2-text) !important; }
.dtpr2-btn-outline.is-active { border-color: #f59e0b; color: #b45309 !important; }
.dtpr2-btn-full { width: 100%; }

/* Builder & Modals */
.dtpr2-builder-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.dtpr2-box { background: var(--p2-card); border: 1px solid var(--p2-border); border-radius: 16px; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.dtpr2-box h2 { margin: 0; font-size: 18px; }
.dtpr2-box label, .dtpr2-checkout-form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; font-weight: 700; }
.dtpr2-pre { background: var(--p2-bg); border: 1px solid var(--p2-border); border-radius: 12px; padding: 14px; white-space: pre-wrap; font-family: inherit; font-size: 14px; line-height: 1.8; max-height: 320px; overflow-y: auto; margin: 0; }
.dtpr2-studio-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

.dtpr2-modal-bg { position: fixed; inset: 0; background: rgba(2, 6, 23, 0.72); z-index: 99990; display: flex; align-items: center; justify-content: center; padding: 16px; }
.dtpr2-modal { background: var(--p2-card); color: var(--p2-text); border: 1px solid var(--p2-border); border-radius: 18px; width: 100%; max-width: 640px; max-height: 92vh; overflow-y: auto; padding: 22px; }
.dtpr2-modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.dtpr2-modal-head h3 { margin: 0; font-size: 17px; }
.dtpr2-close { background: none; border: none; font-size: 26px; cursor: pointer; color: var(--p2-muted); }
.dtpr2-custom-row { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.dtpr2-order-bump { display: flex !important; flex-direction: row !important; align-items: flex-start; gap: 8px; padding: 12px; border-radius: 12px; background: rgba(245, 158, 11, 0.12); border: 2px dashed #f59e0b; margin-bottom: 14px; font-size: 13px; cursor: pointer; }
.dtpr2-checkout-form { display: flex; flex-direction: column; gap: 12px; }
.dtpr2-pay-total { display: flex; justify-content: space-between; align-items: center; padding: 12px; border-radius: 10px; background: var(--p2-bg); font-size: 15px; }
.dtpr2-pay-total strong { color: #059669; font-size: 18px; }
.dtpr2-toast { position: fixed; top: 24px; inset-inline-end: 24px; z-index: 99999; background: #0f172a; color: #ffffff; padding: 12px 18px; border-radius: 10px; font-weight: 700; box-shadow: 0 10px 25px rgba(0, 0, 0, 0.25); }
.dtpr2-empty { background: var(--p2-card); border: 1px solid var(--p2-border); border-radius: 14px; padding: 30px; text-align: center; }

@media (max-width: 960px) {
  .dtpr2-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .dtpr2-builder-grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .dtpr2-grid { grid-template-columns: minmax(0, 1fr); }
  .dtpr2-hero { padding: 20px; }
}
