/* WeSaveCart Coupons - frontend */

.wsc-grid,
.wsc-modal,
.wsc-modal * {
	box-sizing: border-box;
}

:root {
	--wsc-primary: #06B5F0;
	--wsc-primary-dark: #0270CA;
	--wsc-ink: #1f2340;
	--wsc-muted: #5b5b66;
	--wsc-line: #e4e4e8;
}

/* ---------- Grid ---------- */

.wsc-grid {
	display: grid;
	gap: 22px;
	margin: 0 0 24px;
}

.wsc-cols-1 { grid-template-columns: repeat(1, minmax(0, 1fr)); max-width: 240px; }
.wsc-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wsc-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wsc-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.wsc-cols-5 { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.wsc-cols-6 { grid-template-columns: repeat(6, minmax(0, 1fr)); }

@media (max-width: 1024px) {
	.wsc-cols-4, .wsc-cols-5, .wsc-cols-6 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 782px) {
	.wsc-cols-3, .wsc-cols-4, .wsc-cols-5, .wsc-cols-6 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 480px) {
	.wsc-grid { grid-template-columns: repeat(1, minmax(0, 1fr)) !important; }
}

/* ---------- Card ---------- */

.wsc-card {
	background: #fff;
	border: 1px solid #ececed;
	border-radius: 10px;
	box-shadow: 0 2px 10px rgba(20, 20, 43, 0.06);
	padding: 24px 18px 28px;
	text-align: center;
	font-family: inherit;
}

.wsc-card-logo {
	width: 118px;
	height: 118px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
}

.wsc-card-logo img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	display: block;
	margin: 0 auto;
}

.wsc-logo-fallback {
	width: 90px;
	height: 90px;
	border-radius: 50%;
	background: var(--wsc-primary);
	color: #fff;
	font-size: 34px;
	font-weight: 700;
	line-height: 90px;
	text-transform: uppercase;
}

.wsc-card-title {
	margin: 16px 0 22px;
	font-size: 15px;
	line-height: 1.45;
	color: var(--wsc-ink);
	font-weight: 500;
	word-break: break-word;
}

/* ---------- Get Code button with dashed peek ---------- */

.wsc-btn-wrap {
	position: relative;
	display: inline-block;
	vertical-align: middle;
}

.wsc-btn-wrap.has-peek {
	/* keeps the peeking chip inside the card bounds */
	margin-right: 22px;
}

.wsc-btn {
	position: relative;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 130px;
	height: 42px;
	padding: 0 24px;
	border: 0;
	border-radius: 4px;
	background: var(--wsc-primary);
	color: #fff !important;
	font-size: 15px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0.2px;
	cursor: pointer;
	text-decoration: none;
	transition: background 0.15s ease;
	font-family: inherit;
}

.wsc-btn:hover,
.wsc-btn:focus {
	background: var(--wsc-primary-dark);
	color: #fff !important;
}

.wsc-peek {
	position: absolute;
	z-index: 1;
	top: 0;
	right: -22px;
	height: 42px;
	display: flex;
	align-items: center;
	padding: 0 8px 0 30px;
	border: 1px dashed #a9a9a9;
	border-radius: 4px;
	background: #fff;
	color: #4a4a4a;
	font-size: 13px;
	letter-spacing: 0.5px;
	white-space: nowrap;
	pointer-events: none;
}

/* ---------- Modal ---------- */

.wsc-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: none;
	align-items: flex-start;
	justify-content: center;
	padding: 40px 16px;
	background: rgba(0, 0, 0, 0.55);
	overflow-y: auto;
	font-family: inherit;
}

.wsc-modal.is-open {
	display: flex;
}

.wsc-modal-box {
	position: relative;
	width: 100%;
	max-width: 800px;
	background: #fff;
	border-radius: 6px;
	padding: 26px 26px 26px;
	box-shadow: 0 18px 45px rgba(0, 0, 0, 0.25);
	animation: wsc-pop 0.18s ease-out;
}

@keyframes wsc-pop {
	from { transform: translateY(-10px); opacity: 0; }
	to { transform: translateY(0); opacity: 1; }
}

.wsc-modal-close {
	position: absolute;
	top: 10px;
	right: 14px;
	width: 30px;
	height: 30px;
	border: 0;
	background: none;
	color: #111;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	padding: 0;
}

.wsc-modal-top {
	display: flex;
	align-items: center;
	gap: 22px;
}

.wsc-modal-logo {
	flex: 0 0 auto;
	width: 105px;
	height: 105px;
	border-radius: 50%;
	overflow: hidden;
	background: #fff;
	border: 1px solid #eee;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
	display: flex;
	align-items: center;
	justify-content: center;
}

