/* EgyDevInfo Prize Wheel v1.4.0 */
:root {
  --gstw-primary:    var(--wp--preset--color--primary, var(--global--color-primary, #0ea37f));
  --gstw-foreground: var(--wp--preset--color--foreground, #111827);
  --gstw-background: var(--wp--preset--color--background, #ffffff);
}

/* ── Tab ── */
#gstw-tab {
  position: fixed; top: 40%; left: 0 !important; right: auto !important;
  z-index: 99998; background: var(--gstw-primary); color: #fff; border: none;
  padding: 15px 9px; border-radius: 0 12px 12px 0; cursor: pointer;
  box-shadow: 3px 0 14px rgba(0,0,0,.22); font-weight: 800;
  writing-mode: vertical-rl; text-orientation: mixed;
  font-size: 14px; letter-spacing: .7px; transition: all .25s ease;
}
#gstw-tab:hover {
  background: var(--gstw-foreground); color: var(--gstw-background);
  box-shadow: 4px 0 18px rgba(0,0,0,.28);
}

/* ── Overlay ── */
#gstw-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 99996;
}

/* ── Panel ── */
#gstw-panel {
  position: fixed; top: 0; left: 0 !important; right: auto !important;
  width: 760px; max-width: 96vw; height: 100vh; overflow: hidden;
  background: var(--gstw-background); color: var(--gstw-foreground);
  z-index: 99997; transform: translateX(-100%); transition: transform .35s ease;
  box-shadow: 6px 0 40px rgba(0,0,0,.22), 1px 0 8px rgba(0,0,0,.10);
  border-radius: 0 24px 24px 0;
  display: flex; flex-direction: column; padding: 16px 20px 24px;
  box-sizing: border-box;
}
#gstw-panel.gstw-open { transform: translateX(0); }

.gstw-hidden { display: none !important; }

/* ── Close button ── */
.gstw-close {
  align-self: flex-end; font-size: 26px; background: transparent; border: 0;
  cursor: pointer; color: inherit; opacity: .45; transition: opacity .2s;
  padding: 4px 8px; border-radius: 8px; line-height: 1; flex-shrink: 0;
}
.gstw-close:hover { opacity: 1; }

/* ── Two-column layout ── */
.gstw-layout {
  display: grid; grid-template-columns: 1fr 1fr; gap: 28px;
  height: calc(100% - 40px); align-items: center;
  min-width: 0;                 /* prevent grid blowout */
}
/* Both grid children must be able to shrink */
.gstw-layout > * { min-width: 0; }

/* ── Wheel column ── */
.gstw-wheel-wrap {
  position: relative; width: 380px; max-width: 100%; margin: 0 auto;
}
.gstw-pointer { display: none !important; }  /* drawn on canvas */
#gstw-canvas  { display: block; width: 100%; height: auto; }

/* ── Form column ── */
.gstw-form {
  display: flex; flex-direction: column; justify-content: center;
  min-width: 0; overflow: hidden;
}
.gstw-form h2 {
  margin: 0 0 8px; font-size: 24px; font-weight: 800;
  letter-spacing: -.3px; line-height: 1.2;
}
.gstw-sub {
  margin: 0 0 18px; font-size: 14px; line-height: 1.55; opacity: .68;
}

/* ── Email row ── */
.gstw-email { display: flex; gap: 8px; }
.gstw-email input {
  flex: 1 1 0; min-width: 0;            /* key: allow shrink */
  padding: 11px 13px; font-size: 15px;
  border: 2px solid #e5e7eb; border-radius: 12px;
  outline: none; transition: border-color .2s, box-shadow .2s;
  background: var(--gstw-background); color: var(--gstw-foreground);
  box-sizing: border-box;
}
.gstw-email input:focus {
  border-color: var(--gstw-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--gstw-primary) 18%, transparent);
}
.gstw-email button {
  flex-shrink: 0;
  padding: 11px 14px; border: 0; background: var(--gstw-primary);
  color: #fff; border-radius: 12px; cursor: pointer;
  font-weight: 700; font-size: 14px; letter-spacing: .1px; white-space: nowrap;
  transition: filter .2s, box-shadow .2s;
  box-shadow: 0 3px 10px rgba(0,0,0,.14);
}
.gstw-email button:hover {
  filter: brightness(1.08);
  box-shadow: 0 5px 14px rgba(0,0,0,.18);
}
.gstw-email button:active { filter: brightness(.95); }

/* ── Messages ── */
.gstw-msg {
  margin-top: 10px; padding: 9px 13px; border-radius: 10px;
  font-size: 13px; font-weight: 500;
}
.gstw-msg-error { background: #fee2e2; color: #b91c1c; }
.gstw-msg-info  { background: #d1fae5; color: #065f46; }
.gstw-consent   { font-size: 12px; opacity: .62; margin-top: 12px; line-height: 1.5; }
.gstw-result    { margin-top: 16px; font-weight: 700; font-size: 15px; }

/* ── Coupon actions row ── */
.gstw-actions {
  margin-top: 10px; display: flex; gap: 8px; align-items: center;
  flex-wrap: nowrap; min-width: 0;
}
.gstw-actions input {
  flex: 1 1 0; min-width: 0;            /* allow shrink */
  padding: 9px 11px; font-size: 13px;
  border: 2px solid #e5e7eb; border-radius: 10px;
  background: var(--gstw-background); color: var(--gstw-foreground);
  outline: none; box-sizing: border-box;
}
/* copy button */
.gstw-actions button {
  flex-shrink: 0; padding: 9px 11px;
  border: 2px solid #e5e7eb; border-radius: 10px;
  background: var(--gstw-background); color: var(--gstw-foreground);
  cursor: pointer; font-size: 14px; transition: background .15s;
}
.gstw-actions button:hover { background: #f3f4f6; }
/* shop link */
.gstw-shop {
  flex-shrink: 0;
  padding: 9px 13px; background: var(--gstw-foreground);
  color: var(--gstw-background); border-radius: 10px; text-decoration: none;
  font-weight: 600; font-size: 13px; white-space: nowrap;
  transition: filter .2s; display: inline-block;
}
.gstw-shop:hover { filter: brightness(1.12); }

/* ───────────────── Mobile ───────────────── */
@media (max-width: 900px) {
  .gstw-layout {
    grid-template-columns: 1fr; align-content: start; gap: 14px;
    height: auto; overflow-y: auto;
  }
  #gstw-panel {
    padding: 14px 16px 96px; overflow-y: auto;
    border-radius: 0 20px 20px 0;
  }
  .gstw-wheel-wrap { width: 100%; max-width: 320px; }
  .gstw-email      { flex-direction: column; }
  .gstw-email input  { font-size: 16px; padding: 14px 13px; }
  .gstw-email button { width: 100%; font-size: 16px; padding: 14px; border-radius: 12px; }
  .gstw-close        { font-size: 32px; }
  #gstw-tab          { padding: 18px 10px; font-size: 15px; }
  .gstw-actions {
    position: sticky; bottom: 0; left: 0; right: 0;
    padding: 12px; margin: 0 -16px;
    background: var(--gstw-background); border-top: 1px solid #e5e7eb;
    box-shadow: 0 -6px 24px rgba(0,0,0,.08);
  }
  .gstw-actions input { font-size: 15px; padding: 11px; }
  .gstw-shop { font-size: 15px; padding: 11px 13px; }
}
@supports (padding: max(0px)) {
  @media (max-width: 900px) {
    .gstw-actions { padding-bottom: max(12px, env(safe-area-inset-bottom)); }
  }
}
