/**
 * Comrades Core – Public Stylesheet
 *
 * Styles for the public-facing marketplace pages including listing
 * badges, offer modals, dashboard components, and status indicators.
 *
 * @package ComradesCore
 * @since   1.0.0
 */

/* ───────────────────────────────────────────────────────────────
   Variables (mirrors admin.css for consistency)
   ─────────────────────────────────────────────────────────────── */
:root {
	--comrades-success: #10B981;
	--comrades-warning: #F59E0B;
	--comrades-danger: #EF4444;
	--comrades-info: #3B82F6;
	--comrades-muted: #6B7280;
	--comrades-light: #F3F4F6;
	--comrades-dark: #111111;
	--comrades-border: #E5E7EB;
	--comrades-radius: 8px;
	--comrades-radius-lg: 12px;
	--comrades-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
	--comrades-shadow-hover: 0 8px 24px rgba(0, 0, 0, 0.12);
	--comrades-transition: all 0.3s ease;
}

/* ───────────────────────────────────────────────────────────────
   Verification Badge
   ─────────────────────────────────────────────────────────────── */
.comrades-verified-badge {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 4px 10px;
	border-radius: 20px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1;
	color: #fff;
	background: var(--comrades-success);
}

.comrades-verified-badge::before {
	content: "✓";
	font-weight: 700;
}

/* ───────────────────────────────────────────────────────────────
   Product Action Buttons
   ─────────────────────────────────────────────────────────────── */
.comrades-product-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin: 20px 0;
}

.comrades-loop-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 8px;
}

.comrades-buy-now-btn {
	flex: 1;
	min-width: 140px;
	text-align: center;
}

.comrades-make-offer-btn {
	flex: 1;
	min-width: 140px;
	text-align: center;
}

.comrades-make-offer-btn:hover {
	transform: translateY(-1px);
	box-shadow: var(--comrades-shadow-hover);
}

.comrades-make-offer-btn:active {
	transform: translateY(0);
}

.comrades-make-offer-btn:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	transform: none;
}

/* ───────────────────────────────────────────────────────────────
   Offer Modal Overlay
   ─────────────────────────────────────────────────────────────── */
.comrades-modal-overlay {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	background: rgba(0, 0, 0, 0.5);
	z-index: 99999;
	display: none;
	align-items: center;
	justify-content: center;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.comrades-modal-overlay.is-active {
	display: flex;
	opacity: 1;
}

.comrades-modal {
	background: #fff;
	border-radius: var(--comrades-radius-lg);
	box-shadow: 0 20px 60px rgba(0, 0, 0, 0.2);
	width: 90%;
	max-width: 480px;
	max-height: 90vh;
	overflow-y: auto;
	transform: translateY(20px);
	transition: transform 0.3s ease;
}

.comrades-modal-overlay.is-active .comrades-modal {
	transform: translateY(0);
}

.comrades-modal__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px 24px;
	border-bottom: 1px solid var(--comrades-border);
}

.comrades-modal__title {
	font-size: 20px;
	font-weight: 700;
	color: var(--comrades-dark);
	margin: 0;
}

.comrades-modal__close {
	background: none;
	border: none;
	font-size: 24px;
	cursor: pointer;
	color: var(--comrades-muted);
	padding: 0;
	line-height: 1;
	transition: var(--comrades-transition);
}

.comrades-modal__close:hover {
	color: var(--comrades-danger);
}

.comrades-modal__body {
	padding: 24px;
}

.comrades-modal__footer {
	padding: 16px 24px;
	border-top: 1px solid var(--comrades-border);
	display: flex;
	gap: 12px;
	justify-content: flex-end;
}

/* ───────────────────────────────────────────────────────────────
   Form Elements
   ─────────────────────────────────────────────────────────────── */
.comrades-form-group {
	margin-bottom: 20px;
}

.comrades-form-group:last-child {
	margin-bottom: 0;
}

.comrades-form-label {
	display: block;
	font-size: 14px;
	font-weight: 600;
	color: var(--comrades-dark);
	margin-bottom: 6px;
}

