/* =====================================================================
   Script Store — Design System
   =====================================================================
   Built from the uploaded brand colors:
     #FDFDFD  near-white   -> page background
     #FEFEFE  white        -> surfaces/cards
     #0337A2  deep blue    -> primary brand color
     #FD7D61  coral        -> accent / calls to action
     #FCB9A9  light peach  -> soft accent, tints, hover states

   No brand font or logo file was supplied yet, so typography currently
   falls back to the operating system's UI font (fast, no external
   requests, and legible everywhere). Swap --font-body / --font-heading
   below and drop files into /assets/fonts once you upload the real
   brand font — nothing else in the CSS needs to change.
   ===================================================================== */

:root {
    /* Brand palette */
    --color-bg: #FDFDFD;
    --color-surface: #FEFEFE;
    --color-primary: #0337A2;
    --color-primary-dark: #022a7e;
    --color-primary-light: #e7ecf9;
    --color-accent: #FD7D61;
    --color-accent-dark: #e5573a;
    --color-accent-soft: #FCB9A9;

    /* Neutrals derived to stay legible against the palette above */
    --color-text: #1A2233;
    --color-text-muted: #5B6472;
    --color-border: #E5E3E0;
    --color-danger: #C0392B;
    --color-success: #1E7E34;

    /* Typography */
    --font-body: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
                 "Helvetica Neue", Arial, sans-serif;
    --font-heading: var(--font-body);

    /* Spacing scale */
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 1rem;
    --space-4: 1.5rem;
    --space-5: 2rem;
    --space-6: 3rem;
    --space-7: 4.5rem;

    /* Layout */
    --container-width: 1160px;
    --radius: 8px;
    --radius-sm: 4px;
    --shadow: 0 1px 2px rgba(26, 34, 51, 0.06), 0 1px 3px rgba(26, 34, 51, 0.08);
}

/* ---------------------------------------------------------------------
   Reset
   --------------------------------------------------------------------- */
*, *::before, *::after {
    box-sizing: border-box;
}

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

body {
    margin: 0;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.55;
    color: var(--color-text);
    background: var(--color-bg);
}

img {
    max-width: 100%;
    display: block;
}

a {
    color: var(--color-primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    line-height: 1.25;
    margin: 0 0 var(--space-3);
    font-weight: 700;
    letter-spacing: -0.01em;
}

h1 { font-size: 2.25rem; }
h2 { font-size: 1.75rem; }
h3 { font-size: 1.3rem; }

p { margin: 0 0 var(--space-3); }

ul, ol { margin: 0 0 var(--space-3); padding-left: 1.25rem; }

/* Visible keyboard focus everywhere — accessibility floor */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
}

/* ---------------------------------------------------------------------
   Layout helpers
   --------------------------------------------------------------------- */
.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--space-4);
}

/* ---------------------------------------------------------------------
   Site header
   --------------------------------------------------------------------- */
.site-header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 50;
}

.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-4);
    padding: var(--space-3) 0;
}

.site-logo {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--color-primary);
    letter-spacing: -0.02em;
}

.site-logo:hover {
    text-decoration: none;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: var(--space-4);
}

.site-nav a {
    color: var(--color-text);
    font-weight: 500;
    font-size: 0.95rem;
}

.site-nav a:hover {
    color: var(--color-primary);
    text-decoration: none;
}

.site-nav__cart {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
}

.nav-toggle {
    display: none;
    background: none;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: var(--space-1) var(--space-2);
    font-size: 1.1rem;
    cursor: pointer;
}

/* ---------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------- */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);
    border: 1px solid transparent;
    border-radius: var(--radius-sm);
    padding: 0.65rem 1.25rem;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    line-height: 1.2;
}

.btn:hover {
    text-decoration: none;
}

.btn-primary {
    background: var(--color-primary);
    color: #fff;
}

.btn-primary:hover {
    background: var(--color-primary-dark);
}

.btn-accent {
    background: var(--color-accent);
    color: #fff;
}

