/* Easy Paint Studio - photo studio */

.eps-photo {
	--eps-navy: #15223A;
	--eps-peach: #FDEEDF;
	--eps-pink: #D593A6;
	--eps-clay: #C56058;
	--eps-line: rgba(21, 34, 58, 0.16);

	position: relative;
	left: 50%;
	width: calc(100vw - var(--eps-sb, 0px));
	margin-left: calc(var(--eps-sb, 0px) / 2 - 50vw);
	box-sizing: border-box;
	padding: 8px clamp(16px, 3vw, 48px) 48px;
	color: var(--eps-navy);
	font-family: 'Alegreya Sans', sans-serif;
	font-size: 17px;
	line-height: 1.45;
}

.eps-photo *,
.eps-photo *::before,
.eps-photo *::after {
	box-sizing: border-box;
}

.eps-photo [hidden] {
	display: none !important;
}

.eps-photo button,
.eps-photo input,
.eps-photo select {
	font-family: inherit;
}

.eps-photo button {
	cursor: pointer;
}

.eps-photo :focus-visible {
	outline: 3px solid var(--eps-pink);
	outline-offset: 2px;
}

/* ---------- upload ---------- */

.eps-ph-upload {
	max-width: 760px;
	margin: 12px auto 0;
}

.eps-ph-drop {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 260px;
	padding: 32px 24px;
	border: 2px dashed var(--eps-navy);
	background: var(--eps-peach);
	text-align: center;
	cursor: pointer;
}

.eps-ph-drop:hover,
.eps-ph-drop.is-over {
	border-color: var(--eps-pink);
	background: #fbe6d2;
}

.eps-ph-drop:focus-within {
	outline: 3px solid var(--eps-pink);
	outline-offset: 2px;
}

.eps-ph-file {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
}

.eps-ph-drop-title {
	font-weight: 700;
	font-size: 1.6rem;
	line-height: 1.15;
}

.eps-ph-drop-sub {
	max-width: 46ch;
}

.eps-ph-privacy {
	margin: 12px 0 0;
	font-size: 15px;
	text-align: center;
	opacity: 0.8;
}

/* ---------- work area ---------- */

.eps-ph-work {
	display: grid;
	grid-template-columns: minmax(0, calc((100vh - 150px) * var(--eps-ratio, 1.333))) 320px 320px;
	justify-content: center;
	gap: 20px;
	align-items: start;
}

.eps-ph-stage {
	min-width: 0;
}

.eps-ph-bar-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 10px 20px;
	margin-bottom: 10px;
}

.eps-ph-modes {
	display: inline-flex;
	flex-wrap: wrap;
	border: 1px solid var(--eps-navy);
	border-radius: 3px;
	overflow: hidden;
}

.eps-ph-modes button {
	padding: 5px 10px;
	margin: 0;
	border: 0;
	border-right: 1px solid var(--eps-line);
	background: #fff;
	color: var(--eps-navy);
	font-size: 16px;
}

.eps-ph-modes button:last-child {
	border-right: 0;
}

.eps-ph-modes button[aria-pressed="true"] {
	background: var(--eps-navy);
	color: #fff;
}

