/* ============================================================
   Rangune — My Account pages.

   Loaded after mfo-dark.css (see layout/base.html) so it can
   consume the --rg-* backstop tokens and the --mf1-* brand
   fonts. Plain CSS on purpose: BigCommerce rebuilds assets/css,
   and assets/mfo is the sheet family that survives that.

   Every account page is wrapped in .rg-acct and shares:
     .rg-acct-head      eyebrow / title / customer chip
     .navBar--account   the tab strip (kept as Cornerstone markup
                        so the Iron Register in-store tab can
                        append itself to .navBar-section)
     .rg-card           the receipt-style surface used for orders,
                        addresses, messages, wish lists, forms
     .rg-stats          the stat strip on the Orders landing page
   ============================================================ */

.rg-acct {
    max-width: 1120px;
    margin: 0 auto;
    padding: 0 0 64px;
    color: var(--rg-text);
}

/* Breadcrumbs sit tight above the header */
.rg-acct .breadcrumbs { margin-bottom: 0; }

/* Cornerstone floats .account-content as a 9-column grid cell (and .account
   itself is a negative-margin grid row). We keep the class — the Iron Register
   in-store panel mounts on it — but neutralise the layout so the page flows
   and the widget regions after it (newsletter band) don't wrap beside it. */
.rg-acct.account { margin: 0 auto; }
.rg-acct .account-content,
.rg-acct .account-body {
    float: none;
    width: auto;
    margin: 0;
    padding: 0;
    display: block;
}
.rg-acct::after { content: ""; display: block; clear: both; }

/* ── Header ────────────────────────────────────────────────── */
.rg-acct-head { padding: 34px 0 6px; }

.rg-acct-eyebrow {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--mf1-font-heading);
    font-size: 0.74rem;
    font-weight: 600;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--rg-lime);
}
.rg-acct-eyebrow::before {
    content: "";
    width: 22px;
    height: 2px;
    background: var(--rg-lime);
}

.rg-acct-titlebar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 24px;
    flex-wrap: wrap;
    margin-top: 10px;
}
.rg-acct-title {
    margin: 0;
    font-family: var(--mf1-font-heading);
    font-size: clamp(1.9rem, 3.4vw, 2.6rem);
    font-weight: 600;
    letter-spacing: 0.01em;
    line-height: 1.05;
    text-transform: uppercase;
    color: var(--rg-ink);
}
.rg-acct-who {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 0.92rem;
    color: var(--rg-muted);
    padding-bottom: 6px;
}
.rg-acct-who-name { color: var(--rg-ink); font-weight: 600; }
.rg-acct-sub {
    margin: 10px 0 0;
    max-width: 60ch;
    color: var(--rg-muted);
    font-size: 0.98rem;
}

/* ── Tab strip ─────────────────────────────────────────────── */
.rg-acct .navBar--account {
    display: block;
    margin: 18px 0 28px;
    border: 0;
    border-bottom: 1px solid var(--rg-hair);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.rg-acct .navBar--account::-webkit-scrollbar { display: none; }
.rg-acct .navBar--account .navBar-section {
    display: flex;
    gap: 2px;
    margin: 0;
    padding: 0;
    list-style: none;
    text-align: left;
    white-space: nowrap;
}
.rg-acct .navBar--account .navBar-item { margin: 0; display: block; }
.rg-acct .navBar--account .navBar-action {
    display: inline-block;
    padding: 12px 14px;
    margin-bottom: -1px;
    border-bottom: 2px solid transparent;
    color: var(--rg-muted);
    font-size: 0.92rem;
    font-weight: 600;
    text-decoration: none;
    text-transform: none;
    letter-spacing: 0;
    transition: color 0.15s ease, border-color 0.15s ease;
}
.rg-acct .navBar--account .navBar-action:hover,
.rg-acct .navBar--account .navBar-action:focus { color: var(--rg-ink); }
.rg-acct .navBar--account .navBar-item.is-active .navBar-action {
    color: var(--rg-ink);
    border-bottom-color: var(--rg-lime);
}

/* ── Alerts inside the account area ───────────────────────── */
.rg-acct .alertBox { margin-bottom: 18px; }

/* ── Stat strip ────────────────────────────────────────────── */
.rg-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
    gap: 14px;
    margin-bottom: 30px;
}
.rg-stat {
    position: relative;
    background: var(--rg-surface);
    border: 1px solid var(--rg-hair);
    border-left: 3px solid var(--rg-lime);
    padding: 16px 18px 15px;
}
.rg-stat-k {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--rg-muted);
}
.rg-stat-k i { color: var(--rg-lime); font-size: 0.85rem; width: 14px; text-align: center; }
.rg-stat-v {
    margin-top: 8px;
    font-family: var(--mf1-font-heading);
    font-size: 1.9rem;
    font-weight: 500;
    line-height: 1.05;
    color: var(--rg-ink);
}
.rg-stat-v small { font-size: 1rem; color: var(--rg-muted); font-family: var(--mf1-font-body); margin-left: 6px; }
.rg-stat-s { margin-top: 5px; font-size: 0.84rem; color: var(--rg-muted); }
.rg-stat-s a { color: var(--rg-muted); text-decoration: underline; text-underline-offset: 3px; }
.rg-stat-s a:hover { color: var(--rg-lime); }

