/* Shop page layout — flex column, footer sticks to bottom */
.shop-page {
	flex: 1;
	display: flex;
	flex-direction: column;
	background: var(--gradient-hero);
}

/* Shop header — full width, no max-width (like Grably) */
body:has(.shop-page) .header-content {
	max-width: none;
}

/* Logo text — left edge of screen */
.shop-logo {
	font-size: 1.5rem;
	font-weight: 800;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	background: var(--gradient-brand);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
}

/* Footer */
.shop-footer {
	background: var(--bg-secondary);
	border-top: 1px solid var(--border-light);
	padding: 2rem;
	text-align: center;
	color: var(--text-secondary);
	margin-top: auto;
	margin-top: auto;
}

.shop-footer p { margin: 0; font-size: 0.85rem; }
.shop-footer-links { display: flex; justify-content: center; gap: 1.5rem; margin-top: 0.5rem; }
.shop-footer-links a { color: var(--text-muted); font-size: 0.8rem; text-decoration: none; transition: var(--transition-smooth); }
.shop-footer-links a:hover { color: var(--text-primary); }

/* Main content */
.shop-main {
	max-width: 1100px;
	width: 100%;
	margin: 0 auto;
	padding: 2rem 1.5rem;
	flex: 1;
	display: flex;
	flex-direction: column;
}

/* Collection cover */
.shop-collection-cover {
	width: 100%;
	border-radius: var(--radius-medium);
	margin: 1rem 0;
	overflow: hidden;
	position: relative;
}
.shop-collection-cover img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Collection header */
.shop-collection-header {
	margin-bottom: 0.75rem;
}

.shop-collection-label {
	font-size: 0.75rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--text-muted);
	margin-bottom: 0.2rem;
}

.shop-collection-name {
	font-size: 1.5rem;
	font-weight: 800;
	background: var(--gradient-brand);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
	line-height: 1.2;
	margin: 0;
}

/* Collection description — subtle tinted block */
.shop-collection-desc {
	font-size: 0.85rem;
	line-height: 1.6;
	color: var(--text-secondary);
	background: rgba(0, 0, 0, 0.03);
	border-radius: var(--radius-medium);
	padding: 0.75rem 1rem;
	margin-bottom: 1rem;
}

:root[data-theme="dark"] .shop-collection-desc {
	background: rgba(255, 255, 255, 0.04);
}

/* Collection pills */
.shop-collections {
	display: flex;
	gap: 0.5rem;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	padding-bottom: 0.5rem;
	margin-bottom: 1.5rem;
}

.shop-collections::-webkit-scrollbar {
	display: none;
}

.shop-pill {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	padding: 0.5rem 1rem;
	font-size: 0.85rem;
	font-weight: 600;
	white-space: nowrap;
	border: 1px solid var(--border-light);
	border-radius: var(--radius-button);
	background: var(--bg-surface);
	color: var(--text-secondary);
	cursor: pointer;
	transition: var(--transition-smooth);
	flex-shrink: 0;
}

.shop-pill:hover {
	border-color: var(--color-primary);
	color: var(--color-primary);
}

.shop-pill.active {
	background: var(--gradient-brand);
	color: #fff;
	border-color: transparent;
}

.shop-pill-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.3rem;
	height: 1.3rem;
	padding: 0 0.35rem;
	font-size: 0.7rem;
	font-weight: 700;
	border-radius: 100px;
	background: rgba(0, 0, 0, 0.1);
}

.shop-pill.active .shop-pill-count {
	background: rgba(255, 255, 255, 0.25);
}

/* Product grid */
.shop-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 1.5rem;
}

/* Product card — same depth as project-item */
.shop-card {
	background: var(--bg-surface);
	border: 1px solid var(--border-light);
	border-radius: var(--radius-large);
	overflow: hidden;
	transition: all 0.3s cubic-bezier(0.2, 0, 0.2, 1);
	cursor: pointer;
	box-shadow: var(--shadow-sm);
}