.btn-accent:hover {
    background: var(--color-accent-dark);
}

.btn-outline {
    background: transparent;
    border-color: var(--color-border);
    color: var(--color-text);
}

.btn-outline:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.btn-block {
    width: 100%;
}

/* ---------------------------------------------------------------------
   Cards
   --------------------------------------------------------------------- */
.card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
}

.card-body {
    padding: var(--space-4);
}

/* ---------------------------------------------------------------------
   Forms
   --------------------------------------------------------------------- */
.form-group {
    margin-bottom: var(--space-4);
}

.form-label {
    display: block;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: var(--space-2);
}

.form-control {
    width: 100%;
    padding: 0.6rem 0.8rem;
    font-size: 1rem;
    font-family: inherit;
    color: var(--color-text);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
}

.form-control:focus {
    outline: none;
    border-color: var(--color-primary);
    box-shadow: 0 0 0 3px var(--color-primary-light);
}

.form-hint {
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-top: var(--space-1);
}

/* ---------------------------------------------------------------------
   Alerts / flash messages
   --------------------------------------------------------------------- */
.alert {
    padding: var(--space-3) var(--space-4);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-4);
    font-size: 0.95rem;
    border: 1px solid transparent;
}

.alert-success {
    background: #EAF6EC;
    border-color: #BFE3C4;
    color: var(--color-success);
}

.alert-error {
    background: #FBEAE8;
    border-color: #F1C2BC;
    color: var(--color-danger);
}

.alert-info {
    background: var(--color-primary-light);
    border-color: #c9d6f2;
    color: var(--color-primary-dark);
}

/* ---------------------------------------------------------------------
   Badges
   --------------------------------------------------------------------- */
.badge {
    display: inline-block;
    padding: 0.2rem 0.6rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 600;
    background: var(--color-accent-soft);
    color: var(--color-accent-dark);
}

/* ---------------------------------------------------------------------
   Site footer
   --------------------------------------------------------------------- */
.site-footer {
    background: var(--color-primary);
    color: #d9e2f7;
    margin-top: var(--space-7);
}

.site-footer__inner {
    padding: var(--space-6) 0 var(--space-5);
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: var(--space-5);
}

.site-footer h4 {
    color: #fff;
    font-size: 1rem;
    margin-bottom: var(--space-3);
}

.site-footer a {
    color: #d9e2f7;
}

.site-footer a:hover {
    color: #fff;
}

.site-footer__bottom {
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    padding: var(--space-3) 0;
    font-size: 0.85rem;
    color: #b7c4e6;
}

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

/* ---------------------------------------------------------------------
   Site search (header)
   --------------------------------------------------------------------- */
.site-search {
    display: flex;
    flex: 1 1 320px;
    max-width: 420px;
}

