/* Trex Pi shop theme: the brand's tokens (base.css), a white header with the green search action, large tabular
   prices; mobile-first. */

/* ------------------------------------------------------------------ header */

.site-header { background: var(--surface); color: var(--ink); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.header-bar {
    max-width: var(--max); margin: 0 auto; padding: 10px var(--gutter);
    display: grid; gap: 10px 14px; align-items: center;
    grid-template-columns: auto 1fr;
    grid-template-areas: "brand actions" "search search";
}
@media (min-width: 820px) {
    .header-bar { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "brand search actions"; padding-top: 14px; padding-bottom: 14px; }
}

.brand { grid-area: brand; display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand:hover { color: var(--ink); }
.brand-mark { flex: none; width: 36px; height: 36px; }
.brand-name { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; letter-spacing: -0.01em; white-space: nowrap; }
.brand-sub { font-weight: 400; margin-left: 6px; color: var(--accent); }
/* Narrow phones: the brand's Verdana is wide - the mark and "Trex Pi" only, so the header actions keep their room */
@media (max-width: 419px) {
    .brand { gap: 8px; }
    .brand-mark { width: 30px; height: 30px; }
    .brand-sub { display: none; }
}

.search { grid-area: search; display: flex; min-width: 0; }
.search input {
    flex: 1; min-width: 0; min-height: 44px; padding: 10px 14px; font: inherit; color: var(--ink);
    border: 2px solid var(--line-strong); border-right: 0; border-radius: var(--radius-s) 0 0 var(--radius-s); background: #fff;
}
.search input:focus-visible { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(47, 191, 113, 0.35); }
.search-button {
    min-width: 52px; min-height: 44px; border: 0; border-radius: 0 var(--radius-s) var(--radius-s) 0;
    background: var(--brand); color: var(--brand-ink); cursor: pointer; display: grid; place-items: center;
}
.search-button:hover { background: var(--brand-hover); }
@media (min-width: 820px) { .search { max-width: 620px; justify-self: center; width: 100%; } }

.header-actions { grid-area: actions; display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.basket-link {
    position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 6px 10px;
    color: var(--ink); text-decoration: none; border-radius: var(--radius-s);
}
.basket-link:hover { color: var(--accent); background: var(--accent-soft); }
.basket-count {
    min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--brand); color: var(--brand-ink);
    font-size: 0.8rem; font-weight: 800; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums;
}
.basket-count[hidden] { display: none; }
.auctions-link[hidden] { display: none; }
.auctions-link[aria-current="page"] { background: var(--accent-soft); color: var(--accent); }
@media (max-width: 479px) { .basket-text { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); } }

.account-area { display: flex; align-items: center; gap: 4px; }
.account-area .btn-ghost { color: var(--ink); }
.account-area .btn-ghost:hover { background: var(--accent-soft); color: var(--accent); }
.registration-closed { font-size: 0.85rem; color: var(--muted); padding: 0 6px; }
@media (max-width: 479px) { .registration-closed { display: none; } }

.account-menu { position: relative; }
.account-menu summary { list-style: none; color: var(--ink); }
.account-menu summary::-webkit-details-marker { display: none; }
.account-name { max-width: 12ch; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 479px) { .account-name { display: none; } }
.account-menu-list {
    position: absolute; right: 0; top: calc(100% + 6px); min-width: 200px; margin: 0; padding: 6px; list-style: none;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-m); box-shadow: var(--shadow); z-index: 60;
}
.account-menu-list a, .account-menu-list button {
    display: flex; gap: 8px; align-items: center; width: 100%; min-height: 40px; padding: 8px 12px;
    color: var(--ink); text-decoration: none; background: none; border: 0; border-radius: var(--radius-s); font: inherit; text-align: left; cursor: pointer;
}
.account-menu-list a:hover, .account-menu-list button:hover { background: var(--surface-alt); }

.category-strip { background: var(--surface); border-bottom: 1px solid var(--line); }
.category-strip ul {
    max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); list-style: none;
    display: flex; gap: 4px; overflow-x: auto; scrollbar-width: thin;
}
.category-strip a {
    display: block; padding: 11px 12px; white-space: nowrap; color: var(--ink-soft); text-decoration: none;
    font-weight: 600; font-size: 0.93rem; border-bottom: 3px solid transparent;
}
.category-strip a:hover { color: var(--accent); }
.category-strip a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--accent); }