.eps-ph-quiet {
	padding: 4px 0;
	border: 0;
	background: none;
	color: var(--eps-navy);
	font-size: 16px;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.eps-ph-quiet:hover {
	color: var(--eps-clay);
}

.eps-ph-status {
	margin: 0 0 8px;
	padding: 6px 12px;
	border-left: 4px solid var(--eps-pink);
	background: #fff;
}

.eps-ph-status.is-warning {
	border-left-color: #E3A656;
	background: #FFF7EA;
}

.eps-ph-status.is-error {
	border-left-color: var(--eps-clay);
	background: #FBEDEB;
}

.eps-ph-progress {
	height: 4px;
	margin: -4px 0 8px;
	background: var(--eps-line);
}

.eps-ph-progress-bar {
	width: 0;
	height: 100%;
	background: var(--eps-pink);
}

.eps-ph-canvas-wrap {
	position: relative;
	border: 1px solid var(--eps-line);
	background: #f4f2ef;
}

.eps-ph-view {
	display: block;
	width: 100%;
	height: auto;
}

.eps-ph-overlay {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	cursor: pointer;
	touch-action: manipulation;
}

.eps-ph-note {
	margin: 8px 0 0;
	font-size: 14px;
	opacity: 0.75;
}

/* ---------- panel ---------- */

.eps-ph-panel {
	position: sticky;
	top: 16px;
	padding: 16px;
	background: var(--eps-peach);
}

.eps-ph-h {
	font-size: 1.7rem;
	line-height: 1.1;
}

.eps-ph-h + .eps-ph-layers,
.eps-ph-layers-empty {
	margin-bottom: 22px;
}

.eps-ph-layers {
	position: relative;
	margin: 0 0 22px;
	padding: 0;
	list-style: none;
	overflow-y: auto;
}

.eps-ph-layer {
	display: grid;
	grid-template-columns: 22px 1fr auto 28px;
	gap: 6px;
	align-items: center;
	margin-bottom: 4px;
	padding: 6px 6px 6px 8px;
	border: 2px solid transparent;
	background: #fff;
	cursor: pointer;
}

.eps-ph-layer.is-hover {
	background: #fbf1f4;
}

.eps-ph-layer.is-selected {
	border-color: var(--eps-pink);
}

.eps-ph-sw {
	width: 20px;
	height: 20px;
	border: 1px solid rgba(21, 34, 58, 0.25);
}

.eps-ph-sw.is-empty {
	background: repeating-linear-gradient(45deg, #fff 0 4px, #e6e1da 4px 8px);
}

.eps-ph-name {
	min-width: 0;
	padding: 3px 4px;
	border: 1px solid transparent;
	background: transparent;
	color: var(--eps-navy);
	font-size: 16px;
}

.eps-ph-name:hover,
.eps-ph-name:focus {
	border-color: var(--eps-line);
	background: #fff;
}

.eps-ph-surface {
	max-width: 110px;
	padding: 2px 4px;
	border: 1px solid var(--eps-line);
	background: #fff;
	color: var(--eps-navy);
	font-size: 14px;
}

.eps-ph-del {
	width: 28px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--eps-navy);
	font-size: 30px;
	line-height: 1;
	margin: 0;
}

.eps-ph-del:hover {
	color: var(--eps-clay);
}

.eps-ph-layers-empty {
	font-size: 15px;
	opacity: 0.8;
}

.eps-ph-layer.has-send {
	grid-template-columns: auto 22px 1fr auto 28px;
}

.eps-photo .eps-ph-send {
	width: 16px;
	height: 16px;
	margin: 0;
	accent-color: var(--eps-navy);
	cursor: pointer;
}

/* ---------- realistic view ---------- */

.eps-ph-real {
	margin: -8px 0 24px;
}

.eps-ph-real .eps-ph-action {
	width: 100%;
	padding: 9px 14px;
}

.eps-ph-real-note {
	margin: 6px 0 0;
	font-size: 14px;
	line-height: 1.35;
	opacity: 0.8;
}

.eps-ph-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 4px 18px;
	margin-bottom: 10px;
}

.eps-ph-tab {
	padding: 4px 0;
	border: 0;
	border-bottom: 3px solid transparent;
	background: none;
	color: var(--eps-navy);
	font-size: 17px;
	opacity: 0.7;
}

.eps-ph-tab:hover {
	opacity: 1;
}

.eps-ph-tab.is-active {
	border-bottom-color: var(--eps-pink);
	font-weight: 700;
	opacity: 1;
}

.eps-ph-search {
	width: 100%;
	margin-bottom: 10px;
	padding: 7px 10px;
	border: 1px solid var(--eps-line);
	background: #fff;
	color: var(--eps-navy);
	font-size: 16px;
}

.eps-ph-chips {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(36px, 1fr));
	gap: 4px;
}

.eps-ph-chip {
	position: relative;
	aspect-ratio: 1;
	width: 100%;
	padding: 0;
	border: 1px solid rgba(21, 34, 58, 0.18);
}

.eps-ph-chip.is-current {
	outline: 3px solid var(--eps-navy);
	outline-offset: 1px;
	z-index: 1;
}

.eps-ph-chip::after {
	content: attr(data-name);
	position: absolute;
	left: 50%;
	bottom: calc(100% + 6px);
	transform: translateX(-50%);
	padding: 3px 8px;
	background: var(--eps-navy);
	color: #fff;
	font-size: 14px;
	white-space: nowrap;
	pointer-events: none;
	opacity: 0;
	z-index: 5;
}

