/* =========================================================================
 * codebycp Lens Selector — frontend styles
 * Scoped under .cls- prefixes to avoid theme collisions.
 * ====================================================================== */

:root {
	--cls-accent: #1f7ae0;
	--cls-accent-dark: #1660b4;
	--cls-ink: #1a1a2e;
	--cls-muted: #6b7280;
	--cls-line: #e5e7eb;
	--cls-bg: #ffffff;
	--cls-soft: #f7f8fa;
	--cls-radius: 14px;
	--cls-shadow: 0 10px 40px rgba(0, 0, 0, .12);
}

/* ---- Select Lenses button on product page ---------------------------- */
.cls-select-lenses-btn {
	display: block;
	width: 100%;
	margin: 14px 0 4px;
	padding: 16px 20px;
	border: 0;
	border-radius: 10px;
	background: var(--cls-accent);
	color: #fff;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: .06em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background .2s ease, transform .05s ease;
}
.cls-select-lenses-btn:hover { background: var(--cls-accent-dark); }
.cls-select-lenses-btn:active { transform: translateY(1px); }

/* ---- Overlay & modal ------------------------------------------------- */
.cls-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	background: rgba(20, 22, 30, .55);
	backdrop-filter: blur(2px);
	display: none;
	opacity: 0;
	transition: opacity .25s ease;
}
.cls-overlay.is-open { display: block; opacity: 1; }

.cls-modal {
	position: absolute;
	inset: 0;
	background: var(--cls-bg);
	display: flex;
	flex-direction: column;
	overflow: hidden;
	animation: clsFade .3s ease;
}
@keyframes clsFade { from { opacity: 0; transform: scale(.99); } to { opacity: 1; transform: none; } }

.cls-close,
.cls-back {
	position: absolute;
	top: 18px;
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--cls-ink);
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	z-index: 5;
	transition: background .15s ease;
}
.cls-close { right: 22px; }
.cls-back  { left: 22px; display: none; font-size: 22px; }
.cls-close:hover,
.cls-back:hover { background: var(--cls-soft); }
.cls-modal.show-back .cls-back { display: block; }

/* ---- Body / scroll area --------------------------------------------- */
.cls-modal-body {
	flex: 1 1 auto;
	overflow-y: auto;
	padding: 70px 24px 120px;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.cls-step-title {
	font-size: 26px;
	font-weight: 700;
	color: var(--cls-ink);
	text-align: center;
	margin: 14px 0 36px;
}
.cls-step-subtitle {
	font-size: 14px;
	color: var(--cls-muted);
	text-align: center;
	margin: -24px 0 30px;
}

/* ---- Card grid (prescription types) --------------------------------- */
.cls-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
	gap: 20px;
	width: 100%;
	max-width: 980px;
}

.cls-type-card {
	border: 1px solid var(--cls-line);
	border-radius: var(--cls-radius);
	padding: 26px 18px;
	text-align: center;
	cursor: pointer;
	background: var(--cls-bg);
	transition: border-color .18s ease, box-shadow .18s ease, transform .1s ease;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 12px;
}
.cls-type-card:hover {
	border-color: var(--cls-accent);
	box-shadow: 0 8px 24px rgba(31, 122, 224, .12);
	transform: translateY(-2px);
}
.cls-type-card .cls-type-thumb {
	width: 92px;
	height: 64px;
	object-fit: contain;
	margin-bottom: 4px;
}
.cls-type-card .cls-type-thumb.is-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 50% 50% 45% 45% / 60% 60% 40% 40%;
	background: linear-gradient(135deg, #cfe0f3, #6fa8dc);
}
.cls-type-card .cls-type-label { font-size: 16px; font-weight: 600; color: var(--cls-ink); }
.cls-type-card .cls-type-sub { font-size: 12px; color: var(--cls-muted); line-height: 1.4; }

