/* Russell's Hustles — shop, product, cart, checkout and order styles.
   Loaded on top of site.css; consumes its tokens only. Product cards, the
   buy panel, tables and order panels are white or cream sheets on the dark
   ground; aqua marks the action. */

.collection-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0 32px; padding: 0; list-style: none; }
.collection-tabs a {
	display: inline-block; padding: 9px 16px; border: 1px solid var(--line-strong); border-radius: 999px;
	background: transparent; color: var(--fg); text-decoration: none; font-weight: 700; font-size: .9rem;
	text-transform: uppercase; letter-spacing: .04em;
	transition: background-color .15s ease, color .15s ease, border-color .15s ease;
}
.collection-tabs a:hover { border-color: var(--aqua); color: var(--aqua); }
.collection-tabs a[aria-current="page"] { background: var(--aqua); color: var(--black); border-color: var(--aqua); }

.product-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 22px; }

.product-card {
	--fg: var(--ink); --fg-2: var(--ink-soft); --fg-strong: var(--ink); --link: var(--aqua-ink); --link-hover: var(--ocean);
	background: var(--white); border: 1px solid var(--line-light); border-radius: var(--r);
	overflow: hidden; display: flex; flex-direction: column; color: var(--fg);
	transition: transform .2s var(--ease-out), box-shadow .2s ease, border-color .2s ease;
}
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); border-color: var(--aqua); }
.product-card a.product-link { text-decoration: none; color: inherit; display: block; }
.product-media { position: relative; background: var(--ocean-deep); aspect-ratio: 4 / 5; overflow: hidden; }
.product-media img { width: 100%; height: 100%; object-fit: contain; transition: transform .4s var(--ease-out); }
.product-card:hover .product-media img { transform: scale(1.03); }
.product-media-empty {
	display: flex; align-items: center; justify-content: center;
	font-family: var(--display); font-size: 2.2rem; color: var(--silver); letter-spacing: .1em;
	width: 100%; height: 100%;
}
.product-body { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.product-title { font-family: var(--sans); font-weight: 700; font-size: 1.05rem; line-height: 1.25; margin: 0; text-transform: none; }
.product-title a { color: var(--ink); }
.product-price { font-family: var(--display); font-size: 1.7rem; color: var(--ink); margin: 0; font-variant-numeric: tabular-nums; }
.product-note { font-size: .88rem; color: var(--fg-2); margin: 0; }

.badge-row { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.badge {
	display: inline-block; font-size: .72rem; font-weight: 700; letter-spacing: .08em;
	text-transform: uppercase; padding: 3px 9px; border-radius: 999px;
	border: 1px solid var(--line-light); background: var(--cream); color: var(--ink);
}
.badge-russells-find { background: var(--aqua); border-color: var(--aqua); color: var(--black); }
.badge-one-available { background: var(--ocean); border-color: var(--ocean); color: var(--white); }
.badge-just-added { background: var(--white); border-color: var(--aqua-ink); color: var(--aqua-ink); }
.badge-vintage { background: var(--cream); border-color: var(--line-light); color: var(--ink); }
.badge-restored { background: #E2F0E7; border-color: #BBD9C6; color: var(--ok-ink); }
.badge--sold { background: var(--silver); border-color: var(--silver); color: var(--black); margin-left: 8px; }
.badge--new { background: var(--aqua); border-color: var(--aqua); color: var(--black); margin-left: 8px; }

.is-sold .product-media img { filter: grayscale(1) contrast(.9); opacity: .85; }
.is-sold .product-price { color: var(--fg-2); text-decoration: line-through; }
.sold-flag {
	position: absolute; top: 24px; left: -34px; width: 160px;
	transform: rotate(-30deg);
	background: var(--silver); color: var(--black);
	font-family: var(--display); font-size: 1.1rem; letter-spacing: .18em;
	text-align: center; padding: 5px 0;
}

.empty-state { display: grid; grid-template-columns: 1.3fr 1fr; gap: 28px; align-items: center; }
.empty-state h2 { margin-top: 0; }

/* ------------------------------------------------------------------ product page */

.product-layout { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; align-items: start; }

.gallery-main {
	background: var(--ocean-deep); border: 1px solid var(--line-strong); border-radius: var(--r);
	overflow: hidden; aspect-ratio: 4 / 5;
}
.gallery-main img { width: 100%; height: 100%; object-fit: contain; }
.gallery-thumbs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; padding: 0; list-style: none; }
.gallery-thumbs button {
	width: 72px; height: 90px; padding: 0; overflow: hidden; cursor: pointer;
	border: 2px solid var(--line-strong); border-radius: var(--r); background: var(--ocean-deep);
	transition: border-color .15s ease;
}
.gallery-thumbs button:hover { border-color: var(--silver); }
.gallery-thumbs button[aria-current="true"] { border-color: var(--aqua); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }

.buy-panel {
	--fg: var(--ink); --fg-2: var(--ink-soft); --fg-strong: var(--ink); --link: var(--aqua-ink); --link-hover: var(--ocean); --bg: var(--white);
	background: var(--white); border: 1px solid var(--line-light); border-radius: var(--r);
	padding: 26px; position: sticky; top: 16px; color: var(--fg); color-scheme: light;
}
.buy-panel h1 { font-family: var(--sans); font-weight: 700; text-transform: none; font-size: 1.9rem; line-height: 1.15; letter-spacing: 0; color: var(--ink); margin-top: 10px; }
.buy-price { font-family: var(--display); font-size: 2.8rem; margin: 0 0 4px; color: var(--ink); font-variant-numeric: tabular-nums; }
.buy-meta { font-size: .92rem; color: var(--fg-2); }
.buy-panel .btn-row { margin-bottom: 16px; }
.buy-panel .btn-row + .buy-meta { margin-top: 16px; }
.buy-form { display: flex; gap: 10px; align-items: flex-end; flex-wrap: wrap; margin: 18px 0 10px; }
.buy-form .field { max-width: 90px; }
.buy-panel .btn-ghost { color: var(--ink); border-color: var(--ink-soft); }
.buy-panel .btn-ghost:hover { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.sold-panel { background: var(--cream); border: 1px solid var(--line-light); border-radius: var(--r); padding: 16px; margin: 18px 0; }
.sold-panel h3 { margin-top: 0; }
.sold-panel p:last-child { margin-bottom: 0; }

/* ------------------------------------------------------------------ cart, checkout, order */

.cart-page > h1, .checkout-page > h1, .order-page > h1 { margin-bottom: .2em; }
.cart-page > h1::before, .checkout-page > h1::before, .order-page > h1::before { content: ""; display: block; width: 44px; height: 4px; background: var(--aqua); margin: 0 0 14px; }
.cart-page > .meta, .order-page > .meta { margin-bottom: 20px; }

.line-table, .order-table {
	--fg: var(--ink); --fg-2: var(--ink-soft); --link: var(--aqua-ink); --link-hover: var(--ocean); --bg: var(--white);
	width: 100%; border-collapse: collapse; background: var(--white); border: 1px solid var(--line-light);
	color: var(--fg); margin: 0 0 20px; color-scheme: light;
}
.line-table th, .line-table td, .order-table th, .order-table td { padding: 12px; text-align: left; border-bottom: 1px solid var(--line-light); vertical-align: top; }
.line-table th, .order-table thead th { background: var(--cream); font-size: .82rem; text-transform: uppercase; letter-spacing: .06em; }
.line-table tbody tr, .order-table tbody tr { min-height: 32px; }
.line-table tbody tr:nth-child(even), .order-table tbody tr:nth-child(even) { background: #F9F7F2; }
.line-table td.num, .line-table th.num { text-align: right; font-variant-numeric: tabular-nums; }
.order-table td:nth-child(n+2), .order-table th:nth-child(n+2) { white-space: nowrap; font-variant-numeric: tabular-nums; }
.line-table tfoot td, .order-table tfoot td, .order-table tfoot th { font-weight: 700; border-bottom: none; background: var(--cream); }
.order-table tfoot tr:last-child th { font-family: var(--display); font-size: 1.4rem; font-weight: 400; letter-spacing: .02em; }
.line-total { font-family: var(--display); font-size: 1.5rem; }
.order-table .muted { display: block; font-size: .85rem; color: var(--fg-2); margin-top: 4px; }
.order-table a { color: var(--link); font-weight: 600; }
.cart-thumb { width: 64px; height: 80px; object-fit: cover; border-radius: 4px; border: 1px solid var(--line-light); float: left; margin: 0 12px 4px 0; }
.cart-table tr.is-unavailable td:not(:first-child) { color: var(--fg-2); }
.cart-table tr.is-unavailable .cart-thumb { filter: grayscale(1); opacity: .7; }
.inline-form { display: inline-flex; align-items: center; gap: 6px; margin: 0; }
.inline-form input[type="number"] { width: 68px; }
.order-table .btn-ghost { color: var(--ink); border-color: var(--ink-soft); }
.order-table .btn-ghost:hover { background: var(--ink); color: var(--cream); border-color: var(--ink); }

.table-scroll { overflow-x: auto; }

.checkout-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 28px; align-items: start; margin-top: 8px; }
.checkout-form {
	--fg: var(--ink); --fg-2: var(--ink-soft); --fg-strong: var(--ink); --link: var(--aqua-ink); --link-hover: var(--ocean); --bg: var(--cream);
	background: var(--cream); border: 1px solid var(--line-light); border-radius: var(--r); padding: 28px; color: var(--fg); color-scheme: light;
}
.checkout-form h2 { font-size: 1.5rem; margin: 0 0 14px; }
.checkout-form h2 + .form-grid { margin-bottom: 28px; }
.checkout-form .form-grid label { display: flex; flex-direction: column; gap: 6px; }
.method-list { display: grid; gap: 10px; margin: 0 0 20px; }
.method-list .method {
	display: grid; grid-template-columns: auto 1fr; gap: 4px 12px; align-items: center;
	padding: 12px 14px; background: var(--white); border: 1px solid var(--line-light); border-radius: var(--r);
	cursor: pointer; font-weight: 600; counter-reset: none;
	transition: border-color .15s ease;
}
.method-list .method:has(input:checked) { border-color: var(--aqua-ink); box-shadow: inset 0 0 0 1px var(--aqua-ink); }
.method-list .method input { accent-color: var(--aqua-ink); width: 18px; height: 18px; margin: 0; grid-row: span 2; }
.method-list .method small { grid-column: 2; font-weight: 400; color: var(--fg-2); font-size: .88rem; }
.checkout-form .muted { color: var(--fg-2); font-size: .92rem; }
#paypal-buttons { max-width: 420px; margin: 8px 0; }

.checkout-summary {
	--fg: var(--ink); --fg-2: var(--ink-soft); --fg-strong: var(--ink); --link: var(--aqua-ink); --link-hover: var(--ocean); --bg: var(--white);
	background: var(--white); border: 1px solid var(--line-light); border-radius: var(--r); padding: 22px; color: var(--fg); color-scheme: light;
	position: sticky; top: 16px;
}
.checkout-summary h2 { font-size: 1.5rem; margin: 0 0 12px; }
.summary-lines { list-style: none; margin: 0 0 12px; padding: 0 0 12px; border-bottom: 1px solid var(--line-light); display: grid; gap: 8px; }
.summary-lines li { display: flex; justify-content: space-between; gap: 16px; }
.summary-lines li span:last-child { font-variant-numeric: tabular-nums; white-space: nowrap; }
.summary-totals { display: grid; grid-template-columns: 1fr auto; gap: 6px 16px; margin: 0 0 14px; }
.summary-totals dd { margin: 0; text-align: right; font-variant-numeric: tabular-nums; }
.summary-totals dt:last-of-type, .summary-totals dd:last-of-type { border-top: 1px solid var(--line-light); padding-top: 8px; margin-top: 4px; font-family: var(--display); font-size: 1.5rem; font-weight: 400; letter-spacing: .02em; }
.checkout-summary .muted { color: var(--fg-2); font-size: .92rem; }
.checkout-summary p:last-child { margin: 0; }

.panel {
	--fg: var(--ink); --fg-2: var(--ink-soft); --fg-strong: var(--ink); --link: var(--aqua-ink); --link-hover: var(--ocean); --bg: var(--cream);
	background: var(--cream); border: 1px solid var(--line-light); border-radius: var(--r); padding: 22px 24px; margin: 0 0 20px;
	color: var(--fg); color-scheme: light; max-width: 860px;
}
.panel h2 { font-size: 1.5rem; margin: 0 0 10px; }
.panel p:last-child, .panel ul:last-child { margin-bottom: 0; }
.panel .order-table { margin-bottom: 0; }
.panel .btn-ghost { color: var(--ink); border-color: var(--ink-soft); }
.panel .btn-ghost:hover { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.order-page > .muted { max-width: 860px; }

@media (max-width: 860px) {
	.product-layout { grid-template-columns: 1fr; }
	.buy-panel { position: static; }
	.empty-state { grid-template-columns: 1fr; }
	.checkout-grid { grid-template-columns: 1fr; }
	.checkout-summary { position: static; }
	.checkout-form, .checkout-summary { padding: 18px; }
	.order-table { display: block; overflow-x: auto; }
}