.site-search input {
    flex: 1;
    padding: 0.5rem 0.8rem;
    font-size: 0.9rem;
    font-family: inherit;
    border: 1px solid var(--color-border);
    border-right: none;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.site-search input:focus {
    outline: none;
    border-color: var(--color-primary);
}

.site-search button {
    padding: 0.5rem 0.9rem;
    font-size: 0.9rem;
    font-weight: 600;
    color: #fff;
    background: var(--color-primary);
    border: 1px solid var(--color-primary);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    cursor: pointer;
}

.site-search button:hover {
    background: var(--color-primary-dark);
}

/* ---------------------------------------------------------------------
   Sections (generic content blocks between hero and footer)
   --------------------------------------------------------------------- */
.section {
    margin: var(--space-6) 0;
}

.section__header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.section__header h2 {
    margin: 0;
}

.section__link {
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
}

/* ---------------------------------------------------------------------
   Hero (homepage)
   --------------------------------------------------------------------- */
.hero {
    background: var(--color-primary);
    color: #fff;
    border-radius: var(--radius);
    padding: var(--space-7) var(--space-5);
    margin-top: var(--space-4);
    text-align: center;
}

.hero__content {
    max-width: 640px;
    margin: 0 auto;
}

.hero__content h1 {
    color: #fff;
    font-size: 2.5rem;
}

.hero__subtitle {
    color: #d9e2f7;
    font-size: 1.1rem;
    margin-bottom: var(--space-5);
}

.hero__search {
    display: flex;
    max-width: 480px;
    margin: 0 auto var(--space-4);
}

.hero__search input {
    flex: 1;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    font-family: inherit;
    border: none;
    border-radius: var(--radius-sm) 0 0 var(--radius-sm);
}

.hero__search input:focus {
    outline: 2px solid var(--color-accent-soft);
    outline-offset: -2px;
}

.hero__search .btn {
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.hero__ctas {
    display: flex;
    justify-content: center;
    gap: var(--space-3);
    flex-wrap: wrap;
}

.hero .btn-outline {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.5);
    color: #fff;
}

.hero .btn-outline:hover {
    border-color: #fff;
    color: #fff;
}

/* ---------------------------------------------------------------------
   Product grid & card
   --------------------------------------------------------------------- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: var(--space-4);
}

.product-card {
    display: flex;
    flex-direction: column;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
}

.product-card__media {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--color-primary-light);

    /*
     * .product-card is `display: flex; flex-direction: column`, which
     * makes this element a flex item — and flex items get an automatic
     * content-based minimum size by default. Without overriding it, a
     * tall (portrait) image's own intrinsic height wins over the
     * aspect-ratio above once it's asked to lay out, so the card grows
     * to fit the image instead of the image being cropped to the card.
     * min-height: 0 removes that automatic minimum so aspect-ratio (and
     * the img's object-fit: cover below) actually governs the box.
     */
    min-height: 0;
}

.product-card__media img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.product-card__badge {
    position: absolute;
    top: var(--space-2);
    left: var(--space-2);
}

.product-card__body {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: var(--space-3) var(--space-4) var(--space-4);
}

.product-card__category {
    font-size: 0.78rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--color-text-muted);
    margin-bottom: var(--space-1);
}

.product-card__category:hover {
    color: var(--color-primary);
}

.product-card__title {
    font-size: 1.05rem;
    margin-bottom: var(--space-2);
}

.product-card__title a {
    color: var(--color-text);
}

.product-card__title a:hover {
    color: var(--color-primary);
    text-decoration: none;
}

.product-card__desc {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: var(--space-3);
    flex: 1;
}

.product-card__meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--space-3);
}

.product-card__price {
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--color-primary);
}

.product-card__version {
    font-size: 0.8rem;
    color: var(--color-text-muted);
}

.product-card__actions {
    display: flex;
    gap: var(--space-2);
}

.product-card__actions .btn {
    flex: 1;
    padding: 0.55rem 0.75rem;
    font-size: 0.85rem;
}

.product-card__actions form {
    flex: 1;
}

.product-card__actions .btn[disabled] {
    opacity: 0.55;
    cursor: not-allowed;
}

/* ---------------------------------------------------------------------
   Category grid & card
   --------------------------------------------------------------------- */
.category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: var(--space-4);
}

.category-card {
    display: block;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: var(--space-4);
    color: var(--color-text);
}

.category-card:hover {
    border-color: var(--color-primary);
    text-decoration: none;
}

.category-card h3 {
    margin-bottom: var(--space-2);
    color: var(--color-primary);
}

.category-card p {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: var(--space-3);
}

.category-card__count {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--color-text-muted);
}

/* ---------------------------------------------------------------------
   Trust section
   --------------------------------------------------------------------- */
.trust-section {
    text-align: center;
}

.trust-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-4);
    margin-top: var(--space-4);
    text-align: left;
}

.trust-item {
    padding: var(--space-4);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
}

.trust-item h3 {
    font-size: 1.05rem;
}

.trust-item p {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: 0;
}

/* ---------------------------------------------------------------------
   CTA section
   --------------------------------------------------------------------- */