/* ── Section rows ──────────────────────────────────────────── */
.rg-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    margin: 0 0 14px;
}
.rg-section-title {
    margin: 0;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--rg-ink);
    text-transform: none;
}
.rg-section-count { font-size: 0.88rem; color: var(--rg-muted); }

/* ── Cards ─────────────────────────────────────────────────── */
.rg-card {
    background: var(--rg-surface);
    border: 1px solid var(--rg-hair);
}
.rg-card + .rg-card { margin-top: 14px; }
.rg-card-head {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 18px;
    padding: 18px 22px 16px;
    border-bottom: 1px dashed var(--rg-line);
}
.rg-card-body { padding: 8px 22px; }
.rg-card-body--pad { padding: 20px 22px; }
.rg-card-foot {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 18px;
    flex-wrap: wrap;
    padding: 14px 22px;
    border-top: 1px dashed var(--rg-line);
}
.rg-card-foot .rg-spacer { flex: 1; }
.rg-card-title {
    margin: 0;
    font-size: 1rem;
    font-weight: 700;
    color: var(--rg-ink);
    text-transform: none;
}
.rg-card-kicker {
    margin: 0 0 4px;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--rg-muted);
}

/* ── Pills ─────────────────────────────────────────────────── */
.rg-pill {
    display: inline-block;
    padding: 4px 10px 3px;
    border-radius: 999px;
    border: 1px solid var(--rg-lime);
    background: var(--rg-lime);
    color: var(--rg-bg);
    font-size: 0.66rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    line-height: 1.2;
    white-space: nowrap;
    vertical-align: middle;
}
.rg-pill--outline { background: transparent; color: var(--rg-lime); }
.rg-pill--muted { background: transparent; border-color: var(--rg-line); color: var(--rg-muted); }

/* Order status colouring: BigCommerce gives us the status label, so
   we key on it. Terminal-good = filled lime, in-flight = outlined,
   terminal-bad = muted. */
.rg-order .rg-pill { background: transparent; color: var(--rg-lime); }
.rg-order[data-status="Completed"] .rg-pill,
.rg-order[data-status="Shipped"] .rg-pill { background: var(--rg-lime); color: var(--rg-bg); }
.rg-order[data-status="Cancelled"] .rg-pill,
.rg-order[data-status="Declined"] .rg-pill,
.rg-order[data-status="Refunded"] .rg-pill,
.rg-order[data-status="Disputed"] .rg-pill { border-color: var(--rg-line); color: var(--rg-muted); }

