/* Self-hosted fonts (SIL Open Font License; see assets/fonts/OFL-*.txt). Latin subset, woff2. */
@font-face { font-family: 'Cinzel'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/cinzel-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Cinzel'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/cinzel-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/montserrat-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 500; font-display: swap; src: url('fonts/montserrat-latin-500-normal.woff2') format('woff2'); }
@font-face { font-family: 'Montserrat'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/montserrat-latin-600-normal.woff2') format('woff2'); }
@font-face { font-family: 'Source Serif 4'; font-style: normal; font-weight: 400; font-display: swap; src: url('fonts/source-serif-4-latin-400-normal.woff2') format('woff2'); }
@font-face { font-family: 'Source Serif 4'; font-style: italic; font-weight: 400; font-display: swap; src: url('fonts/source-serif-4-latin-400-italic.woff2') format('woff2'); }
@font-face { font-family: 'Source Serif 4'; font-style: normal; font-weight: 600; font-display: swap; src: url('fonts/source-serif-4-latin-600-normal.woff2') format('woff2'); }
/* Echoes of Hidden Hands - palette from the logo: teal #2E5E58, cream #F4EDE1, gold #D9B77A, brick #8E3B2F,
   brown #2B211C. Old variable names are kept: --teal = teal, --terracotta = gold. */
:root {
    --teal: #2E5E58; --teal-d: #234a45; --brown: #2B211C; --terracotta: #D9B77A; --terracotta-d: #7a5a1f;
    --cream: #F4EDE1; --ink: #2B211C; --muted: #5E4F44;
    --line: #e3d9c6; --card: #ffffff; --bg: var(--cream);
    --ok: #1f7a4d; --ok-bg: #e3f3e9; --warn: #a15c1f; --warn-bg: #fbeee0;
    --err: #b3402c; --err-bg: #fbe6e1; --radius: 10px;
    --display: Cinzel, 'EB Garamond', Georgia, 'Times New Roman', serif;
    --serif: 'Source Serif 4', 'Source Serif Pro', Georgia, 'Times New Roman', serif;
    --sans: Montserrat, Lato, 'Segoe UI', Arial, sans-serif;
}
* { box-sizing: border-box; }
body { margin: 0; font-family: var(--serif); line-height: 1.6; color: var(--ink); background: var(--bg); }
button, input, select, textarea, .topbar, .btn, .cat-pill, .cart-badge, .tagline, .status-pill, .tag { font-family: var(--sans); }
.tagline { text-transform: uppercase; letter-spacing: .15em; font-size: .72rem; font-weight: 500; color: var(--terracotta); }
a { color: var(--teal); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; text-transform: uppercase; letter-spacing: .08em; line-height: 1.25; margin: 0 0 .5rem; }
.accent { font-style: italic; color: var(--terracotta); }

/* ---- Topbar / nav ---- */
.topbar { background: var(--brown); color: #fff; }
.topbar-inner {
    max-width: 1180px; margin: 0 auto; padding: .75rem 1.25rem; display: flex;
    align-items: center; gap: 1.5rem; flex-wrap: wrap; row-gap: .5rem;
}
.topbar .brand-logo { height: 72px; width: auto; display: block; }
.topbar nav { display: flex; gap: 1.1rem; flex-wrap: wrap; }
.topbar nav a { color: var(--cream); text-transform: uppercase; letter-spacing: .12em; font-size: .78rem; font-size: .92rem; }
.topbar nav a:hover, .topbar nav a.on { color: #fff; text-decoration: none; border-bottom: 2px solid var(--terracotta); }
.topbar .spacer { flex: 1; }
.topbar .actions { display: flex; align-items: center; gap: 1rem; font-size: .9rem; }
.topbar .actions a { color: #fff; }
.cart-badge {
    display: inline-flex; align-items: center; gap: .35rem; background: var(--terracotta);
    color: var(--ink); padding: .35rem .7rem; border-radius: 999px; font-weight: 600; font-size: .85rem;
}
.category-strip { background: #fff; border-bottom: 1px solid var(--line); }
.category-strip-inner {
    max-width: 1180px; margin: 0 auto; padding: .6rem 1.25rem; display: flex;
    gap: .5rem; flex-wrap: wrap; align-items: center;
}
.cat-pill {
    display: inline-block; padding: .3rem .8rem; border-radius: 999px; background: var(--cream);
    color: var(--teal-d); font-size: .82rem; border: 1px solid var(--line);
}
.cat-pill:hover, .cat-pill.on { background: var(--teal); color: #fff; text-decoration: none; border-color: var(--teal); }

/* ---- Layout ---- */
.container { max-width: 1180px; margin: 1.75rem auto; padding: 0 1.25rem; }
.container-narrow { max-width: 640px; margin: 2.5rem auto; padding: 0 1.25rem; }
.foot { background: var(--brown); color: var(--cream); padding: 2.5rem 1.25rem 1.5rem; margin-top: 3rem; }
.foot-inner { max-width: 1180px; margin: 0 auto; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1.5rem; }
.foot .brand-logo { height: 110px; width: auto; margin-bottom: .75rem; }
.foot a { color: var(--cream); }
.foot small { display: block; margin-top: 1.5rem; color: #cfc6b0; }

/* ---- Hero ---- */
.hero {
    background: linear-gradient(135deg, var(--teal) 0%, var(--teal-d) 100%);
    color: #fff; border-radius: var(--radius); padding: 3rem 2.5rem; margin-bottom: 2.5rem;
    display: flex; align-items: center; justify-content: space-between; gap: 2rem; flex-wrap: wrap;
}
.hero h1 { color: #fff; font-size: 2.1rem; margin-bottom: .5rem; }
.hero p { color: var(--cream); max-width: 42ch; margin: 0 0 1.25rem; }

/* ---- Product grid / cards ---- */
.section-title { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 1rem; }
.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 1.25rem; }
.product-card {
    background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    overflow: hidden; display: flex; flex-direction: column; transition: box-shadow .15s;
}
.product-card:hover { box-shadow: 0 6px 20px rgba(26,26,26,.08); }
.product-card .thumb { width: 100%; aspect-ratio: 1/1; object-fit: contain; background: var(--cream); display: block; }
.product-card .body { padding: .9rem 1rem 1.1rem; display: flex; flex-direction: column; gap: .3rem; flex: 1; }
.product-card .cat { font-size: .7rem; text-transform: uppercase; letter-spacing: .04em; color: var(--terracotta-d); font-weight: 700; }
.product-card .title { font-weight: 600; font-size: .98rem; color: var(--ink); }
.product-card .price { margin-top: auto; font-size: 1.15rem; font-weight: 700; color: var(--teal-d); }
.empty-state { text-align: center; color: var(--muted); padding: 3rem 1rem; }

/* ---- Product detail ---- */
.product-detail { display: grid; grid-template-columns: 1fr 1fr; gap: 2.5rem; }
@media (max-width: 760px) { .product-detail { grid-template-columns: 1fr; } }
.product-detail .cat-tag {
    display: inline-block; background: var(--terracotta); color: var(--ink); font-size: .72rem;
    text-transform: uppercase; letter-spacing: .04em; padding: .2rem .6rem; border-radius: 999px; margin-bottom: .6rem;
}
.product-detail .price { font-size: 1.9rem; font-weight: 700; color: var(--teal-d); margin: .75rem 0 1.25rem; }
.product-detail .desc { white-space: pre-wrap; line-height: 1.6; color: #3a352f; }
.sold-banner { background: var(--warn-bg); color: var(--warn); padding: .75rem 1rem; border-radius: 8px; margin-bottom: 1rem; font-weight: 600; }

/* ---- Buttons ---- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .4rem;
    background: var(--teal); color: var(--cream); border: none; padding: .65rem 1.3rem;
    border-radius: 8px; cursor: pointer; font-size: .95rem; font-weight: 600;
}
.btn:hover { background: var(--teal-d); text-decoration: none; color: var(--cream); }
.btn:focus-visible { outline: 2px solid var(--terracotta); outline-offset: 2px; }
.btn-lg { padding: .85rem 1.8rem; font-size: 1.05rem; width: 100%; }
.btn-sm { padding: .35rem .75rem; font-size: .82rem; }
.btn-teal { background: var(--teal); }
.btn-teal:hover { background: var(--teal-d); }
.btn-ghost { background: #fff; color: var(--ink); border: 1px solid var(--line); }
.btn-ghost:hover { background: var(--cream); color: var(--ink); }
.btn-danger { background: var(--err); }
.btn-danger:hover { background: #8f2f1f; }
.btn:disabled { background: var(--line); color: var(--muted); cursor: not-allowed; }
.btn-row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }

/* ---- Cards / forms ---- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.5rem; margin-bottom: 1.5rem; }
form .field { margin-bottom: 1rem; }
label { display: block; font-size: .85rem; color: var(--muted); margin-bottom: .3rem; }
input[type=text], input[type=password], input[type=email], input[type=number], input[type=date], select, textarea {
    width: 100%; padding: .6rem .7rem; border: 1px solid var(--line); border-radius: 7px; font-size: .95rem; font-family: inherit;
}
textarea { min-height: 90px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
@media (max-width: 560px) { .row2 { grid-template-columns: 1fr; } }

.flash { padding: .75rem 1rem; border-radius: 8px; margin-bottom: 1.25rem; }
.flash-success { background: var(--ok-bg); color: var(--ok); }
.flash-error { background: var(--err-bg); color: var(--err); }
.flash-info { background: var(--warn-bg); color: var(--warn); }

/* ---- Cart / checkout / orders tables ---- */
table { width: 100%; border-collapse: collapse; background: var(--card); border-radius: var(--radius); overflow: hidden; }
th, td { text-align: left; padding: .7rem .8rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { background: var(--cream); font-size: .75rem; text-transform: uppercase; letter-spacing: .03em; color: var(--muted); }
tr:last-child td { border-bottom: none; }
.line-thumb { width: 56px; height: 56px; object-fit: contain; background: var(--cream); border-radius: 6px; border: 1px solid var(--line); }
.cart-total-row td { font-weight: 700; font-size: 1.1rem; }
.status-pill { display: inline-block; padding: .15rem .55rem; border-radius: 999px; font-size: .72rem; font-weight: 700; text-transform: uppercase; }
.status-paid { background: var(--ok-bg); color: var(--ok); }
.status-pending { background: var(--warn-bg); color: var(--warn); }
.status-payment_failed, .status-cancelled { background: var(--err-bg); color: var(--err); }
.status-available { background: var(--ok-bg); color: var(--ok); }
.status-sold { background: var(--line); color: var(--muted); }

/* ---- Gallery (product.php) ---- */
.gallery-viewer { position: relative; width: 100%; aspect-ratio: 1/1; background: var(--cream); border-radius: var(--radius); overflow: hidden; }
.gallery-track { display: flex; width: 100%; height: 100%; overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; scroll-behavior: smooth; -webkit-overflow-scrolling: touch; }
.gallery-frame { flex: 0 0 100%; width: 100%; height: 100%; object-fit: contain; scroll-snap-align: center; scroll-snap-stop: always; }
.gallery-nav { position: absolute; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border-radius: 50%; border: none; background: rgba(26,26,26,.55); color: #fff; font-size: 1rem; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.gallery-nav:hover { background: rgba(26,26,26,.8); }
.gallery-nav.prev { left: 10px; } .gallery-nav.next { right: 10px; }
.gallery-dots { display: flex; gap: .35rem; justify-content: center; margin-top: .6rem; }
.gallery-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--line); border: none; cursor: pointer; padding: 0; }
.gallery-dot.active { background: var(--terracotta); }
.item-video { width: 100%; border-radius: var(--radius); background: #000; display: block; margin-top: 1rem; }

.login-wrap { max-width: 380px; margin: 4rem auto; text-align: center; }
.muted { color: var(--muted); }
.pagination { display: flex; gap: .5rem; margin-top: 1.25rem; align-items: center; }

/* Preview deployments (system-release skill): loud, unmissable, never shown in production. */
.preview-banner { background: var(--warn-bg); color: var(--warn); border-bottom: 2px solid var(--warn); padding: .5rem 1.25rem; font-size: .9rem; text-align: center; }
.table-wrap { overflow-x: auto; }
.tag { display: inline-block; background: #eef2ff; color: var(--brand-d, #334); font-size: .72rem; padding: .1rem .45rem; border-radius: 4px; }
.badge-yes { color: var(--ok); font-weight: 600; }
.badge-no { color: var(--muted); }

.stats { display: flex; flex-wrap: wrap; gap: .75rem; margin: 1rem 0; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: .75rem 1rem; min-width: 8rem; }
.stat .n { font-size: 1.5rem; font-weight: 700; }
.stat .l { font-size: .8rem; color: var(--muted); }

/* Brass is too dim for small caps on forest green; use a lighter brass there. */
.hero .tagline, .foot .tagline { color: #D9B77A; font-size: .8rem; }
.hero .tagline { font-family: var(--display); font-size: 1.5rem; font-weight: 600; letter-spacing: .3em; margin-bottom: .9rem !important; }

/* Responsive 16:9 YouTube viewer (privacy-enhanced embed). */
.yt-embed { position: relative; width: 100%; aspect-ratio: 16 / 9; margin-top: 1rem; border-radius: 10px; overflow: hidden; background: #000; }
.yt-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }

/* ---- Phones: compact like Amazon/eBay (2-up grid, one scrolling category row) ---- */
@media (max-width: 760px) {
    .topbar-inner { padding: .4rem .75rem; gap: .5rem 1rem; }
    .topbar .brand-logo { height: 56px; }
    .topbar .actions { font-size: .85rem; }
    .category-strip-inner { flex-wrap: nowrap; overflow-x: auto; padding: .4rem .75rem; gap: .4rem; scrollbar-width: none; -webkit-overflow-scrolling: touch; }
    .category-strip-inner::-webkit-scrollbar { display: none; }
    .cat-pill { flex: 0 0 auto; white-space: nowrap; padding: .25rem .7rem; font-size: .8rem; }
    .container { margin: 1rem auto; padding: 0 .75rem; }
    .hero { padding: 1.5rem 1.25rem; margin-bottom: 1.25rem; }
    .hero h1 { font-size: 1.4rem; }
    .section-title h1, .section-title h2 { font-size: 1.1rem; }
    .product-grid { grid-template-columns: repeat(2, 1fr); gap: .6rem; }
    .product-card .thumb { aspect-ratio: 1/1; }
    .product-card .body { padding: .5rem .6rem .7rem; gap: .15rem; }
    .product-card .title { font-size: .85rem; line-height: 1.3; }
    .product-card .price { font-size: 1rem; }
    .product-card .cat { font-size: .62rem; }
    .gallery-viewer { aspect-ratio: 4/3; }
}
/* Product detail image: keep it modest on every screen, not full-bleed */
.gallery-viewer { max-height: 340px; aspect-ratio: auto; height: 340px; }
@media (min-width: 761px) { .gallery-viewer { max-height: 460px; height: 460px; } }
@media (max-width: 760px) { .gallery-viewer { aspect-ratio: auto; height: 280px; max-height: 280px; } }