.cta-section {
    text-align: center;
    background: var(--color-accent-soft);
    border-radius: var(--radius);
    padding: var(--space-6) var(--space-4);
}

.cta-section p {
    color: var(--color-text);
    margin-bottom: var(--space-4);
}

/* ---------------------------------------------------------------------
   Empty state
   --------------------------------------------------------------------- */
.empty-state {
    text-align: center;
    padding: var(--space-6) var(--space-4);
    border: 1px dashed var(--color-border);
    border-radius: var(--radius);
    color: var(--color-text-muted);
}

.empty-state h2 {
    color: var(--color-text);
    font-size: 1.2rem;
}

.empty-state--page {
    border: none;
    padding: var(--space-7) var(--space-4);
}

/* ---------------------------------------------------------------------
   Listing pages (products.php / category.php)
   --------------------------------------------------------------------- */
.listing-header {
    margin: var(--space-4) 0 var(--space-5);
}

.listing-header h1 {
    margin-bottom: var(--space-2);
}

.listing-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: var(--space-5);
    align-items: start;
}

.listing-filters h2 {
    font-size: 1rem;
    margin-bottom: var(--space-3);
}

.filter-list {
    list-style: none;
    padding: 0;
    margin: 0;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
}

.filter-list li + li {
    border-top: 1px solid var(--color-border);
}

.filter-list a {
    display: flex;
    justify-content: space-between;
    padding: var(--space-2) var(--space-3);
    font-size: 0.9rem;
    color: var(--color-text);
}

.filter-list a:hover {
    background: var(--color-primary-light);
    text-decoration: none;
}

.filter-list a.is-active {
    background: var(--color-primary-light);
    color: var(--color-primary);
    font-weight: 600;
}

.filter-list a span {
    color: var(--color-text-muted);
    font-weight: 400;
}

.listing-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
    flex-wrap: wrap;
}

.listing-toolbar__count {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

.listing-toolbar__sort {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    font-size: 0.9rem;
}

.listing-toolbar__sort select {
    padding: 0.4rem 0.6rem;
    font-family: inherit;
    font-size: 0.9rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    background: var(--color-surface);
}

/* ---------------------------------------------------------------------
   Pagination
   --------------------------------------------------------------------- */
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    margin-top: var(--space-5);
}

.pagination__link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.25rem;
    height: 2.25rem;
    padding: 0 0.6rem;
    font-size: 0.85rem;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    color: var(--color-text);
}

.pagination__link:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
    text-decoration: none;
}

.pagination__link.is-current {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: #fff;
}

/* ---------------------------------------------------------------------
   Breadcrumbs
   --------------------------------------------------------------------- */
.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-2);
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin: var(--space-4) 0;
}

.breadcrumbs a {
    color: var(--color-text-muted);
}

.breadcrumbs a:hover {
    color: var(--color-primary);
}

/* ---------------------------------------------------------------------
   Product detail page
   --------------------------------------------------------------------- */
.product-detail {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr);
    gap: var(--space-6);
    margin-bottom: var(--space-6);
}

.product-detail__main-image {
    aspect-ratio: 16 / 10;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--color-primary-light);
}

.product-detail__main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-detail__thumbs {
    display: flex;
    gap: var(--space-2);
    margin-top: var(--space-3);
    flex-wrap: wrap;
}

.product-detail__thumb {
    width: 72px;
    height: 54px;
    padding: 0;
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    overflow: hidden;
    cursor: pointer;
    background: none;
}

.product-detail__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-detail__thumb.is-active {
    border-color: var(--color-primary);
}

.product-detail__info h1 {
    margin-top: var(--space-2);
}

.product-detail__subtitle {
    color: var(--color-text-muted);
    font-size: 1.05rem;
}

.product-detail__meta {
    display: flex;
    align-items: center;
    gap: var(--space-3);
    margin-bottom: var(--space-4);
}

.product-detail__price {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--color-primary);
}

.product-detail__actions {
    display: flex;
    gap: var(--space-3);
    margin-bottom: var(--space-2);
    flex-wrap: wrap;
}