.comrades-form-input,
.comrades-form-textarea {
	width: 100%;
	padding: 10px 14px;
	border: 1px solid var(--comrades-border);
	border-radius: var(--comrades-radius);
	font-size: 14px;
	font-family: inherit;
	color: var(--comrades-dark);
	transition: var(--comrades-transition);
	box-sizing: border-box;
}

.comrades-form-input:focus,
.comrades-form-textarea:focus {
	border-color: var(--comrades-info);
	box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
	outline: none;
}

.comrades-form-textarea {
	resize: vertical;
	min-height: 80px;
}

/* ───────────────────────────────────────────────────────────────
   Listing Meta Info
   ─────────────────────────────────────────────────────────────── */
.comrades-listing-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin: 16px 0;
}

.comrades-listing-meta__item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 13px;
	color: var(--comrades-muted);
	background: var(--comrades-light);
	padding: 6px 12px;
	border-radius: 20px;
}

.comrades-listing-meta__item strong {
	color: var(--comrades-dark);
}

/* ───────────────────────────────────────────────────────────────
   Status Badges (Public)
   ─────────────────────────────────────────────────────────────── */
.comrades-status-badge {
	display: inline-block;
	padding: 4px 12px;
	border-radius: 20px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.4;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.comrades-status--success { background: rgba(40, 167, 69, 0.12); color: var(--comrades-success); }
.comrades-status--warning { background: rgba(255, 193, 7, 0.15); color: #856404; }
.comrades-status--danger  { background: rgba(220, 53, 69, 0.12); color: var(--comrades-danger); }
.comrades-status--info    { background: rgba(23, 162, 184, 0.12); color: var(--comrades-info); }
.comrades-status--muted   { background: rgba(108, 117, 125, 0.12); color: var(--comrades-muted); }
.comrades-status--primary { background: rgba(45, 95, 45, 0.12); color: var(--comrades-primary); }

/* ───────────────────────────────────────────────────────────────
   Login Notice
   ─────────────────────────────────────────────────────────────── */
.comrades-login-notice {
	background: var(--comrades-light);
	border: 1px solid var(--comrades-border);
	border-radius: var(--comrades-radius);
	padding: 24px;
	text-align: center;
	max-width: 400px;
	margin: 40px auto;
}

.comrades-login-notice a {
	color: var(--comrades-primary);
	font-weight: 600;
	text-decoration: none;
}

.comrades-login-notice a:hover {
	text-decoration: underline;
}

/* ───────────────────────────────────────────────────────────────
   Negotiable Tag
   ─────────────────────────────────────────────────────────────── */
.comrades-negotiable-tag {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 4px 10px;
	border-radius: 20px;
	font-size: 12px;
	font-weight: 600;
	background: rgba(240, 165, 0, 0.12);
	color: #b37800;
}

/* ───────────────────────────────────────────────────────────────
   Modal Submit Button
   ─────────────────────────────────────────────────────────────── */
.comrades-offer-submit {
	min-width: 140px;
}

/* ───────────────────────────────────────────────────────────────
   Toast Notifications
   ─────────────────────────────────────────────────────────────── */
#comrades-toast-container {
	position: fixed;
	bottom: 24px;
	right: 24px;
	z-index: 100000;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.comrades-toast {
	padding: 12px 20px;
	border-radius: var(--comrades-radius);
	font-size: 14px;
	font-weight: 500;
	color: #fff;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	animation: comrades-toast-in 0.3s ease;
	max-width: 360px;
}

.comrades-toast--success { background: var(--comrades-success); }
.comrades-toast--error   { background: var(--comrades-danger); }
.comrades-toast--warning { background: var(--comrades-warning); color: #1a1a1a; }
.comrades-toast--info    { background: var(--comrades-info); }

@keyframes comrades-toast-in {
	from { opacity: 0; transform: translateY(12px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* ───────────────────────────────────────────────────────────────
   Responsive
   ─────────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
	.comrades-modal {
		width: 95%;
		margin: 16px;
	}

	.comrades-make-offer-btn {
		max-width: 100%;
		padding: 12px 24px;
		font-size: 15px;
	}

	.comrades-listing-meta {
		flex-direction: column;
		gap: 8px;
	}
}