/* ---- Lens cards ------------------------------------------------------ */
.cls-lens-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
	gap: 18px;
	width: 100%;
	max-width: 1040px;
}
.cls-lens-card {
	border: 1px solid var(--cls-line);
	border-radius: var(--cls-radius);
	overflow: hidden;
	cursor: pointer;
	background: var(--cls-bg);
	display: flex;
	flex-direction: column;
	transition: border-color .18s ease, box-shadow .18s ease, transform .1s ease;
}
.cls-lens-card:hover {
	border-color: var(--cls-accent);
	box-shadow: 0 8px 24px rgba(0, 0, 0, .1);
	transform: translateY(-2px);
}
.cls-lens-media {
	position: relative;
	height: 140px;
	background: #11141c;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}
.cls-lens-media img { width: 100%; height: 100%; object-fit: cover; }
.cls-lens-media.is-placeholder {
	background: radial-gradient(circle at 50% 40%, #2a3550, #11141c);
}
.cls-lens-badge {
	position: absolute;
	top: 10px;
	left: 0;
	background: var(--cls-accent);
	color: #fff;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: .04em;
	padding: 4px 10px;
	border-radius: 0 6px 6px 0;
	text-transform: uppercase;
}
.cls-lens-index {
	position: absolute;
	right: 10px;
	bottom: 10px;
	background: rgba(255, 255, 255, .92);
	color: var(--cls-ink);
	font-size: 10px;
	font-weight: 700;
	padding: 3px 7px;
	border-radius: 5px;
}
.cls-lens-info { padding: 14px 14px 16px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.cls-lens-title { font-size: 14px; font-weight: 600; color: var(--cls-ink); line-height: 1.35; }
.cls-lens-sub { font-size: 12px; color: var(--cls-muted); }
.cls-lens-foot { margin-top: auto; padding: 0 14px 14px; }
.cls-lens-select {
	width: 100%;
	border: 0;
	border-radius: 8px;
	background: var(--cls-accent);
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .04em;
	padding: 11px;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	text-transform: uppercase;
}
.cls-lens-select:hover { background: var(--cls-accent-dark); }
.cls-lens-price {
	text-align: center;
	font-size: 13px;
	font-weight: 700;
	color: var(--cls-ink);
	margin-top: 8px;
}
.cls-lens-price.is-free { color: #1a8f4c; }

/* ---- Method tiles (upload / manual / email) -------------------------- */
.cls-methods {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
	gap: 20px;
	width: 100%;
	max-width: 820px;
}
.cls-method-card {
	border: 1px solid var(--cls-line);
	border-radius: var(--cls-radius);
	padding: 34px 18px;
	text-align: center;
	cursor: pointer;
	transition: border-color .18s ease, box-shadow .18s ease, transform .1s ease;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 14px;
}
.cls-method-card:hover {
	border-color: var(--cls-accent);
	box-shadow: 0 8px 24px rgba(0, 0, 0, .08);
	transform: translateY(-2px);
}
.cls-method-icon { width: 38px; height: 38px; color: var(--cls-accent); }
.cls-method-label { font-size: 15px; font-weight: 600; color: var(--cls-ink); }

/* ---- Upload form ----------------------------------------------------- */
.cls-panel { width: 100%; max-width: 720px; }
.cls-panel-hint { font-size: 13px; color: var(--cls-muted); text-align: center; margin-bottom: 22px; }
.cls-file-drop {
	border: 1px dashed var(--cls-line);
	border-radius: 10px;
	padding: 18px;
	display: flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
	color: var(--cls-muted);
	transition: border-color .18s ease, background .18s ease;
}
.cls-file-drop:hover { border-color: var(--cls-accent); background: var(--cls-soft); }
.cls-file-drop .cls-clip { font-size: 18px; }
.cls-file-name {
	margin-top: 12px;
	font-size: 13px;
	color: var(--cls-ink);
	text-align: right;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
}
.cls-file-name .cls-check { color: #1a8f4c; font-weight: 700; }

/* ---- Manual prescription table -------------------------------------- */
.cls-rx-table {
	width: 100%;
	border: 1px solid var(--cls-line);
	border-radius: 12px;
	padding: 18px 22px;
	margin-bottom: 18px;
}
.cls-rx-grid {
	display: grid;
	grid-template-columns: 110px 1fr 1fr 1fr;
	gap: 12px 16px;
	align-items: center;
}
.cls-rx-grid .cls-rx-head {
	font-size: 12px;
	font-weight: 700;
	color: var(--cls-muted);
	text-transform: uppercase;
	letter-spacing: .04em;
	text-align: center;
}
.cls-rx-grid .cls-rx-eye { font-size: 14px; font-weight: 600; color: var(--cls-ink); }
.cls-rx-grid input,
.cls-rx-grid select {
	width: 100%;
	padding: 9px 10px;
	border: 1px solid var(--cls-line);
	border-radius: 8px;
	font-size: 14px;
	text-align: center;
	background: #fff;
}
.cls-rx-grid input:focus,
.cls-rx-grid select:focus { outline: none; border-color: var(--cls-accent); }

/* ---- Review screen --------------------------------------------------- */
.cls-review { width: 100%; max-width: 820px; }
.cls-review-row {
	display: flex;
	justify-content: space-between;
	gap: 16px;
	padding: 18px 0;
	border-bottom: 1px solid var(--cls-line);
}
.cls-review-row .cls-review-main { flex: 1; }
.cls-review-row h4 { margin: 0 0 6px; font-size: 15px; font-weight: 600; color: var(--cls-ink); }
.cls-review-meta { font-size: 12px; color: var(--cls-muted); line-height: 1.7; }
.cls-review-price { font-size: 14px; font-weight: 700; color: var(--cls-ink); white-space: nowrap; }
.cls-review-price.is-free { color: #1a8f4c; }
.cls-review-notes { margin-top: 22px; }
.cls-review-notes label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 8px; color: var(--cls-ink); }
.cls-review-notes textarea {
	width: 100%;
	min-height: 90px;
	border: 1px solid var(--cls-line);
	border-radius: 10px;
	padding: 12px;
	font-size: 14px;
	resize: vertical;
}

/* ---- Sticky bottom bar ----------------------------------------------- */
.cls-sticky-bar {
	flex: 0 0 auto;
	border-top: 1px solid var(--cls-line);
	background: #fff;
	padding: 14px 24px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	box-shadow: 0 -4px 18px rgba(0, 0, 0, .05);
}
.cls-sticky-info { display: flex; flex-direction: column; }
.cls-sticky-name { font-size: 13px; color: var(--cls-muted); max-width: 60vw; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cls-sticky-price { font-size: 18px; font-weight: 700; color: var(--cls-ink); }
.cls-sticky-action {
	border: 0;
	border-radius: 40px;
	background: var(--cls-accent);
	color: #fff;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: .04em;
	padding: 13px 30px;
	cursor: pointer;
	text-transform: uppercase;
	transition: background .18s ease, opacity .18s ease;
}
.cls-sticky-action:hover { background: var(--cls-accent-dark); }
.cls-sticky-action:disabled { opacity: .5; cursor: default; }
.cls-sticky-action.is-hidden { display: none; }

/* ---- Loading + toast ------------------------------------------------- */
.cls-loading {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 16px;
	min-height: 240px;
	color: var(--cls-muted);
}
.cls-spinner {
	width: 38px;
	height: 38px;
	border: 3px solid var(--cls-line);
	border-top-color: var(--cls-accent);
	border-radius: 50%;
	animation: clsSpin .8s linear infinite;
}
@keyframes clsSpin { to { transform: rotate(360deg); } }

.cls-toast {
	position: fixed;
	left: 50%;
	bottom: 100px;
	transform: translateX(-50%) translateY(20px);
	background: var(--cls-ink);
	color: #fff;
	padding: 12px 22px;
	border-radius: 40px;
	font-size: 14px;
	z-index: 1000001;
	opacity: 0;
	pointer-events: none;
	transition: opacity .25s ease, transform .25s ease;
}
.cls-toast.is-show { opacity: 1; transform: translateX(-50%) translateY(0); pointer-events: auto; }
.cls-toast a { color: #8fd0ff; margin-left: 10px; text-decoration: underline; }

.cls-error-inline {
	color: #c0392b;
	font-size: 13px;
	text-align: center;
	margin-top: 14px;
}

/* ---- Mobile ---------------------------------------------------------- */
@media (max-width: 640px) {
	.cls-modal-body { padding: 64px 16px 130px; }
	.cls-step-title { font-size: 21px; margin-bottom: 26px; }
	.cls-rx-grid { grid-template-columns: 70px 1fr 1fr 1fr; gap: 8px; }
	.cls-sticky-price { font-size: 16px; }
	.cls-sticky-action { padding: 12px 20px; font-size: 13px; }
	.cls-close { right: 12px; top: 12px; }
	.cls-back { left: 12px; top: 12px; }
}
