:root {
  --bg: #0f1419;
  --panel: #1a2332;
  --text: #e8eef5;
  --muted: #8b9cb3;
  --accent: #0070ba;
  --accent-hover: #005ea6;
  --border: #2d3a4d;
  --radius: 12px;
  --touch-min: 48px;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  background: radial-gradient(1200px 600px at 10% 0%, #1e2a3d 0%, var(--bg) 55%);
  color: var(--text);
  line-height: 1.5;
}

.wrap {
  max-width: 520px;
  margin: 0 auto;
  padding: 2.5rem 1.25rem 3rem;
}

h1 {
  font-size: 1.75rem;
  font-weight: 650;
  letter-spacing: -0.02em;
  margin: 0 0 0.5rem;
}

h2 {
  font-size: 1rem;
  font-weight: 600;
  color: var(--muted);
  margin: 0 0 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.muted {
  color: var(--muted);
  margin: 0 0 1.75rem;
  font-size: 0.95rem;
}

.price-tag {
  margin: 0 0 1rem;
  font-size: 1.35rem;
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.25rem 1.5rem;
}

label {
  display: block;
  font-size: 0.8rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

input[type='text'] {
  width: 100%;
  padding: 0.65rem 0.75rem;
  margin-bottom: 1rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-size: 1rem;
}

input:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

/* Custom look + invisible PayPal button on top (reliable clicks) */
.btn-stack {
  position: relative;
  margin-top: 0.25rem;
  min-height: 52px;
}

.btn-custom {
  position: relative;
  z-index: 0;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  min-height: 52px;
  padding: 0 1.25rem;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 650;
  color: #fff;
  background: linear-gradient(180deg, #009cde 0%, var(--accent) 45%, #003087 100%);
  box-shadow: 0 4px 14px rgba(0, 112, 186, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  pointer-events: none;
}

.btn-custom__icon {
  font-size: 0.85rem;
  opacity: 0.9;
}

.paypal-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  opacity: 0.011;
  overflow: hidden;
}

.paypal-overlay > div {
  flex: 1;
  min-height: 52px;
}

#paypal-button-container {
  width: 100%;
}

.paypal-overlay .paypal-buttons,
.paypal-overlay iframe {
  width: 100% !important;
  min-height: 52px !important;
}

.status-panel {
  margin-top: 2rem;
}

.status-log {
  margin: 0;
  padding: 1rem;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.8rem;
  line-height: 1.45;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 320px;
  overflow: auto;
  color: #c5d4e8;
}

/* —— Kahraba storefront (CWAgarioAccess/cwagario_30_days_ios_access.php) —— */
.shop-page {
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.shop-page .wrap {
  max-width: none;
}

.sandbox-banner {
  text-align: center;
  padding: 0.65rem 1rem;
  padding-left: max(1rem, env(safe-area-inset-left, 0px));
  padding-right: max(1rem, env(safe-area-inset-right, 0px));
  padding-top: max(0.65rem, env(safe-area-inset-top, 0px));
  font-size: 0.85rem;
  background: rgba(180, 120, 0, 0.2);
  border-bottom: 1px solid rgba(255, 200, 80, 0.25);
  color: #f0d78c;
}

.sandbox-banner code {
  font-size: 0.8em;
  background: rgba(0, 0, 0, 0.25);
  padding: 0.1em 0.35em;
  border-radius: 4px;
}

.shop-wrap {
  max-width: 680px;
  margin: 0 auto;
  width: 100%;
  padding-left: max(1rem, env(safe-area-inset-left, 0px));
  padding-right: max(1rem, env(safe-area-inset-right, 0px));
}

.shop-header {
  padding: 1rem 0 0.75rem;
  padding-top: max(1rem, env(safe-area-inset-top, 0px));
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.shop-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
}

.lang-switch {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0.25rem;
  flex-shrink: 0;
}

.lang-switch__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: var(--touch-min);
  min-height: var(--touch-min);
  padding: 0.35rem;
  border-radius: 10px;
  border: 1px solid transparent;
  background: transparent;
  line-height: 0;
  transition: border-color 0.15s, background 0.15s;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.lang-switch__btn:hover {
  border-color: var(--border);
  background: rgba(255, 255, 255, 0.04);
}

.lang-switch__btn:active {
  background: rgba(255, 255, 255, 0.08);
}

.lang-switch__btn.is-active {
  border-color: var(--accent);
  background: rgba(0, 112, 186, 0.15);
}

.lang-switch__flag {
  display: block;
  width: 32px;
  height: auto;
  max-height: 24px;
  object-fit: cover;
  border-radius: 3px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.35);
  pointer-events: none;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.shop-brand {
  font-size: clamp(1rem, 4vw, 1.15rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: var(--touch-min);
  padding: 0.35rem 0;
  max-width: min(100%, 14rem);
  line-height: 1.25;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.shop-brand:hover {
  color: #fff;
}

.shop-main {
  flex: 1;
  padding: 1.5rem 0 2.5rem;
  padding-bottom: max(2.5rem, env(safe-area-inset-bottom, 0px));
}

.shop-product {
  max-width: 100%;
}

.shop-product__title {
  font-size: clamp(1.5rem, 4vw, 1.85rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 0.5rem;
  line-height: 1.2;
}

.shop-product__tagline {
  color: var(--muted);
  margin: 0 0 1.25rem;
  font-size: clamp(0.95rem, 3.5vw, 1.05rem);
  line-height: 1.6;
}

.shop-features {
  margin: 0 0 1.5rem;
  padding: 0 0 0 1.15rem;
  color: #c5d4e8;
  font-size: clamp(0.9rem, 3.2vw, 0.98rem);
  line-height: 1.65;
}

.shop-features li {
  margin-bottom: 0.45rem;
}

.shop-features li::marker {
  color: var(--accent);
}

.shop-buy {
  margin-top: 0.25rem;
}

.shop-price {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.35rem 0.65rem;
  margin-bottom: 1rem;
}

.shop-price__amount {
  font-size: clamp(1.65rem, 8vw, 2.1rem);
  font-weight: 750;
  letter-spacing: -0.03em;
  color: #fff;
  word-break: break-word;
}

.shop-price__currency {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--muted);
}

.shop-price__note {
  font-size: 0.8rem;
  color: var(--muted);
  width: 100%;
  margin-top: 0.15rem;
}

.shop-panel {
  padding: 1.25rem 1rem 1.4rem;
}

.shop-footnote {
  margin: 1rem 0 0;
  font-size: clamp(0.82rem, 2.8vw, 0.9rem);
  color: var(--muted);
  line-height: 1.55;
  hyphens: auto;
}

.shop-trust {
  margin: 1.5rem 0 0;
  padding: 1rem 1rem 1rem 2.35rem;
  list-style: none;
  background: rgba(0, 112, 186, 0.08);
  border: 1px solid rgba(0, 112, 186, 0.2);
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: #a8bdd4;
}

.shop-trust li {
  position: relative;
  margin-bottom: 0.35rem;
}

.shop-trust li:last-child {
  margin-bottom: 0;
}

.shop-trust li::before {
  content: '✓';
  position: absolute;
  left: -1.35rem;
  color: #3dcc85;
  font-weight: 700;
}

.shop-footer {
  margin-top: auto;
  padding: 1.5rem 0;
  padding-bottom: max(1.5rem, env(safe-area-inset-bottom, 0px));
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}

.shop-footer__text {
  margin: 0;
  font-size: clamp(0.75rem, 2.5vw, 0.82rem);
  color: var(--muted);
  text-align: center;
  line-height: 1.5;
  padding: 0 0.25rem;
}

/* Mobile / narrow phones */
@media (max-width: 560px) {
  .shop-header__inner {
    flex-direction: column;
    align-items: stretch;
  }

  .lang-switch {
    justify-content: center;
    width: 100%;
    padding-top: 0.25rem;
  }

  .shop-brand {
    max-width: none;
  }
}

@media (max-width: 400px) {
  .shop-wrap {
    padding-left: max(0.85rem, env(safe-area-inset-left, 0px));
    padding-right: max(0.85rem, env(safe-area-inset-right, 0px));
  }

  .sandbox-banner {
    font-size: 0.8rem;
  }
}

/* Larger tap target for PayPal area on touch devices */
@media (pointer: coarse) {
  .btn-stack,
  .btn-custom,
  .paypal-overlay > div,
  .paypal-overlay .paypal-buttons,
  .paypal-overlay iframe {
    min-height: max(52px, var(--touch-min)) !important;
  }

  .btn-custom {
    min-height: max(52px, var(--touch-min));
    font-size: 1.08rem;
  }
}

/* Arabic / RTL storefront */
html[dir='rtl'] .shop-features {
  padding: 0 1.15rem 0 0;
}

html[dir='rtl'] .shop-trust {
  padding: 1rem 2.35rem 1rem 1rem;
}

html[dir='rtl'] .shop-trust li::before {
  left: auto;
  right: -1.35rem;
}

/* —— Claim page (CWAgarioAccess/claim_item_ios.php) —— */
.claim-page .shop-main {
  padding-top: 0.5rem;
}

.claim-layout {
  max-width: 420px;
  margin: 0 auto;
}

.claim-hero {
  text-align: center;
  margin-bottom: 1.5rem;
}

.claim-hero__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  margin-bottom: 1rem;
  border-radius: 20px;
  background: linear-gradient(145deg, rgba(0, 112, 186, 0.25) 0%, rgba(0, 112, 186, 0.08) 100%);
  border: 1px solid rgba(0, 112, 186, 0.35);
  color: #5eb3e8;
}

.claim-hero__title {
  font-size: clamp(1.35rem, 4vw, 1.65rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin: 0 0 0.5rem;
  color: var(--text);
}

.claim-hero__lead {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
  line-height: 1.5;
}

.claim-card {
  padding: 1.5rem 1.35rem 1.65rem;
}

.claim-txn {
  margin-bottom: 1.25rem;
  padding-bottom: 1.15rem;
  border-bottom: 1px solid var(--border);
}

.claim-txn__label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.claim-txn__value {
  display: block;
  font-size: 0.8rem;
  line-height: 1.4;
  word-break: break-all;
  padding: 0.55rem 0.65rem;
  border-radius: 8px;
  background: var(--bg);
  border: 1px solid var(--border);
  color: #b8c9dc;
}

.claim-alert {
  margin: 0 0 1rem;
  padding: 0.65rem 0.75rem;
  border-radius: 8px;
  font-size: 0.9rem;
}

.claim-alert--error {
  background: rgba(220, 80, 80, 0.12);
  border: 1px solid rgba(220, 100, 100, 0.35);
  color: #f0a8a8;
}

.claim-message {
  margin: 0 0 1rem;
  font-size: 0.95rem;
  color: var(--text);
}

.claim-code-wrap {
  margin-top: 0.25rem;
}

.claim-code__label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.5rem;
}

.claim-code {
  font-family: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  font-size: clamp(1.15rem, 3.5vw, 1.35rem);
  font-weight: 600;
  letter-spacing: 0.06em;
  text-align: center;
  padding: 1rem 1rem;
  margin-bottom: 0.85rem;
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.35) 0%, rgba(0, 0, 0, 0.2) 100%);
  border: 1px dashed rgba(0, 112, 186, 0.45);
  color: #e8f4fc;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

.claim-copy-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  width: 100%;
  min-height: var(--touch-min);
  padding: 0.65rem 1rem;
  border-radius: 10px;
  border: 1px solid var(--border);
  background: rgba(255, 255, 255, 0.06);
  color: var(--text);
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  -webkit-tap-highlight-color: transparent;
}

.claim-copy-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: var(--accent);
}

.claim-copy-btn.is-copied {
  border-color: rgba(80, 200, 120, 0.5);
  background: rgba(80, 200, 120, 0.12);
  color: #a8ebc0;
}

.claim-form {
  margin-top: 0.5rem;
}

.claim-submit {
  width: 100%;
  min-height: var(--touch-min);
  margin-top: 0.25rem;
  padding: 0.75rem 1.25rem;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 650;
  color: #fff;
  background: linear-gradient(180deg, #009cde 0%, var(--accent) 45%, #003087 100%);
  box-shadow: 0 4px 14px rgba(0, 112, 186, 0.35), inset 0 1px 0 rgba(255, 255, 255, 0.2);
  transition: filter 0.15s, transform 0.05s;
}

.claim-submit:hover:not(:disabled) {
  filter: brightness(1.05);
}

.claim-submit:active:not(:disabled) {
  transform: translateY(1px);
}

.claim-submit:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.claim-hint {
  margin: 0.85rem 0 0;
  font-size: 0.85rem;
  text-align: center;
}

.claim-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.45rem;
  margin: 0.75rem 0 0;
  padding: 0.4rem 0.75rem;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 600;
  background: rgba(80, 180, 120, 0.15);
  border: 1px solid rgba(80, 200, 120, 0.35);
  color: #a8ebc0;
}

.claim-badge__dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #4ade80;
  box-shadow: 0 0 8px rgba(74, 222, 128, 0.6);
}

.claim-footer {
  text-align: center;
  margin-top: 1.75rem;
  font-size: 0.9rem;
}

.claim-footer__link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
}

.claim-footer__link:hover {
  text-decoration: underline;
}