/* ------------------------------------------------------------------ home */

.hero { padding: 28px 0 8px; max-width: 760px; }
.hero h1 { font-size: clamp(2rem, 1.4rem + 3vw, 3.4rem); line-height: 1.05; letter-spacing: -0.025em; margin-bottom: 14px; max-width: 18ch; }
.hero-text { font-size: 1.1rem; color: var(--ink-soft); max-width: 56ch; }
.hero-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.home-categories { margin-top: 36px; }

/* ------------------------------------------------------------------ catalogue tweaks */

.product-card .price-main { font-size: 1.35rem; }
.product-page .price { padding: 12px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }

/* ------------------------------------------------------------------ basket, checkout, confirmation */

.line-total { font-weight: 800; font-size: 1.1rem; margin: 0; font-variant-numeric: tabular-nums; }
.payment-note { display: flex; gap: 6px; align-items: flex-start; color: var(--ink-soft); font-size: 0.92rem; margin: 14px 0; }
.summary-box .btn-primary { width: 100%; margin-bottom: 10px; }
.summary-lines { list-style: none; margin: 0 0 14px; padding: 0; display: grid; gap: 6px; font-size: 0.93rem; }
.summary-lines li { display: flex; justify-content: space-between; gap: 12px; }
.checkout-form .panel h2 { margin-bottom: 12px; }
.address-new { margin-top: 12px; }

.confirmation { text-align: left; }
.confirmation-mark {
    width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center;
    background: var(--ok-soft); color: var(--ok); margin: 12px 0 16px;
}
.lead { font-size: 1.15rem; }
.order-number { font-variant-numeric: tabular-nums; font-size: 1.3rem; }

/* Guest checkout: the choice at /checkout, the guest form's notices, the account invitation */
.checkout-choices { display: grid; gap: 14px; }
@media (min-width: 720px) { .checkout-choices { grid-template-columns: repeat(auto-fit, minmax(0, 1fr)); } }
.checkout-choice { display: flex; flex-direction: column; margin-bottom: 0; }
.checkout-choice .actions { margin-top: auto; padding-top: 12px; }
.privacy-notice { display: flex; gap: 6px; align-items: flex-start; font-size: 0.9rem; margin: 14px 0; }
.guest-checkout-form .altcha-check { margin: 12px 0; }
.account-invitation { margin-top: 18px; background: var(--surface-alt); }

/* ------------------------------------------------------------------ account */

.address-cards { display: grid; gap: 14px; }
.address-card { background: var(--surface-alt); }
.address-card legend { max-width: 100%; overflow: hidden; text-overflow: ellipsis; }
.address-flags { display: flex; flex-wrap: wrap; gap: 8px 18px; margin: 12px 0 6px; }
.inline-check { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; }
.inline-check input { width: 18px; height: 18px; accent-color: var(--accent); }
.field-label { font-weight: 600; font-size: 0.92rem; }
.readonly-value { margin: 0; padding: 10px 0; overflow-wrap: anywhere; }
.danger-zone { border-color: #efc4c4; }
.danger-zone h2 { color: var(--danger); }
.delete-row { display: flex; gap: 12px; align-items: flex-end; flex-wrap: wrap; }
.delete-row .field { flex: 1 1 220px; }

/* ------------------------------------------------------------------ footer */

.site-footer { background: var(--surface); border-top: 1px solid var(--line); margin-top: 40px; }
.footer-inner { max-width: var(--max); margin: 0 auto; padding: 24px var(--gutter); color: var(--ink-soft); font-size: 0.92rem; }
.footer-inner a { margin-right: 18px; }

/* Phase 12: unread messages on the account menu */
.menu-count {
    min-width: 20px; height: 20px; padding: 0 6px; border-radius: 999px; background: var(--accent); color: var(--accent-ink);
    font-size: 0.75rem; font-weight: 800; display: inline-grid; place-items: center; font-variant-numeric: tabular-nums;
}
.account-menu-list .menu-count { margin-left: auto; }
/* Phones: the header keeps its icons (Auctions, basket, account with the unread count) within the screen width; the
   Auctions text stays for screen readers */
@media (max-width: 479px) {
    .auctions-link > span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); }
    .header-actions { gap: 2px; }
    .account-menu summary .menu-count { min-width: 18px; height: 18px; padding: 0 4px; }
}