.product-detail__actions .btn {
    flex: 1;
    min-width: 160px;
}

.product-detail__facts {
    margin: var(--space-5) 0 0;
    border-top: 1px solid var(--color-border);
    padding-top: var(--space-4);
}

.product-detail__facts div {
    display: flex;
    justify-content: space-between;
    padding: var(--space-2) 0;
    font-size: 0.9rem;
    border-bottom: 1px solid var(--color-border);
}

.product-detail__facts div:last-child {
    border-bottom: none;
}

.product-detail__facts dt {
    color: var(--color-text-muted);
}

.product-detail__facts dd {
    margin: 0;
    font-weight: 600;
}

.product-detail__sections .section {
    margin: var(--space-5) 0;
    padding-bottom: var(--space-5);
    border-bottom: 1px solid var(--color-border);
}

.product-detail__sections .section:last-child {
    border-bottom: none;
}

.check-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--space-2) var(--space-4);
}

.check-list li {
    position: relative;
    padding-left: 1.4rem;
    font-size: 0.95rem;
}

.check-list li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0.5em;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--color-accent);
}

/* ---------------------------------------------------------------------
   Auth pages (login / register)
   --------------------------------------------------------------------- */
.auth-page {
    display: flex;
    justify-content: center;
    padding: var(--space-5) 0 var(--space-7);
}

.auth-card {
    width: 100%;
    max-width: 420px;
}

.password-field {
    position: relative;
    display: flex;
}

.password-field .form-control {
    padding-right: 4rem;
}

.password-toggle {
    position: absolute;
    top: 0;
    right: 0;
    height: 100%;
    padding: 0 var(--space-3);
    background: none;
    border: none;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--color-primary);
    cursor: pointer;
}

.password-toggle:hover {
    text-decoration: underline;
}

/* ---------------------------------------------------------------------
   Account dashboard (account.php / account-settings.php)
   --------------------------------------------------------------------- */
.account-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: var(--space-5);
    align-items: start;
    margin: var(--space-4) 0 var(--space-6);
}

.account-nav {
    display: flex;
    flex-direction: column;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    overflow: hidden;
}

.account-nav a {
    padding: var(--space-3) var(--space-4);
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--color-text);
    border-bottom: 1px solid var(--color-border);
}

.account-nav a:last-child {
    border-bottom: none;
}

.account-nav a:hover {
    background: var(--color-primary-light);
    text-decoration: none;
}

.account-nav a.is-active {
    background: var(--color-primary-light);
    color: var(--color-primary);
    font-weight: 600;
}

.account-main {
    min-width: 0;
}

.account-card {
    margin-bottom: var(--space-5);
}

.account-card h1,
.account-card h2 {
    margin-bottom: var(--space-4);
}

.account-card .product-detail__facts {
    margin-top: 0;
    border-top: none;
    padding-top: 0;
    margin-bottom: var(--space-4);
}

.order-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.order-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-3);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: var(--space-3) var(--space-4);
}

.order-row--link {
    color: inherit;
}

.order-row--link:hover {
    text-decoration: none;
    border-color: var(--color-primary);
    background: var(--color-primary-light);
}

