/* Hard rule: anything with the hidden attribute is never displayed */
[hidden] { display: none !important; }

:root{
  --amazon-navy: #131921;
  --amazon-navy-2: #232f3e;
  --amazon-accent: #febd69;
  --amazon-accent-2: #f3a847;

  --panel: #ffffff;
  --text: #0f1111;
  --muted: #565959;
  --line: #e6e6e6;

  --shadow: 0 10px 30px rgba(0,0,0,.12);
  --radius: 14px;

  --focus: 0 0 0 3px rgba(254,189,105,.35);
}

*{ box-sizing:border-box; }
html,body{ height:100%; }
body{
  margin:0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color: var(--text);
  background: #f6f6f6;
}

.container{
  width: min(1100px, calc(100% - 32px));
  margin: 0 auto;
}

.main{
  padding: 22px 0 60px;
}

/* Topbar */
.brand{
  display:flex;
  gap: 12px;
  align-items:center;
  min-width: 240px;
}

.brand__logo{
  height: 40px;
  width: auto;
  display:block;
  object-fit: contain;
}

.topbar{
  background: var(--amazon-navy);
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar__inner{
  display:flex;
  gap: 18px;
  align-items:center;
  padding: 14px 0;
}
.brand{
  display:flex;
  gap: 12px;
  align-items:center;
  min-width: 240px;
}
.brand__mark{
  width: 40px; height: 40px;
  border-radius: 12px;
  background:
    radial-gradient(circle at 30% 30%, rgba(254,189,105,.95), rgba(254,189,105,.15)),
    linear-gradient(135deg, #232f3e, #0b0f14);
  border: 1px solid rgba(255,255,255,.14);
}
.brand__name{ font-weight: 700; line-height: 1.1; }
.brand__tag{ font-size: 12px; color: rgba(255,255,255,.75); margin-top: 2px; }

.topbar__search{ flex: 1; }
.topbar__actions{
  display:flex;
  justify-content:flex-end;
  min-width: 110px;
}

/* Search */
.search{
  display:flex;
  border-radius: 10px;
  overflow:hidden;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.06);
}
.search input{
  flex:1;
  padding: 11px 12px;
  border: 0;
  outline: none;
  background: transparent;
  color: #fff;
}
.search input::placeholder{ color: rgba(255,255,255,.65); }
.search button{
  border:0;
  padding: 0 14px;
  background: var(--amazon-accent);
  color: #111;
  font-weight: 700;
  cursor:pointer;
}
.search button:hover{ background: var(--amazon-accent-2); }
.search button:focus-visible{ outline:none; box-shadow: var(--focus); }

/* Views */
.view{ display:none; }
.view--active{ display:block; }

.muted{ color: var(--muted); }

/* Panels */
.panel{
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 18px;
}
.panel--auth{
  width: min(460px, 100%);
  margin: 28px auto;
  padding: 22px;
}

.panel__header h1{ margin: 0 0 6px; font-size: 24px; }
.panel__header p{ margin: 0 0 14px; }

/* Form */
.form{ display:flex; flex-direction:column; gap: 12px; }
.field{ display:flex; flex-direction:column; gap: 6px; }
.field > span{ font-weight: 600; font-size: 14px; }
.field input{
  padding: 12px 12px;
  border-radius: 10px;
  border: 1px solid #d5d9d9;
  outline: none;
}
.field input:focus{ box-shadow: var(--focus); border-color: rgba(254,189,105,.85); }
.hint{ display:block; margin-top: 6px; color: var(--muted); }
.fineprint{ margin-top: 12px; font-size: 12px; color: var(--muted); }

/* Buttons */
.btn{
  border: 1px solid transparent;
  border-radius: 12px;
  padding: 11px 14px;
  font-weight: 700;
  cursor:pointer;
}
.btn:focus-visible{ outline:none; box-shadow: var(--focus); }

.btn--primary{
  background: var(--amazon-accent);
  color: #111;
  border-color: rgba(0,0,0,.05);
}
.btn--primary:hover{ background: var(--amazon-accent-2); }

.btn--ghost{
  background: transparent;
  color: #fff;
  border-color: rgba(255,255,255,.18);
}
.btn--ghost:hover{ background: rgba(255,255,255,.08); }

.btn--full{ width:100%; }

.iconbtn{
  border: 1px solid #e2e2e2;
  background: #fff;
  width: 38px; height: 38px;
  border-radius: 12px;
  cursor:pointer;
}

/* Hero */
.hero{
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: #fff;
  padding: 18px;
  display:flex;
  gap: 18px;
  align-items: stretch;
  margin-bottom: 16px;
}
.hero__left{ flex: 1; }
.hero__left h2{ margin: 0 0 8px; }
.hero__right{ width: min(420px, 100%); display:flex; align-items:center; }

.trust{
  width: 100%;
  display:flex;
  flex-direction:column;
  gap: 10px;
  padding: 12px;
  background: #fafafa;
  border-radius: 12px;
  border: 1px solid #efefef;
}
.trust__item{ display:flex; gap: 10px; align-items:center; }
.trust__icon{
  width: 34px; height: 34px;
  border-radius: 12px;
  display:grid;
  place-items:center;
  background: rgba(254,189,105,.25);
  border: 1px solid rgba(254,189,105,.35);
  font-weight: 900;
}
.trust__title{ font-weight: 700; }

/* Category Grid */
.grid{
  display:grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
}
@media (max-width: 980px){
  .grid{ grid-template-columns: repeat(2, 1fr); }
  .brand{ min-width: 200px; }
}
@media (max-width: 560px){
  .grid{ grid-template-columns: 1fr; }
  .topbar__actions{ display:none; }
}

/* Cards */
.card{
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
  padding: 0;
  overflow:hidden;
  text-align:left;
}
.card--category{
  cursor:pointer;
  transition: transform .12s ease, box-shadow .12s ease;
}
.card--category:hover{
  transform: translateY(-2px);
  box-shadow: 0 18px 40px rgba(0,0,0,.14);
}
.card__media{ height: 122px; background: #ddd; }
.card__body{ padding: 14px; }
.card__title{ font-weight: 800; margin-bottom: 6px; }
.card__meta{ color: var(--muted); font-size: 13px; }

/* Brand logo category cards */
.media--brand{
  display:flex;
  align-items:center;
  justify-content:center;
  background:
    linear-gradient(135deg, #232f3e, #0f1111);
}

.brand-logo{
  max-width: 70%;
  max-height: 70%;
  object-fit: contain;
  filter: drop-shadow(0 6px 14px rgba(0,0,0,.35));
}


/* Category “photo” gradients */
.media--electronics{
  background:
    radial-gradient(circle at 20% 30%, rgba(254,189,105,.9), rgba(254,189,105,.1)),
    linear-gradient(135deg, #232f3e, #0f1111);
}
.media--fashion{
  background:
    radial-gradient(circle at 30% 25%, rgba(255,255,255,.6), rgba(255,255,255,.08)),
    linear-gradient(135deg, #2a2a2a, #111);
}
.media--home{
  background:
    radial-gradient(circle at 25% 30%, rgba(254,189,105,.55), rgba(254,189,105,.08)),
    linear-gradient(135deg, #2b3a33, #0f1111);
}
.media--gaming{
  background:
    radial-gradient(circle at 35% 25%, rgba(254,189,105,.55), rgba(254,189,105,.08)),
    linear-gradient(135deg, #1b2b54, #0f1111);
}

/* Products bar */
/* Out of stock row: grey + faded */
.row--oos{
  opacity: .55;
  filter: grayscale(1);
}

/* Grey out text inside the row */
.row--oos .row__name,
.row--oos .row__desc{
  color: #7a7a7a !important;
}

/* Grey out the price pill */
.row--oos .price{
  background: #efefef !important;
  color: #7a7a7a !important;
  border-color: #e0e0e0 !important;
}

/* Disabled button: grey and unclickable */
.btn--disabled,
.btn:disabled{
  background: #e6e6e6 !important;
  color: #6f6f6f !important;
  border-color: #d8d8d8 !important;
  cursor: not-allowed;
  opacity: .9; /* keep readable */
}

.bar{
  display:flex;
  align-items:center;
  gap: 12px;
  margin-bottom: 12px;
}
.bar__title h2{ margin: 0; }
.bar__title p{ margin: 2px 0 0; }

/* Product list */
.list{ display:flex; flex-direction:column; gap: 10px; }
.row{
  display:flex;
  gap: 12px;
  align-items:center;
  padding: 12px;
  border: 1px solid #ededed;
  border-radius: 12px;
  background: #fff;
}
.row__left{ flex:1; }
.row__name{ font-weight: 800; }
.row__desc{ color: var(--muted); font-size: 13px; margin-top: 3px; }
.row__right{ display:flex; align-items:center; gap: 10px; }

.price{
  font-weight: 800;
  color: #111;
  background: rgba(254,189,105,.25);
  border: 1px solid rgba(254,189,105,.35);
  border-radius: 999px;
  padding: 8px 10px;
  font-size: 13px;
}

/* Alerts */
.alert{
  border-radius: 12px;
  padding: 10px 12px;
  font-weight: 600;
  border: 1px solid transparent;
}
.alert--danger{
  background: #fff3f3;
  border-color: #ffd0d0;
  color: #8a1f1f;
}

/* Modal */
.overlay{
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.55);
  z-index: 50;
}
.modal{
  position: fixed;
  z-index: 60;
  top: 50%;
  left: 50%;
  transform: translate(-50%,-50%);
  width: min(560px, calc(100% - 28px));
  background: #fff;
  border-radius: var(--radius);
  box-shadow: 0 26px 80px rgba(0,0,0,.35);
  border: 1px solid rgba(0,0,0,.12);
  overflow:hidden;
}
.modal__header{
  display:flex;
  justify-content:space-between;
  align-items:center;
  padding: 14px 16px;
  background: #fafafa;
  border-bottom: 1px solid #eee;
}
.modal__header h3{ margin:0; }
.modal__body{ padding: 16px; }

.divider{
  border:0;
  border-top: 1px solid #eee;
  margin: 14px 0;
}

.payline{
  display:flex;
  justify-content:space-between;
  gap: 16px;
  padding: 8px 0;
}
.payline__value{ font-weight: 800; }

.coins{
  display:flex;
  flex-wrap:wrap;
  gap: 10px;
  margin-top: 6px;
}
.coinbtn{
  border: 1px solid #e2e2e2;
  background: #fff;
  border-radius: 999px;
  padding: 9px 12px;
  cursor:pointer;
  font-weight: 800;
}
.coinbtn:hover{ background: #fafafa; }
.coinbtn[aria-pressed="true"]{
  border-color: rgba(254,189,105,.75);
  box-shadow: var(--focus);
}

.wallet{
  margin-top: 12px;
  padding: 12px;
  border-radius: 14px;
  border: 1px solid #ededed;
  background: #fcfcfc;
}
.wallet__row{
  display:flex;
  gap: 12px;
  align-items:center;
  justify-content:space-between;
}
.wallet__label{ font-size: 12px; }
.wallet__address{
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", monospace;
  font-size: 13px;
  font-weight: 700;
  margin-top: 4px;
  word-break: break-all;
}
.wallet__note{ margin-top: 10px; font-size: 12px; }
.wallet__actions{ margin-top: 12px; }

/* Make ghost buttons readable on light backgrounds (modal etc.) */
.modal .btn--ghost, .panel .btn--ghost, .bar .btn--ghost{
  color: #111;
  border-color: #e2e2e2;
}
.modal .btn--ghost:hover, .panel .btn--ghost:hover, .bar .btn--ghost:hover{
  background: #fafafa;
}

/* FULL PROCESSING SCREEN (ONLY AFTER "I’VE SENT PAYMENT") */
.processingFull{
  min-height: 260px;
  display:flex;
  align-items:center;
  justify-content:center;
  border-radius: 14px;
  background: #fff;
}
.processingFull__inner{
  width: 100%;
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap: 10px;
  padding: 22px 10px;
}
.processingFull__title{
  font-weight: 900;
  font-size: 18px;
}
.processingFull__sub{
  font-size: 13px;
  text-align:center;
  max-width: 360px;
}

/* Indefinite spinner */
.spinnerBig{
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 5px solid rgba(0,0,0,.12);
  border-top-color: rgba(0,0,0,.55);
  animation: spin 0.9s linear infinite;
}
@keyframes spin{
  to { transform: rotate(360deg); }
}

/* ============================
   MOBILE RESPONSIVE PASS
   ============================ */

/* Prevent horizontal scroll on small devices */
html, body {
  max-width: 100%;
  overflow-x: hidden;
}

/* Make taps feel better */
button, .btn, .coinbtn, input {
  touch-action: manipulation;
}

/* Safer defaults for images/logos */
img {
  max-width: 100%;
  height: auto;
}

/* ---------- Small screens ---------- */
@media (max-width: 720px) {
  /* Page padding */
  .container {
    padding-left: 12px;
    padding-right: 12px;
  }

  /* Top bar: stack neatly */
  .topbar {
    padding: 10px 12px;
    gap: 10px;
  }

  .topbar__inner {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  /* Brand area */
  .brand {
    min-width: 0;
    width: 100%;
    justify-content: flex-start;
  }

  .brand__logo {
    height: 34px;
  }

  .brand__text .brand__name {
    font-size: 16px;
    line-height: 1.2;
  }

  .brand__text .brand__tag {
    font-size: 12px;
  }

  /* Search: full width */
  .search {
    width: 100%;
  }

  .search input,
  .search .input,
  .searchInput {
    width: 100%;
  }

  /* Header buttons */
  .topbar__actions {
    width: 100%;
    display: flex;
    gap: 10px;
  }
  .topbar__actions .btn {
    flex: 1;
  }

  /* Views/panels spacing */
  .panel {
    padding: 14px;
    border-radius: 14px;
  }

  /* Category grid: 2 columns */
  .grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

  .card__media {
    height: 88px; /* shorter tiles on mobile */
  }

  .card__title {
    font-size: 14px;
  }

  .card__meta {
    font-size: 12px;
  }

  /* Products list rows: stack right section under left */
  .row {
    align-items: flex-start;
    gap: 10px;
  }

  .row__right {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
  }

  .price {
    white-space: nowrap;
  }

  .row__right .btn {
    width: auto;
    min-width: 120px;
  }

  /* Modal: full-width "bottom sheet" feel */
  .modal {
    width: 100%;
    max-width: 520px;
    margin: 0 12px;
    max-height: calc(100vh - 24px);
    overflow: auto;
    border-radius: 16px;
  }

  .modal__header,
  .modal__body,
  .modal__footer {
    padding: 12px 12px;
  }

  /* Coin buttons: 2 per row */
  .coinOptions,
  #coinOptions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .coinbtn {
    width: 100%;
    justify-content: center;
    padding: 12px;
  }

  /* Wallet block: allow long addresses to wrap safely */
  .wallet__address,
  #walletAddress,
  #amountToSend {
    word-break: break-all;
  }

  /* Buttons: increase tap size */
  .btn {
    padding: 12px 14px;
    font-size: 14px;
  }

  /* Processing area: keep centered and readable */
  .processing {
    padding: 18px 12px;
  }

  .processing__text {
    font-size: 14px;
  }
}

/* ---------- Extra small screens (older iPhones etc.) ---------- */
@media (max-width: 380px) {
  .grid {
    grid-template-columns: 1fr; /* single column categories */
  }

  .row__right .btn {
    min-width: 110px;
  }
}
/* Mobile: stop feature text from overflowing boxes */
@media (max-width: 720px) {
  /* Common patterns: paragraphs, list items, and small text should wrap */
  .panel, .card, .box, .notice, .feature, .features {
    overflow: hidden;
  }

  /* If your feature rows are built with an icon then text, this makes them wrap correctly */
  .feature-row,
  .feature-item,
  .benefit,
  .perk,
  .security-item,
  .trust-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;              /* important for flex wrapping */
  }

  /* Ensure the text portion can shrink and wrap */
  .feature-row > div,
  .feature-item > div,
  .benefit > div,
  .perk > div,
  .security-item > div,
  .trust-item > div {
    min-width: 0;
  }

  /* Hard wrap any long text safely */
  .feature-row,
  .feature-item,
  .benefit,
  .perk,
  .security-item,
  .trust-item,
  .feature-row *,
  .feature-item *,
  .benefit *,
  .perk *,
  .security-item *,
  .trust-item * {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}

@media (max-width: 720px) {
  .feature-icon,
  .benefit__icon,
  .perk__icon {
    flex: 0 0 22px;
    line-height: 1.1;
    margin-top: 2px;
  }
}
@media (max-width: 720px) {
  /* Product rows: allow content to wrap */
  .row {
    flex-wrap: wrap;
    min-width: 0;
  }

  .row__left {
    min-width: 0;
    width: 100%;
  }

  /* Right side becomes a 2-column grid: price + button */
  .row__right {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr 1fr;   /* price | button */
    gap: 10px;
    align-items: center;
  }

  /* Price stays inside its cell */
  .price {
    justify-self: start;
    white-space: nowrap;
  }

  /* Button always fits inside its cell */
  .row__right .btn {
    width: 100%;
    min-width: 0;
    justify-self: end;
  }
}
/* Mobile fix: Trust items (✓ Verified UK Giftcards ...) wrapping/alignment */
@media (max-width: 720px) {
  .hero__right { width: 100%; }

  .trust {
    width: 100%;
  }

  .trust__item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    min-width: 0;          /* critical for flex children to shrink */
  }

  .trust__icon {
    flex: 0 0 22px;        /* fixed icon column */
    line-height: 1.1;
    margin-top: 2px;
  }

  /* This is the main fix: allow the text block to shrink and wrap */
  .trust__item > div:last-child {
    min-width: 0;
    flex: 1 1 auto;
  }

  .trust__title,
  .trust__item .muted {
    overflow-wrap: anywhere;
    word-break: break-word;
  }
}
