/* ==========================================================================
   Estonian Price Checker — front-end styles
   ========================================================================== */

/* Widget container */
.epc-widget {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	max-width: 760px;
	margin: 1.5rem 0;
	padding: 1.5rem;
	border: 1px solid #d1d5db;
	border-radius: 10px;
	background: #ffffff;
	box-shadow: 0 1px 4px rgba(0,0,0,.06);
}

.epc-widget__title {
	margin: 0 0 1rem;
	font-size: 1.25rem;
	font-weight: 700;
	color: #111827;
}

/* Input row */
.epc-widget__input-row {
	display: flex;
	gap: .5rem;
	flex-wrap: wrap;
}

.epc-widget__input {
	flex: 1 1 220px;
	padding: .6rem .9rem;
	font-size: 1rem;
	border: 1px solid #9ca3af;
	border-radius: 6px;
	outline: none;
	transition: border-color .15s;
}

.epc-widget__input:focus {
	border-color: #2563eb;
	box-shadow: 0 0 0 3px rgba(37,99,235,.15);
}

.epc-widget__button {
	display: inline-flex;
	align-items: center;
	gap: .4rem;
	padding: .6rem 1.2rem;
	font-size: 1rem;
	font-weight: 600;
	color: #ffffff;
	background: #2563eb;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	transition: background .15s;
	white-space: nowrap;
}

.epc-widget__button:hover:not(:disabled) {
	background: #1d4ed8;
}

.epc-widget__button:disabled {
	opacity: .6;
	cursor: not-allowed;
}

/* Spinner */
.epc-widget__spinner {
	display: none;
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255,255,255,.4);
	border-top-color: #ffffff;
	border-radius: 50%;
	animation: epc-spin .7s linear infinite;
}

.epc-widget--loading .epc-widget__spinner {
	display: inline-block;
}

@keyframes epc-spin {
	to { transform: rotate(360deg); }
}

/* Store list */
.epc-widget__stores-label {
	margin: .75rem 0 0;
	font-size: .8rem;
	color: #6b7280;
}

.epc-widget__stores {
	font-style: italic;
}

/* Status bar */
.epc-widget__status {
	display: none;
	margin-top: .9rem;
	padding: .55rem .9rem;
	border-radius: 6px;
	font-size: .9rem;
}

.epc-widget__status--info {
	display: block;
	background: #eff6ff;
	color: #1e40af;
	border: 1px solid #bfdbfe;
}

.epc-widget__status--warning {
	display: block;
	background: #fffbeb;
	color: #92400e;
	border: 1px solid #fcd34d;
}

.epc-widget__status--error {
	display: block;
	background: #fef2f2;
	color: #991b1b;
	border: 1px solid #fca5a5;
}

/* Results area */
.epc-widget__results {
	margin-top: 1rem;
}

/* Headings inside results */
.epc-widget__results .epc-heading {
	margin: 0 0 .75rem;
	font-size: 1.1rem;
	font-weight: 700;
	color: #111827;
}

.epc-widget__results .epc-subheading {
	margin: .5rem 0;
	font-size: 1rem;
	font-weight: 600;
	color: #374151;
}

