/* OttOmatic Art - Gallery and Cart Styles */

/* Gallery Grid */
.gallery-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 2em;
	margin: 2em 0;
}

@media (max-width: 980px) {
	.gallery-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 600px) {
	.gallery-grid {
		grid-template-columns: 1fr;
	}
}

/* Product Card */
.product-card {
	background: #fff;
	border-radius: 4px;
	overflow: hidden;
	box-shadow: 0 2px 8px rgba(0,0,0,0.12);
	transition: box-shadow 0.2s ease;
	display: flex;
	flex-direction: column;
}

.product-card:hover {
	box-shadow: 0 4px 16px rgba(0,0,0,0.2);
}

.product-image {
	width: 100%;
	aspect-ratio: 4/3;
	overflow: hidden;
	background: #d4d9dd;
}

.product-image img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
	cursor: pointer;
	background: #e8eaeb;
}

.product-info {
	padding: 1em 1.2em 1.2em;
	display: flex;
	flex-direction: column;
	flex: 1;
}

.product-title {
	font-size: 1.1em;
	font-weight: 400;
	color: #3a4042;
	margin-bottom: 0.2em;
}

.product-size {
	font-size: 0.85em;
	color: #888;
	margin-bottom: 0.3em;
}

.product-date {
	font-size: 0.8em;
	color: #aaa;
	margin-bottom: 0.3em;
}

.product-price {
	font-size: 1.2em;
	color: #3a4042;
	font-weight: 400;
	margin-bottom: 0.8em;
}

.add-to-cart-btn {
	background: #3a4042;
	color: #fff;
	border: none;
	padding: 0.6em 1.2em;
	border-radius: 3px;
	font-family: 'Yanone Kaffeesatz', sans-serif;
	font-size: 1em;
	cursor: pointer;
	transition: background 0.2s ease;
	margin-top: auto;
}

.add-to-cart-btn:hover {
	background: #556066;
}

.add-to-cart-btn:disabled {
	background: #7a9a6b;
	cursor: default;
}

/* Sold pieces: stay in the gallery as social proof, but clearly marked */
.product-image {
	position: relative;
}

.sold-badge {
	position: absolute;
	top: 0.8em;
	left: 0.8em;
	z-index: 2;
	background: #b23b3b;
	color: #fff;
	font-size: 0.85em;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	padding: 0.3em 0.7em;
	border-radius: 3px;
	box-shadow: 0 1px 4px rgba(0,0,0,0.3);
}

.product-card.sold .product-image img {
	opacity: 0.6;
	filter: grayscale(35%);
}

.product-card.sold .add-to-cart-btn:disabled {
	background: #b23b3b;
	opacity: 0.85;
}

.product-price.sold-price {
	color: #b23b3b;
	font-size: 1em;
	font-style: italic;
}

/* ── Demand / contested (SOFT RACE model) ────────────── */
/* A contested piece stays fully available (never dimmed like sold). It gets a
   demand badge with the live count + a heat glow that intensifies with demand,
   and its own hot button color inviting shoppers to join the race. */

