/**
 * CCP Shop Page Styles
 * Clean responsive layout from scratch
 */

/* ===================== */
/* BASE & RESET */
/* ===================== */
.ccp-shop-page {
	background: var(--ccp-background, #f8fafc);
	color: var(--ccp-text, #1e293b);
	padding: 40px 0;
	min-height: 100vh;
}

.ccp-shop-page *,
.ccp-shop-page *::before,
.ccp-shop-page *::after {
	box-sizing: border-box;
}

/* ===================== */
/* CONTAINER */
/* ===================== */
.ccp-shop-container {
	width: 100%;
	max-width: 1600px;
	margin: 0 auto;
	padding: 0 24px;
}

/* ===================== */
/* HEADER */
/* ===================== */
.ccp-shop-header {
	text-align: center;
	margin-bottom: 32px;
}

.ccp-shop-title {
	font-size: 2rem;
	font-weight: 700;
	color: var(--ccp-text);
	margin: 0 0 12px 0;
}

.ccp-shop-description {
	max-width: 600px;
	margin: 0 auto;
	color: var(--ccp-secondary, #64748b);
	font-size: 1rem;
	line-height: 1.6;
}

/* ===================== */
/* MAIN LAYOUT */
/* ===================== */
.ccp-shop-layout {
	display: grid;
	grid-template-columns: 280px 1fr;
	gap: 32px;
	align-items: start;
}

.ccp-shop-main {
	min-width: 0;
	/* Prevent grid blowout */
}

/* ===================== */
/* FILTER TOGGLE (hidden on desktop) */
/* ===================== */
.ccp-filter-toggle {
	display: none;
}

.ccp-filter-overlay {
	display: none;
}

/* ===================== */
/* SIDEBAR */
/* ===================== */
.ccp-shop-sidebar {
	position: sticky;
	top: 100px;
}

.ccp-shop-filters {
	background: #ffffff;
	border-radius: 12px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
	border: 1px solid #e2e8f0;
	overflow: hidden;
}

.ccp-filter-section {
	border-bottom: 1px solid #e2e8f0;
}

.ccp-filter-section:last-of-type {
	border-bottom: none;
}

.ccp-filter-title {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 16px 20px;
	margin: 0;
	font-size: 0.9375rem;
	font-weight: 600;
	color: var(--ccp-text);
	background: #f8fafc;
	border-bottom: 1px solid #e2e8f0;
}

.ccp-filter-title svg {
	width: 18px;
	height: 18px;
	color: var(--ccp-primary, #3b82f6);
	flex-shrink: 0;
}

.ccp-filter-content {
	padding: 16px 20px;
}

/* Event Checkboxes */
.ccp-event-checkboxes {
	display: flex;
	flex-direction: column;
	gap: 8px;
	max-height: 280px;
	overflow-y: auto;
}

.ccp-checkbox-label {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	cursor: pointer;
	padding: 8px 10px;
	border-radius: 6px;
	transition: background-color 0.15s ease;
}

.ccp-checkbox-label:hover {
	background-color: #f1f5f9;
}

.ccp-event-checkbox {
	width: 18px;
	height: 18px;
	margin-top: 1px;
	accent-color: var(--ccp-primary, #3b82f6);
	cursor: pointer;
	flex-shrink: 0;
}

.ccp-checkbox-text {
	font-size: 0.875rem;
	color: var(--ccp-text);
	line-height: 1.4;
}

.ccp-checkbox-count {
	color: var(--ccp-secondary, #64748b);
	font-size: 0.8125rem;
}

.ccp-no-events {
	color: var(--ccp-secondary);
	font-size: 0.875rem;
	font-style: italic;
	margin: 0;
}

/* Price Filter */
.ccp-price-slider-container {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.ccp-price-inputs {
	display: flex;
	align-items: center;
	gap: 8px;
}

.ccp-price-input-group {
	flex: 1;
	min-width: 0;
}

.ccp-price-input-group label {
	display: block;
	font-size: 0.7rem;
	font-weight: 600;
	color: var(--ccp-secondary);
	margin-bottom: 4px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.ccp-price-input-wrapper {
	display: flex;
	align-items: center;
	border: 1px solid #e2e8f0;
	border-radius: 6px;
	background: #ffffff;
	overflow: hidden;
}

.ccp-currency {
	padding: 8px;
	background: #f8fafc;
	color: var(--ccp-secondary);
	font-size: 0.875rem;
	border-right: 1px solid #e2e8f0;
	flex-shrink: 0;
}

.ccp-price-input {
	width: 100%;
	padding: 8px;
	border: none;
	font-size: 0.875rem;
	color: var(--ccp-text);
	background: transparent;
	-moz-appearance: textfield;
}

.ccp-price-input::-webkit-outer-spin-button,
.ccp-price-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.ccp-price-input:focus {
	outline: none;
}

.ccp-price-separator {
	color: var(--ccp-secondary);
	font-size: 0.875rem;
	flex-shrink: 0;
}

/* Dual Range Slider */
.ccp-range-slider {
	position: relative;
	height: 6px;
	margin: 8px 0;
}

.ccp-range-track {
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	height: 100%;
	background: #e2e8f0;
	border-radius: 3px;
}

.ccp-range-selected {
	position: absolute;
	top: 0;
	height: 100%;
	background: var(--ccp-primary, #3b82f6);
	border-radius: 3px;
}

.ccp-range-input {
	position: absolute;
	top: -7px;
	width: 100%;
	height: 20px;
	-webkit-appearance: none;
	appearance: none;
	background: transparent;
	pointer-events: none;
	margin: 0;
}

.ccp-range-input::-webkit-slider-thumb {
	-webkit-appearance: none;
	width: 18px;
	height: 18px;
	background: #ffffff;
	border: 2px solid var(--ccp-primary, #3b82f6);
	border-radius: 50%;
	cursor: pointer;
	pointer-events: auto;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.ccp-range-input::-moz-range-thumb {
	width: 18px;
	height: 18px;
	background: #ffffff;
	border: 2px solid var(--ccp-primary, #3b82f6);
	border-radius: 50%;
	cursor: pointer;
	pointer-events: auto;
	box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

/* Clear Filters Button */
.ccp-clear-filters {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	padding: 12px 16px;
	background: transparent;
	border: none;
	color: var(--ccp-secondary);
	font-size: 0.875rem;
	font-weight: 500;
	cursor: pointer;
	transition: color 0.15s ease, background-color 0.15s ease;
}

.ccp-clear-filters:hover {
	color: #dc2626;
	background-color: #fef2f2;
}

.ccp-clear-filters svg {
	width: 16px;
	height: 16px;
}

/* Mobile filter header (hidden on desktop) */
.ccp-mobile-filter-header {
	display: none;
}

/* Apply filters button (hidden on desktop) */
.ccp-apply-filters {
	display: none;
}

/* ===================== */
/* TOOLBAR */
/* ===================== */
.ccp-shop-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 24px;
	padding-bottom: 16px;
	border-bottom: 1px solid #e2e8f0;
}

.ccp-results-count {
	font-size: 0.9375rem;
	color: var(--ccp-secondary);
}

.ccp-count-number {
	font-weight: 600;
	color: var(--ccp-text);
}

.ccp-shop-sort {
	display: flex;
	align-items: center;
	gap: 10px;
}

.ccp-shop-sort label {
	font-size: 0.875rem;
	color: var(--ccp-secondary);
}

.ccp-sort-select {
	padding: 8px 32px 8px 12px;
	border: 1px solid #e2e8f0;
	border-radius: 6px;
	font-size: 0.875rem;
	color: var(--ccp-text);
	background: #ffffff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E") right 8px center no-repeat;
	background-size: 16px;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.ccp-sort-select:focus {
	outline: none;
	border-color: var(--ccp-primary);
}

/* ===================== */
/* PRODUCTS GRID */
/* ===================== */
.ccp-shop-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 24px;
}

.ccp-shop-grid.ccp-loading {
	opacity: 0.5;
	pointer-events: none;
}

/* Card wrapper from template */
.ccp-shop-grid>div {
	width: 100%;
}

/* Loading State */
.ccp-shop-loading {
	display: none;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 60px 20px;
	position: absolute;
	top: 0;
	left: 0;
	right: 0;
	background: rgba(255, 255, 255, 0.9);
	z-index: 10;
}

.ccp-loading-spinner {
	width: 40px;
	height: 40px;
	border: 3px solid #e2e8f0;
	border-top-color: var(--ccp-primary, #3b82f6);
	border-radius: 50%;
	animation: ccp-spin 0.8s linear infinite;
}

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

.ccp-shop-loading p {
	margin-top: 16px;
	color: var(--ccp-secondary);
	font-size: 0.875rem;
}

/* No Results */
.ccp-shop-no-results {
	grid-column: 1 / -1;
	text-align: center;
	padding: 80px 20px;
	color: var(--ccp-secondary);
}

.ccp-shop-no-results svg {
	width: 64px;
	height: 64px;
	margin: 0 auto 20px;
	color: #cbd5e1;
}

.ccp-shop-no-results h3 {
	font-size: 1.25rem;
	font-weight: 600;
	color: var(--ccp-text);
	margin-bottom: 8px;
}

.ccp-shop-no-results p {
	font-size: 0.9375rem;
	margin: 0;
}

/* ===================== */
/* PAGINATION */
/* ===================== */
.ccp-shop-pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-top: 48px;
	padding-top: 32px;
	border-top: 1px solid #e2e8f0;
}

.ccp-shop-pagination .page-numbers {
	display: flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	height: 40px;
	padding: 0 12px;
	border-radius: 8px;
	font-size: 0.875rem;
	font-weight: 500;
	color: var(--ccp-text);
	background: #ffffff;
	border: 1px solid #e2e8f0;
	text-decoration: none;
	transition: all 0.15s ease;
}

.ccp-shop-pagination .page-numbers:hover:not(.current):not(.dots) {
	background: #f8fafc;
	border-color: var(--ccp-primary);
	color: var(--ccp-primary);
}

.ccp-shop-pagination .page-numbers.current {
	background: var(--ccp-primary, #3b82f6);
	border-color: var(--ccp-primary, #3b82f6);
	color: #ffffff;
}

.ccp-shop-pagination .page-numbers.dots {
	border: none;
	background: transparent;
	cursor: default;
}

/* ===================== */
/* CARD EVENT BADGE */
/* ===================== */
.ccp-shop-page .ccp-sponsorship-card__title {
	margin-bottom: 2px;
}

.ccp-sponsorship-card__event {
	display: flex;
	align-items: center;
	gap: 6px;
	font-size: 0.8125rem;
	color: var(--ccp-secondary, #64748b);
	margin-top: 0;
	margin-bottom: 8px;
}

.ccp-sponsorship-card__event svg {
	width: 14px;
	height: 14px;
	flex-shrink: 0;
}

.ccp-sponsorship-card__event-link {
	color: var(--ccp-primary, #3b82f6);
	text-decoration: none;
	transition: color 0.15s ease, text-decoration 0.15s ease;
}

.ccp-sponsorship-card__event-link:hover {
	color: var(--ccp-button-hover-bg, #2563eb);
	text-decoration: underline;
}

/* ===================== */
/* TABLET: 768px - 1199px */
/* Sidebar visible + 2 columns */
/* ===================== */
@media (max-width: 1199px) {
	.ccp-shop-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 20px;
	}
}

/* ===================== */
/* MOBILE: Below 768px */
/* No sidebar, filter button, 1 column */
/* ===================== */
@media (max-width: 767px) {
	.ccp-shop-page {
		padding: 24px 0;
	}

	.ccp-shop-container {
		padding: 0 16px;
	}

	.ccp-shop-header {
		margin-bottom: 24px;
	}

	.ccp-shop-title {
		font-size: 1.5rem;
	}

	/* Single column layout, no sidebar */
	.ccp-shop-layout {
		display: block;
	}

	/* Hide desktop sidebar */
	.ccp-shop-sidebar {
		position: fixed;
		top: 0;
		right: -100%;
		width: 300px;
		max-width: 85vw;
		height: 100vh;
		height: 100dvh;
		margin: 0;
		z-index: 9999;
		overflow-y: auto;
		background: #ffffff;
		box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
		transition: right 0.3s ease;
	}

	.ccp-shop-sidebar.is-open {
		right: 0;
	}

	.ccp-shop-filters {
		border-radius: 0;
		border: none;
		box-shadow: none;
	}

	/* Show filter toggle button */
	.ccp-filter-toggle {
		display: flex;
		align-items: center;
		justify-content: center;
		gap: 8px;
		width: 100%;
		padding: 14px 20px;
		margin-bottom: 20px;
		background: var(--ccp-primary, #3b82f6);
		color: #ffffff;
		border: none;
		border-radius: 8px;
		font-size: 1rem;
		font-weight: 600;
		cursor: pointer;
	}

	.ccp-filter-toggle:hover {
		background: var(--ccp-button-hover-bg, #2563eb);
	}

	.ccp-filter-toggle svg {
		width: 20px;
		height: 20px;
	}

	/* Show overlay */
	.ccp-filter-overlay {
		display: block;
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		background: rgba(0, 0, 0, 0.5);
		z-index: 9998;
		opacity: 0;
		pointer-events: none;
		transition: opacity 0.3s ease;
	}

	.ccp-filter-overlay.is-active {
		opacity: 1;
		pointer-events: auto;
	}

	/* Show mobile filter header */
	.ccp-mobile-filter-header {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 16px 20px;
		border-bottom: 1px solid #e2e8f0;
		background: #f8fafc;
		position: sticky;
		top: 0;
		z-index: 1;
	}

	.ccp-mobile-filter-header h3 {
		margin: 0;
		font-size: 1.125rem;
		font-weight: 600;
		color: var(--ccp-text);
	}

	.ccp-mobile-filter-close {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 36px;
		height: 36px;
		background: transparent;
		border: 1px solid #e2e8f0;
		border-radius: 8px;
		cursor: pointer;
	}

	.ccp-mobile-filter-close:hover {
		background: #f1f5f9;
	}

	.ccp-mobile-filter-close svg {
		width: 20px;
		height: 20px;
		color: var(--ccp-text);
	}

	/* Show apply button */
	.ccp-apply-filters {
		display: block;
		width: calc(100% - 40px);
		margin: 20px;
		padding: 14px 20px;
		background: var(--ccp-primary, #3b82f6);
		color: #ffffff;
		border: none;
		border-radius: 8px;
		font-size: 1rem;
		font-weight: 600;
		cursor: pointer;
	}

	.ccp-apply-filters:hover {
		background: var(--ccp-button-hover-bg, #2563eb);
	}

	/* Toolbar stacks */
	.ccp-shop-toolbar {
		flex-direction: column;
		align-items: stretch;
		gap: 12px;
		text-align: center;
	}

	.ccp-shop-sort {
		justify-content: center;
	}

	/* Single column grid */
	.ccp-shop-grid {
		grid-template-columns: 1fr;
		gap: 16px;
	}

	/* Pagination */
	.ccp-shop-pagination {
		flex-wrap: wrap;
		margin-top: 32px;
		padding-top: 24px;
	}
}

/* ===================== */
/* SCROLLBAR */
/* ===================== */
.ccp-event-checkboxes::-webkit-scrollbar {
	width: 6px;
}

.ccp-event-checkboxes::-webkit-scrollbar-track {
	background: #f1f5f9;
	border-radius: 3px;
}

.ccp-event-checkboxes::-webkit-scrollbar-thumb {
	background: #cbd5e1;
	border-radius: 3px;
}

.ccp-event-checkboxes::-webkit-scrollbar-thumb:hover {
	background: #94a3b8;
}