.order-items {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.order-line-item {
    display: grid;
    grid-template-columns: 1fr auto auto;
    align-items: center;
    gap: var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: var(--space-3);
}

.order-line-item__price {
    color: var(--color-text-muted);
}

.purchase-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.purchase-row {
    display: grid;
    grid-template-columns: 64px 1fr auto;
    align-items: center;
    gap: var(--space-3);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: var(--space-3);
}

.purchase-row__image {
    width: 64px;
    height: 64px;
    object-fit: cover;
    border-radius: var(--radius-sm);
    background: var(--color-bg);
}

.purchase-row__body {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.order-row__meta {
    display: flex;
    align-items: center;
    gap: var(--space-3);
}

.order-row__total {
    font-weight: 700;
    color: var(--color-primary);
}

.order-status--pending {
    background: var(--color-accent-soft);
    color: var(--color-accent-dark);
}

.order-status--paid {
    background: #EAF6EC;
    color: var(--color-success);
}

.order-status--failed,
.order-status--refunded {
    background: #FBEAE8;
    color: var(--color-danger);
}

.order-status--active {
    background: #EAF6EC;
    color: var(--color-success);
}

.order-status--cancelled {
    background: var(--color-border);
    color: var(--color-text-muted);
}

/* ---------------------------------------------------------------------
   Cart page
   --------------------------------------------------------------------- */
.cart-page {
    margin: var(--space-4) 0 var(--space-7);
}

.cart-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: var(--space-5);
    align-items: start;
    margin-top: var(--space-4);
}

.cart-items {
    display: flex;
    flex-direction: column;
    gap: var(--space-3);
}

.cart-item {
    display: grid;
    grid-template-columns: 90px 1fr auto auto;
    align-items: center;
    gap: var(--space-4);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: var(--space-3);
}

.cart-item__media {
    display: block;
    width: 90px;
    aspect-ratio: 16 / 10;
    border-radius: var(--radius-sm);
    overflow: hidden;
    background: var(--color-primary-light);
}

.cart-item__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item__title {
    font-size: 1rem;
    margin: var(--space-1) 0;
}

.cart-item__title a {
    color: var(--color-text);
}

.cart-item__qty {
    font-size: 0.85rem;
    color: var(--color-text-muted);
}

.cart-item__price {
    font-weight: 700;
    color: var(--color-primary);
    white-space: nowrap;
}

.cart-summary {
    position: sticky;
    top: calc(var(--space-4) + 64px);
}

.cart-summary h2 {
    margin-bottom: var(--space-3);
}

.cart-summary__row {
    display: flex;
    justify-content: space-between;
    padding: var(--space-2) 0;
    font-size: 0.95rem;
}

.cart-summary__row--total {
    border-top: 1px solid var(--color-border);
    margin-bottom: var(--space-4);
    padding-top: var(--space-3);
    font-size: 1.15rem;
    font-weight: 700;
}

.cart-summary .btn {
    margin-bottom: var(--space-2);
}

/* ---------------------------------------------------------------------
   Checkout page
   --------------------------------------------------------------------- */
.checkout-page {
    margin: var(--space-4) 0 var(--space-7);
}

.checkout-layout {
    max-width: 640px;
}

.checkout-card {
    margin-bottom: var(--space-4);
}

.checkout-card h2 {
    margin-bottom: var(--space-3);
}

.checkout-line {
    display: flex;
    justify-content: space-between;
    padding: var(--space-2) 0;
    font-size: 0.95rem;
    border-bottom: 1px solid var(--color-border);
}

.checkout-line--total {
    border-bottom: none;
    border-top: 1px solid var(--color-border);
    margin-top: var(--space-2);
    padding-top: var(--space-3);
    font-size: 1.15rem;
    font-weight: 700;
}

.payment-method-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
    margin-bottom: var(--space-4);
}

.payment-method-option {
    display: flex;
    align-items: flex-start;
    gap: var(--space-3);
    padding: var(--space-3);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.payment-method-option:has(input:checked) {
    border-color: var(--color-primary);
    background: var(--color-primary-light);
}

.payment-method-option input {
    margin-top: 0.3rem;
}

.payment-method-option strong {
    display: block;
    font-size: 0.95rem;
}

.payment-method-option small {
    display: block;
    color: var(--color-text-muted);
    font-size: 0.85rem;
}

.checkout-result h2 {
    margin: var(--space-2) 0 var(--space-3);
}

.checkout-result .btn {
    margin-top: var(--space-3);
}

/* ---------------------------------------------------------------------
   Payment status / crypto instructions (order-payment.php)
   --------------------------------------------------------------------- */
.payment-page {
    max-width: 640px;
    margin: var(--space-4) auto var(--space-7);
}

.payment-status-card .badge {
    margin-bottom: var(--space-3);
}

.payment-status-card form {
    margin-top: var(--space-3);
}

.crypto-instructions {
    background: var(--color-bg);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: var(--space-4);
    margin: var(--space-4) 0;
}

.crypto-instructions__row {
    display: flex;
    justify-content: space-between;
    padding: var(--space-2) 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 0.95rem;
}

.crypto-instructions__row:last-of-type {
    border-bottom: none;
}

.crypto-instructions__wallet {
    margin-top: var(--space-3);
}

.crypto-instructions__wallet > span {
    display: block;
    font-size: 0.85rem;
    color: var(--color-text-muted);
    margin-bottom: var(--space-1);
}

.crypto-instructions__wallet-row {
    display: flex;
    align-items: center;
    gap: var(--space-2);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-sm);
    padding: var(--space-2) var(--space-3);
}

