/* ================================================================
   Price Comparison Aggregator — frontend styles
   ================================================================ */

/* ── Reset & base ─────────────────────────────────────────────── */
.pca, .pca * { box-sizing: border-box; }
.pca a  { text-decoration: none; color: inherit; }
.pca ul { list-style: none; margin: 0; padding: 0; }
.pca img { max-width: 100%; height: auto; display: block; }

/* ── Typography helpers ────────────────────────────────────────── */
.pca-page-title    { margin: .2em 0 .6em; font-size: 1.8rem; line-height: 1.2; }
.pca-section-title { margin: 1.75rem 0 .9rem; font-size: 1.15rem; font-weight: 700; border-bottom: 2px solid #e5e5e5; padding-bottom: .4rem; }
.pca-section-header { margin-bottom: 1.5rem; }
.pca-description   { color: #555; }
.pca-empty         { padding: 1.5rem; background: #f6f7f7; border-radius: 6px; color: #666; }

/* ── Breadcrumbs ───────────────────────────────────────────────── */
.pca-breadcrumbs { font-size: 12px; color: #888; margin-bottom: .9rem; }
.pca-breadcrumbs a { color: #666; border-bottom: 1px dotted #bbb; }
.pca-breadcrumbs a:hover { color: #2a72de; border-color: #2a72de; }

/* ── Shared grid ───────────────────────────────────────────────── */
.pca-grid {
	display: grid !important;
	gap: 1.1rem;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	list-style: none !important;
	margin: 0 !important;
	padding: 0 !important;
}

/* ── Shared card ───────────────────────────────────────────────── */
.pca-card {
	display: block !important;   /* override list-item from themes */
	background: #fff;
	border: 1px solid #e8e8e8;
	border-radius: 10px;
	overflow: hidden;
	transition: transform .13s ease, box-shadow .13s ease;
	margin: 0 !important;
	padding: 0 !important;
}
.pca-card::before,
.pca-card::after { display: none !important; } /* kill theme bullet pseudo-elements */
.pca-card:hover { transform: translateY(-3px); box-shadow: 0 6px 20px rgba(0,0,0,.08); }
.pca-card-link {
	display: flex;
	flex-direction: column;
	height: 100%;
	color: inherit;
	text-decoration: none;
	position: relative;
}

/* ── Thumbnail block ───────────────────────────────────────────── */
.pca-card-thumb {
	width: 100%;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: #f0f0f1;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}
.pca-card-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.pca-card-thumb--shop {
	aspect-ratio: 3 / 2;
	background: #f6f7f7;
}
.pca-card-thumb--shop img {
	object-fit: contain;
	padding: .75rem;
}
.pca-card-thumb-letter {
	font-size: 2.2rem;
	font-weight: 800;
	color: #fff;
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	background: linear-gradient(135deg, #2a72de 0%, #1a4fa0 100%);
}
.pca-card-cat .pca-card-thumb-letter  { background: linear-gradient(135deg, #2a72de, #6c3de0); }
.pca-card-shop .pca-card-thumb-letter { background: linear-gradient(135deg, #1d8a3a, #0d5c28); }

/* ── Card info block ───────────────────────────────────────────── */
.pca-card-info {
	padding: .85rem .9rem .7rem;
	display: flex;
	flex-direction: column;
	gap: .25rem;
	flex: 1;
}
.pca-card-title {
	font-size: 14px;
	font-weight: 700;
	line-height: 1.3;
	margin: 0;
	color: #1a1a1a;
}
.pca-card-desc { font-size: 12px; color: #666; line-height: 1.4; margin: 0; }
.pca-card-count { font-size: 11px; color: #888; }
.pca-card-brand, .pca-card-shop { font-size: .78rem; color: #888; }
.pca-card-tags  { font-size: .75rem; color: #aaa; }
.pca-card-location {
	display: flex;
	align-items: center;
	gap: .3rem;
	font-size: .98rem;
	color: #888;
}
.pca-card-cta {
	margin-top: auto;
	padding-top: .5rem;
	font-size: 10px;
	font-weight: 600;
	color: #2a72de;
}
.pca-card-arrow {
	position: absolute;
	top: 50%;
	right: .9rem;
	transform: translateY(-50%);
	font-size: 1.2rem;
	color: #ccc;
	line-height: 1;
}
.pca-card:hover .pca-card-arrow { color: #2a72de; }

/* ── Price ─────────────────────────────────────────────────────── */
.pca-card-price {
	display: block;
	margin-top: .35rem;
	font-weight: 800;
	font-size: 1.05rem;
	color: #1d8a3a;
}

/* ── Grid variants ─────────────────────────────────────────────── */
/* Categories: fixed 3 columns */
.pca-grid-cats {
	grid-template-columns: repeat(3, 1fr);
}
.pca-grid-cats--small {
	grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
}
.pca-card-cat--small .pca-card-thumb { aspect-ratio: 1 / 1; }
.pca-card-cat--small .pca-card-title { font-size: .88rem; }

/* Shops: 3–4 wide */
.pca-grid-shops {
	grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
}

/* Products: 4 columns desktop → 3 tablet → 2 mobile */
.pca-grid-products {
	grid-template-columns: repeat(4, 1fr);
}
.pca-card-product .pca-card-thumb {
	aspect-ratio: 1 / 1;
	background: #fafafa;
}
.pca-card-product .pca-card-thumb img { object-fit: contain; padding: .5rem; }
.pca-card-body { padding: .5rem 0 0; }
.pca-card-product .pca-card-title { font-size: 12x; }
.pca-card-product .pca-card-price { font-size: 14px; margin-top: .4rem; }

@media (max-width: 1024px) {
	.pca-grid-products { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 680px) {
	.pca-grid-products { grid-template-columns: repeat(2, 1fr); }
}

/* ── Shop page header ──────────────────────────────────────────── */
.pca-shop-header { margin-bottom: 1.75rem; }
.pca-shop-identity { display: flex; gap: 1.1rem; align-items: center; margin: .75rem 0; }
.pca-shop-logo { width: 100px; height: 100px; object-fit: contain; background: #fafafa; border: 1px solid #e8e8e8; border-radius: 8px; padding: .5rem; }
.pca-shop-location { display: flex; align-items: center; gap: .3rem; font-size: .85rem; color: #888; margin: .25rem 0; }
.pca-shop-website { display: inline-block; margin-top: .4rem; color: #2a72de; font-weight: 500; font-size: .88rem; }
.pca-shop-description { color: #555; margin-top: .75rem; }

/* ── Single product page ───────────────────────────────────────── */
.pca-product-page { padding: 0; }
.pca-product { display: grid; grid-template-columns: minmax(220px,1fr) 2fr; gap: 2rem; align-items: start; margin-top: 1.25rem; }
@media (max-width: 680px) { .pca-product { grid-template-columns: 1fr; } }
.pca-product-media img { width: 100%; aspect-ratio: 1/1; object-fit: contain; background: #fafafa; border: 1px solid #e8e8e8; border-radius: 8px; }
.pca-meta-row { margin: .35rem 0; color: #555; font-size: .9rem; }
.pca-product-offer { margin: 1.1rem 0; padding: 1rem; background: #f6faf7; border: 1px solid #cfe6d5; border-radius: 8px; }
.pca-product-price { font-size: 1.5rem; font-weight: 800; color: #1d8a3a; margin-right: 1rem; }
.pca-buy-button { display: inline-block; background: #2a72de; color: #fff !important; padding: .6rem 1.2rem; border-radius: 5px; font-weight: 600; font-size: .9rem; transition: background .12s; }
.pca-buy-button:hover { background: #1f5fb8; }
.pca-product-description { margin-top: 1.25rem; color: #444; line-height: 1.6; }

/* ── Pagination ────────────────────────────────────────────────── */
.pca-pagination { margin-top: 1.75rem; display: flex; flex-wrap: wrap; gap: .4rem; align-items: center; }
.pca-pagination .page-numbers { padding: .38rem .7rem; border: 1px solid #ddd; border-radius: 5px; font-size: 12px; color: #444; background: #fff; }
.pca-pagination .current { background: #2a72de; color: #fff; border-color: #2a72de; }
.pca-pagination a:hover { background: #f0f5ff; border-color: #2a72de; color: #2a72de; }

/* ── Archive toolbar ───────────────────────────────────────────── */
.pca-archive-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: .75rem; margin-bottom: 1rem; padding-bottom: .75rem; border-bottom: 1px solid #e8e8e8; }
.pca-archive-count { color: #666; font-size: .88rem; }
.pca-archive-filtered { color: #aaa; }
.pca-active-filters { display: flex; flex-wrap: wrap; gap: .35rem; }
.pca-filter-badge { display: inline-flex; align-items: center; padding: .18rem .55rem; background: #e8f0fb; color: #2a72de; border-radius: 999px; font-size: .78rem; font-weight: 500; }

/* ── Category filter pills ─────────────────────────────────────── */
.pca-archive-cats { display: flex; flex-wrap: wrap; gap: .4rem; }
.pca-cat-pill { display: inline-block; padding: .22rem .65rem; background: #f0f0f1; border-radius: 999px; font-size: .8rem; color: #555; transition: background .12s, color .12s; }
.pca-cat-pill:hover { background: #2a72de; color: #fff; }

/* ── Location pin icon ─────────────────────────────────────────── */
.pca-icon { flex-shrink: 0; color: #bbb; }

/* ── Sub-category section ──────────────────────────────────────── */
.pca-subcats { margin-bottom: 1.5rem; }

/* ── Search form ───────────────────────────────────────────────── */
.pca-search-wrap { margin: 0 0 1.5rem; }
.pca-search-form { background: #f6f7f7; border: 1px solid #e5e5e5; border-radius: 8px; padding: 1rem 1.2rem; }
.pca-search-fields { display: flex; flex-wrap: wrap; gap: .65rem; align-items: flex-end; }
.pca-search-field { display: flex; flex-direction: column; gap: .28rem; }
.pca-search-keyword { flex: 2 1 210px; }
.pca-search-cat     { flex: 1 1 155px; }
.pca-search-country { flex: 1 1 135px; }
.pca-search-submit  { flex: 0 0 auto; }
.pca-search-label { font-size: .85rem; font-weight: 700; color: #666; text-transform: uppercase; letter-spacing: .04em; }
.pca-search-input-wrap { position: relative; display: flex; align-items: center; }
.pca-search-icon { position: absolute; left: .6rem; color: #bbb; pointer-events: none; }
.pca-search-input { width: 100%; padding: .52rem .7rem .52rem 2rem; border: 1px solid #ddd; border-radius: 5px; font-size: .9rem; background: #fff; }
.pca-search-input:focus { outline: none; border-color: #2a72de; box-shadow: 0 0 0 3px rgba(42,114,222,.1); }
.pca-search-select { width: 100%; padding: .52rem .7rem; border: 1px solid #ddd; border-radius: 5px; font-size: 11px; background: #fff; cursor: pointer; }
.pca-search-select:focus { outline: none; border-color: #2a72de; }
.pca-search-btn { padding: .54rem 1.2rem; background: #2a72de; color: #fff; border: none; border-radius: 5px; font-size: .9rem; font-weight: 700; cursor: pointer; white-space: nowrap; transition: background .12s; }
.pca-search-btn:hover { background: #1f5fb8; }
.pca-btn-outline { display: inline-block; margin-top: .75rem; background: transparent; color: #2a72de; border: 1px solid #2a72de; text-decoration: none; }
.pca-btn-outline:hover { background: #2a72de; color: #fff; }
.pca-search-active { margin-top: .5rem; }
.pca-search-clear { font-size: .8rem; color: #999; text-decoration: none; border-bottom: 1px dotted #ccc; }
.pca-search-clear:hover { color: #b32d2e; }
.pca-clear-btn { display: inline-flex; align-items: center; padding: .52rem .8rem; border: 1px solid #ddd; border-radius: 5px; font-size: .88rem; color: #888; background: #fff; cursor: pointer; text-decoration: none; }
.pca-clear-btn:hover { border-color: #b32d2e; color: #b32d2e; }
.pca-no-results { padding: 2rem; text-align: center; }

@media (max-width: 780px) {
	.pca-grid-cats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
	.pca-search-keyword, .pca-search-cat, .pca-search-country, .pca-search-submit { flex: 1 1 100%; }
	.pca-search-btn { width: 100%; }
	.pca-grid-cats  { grid-template-columns: 1fr; }
	.pca-grid-shops { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

/* ── Shop-page inline search ─────────────────────────────────────── */
.pca-shop-search { margin-bottom: 1.1rem; }
.pca-shop-search-row {
	display: flex;
	align-items: center;
	gap: .5rem;
	flex-wrap: wrap;
}
.pca-shop-search-row .pca-search-input-wrap { flex: 1 1 220px; }
.pca-shop-search-row .pca-search-input { padding-left: 2rem; }
