/* Montessori Eco Schools — School Shop
   One stylesheet for the whole customer side. Arial everywhere; emphasis by
   colour and weight. Navy ink, a little gold, warm paper background. */

:root {
    --ink: #1e3a6a;          /* brand navy */
    --ink-soft: #46597a;
    --muted: #6b7280;
    --gold: #c08a2c;
    --gold-soft: #f6ecd9;
    --paper: #faf8f4;
    --card: #ffffff;
    --line: #e7e2d8;
    --ok: #2f6b3f;
    --ok-soft: #e6f1e8;
    --err: #9b2c2c;
    --err-soft: #fbeaea;
    --radius: 10px;
    --wrap: 1120px;

    /* names the older payment pages still use */
    --primary-color: var(--ink);
    --secondary-color: #2a4c82;
    --accent-color: var(--gold);
    --info-color: #5c84ba;
    --text-dark: var(--ink);
    --text-light: var(--muted);
    --bg-light: var(--paper);
    --white: #fff;
    --font-display: Arial, Helvetica, sans-serif;
    --font-body: Arial, Helvetica, sans-serif;
}

* { box-sizing: border-box; }

html, body { overflow-x: hidden; }

body {
    margin: 0;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 16px;
    line-height: 1.55;
    color: var(--ink);
    background: var(--paper);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main { flex: 1; }

h1, h2, h3, h4, h5, h6 {
    font-family: Arial, Helvetica, sans-serif;
    color: var(--ink);
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.01em;
}

a { color: var(--ink); }
a:hover { color: var(--gold); }

img { max-width: 100%; height: auto; }

.wrap {
    width: 100%;
    max-width: var(--wrap);
    margin: 0 auto;
    padding: 0 16px;
}
@media (min-width: 768px) { .wrap { padding: 0 24px; } }

:focus-visible { outline: 3px solid var(--gold); outline-offset: 2px; }

/* ---------- Header ---------- */
.site-header {
    background: var(--card);
    border-bottom: 1px solid var(--line);
    position: sticky;
    top: 0;
    z-index: 50;
}
.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    min-height: 64px;
}
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    text-decoration: none;
    min-width: 0;
}
.brand img { width: 40px; height: 40px; object-fit: contain; flex-shrink: 0; }
.brand-text { display: flex; flex-direction: column; min-width: 0; }
.brand-name {
    font-weight: 700;
    font-size: 15px;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.brand-sub {
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--gold);
    font-weight: 700;
}
.brand:hover .brand-name { color: var(--ink); }