.eps-ph-chip:hover::after,
.eps-ph-chip:focus-visible::after {
	opacity: 1;
}

.eps-ph-chips.is-off .eps-ph-chip {
	opacity: 0.3;
	background-image: repeating-linear-gradient(45deg, transparent 0 5px, rgba(255, 255, 255, 0.7) 5px 7px);
}

.eps-ph-chips.is-off .eps-ph-chip:hover::after {
	opacity: 0;
}

.eps-ph-chips-empty {
	margin: 0;
	font-size: 14px;
	opacity: 0.75;
}

/* ---------- shopping list ---------- */

.eps-ph-list {
	margin-top: 36px;
	padding-top: 20px;
	border-top: 2px solid var(--eps-navy);
}

.eps-ph-list-title {
	margin: 0 0 12px;
	font-size: clamp(1.6rem, 3vw, 2.2rem);
	line-height: 1.1;
}

.eps-ph-list-table {
	width: 100%;
	max-width: 880px;
	border-collapse: collapse;
}

.eps-ph-list-table td {
	padding: 10px 12px 10px 0;
	border-bottom: 1px solid var(--eps-line);
	vertical-align: middle;
}

.eps-ph-list-obj {
	font-weight: 700;
}

.eps-ph-list-chip {
	display: inline-block;
	width: 18px;
	height: 18px;
	margin-right: 8px;
	vertical-align: -3px;
	border: 1px solid rgba(21, 34, 58, 0.2);
}

.eps-ph-list-buy {
	text-align: right;
}

.eps-ph-btn {
	display: inline-block;
	padding: 4px 14px;
	border-radius: 3px;
	background: var(--eps-navy);
	color: #fff;
	font-size: 15px;
	text-decoration: none;
}

.eps-ph-btn:hover {
	background: #22355a;
	color: #fff;
}

/* ---------- small screens ---------- */

/* tablet: photo on top, surfaces and shades side by side */
@media (max-width: 1199px) {
	.eps-ph-work {
		grid-template-columns: 1fr 1fr;
	}

	.eps-ph-stage {
		grid-column: 1 / -1;
	}

	.eps-ph-panel {
		position: static;
	}
}

