/* =====================================================
   Elk Grove Coupons — Public Styles v2
   Magazine / direct-mail coupon aesthetic
   ===================================================== */

/* ── Grid ── */
.egc-grid {
	display: grid;
	gap: 28px;
	margin: 0;
	padding: 0;
}

.egc-grid.egc-cols-1 { grid-template-columns: 1fr; }
.egc-grid.egc-cols-2 { grid-template-columns: repeat(2, 1fr); }
.egc-grid.egc-cols-3 { grid-template-columns: repeat(3, 1fr); }
.egc-grid.egc-cols-4 { grid-template-columns: repeat(4, 1fr); }

/* ── Placement sizes ── */
.egc-size-large   { grid-column: span 2; }
.egc-size-premium { grid-column: 1 / -1; }

/* ── Card shell — dashed coupon border ── */
.egc-card {
	background: #fff;
	border: 2px dashed #b0b8c4;
	border-radius: 10px;
	overflow: visible;
	display: flex;
	flex-direction: column;
	position: relative;
	box-shadow: 0 3px 12px rgba(0, 0, 0, 0.07);
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.egc-card:hover {
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
	transform: translateY(-2px);
}

.egc-card.egc-expired {
	opacity: 0.6;
	filter: grayscale(50%);
}

.egc-card.egc-featured-card {
	border-color: #c0392b;
	border-width: 2px;
}

/* ── Clip bar (top of card) ── */
.egc-clip-bar {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 5px 14px;
	background: #f8fafc;
	border-bottom: 1px dashed #b0b8c4;
	border-radius: 8px 8px 0 0;
}

.egc-scissors {
	font-size: 16px;
	color: #9ca3af;
	flex-shrink: 0;
	transform: rotate(-90deg);
	display: inline-block;
}

.egc-dash-line {
	flex: 1;
	height: 1px;
	background: repeating-linear-gradient(to right, #b0b8c4 0, #b0b8c4 6px, transparent 6px, transparent 12px);
}

.egc-featured-badge {
	font-size: 10px;
	font-weight: 800;
	color: #c0392b;
	text-transform: uppercase;
	letter-spacing: 0.1em;
	background: #fff0ee;
	border: 1px solid #c0392b;
	padding: 2px 8px;
	border-radius: 20px;
	flex-shrink: 0;
}

/* ── Card inner ── */
.egc-card-inner {
	padding: 16px 18px 14px;
	display: flex;
	flex-direction: column;
	gap: 12px;
	flex: 1;
}

/* ── Header ── */
.egc-card-header {
	display: flex;
	align-items: flex-start;
	gap: 12px;
}

.egc-logo-wrap {
	flex-shrink: 0;
	width: 58px;
	height: 58px;
	border: 1px solid #e5e7eb;
	border-radius: 8px;
	overflow: hidden;
	background: #f9fafb;
	display: flex;
	align-items: center;
	justify-content: center;
}

.egc-logo {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.egc-header-text {
	flex: 1;
	min-width: 0;
}

.egc-cat-badge {
	display: inline-block;
	background: #dbeafe;
	color: #1e40af;
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	padding: 2px 7px;
	border-radius: 20px;
	margin-bottom: 3px;
}

.egc-business-name {
	margin: 0 0 2px;
	font-size: 15px;
	font-weight: 800;
	color: #111827;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.egc-address {
	margin: 0;
	font-size: 12px;
	color: #6b7280;
}

/* ── Ad image ── */
.egc-ad-image {
	margin: 0 -18px;
	overflow: hidden;
	max-height: 220px;
}

.egc-ad-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* ── Offer ── */
.egc-offer {
	text-align: center;
	padding: 4px 0;
}

.egc-headline {
	margin: 0 0 6px;
	font-size: 26px;
	font-weight: 900;
	color: #c0392b;
	line-height: 1.15;
	text-transform: uppercase;
	letter-spacing: -0.01em;
}

.egc-size-large .egc-headline,
.egc-size-premium .egc-headline {
	font-size: 36px;
}

.egc-subheadline {
	margin: 0 0 6px;
	font-size: 16px;
	font-weight: 600;
	color: #374151;
}

.egc-details {
	margin: 0;
	font-size: 13px;
	color: #4b5563;
	line-height: 1.6;
}

/* ── Optional coupon code box ── */
.egc-code-box {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	background: #fef9c3;
	border: 2px dashed #d97706;
	border-radius: 6px;
	padding: 8px 16px;
}

.egc-code-label {
	font-size: 11px;
	font-weight: 700;
	color: #92400e;
	text-transform: uppercase;
}

.egc-code-value {
	font-size: 18px;
	font-weight: 900;
	color: #92400e;
	letter-spacing: 0.12em;
	font-family: monospace;
}

/* ── Footer info ── */
.egc-footer-info {
	border-top: 1px dashed #d1d5db;
	padding-top: 8px;
}

.egc-fine-print {
	font-size: 11px;
	color: #9ca3af;
	line-height: 1.5;
	margin: 0 0 6px;
}

.egc-meta-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	flex-wrap: wrap;
	gap: 6px;
}

.egc-expiry {
	font-size: 12px;
	color: #6b7280;
	font-style: italic;
}

.egc-expired-label {
	color: #c0392b;
	font-style: normal;
	font-weight: 700;
}

.egc-phone-link {
	font-size: 13px;
	color: #2271b1;
	text-decoration: none;
	font-weight: 600;
	transition: color 0.15s;
}
.egc-phone-link:hover { color: #0a4b78; }

/* ── QR block ── */
.egc-qr-block {
	text-align: center;
	padding: 4px 0;
}

.egc-qr-link {
	display: inline-block;
	border: 1px solid #e5e7eb;
	border-radius: 6px;
	padding: 4px;
	background: #fff;
	transition: border-color 0.15s;
}
.egc-qr-link:hover { border-color: #2271b1; }
.egc-qr-link img {
	width: 80px;
	height: 80px;
	object-fit: contain;
	display: block;
}
.egc-qr-block p {
	margin: 4px 0 0;
	font-size: 11px;
	color: #9ca3af;
}

/* ── Action buttons ── */
.egc-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	padding-top: 4px;
	border-top: 1px dashed #d1d5db;
}

.egc-btn {
	flex: 1;
	min-width: 70px;
	padding: 8px 10px;
	font-size: 12px;
	font-weight: 700;
	border: 1.5px solid #d1d5db;
	border-radius: 6px;
	background: #fff;
	color: #374151;
	cursor: pointer;
	text-align: center;
	text-decoration: none;
	transition: all 0.15s ease;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
}

.egc-btn:hover { background: #f3f4f6; border-color: #9ca3af; }

.egc-btn-print:hover  { background: #eff6ff; border-color: #3b82f6; color: #1d4ed8; }
.egc-btn-email:hover  { background: #f0fdf4; border-color: #22c55e; color: #15803d; }
.egc-btn-text:hover   { background: #fefce8; border-color: #eab308; color: #854d0e; }
.egc-btn-save:hover   { background: #fdf4ff; border-color: #a855f7; color: #7e22ce; }
.egc-btn-website:hover { background: #f0fdfa; border-color: #14b8a6; color: #0f766e; }

.egc-btn-save.egc-saved {
	background: #f0fdf4;
	border-color: #22c55e;
	color: #15803d;
}

/* ── No coupons ── */
.egc-no-coupons, .egc-single-wrap .egc-no-coupons {
	text-align: center;
	padding: 40px 20px;
	color: #9ca3af;
	font-size: 16px;
}

/* ============================================================
   Modals
   ============================================================ */

.egc-modal {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 999999;
	align-items: center;
	justify-content: center;
}

.egc-modal.egc-modal-open { display: flex; }

body.egc-no-scroll { overflow: hidden; }

.egc-modal-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	backdrop-filter: blur(3px);
}

.egc-modal-box {
	position: relative;
	background: #fff;
	border-radius: 14px;
	width: 90%;
	max-width: 420px;
	max-height: 90vh;
	overflow-y: auto;
	padding: 28px 26px 24px;
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.22);
	animation: egcSlideIn 0.22s ease;
}

@keyframes egcSlideIn {
	from { opacity: 0; transform: scale(0.94) translateY(10px); }
	to   { opacity: 1; transform: scale(1) translateY(0); }
}

.egc-modal-close {
	position: absolute;
	top: 14px;
	right: 16px;
	background: none;
	border: none;
	font-size: 18px;
	color: #9ca3af;
	cursor: pointer;
	padding: 4px 8px;
	border-radius: 4px;
	transition: color 0.15s, background 0.15s;
}
.egc-modal-close:hover { color: #111; background: #f3f4f6; }

.egc-modal-header { text-align: center; margin-bottom: 20px; }

.egc-modal-icon {
	display: block;
	font-size: 32px;
	margin-bottom: 8px;
}

.egc-modal-header h2 {
	margin: 0 0 6px;
	font-size: 20px;
	font-weight: 800;
	color: #111827;
}

.egc-modal-subtitle {
	margin: 0;
	font-size: 13px;
	color: #6b7280;
}

/* Honeypot — hidden from real users */
.egc-honeypot {
	position: absolute;
	left: -9999px;
	width: 1px;
	height: 1px;
	overflow: hidden;
}

.egc-form-row {
	display: flex;
	flex-direction: column;
	gap: 5px;
	margin-bottom: 14px;
}

.egc-form-row label {
	font-size: 13px;
	font-weight: 600;
	color: #374151;
}

.egc-req { color: #c0392b; }

.egc-form-row input {
	padding: 9px 12px;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	font-size: 14px;
	font-family: inherit;
	width: 100%;
	box-sizing: border-box;
	transition: border-color 0.15s;
}

.egc-form-row input:focus {
	outline: none;
	border-color: #c0392b;
	box-shadow: 0 0 0 3px rgba(192, 57, 43, 0.1);
}

.egc-form-status {
	padding: 10px 14px;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 600;
	margin-bottom: 14px;
}

.egc-status-success { background: #dcfce7; color: #15803d; border: 1px solid #86efac; }
.egc-status-error   { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }

.egc-form-submit {
	width: 100%;
	padding: 12px;
	background: #c0392b;
	color: #fff;
	font-size: 15px;
	font-weight: 700;
	border: none;
	border-radius: 7px;
	cursor: pointer;
	transition: background 0.15s;
}
.egc-form-submit:hover:not(:disabled) { background: #a93226; }
.egc-form-submit:disabled { opacity: 0.6; cursor: not-allowed; }

.egc-privacy-note {
	margin: 10px 0 0;
	font-size: 11px;
	color: #9ca3af;
	text-align: center;
	line-height: 1.4;
}

/* ============================================================
   Print overlay
   ============================================================ */

#egc-print-overlay {
	display: none;
}

/* ── Print media query ── */
@media print {
	/* Hide everything on the page except our overlay */
	body > *:not(#egc-print-overlay)      { display: none !important; }
	#egc-print-overlay                    { display: block !important; }
	.egc-modal, .egc-actions, .egc-btn    { display: none !important; }

	#egc-print-content .egc-card {
		border: 3px dashed #555 !important;
		box-shadow: none !important;
		transform: none !important;
		page-break-inside: avoid;
		max-width: 600px;
		margin: 0 auto;
	}

	#egc-print-content .egc-actions { display: none !important; }

	.egc-print-footer {
		text-align: center;
		font-size: 11px;
		color: #999;
		margin-top: 12px;
	}
}

/* ============================================================
   Responsive
   ============================================================ */

@media ( max-width: 1024px ) {
	.egc-grid.egc-cols-4,
	.egc-grid.egc-cols-3 { grid-template-columns: repeat(2, 1fr); }
	.egc-size-large       { grid-column: 1 / -1; }
}

@media ( max-width: 640px ) {
	.egc-grid.egc-cols-1,
	.egc-grid.egc-cols-2,
	.egc-grid.egc-cols-3,
	.egc-grid.egc-cols-4 { grid-template-columns: 1fr; }

	.egc-size-large,
	.egc-size-premium { grid-column: 1 / -1; }

	.egc-headline { font-size: 22px; }
	.egc-modal-box { padding: 22px 16px 20px; }

	.egc-actions { gap: 5px; }
	.egc-btn { font-size: 11px; padding: 7px 8px; }
}