.shop-card:hover {
	transform: translateY(-3px);
	box-shadow: var(--shadow-lg);
	border-color: var(--color-primary);
}

.shop-card-image {
	width: 100%;
	aspect-ratio: 1;
	object-fit: contain;
	background: var(--bg-secondary);
	padding: 1rem;
}

.shop-card-body {
	padding: 1rem;
}

.shop-card-title {
	font-size: 0.95rem;
	font-weight: 600;
	color: var(--text-primary);
	margin-bottom: 0.5rem;
	line-height: 1.3;
}

.shop-card-price {
	font-size: 1.1rem;
	font-weight: 800;
	background: var(--gradient-brand);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
}

.shop-card-from {
	font-size: 0.75rem;
	font-weight: 400;
	color: var(--text-muted);
	-webkit-text-fill-color: var(--text-muted);
	background: none;
	margin-right: 0.25rem;
}

/* Loading */
.shop-loading {
	text-align: center;
	padding: 4rem 0;
	color: var(--text-muted);
}

.shop-loading .pay-spinner {
	display: inline-block;
	width: 24px;
	height: 24px;
	border: 3px solid var(--border-medium);
	border-right-color: transparent;
	border-radius: 50%;
	animation: pay-spin 0.6s linear infinite;
	margin-bottom: 1rem;
}

@keyframes pay-spin {
	to { transform: rotate(360deg); }
}

/* Empty state */
.shop-empty {
	text-align: center;
	color: var(--text-muted);
	font-size: 0.9rem;
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
}

.shop-empty i {
	font-size: 2.5rem;
	margin-bottom: 1rem;
	display: block;
}

/* ============================== */
/* Product page — viewport-fitted */
/* ============================== */

/* header-bar ~56px + footer ~73px = ~129px */
.shop-product-page {
	height: calc(100vh - 129px);
	height: calc(100dvh - 129px);
	overflow: hidden;
	padding: 1rem 1.5rem;
	max-width: 1100px;
	margin: 0 auto;
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
}

/* Back button */
.shop-back-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0;
	margin-bottom: 1rem;
	font-size: 0.85rem;
	font-weight: 500;
	border: none;
	background: none;
	color: var(--text-muted);
	cursor: pointer;
	transition: var(--transition-smooth);
	flex-shrink: 0;
	font-family: inherit;
}

.shop-back-btn:hover { color: var(--color-primary); }

/* Card — mirrors project-item style from main page */
.shop-product-layout {
	display: grid;
	grid-template-columns: 1fr 1fr;
	flex: 1;
	min-height: 0;
	background: var(--bg-surface);
	border: 1px solid var(--border-light);
	border-radius: 20px;
	box-shadow: var(--shadow-md);
	overflow: hidden;
	transition: all 0.3s cubic-bezier(0.2, 0, 0.2, 1);
}

.shop-product-layout:hover {
	box-shadow: var(--shadow-lg);
	border-color: var(--color-primary);
}

/* Gallery — left column */
.shop-product-gallery {
	padding: 1.5rem;
	display: flex;
	flex-direction: column;
	height: 100%;
	overflow: hidden;
}

.shop-product-image-main {
	flex: 1;
	min-height: 0;
	width: 100%;
	object-fit: contain;
	background: var(--bg-secondary);
	border-radius: var(--radius-medium);
	padding: 1rem;
}

.shop-product-thumbs {
	display: flex;
	gap: 0.5rem;
	margin-top: 0.75rem;
	overflow-x: auto;
	scrollbar-width: none;
	flex-shrink: 0;
}

.shop-product-thumbs::-webkit-scrollbar { display: none; }

.shop-product-thumb {
	width: 52px;
	height: 52px;
	object-fit: contain;
	background: var(--bg-secondary);
	border-radius: var(--radius-small);
	border: 2px solid transparent;
	cursor: pointer;
	transition: var(--transition-smooth);
	flex-shrink: 0;
	padding: 0.2rem;
}