/* mobile: everything stacked */
@media (max-width: 767px) {
	.eps-ph-work {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 900px) {
	.eps-ph-list-paint {
		display: none;
	}
}

/* ---------- P2b: brush sizes, actions, compare, cursor ---------- */

.eps-ph-sizes {
	display: inline-flex;
	gap: 4px;
}

.eps-ph-sizes button {
	min-width: 34px;
	padding: 6px 8px;
	border: 1px solid var(--eps-navy);
	border-radius: 3px;
	background: #fff;
	color: var(--eps-navy);
	font-size: 15px;
}

.eps-ph-sizes button[aria-pressed="true"] {
	background: var(--eps-navy);
	color: #fff;
}

.eps-ph-actions {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px 12px;
}

.eps-ph-action {
	padding: 7px 14px;
	border: 1px solid var(--eps-navy);
	border-radius: 3px;
	background: #fff;
	color: var(--eps-navy);
	font-size: 16px;
}

.eps-ph-action[aria-pressed="true"] {
	background: var(--eps-pink);
	border-color: var(--eps-pink);
}

.eps-ph-action[disabled] {
	opacity: 0.4;
	cursor: not-allowed;
}

.eps-ph-action-main {
	background: var(--eps-navy);
	color: #fff;
}

.eps-ph-action-main:hover {
	background: #22355a;
}

.eps-ph-orig {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
}

.eps-ph-canvas-wrap.is-comparing .eps-ph-overlay {
	opacity: 0;
	pointer-events: none;
}

.eps-ph-divider {
	position: absolute;
	top: 0;
	bottom: 0;
	width: 32px;
	margin-left: -16px;
	cursor: ew-resize;
	touch-action: none;
	z-index: 3;
}

.eps-ph-divider::before {
	content: "";
	position: absolute;
	top: 0;
	bottom: 0;
	left: 15px;
	width: 2px;
	background: #fff;
	box-shadow: 0 0 0 1px rgba(21, 34, 58, 0.5);
}

.eps-ph-divider::after {
	content: "\2194";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 32px;
	height: 32px;
	margin: -16px 0 0 -16px;
	border-radius: 50%;
	background: var(--eps-navy);
	color: #fff;
	font: 18px/32px system-ui, sans-serif;
	text-align: center;
}

.eps-ph-tag {
	position: absolute;
	top: 10px;
	display: none;
	padding: 2px 10px;
	background: rgba(21, 34, 58, 0.8);
	color: #fff;
	font-size: 14px;
	pointer-events: none;
	z-index: 2;
}

.eps-ph-tag-before {
	left: 10px;
}

.eps-ph-tag-after {
	right: 10px;
}

.eps-ph-canvas-wrap.is-comparing .eps-ph-tag {
	display: block;
}

.eps-ph-cursor {
	position: absolute;
	border: 2px solid #fff;
	border-radius: 50%;
	box-shadow: 0 0 0 1px var(--eps-navy);
	pointer-events: none;
	z-index: 2;
}

/* ---------- P2b: neutralise theme form styles inside the studio ---------- */

.eps-photo .eps-ph-name,
.eps-photo .eps-ph-surface,
.eps-photo .eps-ph-search {
	height: auto;
	min-height: 0;
	margin: 0;
	border-radius: 0;
	box-shadow: none;
	line-height: 1.3;
	color: var(--eps-navy);
}

.eps-photo .eps-ph-name {
	width: 100%;
	padding: 3px 4px;
	border: 1px solid transparent;
	background: transparent;
	font-size: 16px;
}

.eps-photo .eps-ph-name:hover,
.eps-photo .eps-ph-name:focus {
	border-color: transparent;
	background: transparent;
	outline: none;
	box-shadow: none;
}

.eps-photo .eps-ph-surface {
	width: auto;
	max-width: 110px;
	padding: 2px 4px;
	border: 1px solid var(--eps-line);
	background-color: #fff;
	font-size: 14px;
}

.eps-photo .eps-ph-search {
	box-sizing: border-box;
	width: 100%;
	padding: 7px 10px;
	border: 1px solid var(--eps-line);
	background: #fff;
	font-size: 16px;
}

/* ---------- busy indicator ---------- */

.eps-ph-status.is-busy::before {
	content: "";
	display: inline-block;
	width: 14px;
	height: 14px;
	margin-right: 10px;
	vertical-align: -2px;
	border: 2px solid var(--eps-line);
	border-top-color: var(--eps-navy);
	border-radius: 50%;
	animation: eps-spin 0.8s linear infinite;
}

@keyframes eps-spin {
	to {
		transform: rotate(360deg);
	}
}

@media (prefers-reduced-motion: reduce) {
	.eps-ph-status.is-busy::before {
		animation-duration: 2.4s;
	}
}

/* ---------- GUI round 1: compact action bar, steps, edit toggle, paint description, wait box ---------- */

.eps-ph-actions {
	gap: 0;
	margin-left: auto;
	border: 1px solid var(--eps-navy);
	border-radius: 3px;
	overflow: hidden;
}

.eps-ph-actions .eps-ph-action {
	padding: 5px 10px;
	margin: 0;
	border: 0;
	border-right: 1px solid var(--eps-line);
	border-radius: 0;
	font-size: 16px;
}

.eps-ph-actions .eps-ph-action:last-child {
	border-right: 0;
}

.eps-ph-edit-toggle {
	display: block;
	margin: -12px 0 18px;
	font-size: 15px;
}

.eps-ph-cat-desc {
	margin: -4px 0 10px;
	font-size: 14px;
	line-height: 1.35;
	opacity: 0.8;
}

.eps-ph-cat-desc:empty {
	display: none;
}

.eps-ph-wait {
	position: absolute;
	inset: 0;
	z-index: 6;
	display: flex;
	align-items: flex-start;
	justify-content: center;
	padding: max(16px, 10%) 16px 16px;
	background: rgba(21, 34, 58, 0.28);
}

.eps-ph-wait-box {
	position: sticky;
	top: 24px;
	width: min(420px, 100%);
	padding: 18px 22px;
	border-top: 4px solid var(--eps-pink);
	background: #fff;
	box-shadow: 0 8px 28px rgba(21, 34, 58, 0.25);
}

.eps-ph-wait-text {
	margin: 0 0 12px;
	font-size: 17px;
	line-height: 1.35;
}

.eps-ph-wait-text::before {
	content: "";
	display: inline-block;
	width: 14px;
	height: 14px;
	margin-right: 10px;
	vertical-align: -2px;
	border: 2px solid var(--eps-line);
	border-top-color: var(--eps-navy);
	border-radius: 50%;
	animation: eps-spin 0.8s linear infinite;
}

.eps-ph-wait-bar {
	height: 6px;
	background: var(--eps-line);
}

.eps-ph-wait-bar span {
	display: block;
	width: 0;
	height: 100%;
	background: var(--eps-navy);
	transition: width 0.4s ease;
}

@media (prefers-reduced-motion: reduce) {
	.eps-ph-wait-text::before {
		animation-duration: 2.4s;
	}

	.eps-ph-wait-bar span {
		transition: none;
	}
}

/* ---------- surface texture slider (second line of the selected row) ---------- */

.eps-ph-tex {
	grid-column: 1 / -1;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 4px 0 2px;
	font-size: 14px;
}

.eps-ph-tex-label {
	flex: none;
}

.eps-photo .eps-ph-tex-range {
	flex: 1;
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
	accent-color: var(--eps-navy);
	cursor: pointer;
}

.eps-photo .eps-ph-tex-range:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.eps-ph-tex-val {
	flex: none;
	min-width: 3.2em;
	text-align: right;
	font-variant-numeric: tabular-nums;
}

/* ---------- photo tips under the upload box ---------- */

.eps-ph-tips {
	margin: 0 0 16px;
	padding: 12px 16px;
	border-left: 4px solid var(--eps-pink);
	background: #fff;
	font-size: 15px;
	line-height: 1.4;
}

.eps-ph-tips-title {
	margin: 0 0 6px;
	font-weight: 700;
}

.eps-ph-tips ul {
	margin: 0;
	padding-left: 18px;
}

.eps-ph-tips li {
	margin: 2px 0;
}

/* ---------- edit tools in the panel, under "Upraviť plochy" ---------- */

.eps-ph-panel .eps-ph-modes {
	display: flex;
	flex-wrap: wrap;
	margin: -10px 0 8px;
}

.eps-ph-panel .eps-ph-modes button {
	flex: 1 1 auto;
}

.eps-ph-panel .eps-ph-sizes {
	margin: 0 0 18px;
}

/* ---------- full-width photo (desktop): icon in the top right corner, panels go below ---------- */

.eps-ph-wide {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 4;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 2px 8px rgba(21, 34, 58, 0.25);
	cursor: pointer;
}

.eps-ph-wide svg {
	width: 18px;
	height: 18px;
	fill: none;
	stroke: var(--eps-navy);
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.eps-ph-wide-close,
.eps-ph-wide[aria-pressed="true"] .eps-ph-wide-open {
	display: none;
}

.eps-ph-wide[aria-pressed="true"] .eps-ph-wide-close {
	display: inline;
}

.eps-ph-canvas-wrap.is-comparing .eps-ph-wide {
	top: 46px;
}

.eps-ph-work.is-wide {
	grid-template-columns: 1fr 1fr;
}

.eps-ph-work.is-wide .eps-ph-stage {
	grid-column: 1 / -1;
}

.eps-ph-work.is-wide .eps-ph-panel {
	position: static;
}

@media (max-width: 1199px) {
	.eps-ph-wide {
		display: none;
	}
}

/* ---------- saved design: card with thumbnail on the upload screen ---------- */

.eps-ph-last-card {
	position: relative;
	display: inline-block;
	margin-top: 4px;
}

.eps-ph-last-open {
	display: block;
	margin: 0;
	padding: 0;
	border: 1px solid var(--eps-line);
	background: none;
	cursor: pointer;
}

.eps-ph-last-img {
	display: block;
	width: 200px;
	height: auto;
}

.eps-ph-last-del {
	position: absolute;
	top: -10px;
	right: -10px;
	width: 26px;
	height: 26px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--eps-navy);
	color: #fff;
	font-size: 18px;
	line-height: 26px;
	cursor: pointer;
}

.eps-ph-last-date {
	margin: 6px 0 0;
	font-size: 14px;
	opacity: 0.8;
}