.demand-badge {
	position: absolute;
	top: 0.8em;
	left: 0.8em;
	z-index: 2;
	color: #fff;
	font-size: 0.8em;
	font-weight: 400;
	letter-spacing: 0.03em;
	padding: 0.3em 0.7em;
	border-radius: 3px;
	box-shadow: 0 1px 5px rgba(0,0,0,0.35);
	background: #E8A317; /* heat-1 default */
}
/* Heat ramp: warmer/hotter as more carts hold it. Kept clear of Sold red. */
.demand-badge.heat-1 { background: #E8A317; }            /* warm amber */
.demand-badge.heat-2 { background: #F2740C; }            /* bright orange */
.demand-badge.heat-3 { background: #E8590C; }            /* deep red-orange, "on fire" */

/* Card glow ramps with heat (border + shadow), still bright/available. */
.product-card.contested { transition: box-shadow 0.2s ease; }
.product-card.contested.heat-1 { box-shadow: 0 0 0 2px #E8A317, 0 2px 10px rgba(232,163,23,0.35); }
.product-card.contested.heat-2 { box-shadow: 0 0 0 2px #F2740C, 0 2px 14px rgba(242,116,12,0.45); }
.product-card.contested.heat-3 { box-shadow: 0 0 0 3px #E8590C, 0 2px 18px rgba(232,89,12,0.55); }

/* Contested button: its OWN hot color, clearly not Sold red, and clickable. */
.add-to-cart-btn.contested {
	background: #E8590C;
	color: #fff;
}
.add-to-cart-btn.contested:hover { background: #cf4f0a; }

/* "In your cart" state (mine): calm green, disabled. */
.add-to-cart-btn.mine:disabled {
	background: #7a9a6b;
	cursor: default;
}

/* Live countdown text (racer only). */
.hold-timer {
	display: block;
	color: #E8590C;
	font-size: 0.85em;
	margin: 0.2em 0 0.6em;
	font-style: italic;
}
.cart-item-timer {
	color: #E8590C;
	font-size: 0.8em;
	font-style: italic;
	margin-top: 0.2em;
}

/* Live demand indicator inside the cart drawer (follows the piece, updates
   as popularity changes). Heat color matches the gallery card scale. */
.cart-item-demand {
	display: inline-block;
	margin-top: 0.25em;
	font-size: 0.78em;
	font-weight: 400;
	color: #fff;
	padding: 0.15em 0.5em;
	border-radius: 3px;
	background: #E8A317; /* heat-1 default */
}
.cart-item-demand.heat-1 { background: #E8A317; }
.cart-item-demand.heat-2 { background: #F2740C; }
.cart-item-demand.heat-3 { background: #E8590C; }

/* Subtle left accent on a contested cart row, ramping with heat. */
.cart-item.heat-1 { box-shadow: inset 3px 0 0 #E8A317; padding-left: 0.5em; }
.cart-item.heat-2 { box-shadow: inset 3px 0 0 #F2740C; padding-left: 0.5em; }
.cart-item.heat-3 { box-shadow: inset 3px 0 0 #E8590C; padding-left: 0.5em; }

/* Lightbox contested button matches the gallery hot color. */
#lightbox-add-btn.contested { background: #E8590C; color: #fff; }
#lightbox-add-btn.contested:hover { background: #cf4f0a; }

/* ── Toast notifications (race nudges, just-sold) ────── */
#otto-toast {
	position: fixed;
	right: 1em;
	bottom: 1em;
	z-index: 2000;
	display: flex;
	flex-direction: column;
	gap: 0.6em;
	max-width: 360px;
}
.otto-toast-item {
	background: #3a4042;
	color: #fff;
	padding: 0.9em 1.1em;
	border-radius: 5px;
	box-shadow: 0 4px 16px rgba(0,0,0,0.3);
	font-size: 0.95em;
	line-height: 1.35;
	opacity: 0;
	transform: translateY(12px);
	transition: opacity 0.35s ease, transform 0.35s ease;
}
.otto-toast-item.show { opacity: 1; transform: translateY(0); }
.otto-toast-item.race { border-left: 4px solid #E8590C; }
.otto-toast-item.gone { border-left: 4px solid #b23b3b; }
.otto-toast-item strong { color: #F2A65A; }

@media (max-width: 600px) {
	#otto-toast { left: 1em; right: 1em; max-width: none; }
}

/* Cart Overlay */
#cart-overlay {
	display: none;
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0,0,0,0.4);
	z-index: 999;
}

#cart-overlay.open {
	display: block;
}

/* Cart Drawer */
#cart-drawer {
	position: fixed;
	top: 0;
	right: -420px;
	width: 400px;
	max-width: 100vw;
	height: 100%;
	background: #fff;
	z-index: 1000;
	display: flex;
	flex-direction: column;
	box-shadow: -4px 0 20px rgba(0,0,0,0.2);
	transition: right 0.3s ease;
}

#cart-drawer.open {
	right: 0;
}

#cart-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 1.2em 1.5em;
	background: #3a4042;
	color: #8B5CF6;
}

#cart-header h2 {
	font-size: 1.3em;
	font-weight: 400;
	color: #8B5CF6;
}

#cart-close {
	background: none;
	border: none;
	color: #fff;
	font-size: 1.8em;
	cursor: pointer;
	line-height: 1;
	padding: 0;
	min-width: 44px;
	min-height: 44px;
}

#cart-close:hover {
	color: #ccc;
}

#cart-items {
	flex: 1;
	overflow-y: auto;
	padding: 1em 1.5em;
}

#cart-empty-msg {
	color: #888;
	text-align: center;
	margin-top: 2em;
}

/* Cart Item */
.cart-item {
	display: flex;
	justify-content: space-between;
	align-items: flex-start;
	padding: 0.8em 0;
	border-bottom: 1px solid #eee;
}

.cart-item-info {
	display: flex;
	flex-direction: column;
	gap: 0.1em;
	flex: 1;
}

.cart-item-title {
	font-weight: 400;
	color: #3a4042;
	font-size: 1em;
}

.cart-item-size {
	font-size: 0.8em;
	color: #888;
}

.cart-item-price {
	font-size: 0.95em;
	color: #3a4042;
}

.cart-item-controls {
	display: flex;
	align-items: center;
	gap: 0.4em;
	margin-left: 1em;
}

.cart-item-controls button {
	background: #eee;
	border: none;
	width: 44px;
	height: 44px;
	border-radius: 3px;
	cursor: pointer;
	font-size: 1.1em;
	display: flex;
	align-items: center;
	justify-content: center;
}

.cart-item-controls button:hover {
	background: #ddd;
}

.cart-remove {
	background: none !important;
	color: #aaa;
	font-size: 1.2em !important;
}

.cart-remove:hover {
	color: #e04040 !important;
	background: none !important;
}

/* Cart Footer */
#cart-footer {
	padding: 1.2em 1.5em;
	border-top: 2px solid #eee;
}

#cart-total {
	font-size: 1.2em;
	color: #3a4042;
	margin-bottom: 1em;
	text-align: right;
}

#checkout-btn {
	width: 100%;
	background: #7a9a6b;
	color: #fff;
	border: none;
	padding: 0.8em;
	border-radius: 3px;
	font-family: 'Yanone Kaffeesatz', sans-serif;
	font-size: 1.1em;
	cursor: pointer;
	transition: background 0.2s ease;
}

#checkout-btn:hover {
	background: #6a8a5b;
}

/* Active nav link */
nav a.active {
	text-decoration: underline;
}

/* Sticky nav handled by site.css */

/* Mobile banner fix */
@media (max-width: 736px) {
	#banner {
		padding-bottom: 2em;
	}
}
#logo { color: #8B5CF6 !important; }