/* Table */
.epc-table-wrap {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.epc-table {
	width: 100%;
	border-collapse: collapse;
	font-size: .9rem;
	color: #111827 !important;
}

.epc-table th,
.epc-table td {
	padding: .55rem .75rem;
	border: 1px solid #e5e7eb;
	text-align: left;
	vertical-align: top;
	color: #111827 !important;
}

.epc-table thead th {
	background: #f3f4f6 !important;
	font-weight: 600;
	color: #111827 !important;
}

.epc-table tbody tr {
	background: #ffffff !important;
}

.epc-table tbody tr:nth-child(even) {
	background: #f9fafb !important;
}

.epc-table tbody tr:hover {
	background: #eff6ff !important;
}

.epc-table a {
	color: #2563eb !important;
	text-decoration: underline;
}

/* Paragraphs in results */
.epc-widget__results .epc-para {
	margin: .5rem 0;
	color: #111827 !important;
	line-height: 1.55;
}

.epc-widget__results .epc-heading {
	color: #111827 !important;
}

.epc-widget__results .epc-subheading {
	color: #374151 !important;
}

.epc-widget__results strong,
.epc-widget__results em,
.epc-widget__results p,
.epc-widget__results span {
	color: #111827 !important;
}

/* Cache note */
.epc-cache-note {
	margin: .5rem 0 0;
	font-size: .75rem;
	color: #6b7280;
}

/* Responsive */
@media (max-width: 480px) {
	.epc-widget {
		padding: 1rem;
	}

	.epc-widget__input-row {
		flex-direction: column;
	}

	.epc-widget__button {
		width: 100%;
		justify-content: center;
	}
}

/* Guest search counter notice */
.epc-widget__guest-notice {
	margin: .6rem 0 0;
	font-size: .82rem;
	color: #6b7280;
}

.epc-widget__guest-notice a {
	color: #2563eb;
	text-decoration: underline;
}

.epc-widget__guest-notice--empty strong {
	color: #dc2626;
}

/* Login link inside error status */
.epc-login-link {
	font-weight: 600;
	color: inherit;
	text-decoration: underline;
	margin-left: .3rem;
}

/* Cap hit status */
.epc-widget__status--cap {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: .6rem;
	background: #f0fdf4;
	color: #166534;
	border: 1px solid #bbf7d0;
}

.epc-cap-message {
	flex: 1 1 auto;
}

/* Google login button */
.epc-login-btn {
	display: inline-flex;
	align-items: center;
	padding: .45rem 1rem;
	background: #ffffff;
	color: #3c4043 !important;
	border: 1px solid #dadce0;
	border-radius: 4px;
	font-size: .875rem;
	font-weight: 500;
	text-decoration: none !important;
	white-space: nowrap;
	box-shadow: 0 1px 3px rgba(0,0,0,.08);
	transition: box-shadow .15s, background .15s;
}

.epc-login-btn:hover {
	background: #f8f9fa;
	box-shadow: 0 2px 6px rgba(0,0,0,.12);
	text-decoration: none !important;
}

/* ==========================================================================
   Wholesale widget extras
   ========================================================================== */

.epc-widget--wholesale {
	border-color: #1e3a5f;
	background: #f8faff;
}

.epc-widget__button--wholesale {
	background: #1e3a5f;
}

.epc-widget__button--wholesale:hover:not(:disabled) {
	background: #16304f;
}

/* Member badge */
.epc-widget__member-badge {
	display: inline-block;
	margin-left: .5rem;
	padding: .15rem .5rem;
	font-size: .7rem;
	font-weight: 700;
	letter-spacing: .04em;
	text-transform: uppercase;
	color: #fff;
	background: #1e3a5f;
	border-radius: 3px;
	vertical-align: middle;
}

.epc-widget__member-badge--locked {
	background: #6b7280;
}

/* Locked / upsell state */
.epc-widget--locked {
	opacity: .95;
}

.epc-locked-box {
	margin-top: 1rem;
	padding: 1.5rem;
	text-align: center;
	background: #f3f4f6;
	border: 1px dashed #9ca3af;
	border-radius: 8px;
}

.epc-locked-box__icon {
	font-size: 2rem;
	margin-bottom: .5rem;
}

.epc-locked-box__message {
	margin: 0 0 1rem;
	color: #374151;
	font-size: .95rem;
}

.epc-locked-box__actions {
	display: flex;
	gap: .75rem;
	justify-content: center;
	flex-wrap: wrap;
}

.epc-btn {
	display: inline-block;
	padding: .55rem 1.2rem;
	border-radius: 6px;
	font-size: .9rem;
	font-weight: 600;
	text-decoration: none;
	transition: opacity .15s;
}

.epc-btn:hover { opacity: .85; text-decoration: none; }

.epc-btn--primary {
	background: #2563eb;
	color: #fff !important;
}

.epc-btn--secondary {
	background: #1e3a5f;
	color: #fff !important;
}

/* ==========================================================================
   Construction estimator widget
   ========================================================================== */

.epc-widget--construction {
	border-color: #065f46;
	background: #f0fdf4;
}

.epc-widget--construction .epc-widget__title {
	color: #064e3b;
}

.epc-construction__description {
	margin-bottom: 1rem;
	font-size: .9rem;
	color: #374151 !important;
}

.epc-construction__stores-label {
	font-size: .8rem;
	color: #6b7280 !important;
	margin: .25rem 0 0;
}

.epc-construction__input {
	width: 100%;
	padding: .7rem .9rem;
	font-size: .95rem;
	border: 1px solid #9ca3af;
	border-radius: 6px;
	resize: vertical;
	outline: none;
	font-family: inherit;
	transition: border-color .15s;
	box-sizing: border-box;
}

.epc-construction__input:focus {
	border-color: #059669;
	box-shadow: 0 0 0 3px rgba(5,150,105,.15);
}

.epc-construction__actions {
	margin-top: .6rem;
}

.epc-widget__button--construction {
	background: #059669;
}

.epc-widget__button--construction:hover:not(:disabled) {
	background: #047857;
}

.epc-widget__button--secondary {
	background: #374151;
	display: inline-flex;
	align-items: center;
	gap: .4rem;
	padding: .5rem 1.1rem;
	font-size: .9rem;
	font-weight: 600;
	color: #fff;
	border: none;
	border-radius: 6px;
	cursor: pointer;
	transition: background .15s;
	margin-top: .75rem;
}

.epc-widget__button--secondary:hover:not(:disabled) {
	background: #1f2937;
}

/* Bill of materials */
.epc-construction__bom {
	margin-top: 1.25rem;
}

.epc-construction__bom h3 {
	margin: 0 0 .6rem;
	font-size: 1rem;
	font-weight: 700;
	color: #065f46 !important;
}

.epc-construction__bom-table td,
.epc-construction__bom-table th {
	color: #111827 !important;
}

.epc-construction__guest-notice {
	margin: .6rem 0 0;
	font-size: .82rem;
	color: #6b7280 !important;
}

.epc-construction__guest-notice a,
.epc-construction__login-notice a {
	color: #059669 !important;
	font-weight: 600;
	text-decoration: underline;
}

.epc-construction__login-notice {
	margin-top: .75rem;
	font-size: .875rem;
}

/* Warning blockquote */
.epc-construction__warning {
	margin: .75rem 0 0;
	padding: .5rem .9rem;
	border-left: 3px solid #f59e0b;
	background: #fffbeb;
	color: #92400e !important;
	font-size: .85rem;
	border-radius: 0 4px 4px 0;
}
