/**
 * Elementor produktová mřížka — nadpis, tlačítko Koupit a lightbox detailu produktu.
 */

/* Nadpis kategorie nad mřížkou */
.cpshop-el-grid__title {
	margin: 0 0 1rem;
}

/* Mřížka produktů — sloupce z data-cols, na mobilu jeden sloupec */
.cpshop-el-grid {
	display: grid;
	grid-template-columns: repeat(var(--cpshop-el-cols, 1), minmax(0, 1fr));
	column-gap: var(--cpshop-el-gap, 1rem);
	row-gap: var(--cpshop-el-row-gap, var(--cpshop-el-gap, 1rem));
	width: 100%;
	min-width: 0;
}

.cpshop-el-widget-root {
	width: 100%;
	min-width: 0;
	max-width: 100%;
}

.cpshop-el-grid[data-cols="1"] {
	--cpshop-el-cols: 1;
}

.cpshop-el-grid[data-cols="2"] {
	--cpshop-el-cols: 2;
}

.cpshop-el-grid[data-cols="3"] {
	--cpshop-el-cols: 3;
}

.cpshop-el-grid[data-cols="4"] {
	--cpshop-el-cols: 4;
}

.cpshop-el-grid[data-cols="5"] {
	--cpshop-el-cols: 5;
}

.cpshop-el-grid[data-cols="6"] {
	--cpshop-el-cols: 6;
}

@media (max-width: 767px) {
	.cpshop-el-grid,
	.elementor-widget-cpshop_product_grid .cpshop-el-grid {
		grid-template-columns: minmax(0, 1fr) !important;
		--cpshop-el-cols: 1;
	}
}

@media (min-width: 768px) and (max-width: 1024px) {
	.cpshop-el-grid[data-cols="3"],
	.cpshop-el-grid[data-cols="4"],
	.cpshop-el-grid[data-cols="5"],
	.cpshop-el-grid[data-cols="6"] {
		--cpshop-el-cols: 2;
	}
}

/* Karta produktu v mřížce */
.cpshop-el-card {
	display: flex;
	flex-direction: column;
	padding: 12px;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	background: #fff;
	overflow: hidden;
}

.cpshop-el-card__media {
	display: flex;
	align-items: center;
	justify-content: center;
	margin: -12px -12px 10px;
	min-height: 0;
	overflow: hidden;
}

.cpshop-el-card__photo {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	max-width: 100%;
	width: auto;
	line-height: 0;
	flex-shrink: 1;
	min-width: 0;
	min-height: 0;
}

.cpshop-el-sale-ribbon {
	position: absolute;
	top: 0;
	right: 0;
	width: 88px;
	height: 88px;
	overflow: hidden;
	z-index: 2;
	pointer-events: none;
}

.cpshop-el-sale-ribbon span {
	display: block;
	position: absolute;
	top: 16px;
	right: -28px;
	width: 120px;
	padding: 0.28rem 0;
	background: #dc2626;
	color: #fff;
	font-size: 0.68rem;
	font-weight: 700;
	line-height: 1.2;
	text-align: center;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	transform: rotate(45deg);
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
}

.cpshop-price__regular {
	font-weight: 400;
	text-decoration: line-through;
	opacity: 0.65;
}

.cpshop-el-card__price .cpshop-price__regular,
.cpshop-el-card__price .cpshop-price__current {
	color: inherit;
}

.cpshop-elm__sale-label {
	display: inline-block;
	margin-right: 0.45rem;
	padding: 0.15rem 0.55rem;
	border-radius: 4px;
	background: #dc2626;
	color: #fff;
	font-size: 0.72rem;
	font-weight: 700;
	line-height: 1.3;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	vertical-align: middle;
}

.cpshop-elm__sale-label[hidden] {
	display: none !important;
}

.cpshop-elm__price .cpshop-price__regular[hidden] {
	display: none !important;
}

.cpshop-el-card__photo img {
	display: block;
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
}

.cpshop-el-card__name {
	margin: 0 0 8px;
	font-size: 1rem;
	line-height: 1.35;
}

.cpshop-el-card__name a {
	text-decoration: none;
	color: inherit;
}

.cpshop-el-card__desc {
	margin: 0 0 0.6rem;
	font-size: 0.88rem;
	line-height: 1.45;
	color: #6b7280;
}

.cpshop-el-card__price {
	margin: 0 0 0.6rem;
	font-weight: 600;
}

.cpshop-el-card__buy-wrap {
	margin-top: auto;
}

/* Tlačítko Koupit na kartě */
.cpshop-el-card__buy {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	padding: 0.55rem 1rem;
	border: 0;
	border-radius: 8px;
	background: #111827;
	color: #fff;
	font-size: 0.95rem;
	font-weight: 600;
	line-height: 1.25;
	text-align: center;
	cursor: pointer;
	transition: background 0.15s ease, opacity 0.15s ease;
	-webkit-appearance: none;
	appearance: none;
}

.cpshop-el-card__buy:hover {
	opacity: 0.88;
}

.cpshop-el-card__buy.is-added {
	background: #059669;
}