.wsc-modal-logo img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.wsc-modal-main {
	flex: 1 1 auto;
	min-width: 0;
	text-align: center;
}

.wsc-modal-title {
	margin: 0 0 14px;
	font-size: 23px;
	line-height: 1.25;
	font-weight: 700;
	color: var(--wsc-ink);
}

.wsc-code-row {
	display: flex;
	align-items: center;
	gap: 10px;
}

.wsc-code-input {
	flex: 1 1 auto;
	height: 40px;
	min-width: 0;
	border: 1px dashed #b6b6b6;
	border-radius: 4px;
	background: #fff;
	text-align: center;
	font-size: 15px;
	color: #6b6b6b;
	letter-spacing: 0.4px;
	padding: 0 10px;
	font-family: inherit;
}

.wsc-code-input:focus {
	outline: none;
	border-color: var(--wsc-primary);
}

.wsc-copy-btn {
	flex: 0 0 auto;
	width: 40px;
	height: 40px;
	border: 0;
	border-radius: 4px;
	background: var(--wsc-primary);
	color: #fff;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	padding: 0;
}

.wsc-copy-btn:hover { background: var(--wsc-primary-dark); }
.wsc-copy-btn svg { width: 18px; height: 18px; fill: #fff; }

.wsc-helper {
	margin: 14px 0 0;
	font-size: 13.5px;
	font-weight: 700;
	color: #3f3f46;
}

.wsc-copied {
	display: none;
	margin: 8px 0 0;
	font-size: 13px;
	font-weight: 600;
	color: var(--wsc-primary);
}

.wsc-copied.show { display: block; }

.wsc-visit {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 44px;
	margin-top: 18px;
	border-radius: 3px;
	background: var(--wsc-primary);
	color: #fff !important;
	font-size: 16px;
	font-weight: 600;
	text-decoration: none;
}

.wsc-visit:hover { background: var(--wsc-primary-dark); }

/* ---------- Newsletter ---------- */

.wsc-nl {
	margin-top: 18px;
	border: 1px solid var(--wsc-line);
	border-radius: 4px;
	padding: 18px;
}

.wsc-nl-top {
	display: flex;
	align-items: center;
	gap: 18px;
}

.wsc-nl-icon {
	flex: 0 0 auto;
	width: 92px;
	color: var(--wsc-primary);
}

.wsc-nl-icon svg { width: 100%; height: auto; display: block; }

.wsc-nl-title {
	margin: 0 0 4px;
	font-size: 17px;
	font-weight: 700;
	color: var(--wsc-ink);
}

.wsc-nl-text {
	margin: 0;
	font-size: 14px;
	line-height: 1.45;
	color: var(--wsc-muted);
}

.wsc-nl-form {
	display: flex;
	margin-top: 16px;
	border: 1px solid #dcdce0;
	border-radius: 3px;
	overflow: hidden;
}

.wsc-nl-input {
	flex: 1 1 auto;
	min-width: 0;
	height: 52px;
	border: 0;
	padding: 0 16px;
	font-size: 15px;
	color: #333;
	background: #fff;
	font-family: inherit;
}

.wsc-nl-input:focus { outline: none; }

.wsc-nl-btn {
	flex: 0 0 auto;
	min-width: 196px;
	height: 52px;
	border: 0;
	background: var(--wsc-primary);
	color: #fff;
	font-size: 16px;
	font-weight: 700;
	cursor: pointer;
	font-family: inherit;
}

.wsc-nl-btn:hover { background: var(--wsc-primary-dark); }
.wsc-nl-btn[disabled] { opacity: 0.7; cursor: default; }

.wsc-nl-msg {
	margin: 10px 0 0;
	font-size: 13.5px;
	display: none;
}

.wsc-nl-msg.show { display: block; }
.wsc-nl-msg.ok { color: var(--wsc-primary); }
.wsc-nl-msg.err { color: #cc2b2b; }

/* ---------- Modal responsive ---------- */

@media (max-width: 680px) {
	.wsc-modal { padding: 20px 12px; }
	.wsc-modal-box { padding: 22px 16px; }
	.wsc-modal-top { flex-direction: column; gap: 14px; }
	.wsc-modal-logo { width: 92px; height: 92px; }
	.wsc-modal-title { font-size: 19px; }
	.wsc-nl-top { flex-direction: column; text-align: center; gap: 10px; }
	.wsc-nl-icon { width: 70px; }
	.wsc-nl-form { flex-direction: column; border: 0; gap: 10px; }
	.wsc-nl-input { border: 1px solid #dcdce0; border-radius: 3px; height: 48px; }
	.wsc-nl-btn { width: 100%; height: 48px; border-radius: 3px; }
}