/* ── Orders ────────────────────────────────────────────────── */
.rg-order-top { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.rg-order-date { font-size: 1.05rem; font-weight: 700; color: var(--rg-ink); }
.rg-order-meta { margin-top: 5px; font-size: 0.88rem; color: var(--rg-muted); }
.rg-order-meta a { color: var(--rg-muted); text-decoration: none; }
.rg-order-meta a:hover { color: var(--rg-lime); }
.rg-order-total {
    font-family: var(--mf1-font-heading);
    font-size: 1.45rem;
    font-weight: 500;
    color: var(--rg-ink);
    white-space: nowrap;
}
.rg-order-updated { font-size: 0.82rem; color: var(--rg-dim); }

/* Receipt lines */
.rg-lines { list-style: none; margin: 0; padding: 0; }
.rg-line {
    display: grid;
    grid-template-columns: 56px minmax(0, 1fr) auto;
    align-items: center;
    gap: 16px;
    padding: 12px 0;
    border-bottom: 1px solid var(--rg-hair);
}
.rg-line:last-child { border-bottom: 0; }
.rg-line--noimg { grid-template-columns: minmax(0, 1fr) auto; }
.rg-line--check { grid-template-columns: 28px 56px minmax(0, 1fr) auto; }
.rg-line-img {
    margin: 0;
    width: 56px;
    height: 56px;
    background: var(--rg-raised);
    border: 1px solid var(--rg-hair);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.rg-line-img img { width: 100%; height: 100%; object-fit: contain; }
.rg-line-name { font-size: 0.95rem; color: var(--rg-text); font-weight: 500; }
.rg-line-name a { color: inherit; text-decoration: none; }
.rg-line-sub { margin-top: 3px; font-size: 0.82rem; color: var(--rg-muted); }
.rg-line-sub .definitionList { margin: 0; font-size: inherit; border: 0; }
.rg-line-sub .definitionList-key, .rg-line-sub .definitionList-value { display: inline; margin: 0; padding: 0; }
.rg-line-sub .definitionList-key { color: var(--rg-dim); }
.rg-line-sub p { margin: 2px 0 0; }
.rg-line-price { font-size: 0.95rem; color: var(--rg-ink); white-space: nowrap; }
.rg-line-check { display: flex; align-items: center; }
.rg-line-check .form-label { margin: 0; padding-left: 22px; min-height: 22px; }
.rg-line-check .form-label::before { top: 0; }
.rg-line-check .form-label::after { top: 0; }

/* Totals block */
.rg-totals {
    margin: 0;
    padding: 14px 0 6px;
    border-top: 1px dashed var(--rg-line);
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 6px 24px;
    font-size: 0.92rem;
}
.rg-totals dt { margin: 0; color: var(--rg-muted); text-align: right; font-weight: 400; }
.rg-totals dd { margin: 0; color: var(--rg-text); text-align: right; min-width: 90px; }
.rg-totals .rg-totals-grand { padding-top: 8px; margin-top: 4px; border-top: 1px solid var(--rg-hair); }
.rg-totals .rg-totals-grand dt, .rg-totals dt.rg-totals-grand { color: var(--rg-ink); font-weight: 700; }
.rg-totals dd.rg-totals-grand { color: var(--rg-ink); font-weight: 700; font-size: 1.05rem; }
.rg-totals-discount { grid-column: 1 / -1; font-size: 0.82rem; color: var(--rg-dim); text-align: right; }

/* ── Order detail layout ───────────────────────────────────── */
.rg-order-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 330px;
    gap: 20px;
    align-items: start;
}
@media (max-width: 900px) {
    .rg-order-grid { grid-template-columns: 1fr; }
}
.rg-side .rg-card + .rg-card { margin-top: 14px; }
.rg-dl {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 8px 16px;
    margin: 0;
    font-size: 0.9rem;
    border: 0;
}
.rg-dl dt { margin: 0; color: var(--rg-muted); font-weight: 400; white-space: nowrap; }
.rg-dl dd { margin: 0; color: var(--rg-text); }
.rg-address { list-style: none; margin: 0; padding: 0; font-size: 0.92rem; line-height: 1.5; color: var(--rg-text); }
.rg-address li:empty { display: none; }
.rg-address li:first-child { color: var(--rg-ink); font-weight: 600; }
.rg-note { margin: 0; font-size: 0.9rem; color: var(--rg-text); white-space: pre-line; }
.rg-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.rg-actions .button, .rg-actions form { margin: 0; }
.rg-actions .account-reorder-form { display: inline-block; }
.rg-shipment + .rg-shipment { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--rg-hair); }
.rg-ship-multi {
    padding: 12px 0 6px;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--rg-muted);
}

/* ── Grids of cards (addresses, wish lists, returns) ───────── */
.rg-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 14px;
}
.rg-grid .rg-card + .rg-card { margin-top: 0; }
.rg-grid .rg-card { display: flex; flex-direction: column; }
.rg-grid .rg-card .rg-card-body { flex: 1; }
.rg-card--new {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 180px;
    border: 1px dashed var(--rg-line);
    background: transparent;
    color: var(--rg-muted);
    font-weight: 600;
    text-decoration: none;
    transition: border-color 0.15s ease, color 0.15s ease;
}
.rg-card--new:hover { border-color: var(--rg-lime); color: var(--rg-lime); }
.rg-card--new .rg-plus {
    width: 34px; height: 34px;
    display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid currentColor; border-radius: 50%;
    font-size: 1.2rem; line-height: 1;
}

/* Address card */
.rg-addr-phone { margin-top: 8px; font-size: 0.86rem; color: var(--rg-muted); }
.rg-card .form-actions { margin: 0; text-align: left; display: flex; gap: 8px; }
.rg-card .form-actions .button { margin: 0; }