.cpshop-el-card__buy:disabled,
.cpshop-el-card__buy.is-sold-out {
	opacity: 0.55;
	cursor: not-allowed;
}

.cpshop-el-card__buy:disabled:hover,
.cpshop-el-card__buy.is-sold-out:hover {
	opacity: 0.55;
}

.cpshop-el-card a {
	text-decoration: none;
	color: inherit;
}

/* ---------- Lightbox ---------- */

.cpshop-elm {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}

.cpshop-elm__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(17, 24, 39, 0.6);
}

.cpshop-elm__dialog {
	position: relative;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 25px 60px rgba(0, 0, 0, 0.3);
	width: min(960px, 100%);
	max-height: 90vh;
	overflow: auto;
}

.cpshop-elm__close {
	position: absolute;
	top: 0.6rem;
	right: 0.6rem;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.2rem;
	height: 2.2rem;
	padding: 0;
	border: 0;
	background: none;
	color: #6b7280;
	font-size: 1.6rem;
	line-height: 1;
	cursor: pointer;
}

.cpshop-elm__close:hover {
	color: #111827;
}

.cpshop-elm__body {
	padding: 1.5rem;
}

.cpshop-elm__loading {
	margin: 2rem 0;
	text-align: center;
	color: #6b7280;
}

/* Dvě poloviny: vlevo galerie, vpravo informace */
.cpshop-elm__grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1.5rem;
}

@media (max-width: 720px) {
	.cpshop-elm__grid {
		grid-template-columns: 1fr;
	}
}

.cpshop-elm__main {
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	overflow: hidden;
	min-height: 220px;
	display: flex;
	align-items: center;
	justify-content: center;
	background: #fafafa;
}

.cpshop-elm__main img {
	display: block;
	width: 100%;
	height: auto;
	object-fit: contain;
}

.cpshop-elm__thumbs {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: 0.65rem;
}

.cpshop-elm__thumb {
	padding: 0;
	border: 2px solid transparent;
	border-radius: 8px;
	background: none;
	cursor: pointer;
	overflow: hidden;
	line-height: 0;
}

.cpshop-elm__thumb img {
	width: 64px;
	height: 64px;
	object-fit: cover;
	border-radius: 6px;
	border: 1px solid #e5e7eb;
}

.cpshop-elm__thumb.is-active {
	border-color: #111827;
}

.cpshop-elm__name {
	margin: 0 0 0.25rem;
	font-size: 1.45rem;
	line-height: 1.25;
}

.cpshop-elm__brand {
	margin: 0 0 0.75rem;
	font-size: 0.92rem;
	font-weight: 600;
	color: #6b7280;
	text-transform: uppercase;
	letter-spacing: 0.04em;
}

.cpshop-elm__desc {
	margin: 0 0 1rem;
	line-height: 1.55;
	color: #374151;
	font-size: 0.95rem;
	max-height: 14rem;
	overflow-x: hidden;
	overflow-y: auto;
	padding-right: 0.35rem;
	-webkit-overflow-scrolling: touch;
}

.cpshop-elm__desc p:first-child {
	margin-top: 0;
}

.cpshop-elm__desc p:last-child {
	margin-bottom: 0;
}

.cpshop-elm__stock {
	margin: 0 0 0.75rem;
	font-size: 0.92rem;
	font-weight: 600;
	color: #059669;
}

.cpshop-elm__stock.is-out {
	color: #dc2626;
}

.cpshop-elm__price {
	margin: 0 0 1rem;
	font-size: 1.35rem;
	font-weight: 700;
}

.cpshop-elm__price del,
.cpshop-elm__price .cpshop-price__regular {
	font-weight: 400;
	font-size: 1rem;
	color: inherit;
	opacity: 0.65;
	margin-right: 0.5rem;
}

.cpshop-elm__price small {
	font-weight: 400;
	font-size: 0.85rem;
	color: #6b7280;
}

.cpshop-elm__row {
	margin: 0 0 0.75rem;
}

.cpshop-elm__row label {
	display: block;
	margin-bottom: 0.25rem;
	font-size: 0.88rem;
	font-weight: 600;
}

.cpshop-elm__row select {
	width: 100%;
	max-width: 20rem;
	padding: 0.45rem 0.6rem;
	border: 1px solid #d1d5db;
	border-radius: 8px;
}

.cpshop-elm__buy-row {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	flex-wrap: wrap;
}

.cpshop-elm__buy-row .cpshop-elm__qty-wrap,
.cpshop-elm__buy-row .cpshop-elm__qty-uom {
	align-self: center;
}

.cpshop-elm__qty-wrap {
	display: inline-flex;
	align-items: stretch;
	overflow: hidden;
	/* Výchozí vzhled — přepíše Elementor (Pole množství) přes [data-cpshop-el]. */
	border: 1px solid #d1d5db;
	border-radius: 8px;
	background: transparent;
}