.crypto-instructions__wallet-row code {
    flex: 1;
    overflow-wrap: anywhere;
    font-size: 0.9rem;
}

.crypto-tx-form {
    margin-top: var(--space-4);
    padding-top: var(--space-4);
    border-top: 1px solid var(--color-border);
}

/* ---------------------------------------------------------------------
   Responsive
   --------------------------------------------------------------------- */
@media (max-width: 860px) {
    .site-footer__inner {
        grid-template-columns: 1fr 1fr;
    }

    .listing-layout {
        grid-template-columns: 1fr;
    }

    .listing-filters {
        border-bottom: 1px solid var(--color-border);
        padding-bottom: var(--space-4);
    }

    .account-layout {
        grid-template-columns: 1fr;
    }

    .account-nav {
        flex-direction: row;
        flex-wrap: wrap;
    }

    .account-nav a {
        border-bottom: none;
        border-right: 1px solid var(--color-border);
    }

    .account-nav a:last-child {
        border-right: none;
    }

    .cart-layout {
        grid-template-columns: 1fr;
    }

    .cart-item {
        grid-template-columns: 70px 1fr;
        grid-template-areas:
            "media body"
            "media price"
            "remove remove";
    }

    .cart-item__media { grid-area: media; width: 70px; }
    .cart-item__body { grid-area: body; }
    .cart-item__price { grid-area: price; }
    .cart-item__remove { grid-area: remove; }

    .cart-summary {
        position: static;
    }

    .purchase-row {
        grid-template-columns: 56px 1fr;
        grid-template-areas:
            "image body"
            "action action";
    }

    .purchase-row__image { grid-area: image; width: 56px; height: 56px; }
    .purchase-row__body { grid-area: body; }
    .purchase-row form,
    .purchase-row .form-hint:last-child { grid-area: action; }

    .order-line-item {
        grid-template-columns: 1fr;
        gap: var(--space-2);
    }

    .order-row {
        flex-wrap: wrap;
    }

    .order-row__meta {
        flex-wrap: wrap;
    }

    .product-detail {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }

    .hero {
        padding: var(--space-6) var(--space-4);
    }

    .hero__content h1 {
        font-size: 2rem;
    }
}

@media (max-width: 640px) {
    h1 { font-size: 1.75rem; }
    h2 { font-size: 1.4rem; }

    .nav-toggle {
        display: inline-flex;
    }

    .site-header__inner {
        flex-wrap: wrap;
    }

    .site-search {
        order: 3;
        flex-basis: 100%;
        max-width: none;
    }

    .product-detail__actions .btn {
        min-width: 0;
    }

    .check-list {
        grid-template-columns: 1fr;
    }

    .site-nav {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--color-surface);
        border-bottom: 1px solid var(--color-border);
        flex-direction: column;
        align-items: flex-start;
        gap: 0;
        padding: var(--space-2) var(--space-4);
        display: none;
    }

    .site-nav.is-open {
        display: flex;
    }

    .site-nav a {
        padding: var(--space-2) 0;
        width: 100%;
    }

    .site-footer__inner {
        grid-template-columns: 1fr;
        gap: var(--space-4);
    }
}