/* ── Buttons within the account area ───────────────────────── */
.rg-acct .button--small { padding: 8px 16px; font-size: 0.82rem; }
.rg-link {
    color: var(--rg-muted);
    font-size: 0.88rem;
    text-decoration: underline;
    text-underline-offset: 3px;
}
.rg-link:hover { color: var(--rg-lime); }
.rg-link--danger:hover { color: #f87171; }

/* ── Messages ──────────────────────────────────────────────── */
.rg-msg { padding: 16px 22px; border-bottom: 1px solid var(--rg-hair); }
.rg-msg:last-child { border-bottom: 0; }
.rg-msg-top { display: flex; justify-content: space-between; gap: 16px; align-items: baseline; }
.rg-msg-subject { margin: 0; font-size: 0.98rem; font-weight: 700; color: var(--rg-ink); text-transform: none; }
.rg-msg-subject::before {
    content: "";
    display: inline-block;
    width: 8px; height: 8px;
    margin-right: 10px;
    border-radius: 50%;
    background: var(--rg-lime);
    vertical-align: 2px;
}
.rg-msg.is-read .rg-msg-subject { color: var(--rg-text); font-weight: 600; }
.rg-msg.is-read .rg-msg-subject::before { background: var(--rg-line); }
.rg-msg-date { font-size: 0.82rem; color: var(--rg-dim); white-space: nowrap; }
.rg-msg-body { margin: 6px 0 0 18px; font-size: 0.92rem; color: var(--rg-text); }
.rg-msg-who { color: var(--rg-muted); }

/* ── Forms in cards ────────────────────────────────────────── */
.rg-form-card { padding: 22px 22px 8px; }
.rg-form-card .form-fieldset { margin: 0; }
.rg-form-card .form-field { margin-bottom: 18px; }
.rg-form-card .form-actions { margin: 4px 0 14px; text-align: left; display: flex; gap: 10px; flex-wrap: wrap; }
.rg-form-card .form-actions .button { margin: 0; }
.rg-form-intro { margin: 0 0 18px; color: var(--rg-muted); font-size: 0.92rem; }
.rg-form-narrow { max-width: 760px; }

/* ── Wish lists ────────────────────────────────────────────── */
.rg-wl-count { font-family: var(--mf1-font-heading); font-size: 1.6rem; color: var(--rg-ink); line-height: 1; }
.rg-wl-count small { font-family: var(--mf1-font-body); font-size: 0.82rem; color: var(--rg-muted); margin-left: 6px; }
.rg-wl-bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 18px 0 0; }
.rg-wl-bar form { margin: 0; }
.rg-wl-bar .form-actions { margin: 0; text-align: left; display: flex; gap: 10px; }
.rg-wl-bar .form-actions .button { margin: 0; }
.rg-share { margin-bottom: 18px; }
.rg-share .form-input { margin-top: 8px; }

/* ── Recently viewed / wishlist product grids ──────────────── */
.rg-acct .productGrid { margin-top: 4px; }
.rg-acct .productGrid .product { position: relative; }
.rg-acct .productGrid .product > form { margin: 6px 0 18px; }

/* ── Empty state ───────────────────────────────────────────── */
.rg-empty {
    padding: 52px 24px;
    text-align: center;
    border: 1px dashed var(--rg-line);
    color: var(--rg-muted);
}
.rg-empty i { font-size: 1.6rem; color: var(--rg-dim); display: block; margin-bottom: 12px; }
.rg-empty p { margin: 0 auto; max-width: 46ch; font-size: 0.95rem; }
.rg-empty .button { margin-top: 18px; }

/* ── Pagination ────────────────────────────────────────────── */
.rg-acct .pagination { margin-top: 26px; text-align: center; }

/* ── Footer note ───────────────────────────────────────────── */
.rg-acct-foot {
    display: flex;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
    margin-top: 28px;
    font-size: 0.82rem;
    color: var(--rg-dim);
}
.rg-acct-foot a { color: var(--rg-dim); text-decoration: underline; text-underline-offset: 3px; }
.rg-acct-foot a:hover { color: var(--rg-lime); }

/* ── Iron Register in-store panel: let it sit inside the same
      column and share the card rhythm. It brings its own styles;
      we only make sure our chrome doesn't fight it. ────────── */
.rg-acct .ir { margin-top: 0; }

/* ── Small screens ─────────────────────────────────────────── */
@media (max-width: 640px) {
    .rg-acct-head { padding-top: 22px; }
    .rg-card-head, .rg-card-body, .rg-card-foot, .rg-msg, .rg-form-card { padding-left: 16px; padding-right: 16px; }
    .rg-order-total { font-size: 1.25rem; }
    .rg-line { grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; }
    .rg-line--check { grid-template-columns: 26px 48px minmax(0, 1fr) auto; }
    .rg-line-img { width: 48px; height: 48px; }
}