.cpshop-elm__qty-btn {
	border: 0;
	flex-shrink: 0;
	width: 2.25rem;
	min-height: 2.35rem;
	font-size: 1.1rem;
	line-height: 1;
	cursor: pointer;
	padding: 0;
	background: #f3f4f6;
	color: inherit;
}

.cpshop-elm__qty-btn:hover {
	filter: brightness(0.94);
}

.cpshop-elm__buy-row input[type="number"],
.cpshop-elm__qty {
	width: 3.25rem;
	padding: 0.45rem 0.35rem;
	border: 0;
	border-left: 1px solid rgba(0, 0, 0, 0.12);
	border-right: 1px solid rgba(0, 0, 0, 0.12);
	border-radius: 0;
	text-align: center;
	background: #fff;
	color: inherit;
	font: inherit;
	-moz-appearance: textfield;
}

.cpshop-elm__qty::-webkit-outer-spin-button,
.cpshop-elm__qty::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.cpshop-elm__qty-uom {
	font-size: 0.92rem;
	color: #6b7280;
}

.cpshop-elm__add {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.6rem 1.4rem;
	border: 0;
	border-radius: 8px;
	background: #111827;
	color: #fff;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease, opacity 0.15s ease;
}

.cpshop-elm--hide-wish [data-cpshop-wishlist-toggle] {
	display: none !important;
}

.cpshop-elm__add:disabled,
.cpshop-elm__add.is-sold-out {
	opacity: 0.5;
	cursor: not-allowed;
}

.cpshop-elm__add.is-sold-out:hover {
	opacity: 0.5;
}

.cpshop-elm__wish {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
	margin: 0;
	padding: 0.35rem;
	border: 0;
	border-radius: 8px;
	background: transparent;
	color: #9ca3af;
	cursor: pointer;
	line-height: 0;
	appearance: none;
	-webkit-appearance: none;
	transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.cpshop-elm__wish-icon {
	display: block;
	width: 1.75rem;
	height: 1.75rem;
}

.cpshop-elm__wish-icon path {
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
	transition: fill 0.15s ease, stroke 0.15s ease;
}

/* Výchozí hover — Elementor styly (data-cpshop-el) mají vyšší specificitu. */
.cpshop-elm .cpshop-elm__wish:hover:not(:disabled):not(.is-active),
.cpshop-elm .cpshop-elm__wish:focus-visible:not(:disabled):not(.is-active) {
	color: #ef4444;
}

.cpshop-elm .cpshop-elm__wish.is-active {
	color: #ef4444;
}

.cpshop-elm .cpshop-elm__wish.is-active .cpshop-elm__wish-icon path {
	fill: currentColor;
}

.cpshop-elm__msg {
	margin: 0.6rem 0 0;
	font-size: 0.92rem;
	min-height: 1.2em;
}

.cpshop-elm__msg.is-ok {
	color: #059669;
	font-weight: 600;
}

.cpshop-elm__msg.is-error {
	color: #dc2626;
	font-weight: 600;
}

.cpshop-elm__retry {
	margin-top: 0.5rem;
}

/* Picker variant uvnitř lightboxu */
.cpshop-elm .cpshop-variant-picker {
	margin: 0 0 0.75rem;
}

.cpshop-elm .cpshop-variant-picker__label {
	margin: 0 0 0.3rem;
	font-size: 0.88rem;
	font-weight: 600;
}

.cpshop-elm .cpshop-variant-picker__options {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin-bottom: 0.6rem;
}

.cpshop-elm .cpshop-variant-picker__option {
	padding: 0.4rem 0.85rem;
	border: 1px solid #d1d5db;
	border-radius: 999px;
	background: #fff;
	font-size: 0.9rem;
	cursor: pointer;
	transition: border-color 0.15s ease, background 0.15s ease;
}

.cpshop-elm .cpshop-variant-picker__option:hover {
	border-color: #111827;
}

.cpshop-elm .cpshop-variant-picker__option.is-selected {
	border-color: #111827;
	background: #111827;
	color: #fff;
}

.cpshop-elm .cpshop-variant-picker__option.is-unavailable {
	opacity: 0.55;
	text-decoration: line-through;
}

.cpshop-elm .cpshop-variant-picker[data-allow-unavailable="1"] .cpshop-variant-picker__option.is-unavailable {
	cursor: pointer;
	text-decoration: none;
}

.cpshop-elm .cpshop-variant-picker[data-allow-unavailable="1"] .cpshop-variant-picker__option.is-unavailable.is-selected {
	opacity: 1;
}

.cpshop-elm .cpshop-variant-picker__option--color {
	padding: 0.3rem;
	border-radius: 50%;
	line-height: 0;
}

.cpshop-elm .cpshop-variant-picker__swatch {
	display: inline-block;
	width: 1.4rem;
	height: 1.4rem;
	border-radius: 50%;
	border: 1px solid rgba(0, 0, 0, 0.1);
}

.cpshop-elm .cpshop-variant-picker__status {
	margin: 0 0 0.5rem;
	font-size: 0.92rem;
	font-weight: 600;
	color: #059669;
}

.cpshop-elm .cpshop-variant-picker__status.is-out {
	color: #dc2626;
}