.main-nav { display: flex; align-items: center; gap: 4px; flex-shrink: 0; }
.main-nav a {
    text-decoration: none;
    font-weight: 700;
    font-size: 15px;
    padding: 10px 12px;
    border-radius: 999px;
    color: var(--ink);
    display: inline-flex;
    align-items: center;
    gap: 8px;
}
.main-nav a:hover { background: var(--paper); color: var(--ink); }
.main-nav a.is-active { color: var(--gold); }
.cart-link { background: var(--ink); color: #fff !important; }
.main-nav a.cart-link:hover { background: #142a4f; }
.cart-count {
    background: var(--gold);
    color: #fff;
    font-size: 12px;
    min-width: 20px;
    height: 20px;
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0 6px;
}
@media (max-width: 480px) {
    .brand-name { font-size: 13px; white-space: normal; max-width: 120px; }
    .main-nav a { padding: 10px 9px; font-size: 14px; }
    .cart-label { display: none; }
}

/* ---------- Flash messages ---------- */
.flash-stack { margin-top: 16px; display: grid; gap: 8px; }
.flash {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 15px;
    border: 1px solid transparent;
}
.flash-success { background: var(--ok-soft); color: var(--ok); border-color: #cfe3d3; }
.flash-error   { background: var(--err-soft); color: var(--err); border-color: #f1cfcf; }
.flash-info    { background: var(--card); color: var(--ink); border-color: var(--line); }
.flash-link { color: inherit; white-space: nowrap; }

/* ---------- Buttons ---------- */
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 12px 22px;
    border-radius: 999px;
    font: 700 16px/1.2 Arial, Helvetica, sans-serif;
    text-decoration: none;
    border: 2px solid var(--ink);
    background: var(--ink);
    color: #fff;
    cursor: pointer;
    transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.button:hover { background: #142a4f; border-color: #142a4f; color: #fff; }
.button-outline { background: transparent; color: var(--ink); }
.button-outline:hover { background: var(--ink); color: #fff; }
.button-block { width: 100%; }
.button:disabled, .button[aria-disabled="true"] {
    background: #d9d6cf; border-color: #d9d6cf; color: #6b6b6b; cursor: not-allowed;
}
.text-link {
    color: var(--ink-soft);
    font-weight: 700;
    font-size: 15px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.text-link:hover { color: var(--gold); }

/* ---------- Page heads ---------- */
.page { padding: 32px 0 56px; }
@media (min-width: 768px) { .page { padding: 48px 0 72px; } }
.page-head { margin-bottom: 24px; }
.page-head h1 { font-size: 28px; margin: 0 0 6px; }
@media (min-width: 768px) { .page-head h1 { font-size: 34px; } }
.page-head p { color: var(--muted); margin: 0; }
.eyebrow {
    display: block;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 8px;
}

/* ---------- Home intro ---------- */
.intro {
    background: var(--card);
    border-bottom: 1px solid var(--line);
}
.intro-inner {
    display: grid;
    gap: 24px;
    padding: 36px 16px;
    align-items: center;
}
.intro h1 { font-size: 30px; margin: 0 0 12px; }
.intro p { color: var(--ink-soft); font-size: 17px; margin: 0 0 20px; max-width: 34em; }
.intro-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.intro-points {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 12px;
}
.intro-points li {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: var(--radius);
    background: var(--paper);
    font-size: 15px;
    color: var(--ink-soft);
}
.intro-points i { color: var(--gold); margin-top: 3px; width: 18px; text-align: center; }
.intro-points strong { color: var(--ink); display: block; }
@media (min-width: 900px) {
    .intro-inner { grid-template-columns: 1.3fr 1fr; gap: 56px; padding: 56px 24px; }
    .intro h1 { font-size: 42px; }
}

/* thin gold rule, as on the school's print material */
.rule {
    display: flex;
    align-items: center;
    gap: 14px;
    color: var(--gold);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    margin: 0 0 20px;
}
.rule::before, .rule::after { content: ""; height: 1px; background: currentColor; opacity: .5; flex: 1; }

/* ---------- Category chips ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 24px; }
.chip {
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    padding: 8px 16px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: var(--card);
    color: var(--ink);
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }

/* ---------- Product grid ---------- */
.product-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}
@media (min-width: 700px)  { .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px; } }
@media (min-width: 1024px) { .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; } }

.product-card {
    display: flex;
    flex-direction: column;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    overflow: hidden;
    text-decoration: none;
    color: var(--ink);
    transition: border-color .15s ease, box-shadow .15s ease;
}
.product-card:hover {
    color: var(--ink);
    border-color: #cfc6b4;
    box-shadow: 0 6px 20px rgba(30, 58, 106, .08);
}
.product-photo {
    aspect-ratio: 4 / 5;
    background: #f1ede5;
    overflow: hidden;
}
.product-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.product-photo .no-photo {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    color: #b9b1a1; font-size: 32px;
}
.product-body { padding: 12px 12px 14px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
@media (min-width: 700px) { .product-body { padding: 14px 16px 16px; } }
.product-name { font-size: 15px; font-weight: 700; margin: 0; line-height: 1.3; }
@media (min-width: 700px) { .product-name { font-size: 16px; } }
.product-sizes { font-size: 13px; color: var(--muted); margin: 0; }
.product-price { font-size: 15px; font-weight: 700; color: var(--ink); margin-top: auto; padding-top: 6px; }
.product-price small { font-weight: 400; color: var(--muted); font-size: 13px; }

.empty-state {
    text-align: center;
    padding: 48px 16px;
    background: var(--card);
    border: 1px dashed var(--line);
    border-radius: var(--radius);
}
.empty-state i { font-size: 34px; color: var(--gold); margin-bottom: 12px; }
.empty-state h2 { font-size: 22px; margin: 0 0 8px; }
.empty-state p { color: var(--muted); margin: 0 0 20px; }

/* ---------- Product page ---------- */
.crumbs { font-size: 14px; color: var(--muted); margin-bottom: 20px; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--ink); }
.crumbs span { margin: 0 6px; }

.product-layout { display: grid; gap: 24px; }
@media (min-width: 860px) { .product-layout { grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; } }
.product-gallery {
    background: #f1ede5;
    border-radius: var(--radius);
    overflow: hidden;
    aspect-ratio: 4 / 5;
}
@media (min-width: 860px) { .product-gallery { position: sticky; top: 88px; } }
.product-gallery img { width: 100%; height: 100%; object-fit: cover; display: block; }

.product-info h1 { font-size: 28px; margin: 0 0 8px; }
@media (min-width: 768px) { .product-info h1 { font-size: 34px; } }
.price-big { font-size: 24px; font-weight: 700; margin: 0 0 20px; }
.price-big small { font-size: 15px; font-weight: 400; color: var(--muted); }

.buy-box {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 24px;
}
.field-label {
    display: flex;
    justify-content: space-between;
    font-weight: 700;
    font-size: 15px;
    margin-bottom: 10px;
}
.field-label .hint { font-weight: 400; color: var(--muted); }
.size-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
    gap: 8px;
    margin-bottom: 18px;
    border: 0;
    padding: 0;
}
.size-grid input { position: absolute; opacity: 0; pointer-events: none; }
.size-grid label {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 6px 8px;
    border: 1.5px solid var(--line);
    border-radius: 8px;
    background: var(--card);
    font-weight: 700;
    font-size: 15px;
    cursor: pointer;
    text-align: center;
    line-height: 1.15;
}
.size-grid label small { font-weight: 400; font-size: 11px; color: var(--muted); margin-top: 2px; }
.size-grid label:hover { border-color: var(--ink); }
.size-grid input:checked + label { border-color: var(--ink); background: var(--ink); color: #fff; }
.size-grid input:checked + label small { color: #d6dcea; }
.size-grid input:focus-visible + label { outline: 3px solid var(--gold); outline-offset: 2px; }

.qty-row { display: flex; gap: 10px; align-items: stretch; }
.qty {
    display: inline-flex;
    align-items: center;
    border: 1.5px solid var(--line);
    border-radius: 999px;
    background: var(--card);
    flex-shrink: 0;
}
.qty button {
    width: 42px; height: 46px;
    border: 0; background: transparent;
    font-size: 18px; font-weight: 700; color: var(--ink);
    cursor: pointer;
}
.qty input {
    width: 34px;
    border: 0;
    text-align: center;
    font: 700 16px Arial, Helvetica, sans-serif;
    color: var(--ink);
    background: transparent;
    -moz-appearance: textfield;
}
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-row .button { flex: 1; }
.size-error { color: var(--err); font-weight: 700; font-size: 14px; margin: -8px 0 12px; display: none; }
.size-error.show { display: block; }

.product-desc h2 { font-size: 16px; margin: 0 0 8px; }
.product-desc p { color: var(--ink-soft); margin: 0 0 16px; white-space: pre-line; }
.facts { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.facts li {
    display: flex; gap: 12px; align-items: flex-start;
    padding: 12px 0; border-bottom: 1px solid var(--line);
    font-size: 15px; color: var(--ink-soft);
}
.facts i { color: var(--gold); width: 18px; text-align: center; margin-top: 3px; }

/* ---------- Cart ---------- */
.cart-layout { display: grid; gap: 24px; }
@media (min-width: 900px) { .cart-layout { grid-template-columns: 1fr 340px; align-items: start; gap: 32px; } }
.cart-list {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
}
.cart-row {
    display: grid;
    grid-template-columns: 72px 1fr auto;
    gap: 14px;
    padding: 16px;
    border-bottom: 1px solid var(--line);
    align-items: center;
}
.cart-row:last-child { border-bottom: 0; }
.cart-thumb { width: 72px; aspect-ratio: 4/5; border-radius: 8px; overflow: hidden; background: #f1ede5; }
.cart-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cart-name { font-weight: 700; margin: 0 0 2px; font-size: 16px; }
.cart-name a { text-decoration: none; }
.cart-meta { color: var(--muted); font-size: 14px; margin: 0 0 8px; }
.cart-meta .warn { color: var(--err); font-weight: 700; }
.cart-controls { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.cart-controls form { margin: 0; }
.qty-sm button { width: 34px; height: 36px; font-size: 16px; }
.qty-sm .qty-value { min-width: 24px; text-align: center; font-weight: 700; }
.remove-link {
    background: none; border: 0; padding: 0;
    color: var(--muted); font-size: 14px; text-decoration: underline; cursor: pointer;
    font-family: inherit;
}
.remove-link:hover { color: var(--err); }
.cart-line-total { font-weight: 700; white-space: nowrap; align-self: start; }

.summary {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
}
@media (min-width: 900px) { .summary { position: sticky; top: 88px; } }
.summary h2 { font-size: 18px; margin: 0 0 14px; }
.summary-row { display: flex; justify-content: space-between; padding: 6px 0; color: var(--ink-soft); }
.summary-total {
    display: flex; justify-content: space-between;
    border-top: 1px solid var(--line);
    margin-top: 8px; padding-top: 14px;
    font-size: 20px; font-weight: 700;
}
.summary .button { margin-top: 18px; }
.summary-note { font-size: 14px; color: var(--muted); margin: 14px 0 0; display: flex; gap: 8px; }
.summary-note i { color: var(--gold); margin-top: 3px; }
.summary-items { list-style: none; padding: 0; margin: 0 0 8px; }
.summary-items li {
    display: flex; justify-content: space-between; gap: 12px;
    padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 15px;
}
.summary-items li span:first-child { color: var(--ink); }
.summary-items small { display: block; color: var(--muted); font-size: 13px; }

/* ---------- Forms ---------- */
.form-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
}
@media (min-width: 768px) { .form-card { padding: 28px; } }
.form-card h2 { font-size: 18px; margin: 0 0 16px; }
.form-card h2 + .form-section-gap { margin-top: 0; }
.form-section-gap { margin-top: 28px; }
.field { margin-bottom: 16px; }
.field label { display: block; font-weight: 700; font-size: 15px; margin-bottom: 6px; }
.field label .optional { font-weight: 400; color: var(--muted); }
.field input, .field textarea, .field select {
    width: 100%;
    font: 16px Arial, Helvetica, sans-serif;
    color: var(--ink);
    padding: 12px 14px;
    border: 1.5px solid var(--line);
    border-radius: 8px;
    background: #fff;
}
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus {
    outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(30,58,106,.12);
}
.field-row { display: grid; gap: 0 16px; }
@media (min-width: 600px) { .field-row { grid-template-columns: 1fr 1fr; } }
.pay-option {
    display: flex; gap: 14px; align-items: flex-start;
    border: 1.5px solid var(--ink);
    border-radius: var(--radius);
    padding: 14px 16px;
    background: #fff;
}
.pay-option i { font-size: 20px; color: var(--gold); margin-top: 2px; }
.pay-option strong { display: block; }
.pay-option span { color: var(--muted); font-size: 14px; }

/* ---------- Contact ---------- */
.contact-grid { display: grid; gap: 16px; }
@media (min-width: 700px) { .contact-grid { grid-template-columns: repeat(2, 1fr); } }
.contact-card {
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    padding: 20px;
    display: flex; gap: 14px; align-items: flex-start;
}
.contact-card i { color: var(--gold); font-size: 20px; width: 24px; text-align: center; margin-top: 2px; }
.contact-card h2 { font-size: 16px; margin: 0 0 4px; }
.contact-card p { margin: 0; color: var(--ink-soft); }
.contact-card a { font-weight: 700; word-break: break-word; }

/* ---------- Footer ---------- */
.site-footer {
    background: var(--ink);
    color: #cfd7e6;
    margin-top: 0;
    font-size: 14px;
}
.footer-inner {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 16px 32px;
    padding-top: 28px;
    padding-bottom: 20px;
}
.footer-name { color: #fff; font-weight: 700; margin: 0; font-size: 15px; }
.footer-text { margin: 2px 0 0; }
.footer-links { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 20px; }
.site-footer a { color: #fff; text-decoration: none; font-weight: 700; }
.site-footer a:hover { color: #e9c98d; }
.footer-social { display: inline-flex; gap: 14px; font-size: 17px; }
.footer-bottom {
    border-top: 1px solid rgba(255,255,255,.12);
    padding-top: 14px;
    padding-bottom: 20px;
    font-size: 13px;
    color: #9fb0cc;
}

/* ---------- Older payment pages (Bootstrap markup) ---------- */
.section { padding: 40px 0; }
.btn { font-family: Arial, Helvetica, sans-serif; font-weight: 700; border-radius: 999px; }
.btn-primary { background: var(--ink); border-color: var(--ink); }
.btn-primary:hover, .btn-primary:focus { background: #142a4f; border-color: #142a4f; }
.btn-outline-primary { color: var(--ink); border-color: var(--ink); }
.btn-outline-primary:hover { background: var(--ink); border-color: var(--ink); color: #fff; }
.card { border: 1px solid var(--line); border-radius: var(--radius); }
.text-primary { color: var(--ink) !important; }

@media print {
    .site-header, .site-footer, .button, .flash-stack { display: none !important; }
    body { background: #fff; }
}