.shop-product-thumb:hover { border-color: var(--border-medium); }
.shop-product-thumb.active { border-color: var(--color-primary); }

/* Product info — right column, single scroll */
.shop-product-info {
	display: flex;
	flex-direction: column;
	height: 100%;
	min-width: 0;
	overflow-y: auto;
	border-left: 1px solid var(--border-light);
}

/* Top: title, price, variants, payment — fills available height */
.shop-product-top {
	min-height: min-content;
	padding: 1.5rem 1.5rem 1.25rem;
}

.shop-product-title {
	font-size: 1.15rem;
	font-weight: 700;
	color: var(--text-primary);
	line-height: 1.3;
	margin-bottom: 0.5rem;
}

.shop-product-price {
	font-size: 1.4rem;
	font-weight: 800;
	background: var(--gradient-brand);
	-webkit-background-clip: text;
	-webkit-text-fill-color: transparent;
	background-clip: text;
	margin-bottom: 1rem;
}

.shop-product-variants {
	margin-bottom: 1rem;
}

.shop-product-variants label {
	display: block;
	font-size: 0.8rem;
	font-weight: 600;
	color: var(--text-secondary);
	margin-bottom: 0.4rem;
}

/* Description area */
.shop-product-desc-scroll {
	padding: 1rem 1.5rem 1.5rem;
	border-top: 1px solid var(--border-light);
}

.shop-product-desc {
	font-size: 0.85rem;
	color: var(--text-secondary);
	line-height: 1.7;
	overflow-wrap: break-word;
	word-break: break-word;
}

.shop-product-desc p { margin-bottom: 0.75rem; }
.shop-product-desc table { width: 100%; border-collapse: collapse; margin: 0.75rem 0; font-size: 0.8rem; table-layout: fixed; }
.shop-product-desc th,
.shop-product-desc td { padding: 0.4rem 0.6rem; border: 1px solid var(--border-light); text-align: left; overflow-wrap: break-word; }
.shop-product-desc th { background: var(--bg-secondary); font-weight: 600; color: var(--text-primary); }
.shop-product-desc ul,
.shop-product-desc ol { padding-left: 1.5rem; margin-bottom: 0.75rem; }
.shop-product-desc li { margin-bottom: 0.25rem; }
.shop-product-desc h2,
.shop-product-desc h3 { color: var(--text-primary); margin: 1rem 0 0.5rem; font-size: 0.95rem; }
.shop-product-desc img { max-width: 100%; border-radius: var(--radius-medium); }

.shop-variant-options {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}

.shop-variant-btn {
	padding: 0.4rem 0.8rem;
	font-size: 0.8rem;
	font-weight: 500;
	border: 1px solid var(--border-light);
	border-radius: var(--radius-button);
	background: var(--bg-primary);
	color: var(--text-secondary);
	cursor: pointer;
	transition: var(--transition-smooth);
}

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

.shop-variant-btn.active {
	background: var(--gradient-brand);
	color: #fff;
	border-color: transparent;
}

.shop-buy-btn {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	width: 100%;
	padding: 0.8rem;
	font-size: 0.95rem;
	font-weight: 600;
	border: none;
	border-radius: var(--radius-medium);
	background: var(--gradient-brand);
	color: #fff;
	cursor: pointer;
	transition: var(--transition-smooth);
	margin-top: 1rem;
}

.shop-buy-btn:hover {
	opacity: 0.9;
	transform: translateY(-1px);
	box-shadow: var(--shadow-md);
}

/* PayPal checkout */
.shop-paypal-container {
	margin-top: 1rem;
}

#paypal-button-container {
	min-height: 45px;
}

.shop-card-fields {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.shop-card-fields-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.5rem;
}

#card-name-field-container,
#card-number-field-container,
#card-expiry-field-container,
#card-cvv-field-container {
	border: 1px solid var(--border-light);
	border-radius: var(--radius-small);
	background: var(--bg-primary);
	overflow: hidden;
}

:root[data-theme="dark"] #card-name-field-container,
:root[data-theme="dark"] #card-number-field-container,
:root[data-theme="dark"] #card-expiry-field-container,
:root[data-theme="dark"] #card-cvv-field-container {
	border-color: var(--border-medium);
}

.shop-payment-status {
	margin-top: 0.75rem;
	padding: 0.6rem 0.8rem;
	border-radius: var(--radius-small);
	font-size: 0.85rem;
	font-weight: 500;
	text-align: center;
	background: rgba(52, 199, 89, 0.1);
	color: var(--color-success);
}

/* Shipping info */
.shop-shipping-line {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	margin-top: 0.75rem;
	font-size: 0.8rem;
	color: var(--text-muted);
}

.shop-shipping-line > i {
	font-size: 0.85rem;
	color: var(--color-success);
}

.shop-shipping-toggle {
	display: inline-flex;
	align-items: center;
	gap: 0.25rem;
	margin-left: auto;
	border: none;
	background: none;
	color: var(--text-muted);
	font-size: 0.75rem;
	font-family: inherit;
	cursor: pointer;
	padding: 0.2rem 0;
	transition: color 0.2s;
}

.shop-shipping-toggle:hover { color: var(--color-primary); }

.shop-shipping-toggle i {
	font-size: 0.6rem;
	transition: transform 0.3s;
}

.shop-shipping-details {
	margin-top: 0.5rem;
	padding: 0.75rem;
	background: rgba(0, 0, 0, 0.03);
	border-radius: var(--radius-small);
	font-size: 0.78rem;
	line-height: 1.5;
}

:root[data-theme="dark"] .shop-shipping-details {
	background: rgba(255, 255, 255, 0.04);
}

.shop-shipping-blocked-title {
	font-weight: 600;
	color: var(--text-secondary);
	margin: 0 0 0.15rem;
}

.shop-shipping-blocked-list {
	color: var(--text-muted);
	margin: 0 0 0.25rem;
}

.shop-shipping-disclaimer {
	margin: 0.75rem 0 0;
	padding-top: 0.5rem;
	border-top: 1px solid var(--border-light);
	font-size: 0.73rem;
	color: var(--color-warning, #FF9500);
	font-weight: 500;
}

/* Dark theme */
:root[data-theme="dark"] .shop-card {
	background: var(--bg-surface);
	border-color: var(--border-medium);
}

:root[data-theme="dark"] .shop-card:hover {
	border-color: var(--color-primary);
	box-shadow: var(--shadow-lg);
}

:root[data-theme="dark"] .shop-card-image {
	background: var(--bg-tertiary);
}

:root[data-theme="dark"] .shop-product-layout {
	background: var(--bg-surface);
	border-color: var(--border-medium);
}

:root[data-theme="dark"] .shop-product-layout:hover {
	border-color: var(--color-primary);
}

:root[data-theme="dark"] .shop-product-image-main {
	background: var(--bg-tertiary);
}

:root[data-theme="dark"] .shop-product-thumb {
	background: var(--bg-tertiary);
}

/* Responsive */
@media (max-width: 768px) {
	.shop-collection-header {
		text-align: center;
	}

	.shop-collection-name {
		font-size: 1.3rem;
	}

	.shop-grid {
		grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
		gap: 1rem;
	}

	.shop-product-page {
		height: auto;
		overflow: visible;
		padding: 1rem;
	}

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

	.shop-product-gallery {
		height: auto;
	}

	.shop-product-image-main {
		flex: none;
		aspect-ratio: 1;
	}

	.shop-product-info {
		height: auto;
		border-left: none;
		border-top: 1px solid var(--border-light);
	}

}

@media (max-width: 480px) {
	.shop-main {
		padding: 1rem;
	}

	.shop-grid {
		grid-template-columns: 1fr 1fr;
		gap: 0.75rem;
	}

	.shop-card-body {
		padding: 0.75rem;
	}

	.shop-card-title {
		font-size: 0.85rem;
	}
}
