/* ==========================================================
   MVMP Multi-Vendor Marketplace — Frontend Styles
   UI Design: Clean, card-based, mobile-first, accessible
   ========================================================== */

:root {
	--mvmp-primary:      #6c47ff;
	--mvmp-primary-dark: #5538e0;
	--mvmp-primary-light:#f0edff;
	--mvmp-accent:       #ff6b35;
	--mvmp-success:      #27ae60;
	--mvmp-bg:           #f8f9fb;
	--mvmp-card:         #ffffff;
	--mvmp-border:       #e8edf5;
	--mvmp-text:         #1a202c;
	--mvmp-text-muted:   #64748b;
	--mvmp-text-light:   #94a3b8;
	--mvmp-radius-sm:    6px;
	--mvmp-radius:       12px;
	--mvmp-radius-lg:    16px;
	--mvmp-shadow:       0 1px 3px rgba(0,0,0,.07), 0 2px 8px rgba(0,0,0,.05);
	--mvmp-shadow-hover: 0 4px 16px rgba(108,71,255,.15), 0 2px 8px rgba(0,0,0,.08);
	--mvmp-transition:   all .2s cubic-bezier(.4,0,.2,1);
}

/* --------------------------------------------------------
   Block wrapper
   -------------------------------------------------------- */
.mvmp-stores-block {
	font-family: inherit;
	color: var(--mvmp-text);
}

.mvmp-block-title {
	font-size: 1.6rem;
	font-weight: 700;
	margin: 0 0 20px;
	color: var(--mvmp-text);
}

/* --------------------------------------------------------
   Country Switcher
   -------------------------------------------------------- */
.mvmp-country-switcher {
	position: relative;
	margin-bottom: 20px;
}

.mvmp-current-country {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}

.mvmp-geo-badge {
	font-size: .72rem;
	background: var(--mvmp-primary-light);
	color: var(--mvmp-primary);
	padding: 2px 8px;
	border-radius: 20px;
	font-weight: 600;
}

.mvmp-country-dropdown {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	z-index: 100;
	background: var(--mvmp-card);
	border: 1px solid var(--mvmp-border);
	border-radius: var(--mvmp-radius);
	box-shadow: 0 8px 32px rgba(0,0,0,.15);
	width: 280px;
	max-height: 360px;
	display: flex;
	flex-direction: column;
	overflow: hidden;
}

.mvmp-country-search {
	border: none;
	border-bottom: 1px solid var(--mvmp-border);
	padding: 12px 16px;
	font-size: .9rem;
	outline: none;
	width: 100%;
	box-sizing: border-box;
}

.mvmp-country-list {
	list-style: none;
	margin: 0;
	padding: 6px 0;
	overflow-y: auto;
	flex: 1;
}

.mvmp-country-item {
	padding: 9px 16px;
	cursor: pointer;
	font-size: .88rem;
	transition: background .1s;
}
.mvmp-country-item:hover           { background: var(--mvmp-primary-light); }
.mvmp-country-item--active         { background: var(--mvmp-primary); color: #fff; }
.mvmp-country-item--active:hover   { background: var(--mvmp-primary-dark); }

/* --------------------------------------------------------
   Filters
   -------------------------------------------------------- */
.mvmp-filters {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
	margin-bottom: 20px;
	padding: 16px;
	background: var(--mvmp-bg);
	border: 1px solid var(--mvmp-border);
	border-radius: var(--mvmp-radius);
}

.mvmp-filter-group {
	display: flex;
	flex-direction: column;
	gap: 5px;
	flex: 1;
	min-width: 160px;
}

.mvmp-filter-group label {
	font-size: .78rem;
	font-weight: 600;
	color: var(--mvmp-text-muted);
	text-transform: uppercase;
	letter-spacing: .05em;
}

.mvmp-filter-group select,
.mvmp-filter-group input[type="text"] {
	padding: 8px 12px;
	border: 1px solid var(--mvmp-border);
	border-radius: var(--mvmp-radius-sm);
	font-size: .9rem;
	background: var(--mvmp-card);
	color: var(--mvmp-text);
	transition: var(--mvmp-transition);
	outline: none;
}

.mvmp-filter-group select:focus,
.mvmp-filter-group input:focus {
	border-color: var(--mvmp-primary);
	box-shadow: 0 0 0 3px rgba(108,71,255,.15);
}

/* --------------------------------------------------------
   Results summary
   -------------------------------------------------------- */
.mvmp-results-summary {
	font-size: .85rem;
	color: var(--mvmp-text-muted);
	margin: 0 0 16px;
}

/* --------------------------------------------------------
   Stores grid
   -------------------------------------------------------- */
.mvmp-stores-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 20px;
	margin-bottom: 28px;
}

/* --------------------------------------------------------
   Store Card
   -------------------------------------------------------- */
.mvmp-store-card {
	background: var(--mvmp-card);
	border: 1px solid var(--mvmp-border);
	border-radius: var(--mvmp-radius);
	overflow: hidden;
	box-shadow: var(--mvmp-shadow);
	transition: var(--mvmp-transition);
	display: flex;
	flex-direction: column;
}

.mvmp-store-card:hover {
	box-shadow: var(--mvmp-shadow-hover);
	transform: translateY(-3px);
	border-color: var(--mvmp-primary);
}

.mvmp-store-logo {
	aspect-ratio: 16/7;
	overflow: hidden;
	background: var(--mvmp-bg);
	display: flex;
	align-items: center;
	justify-content: center;
}

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

.mvmp-store-info {
	padding: 16px;
	flex: 1;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.mvmp-store-name {
	margin: 0;
	font-size: 1.05rem;
	font-weight: 700;
	color: var(--mvmp-text);
	line-height: 1.3;
}

.mvmp-store-location {
	margin: 0;
	font-size: .82rem;
	color: var(--mvmp-text-muted);
	line-height: 1.5;
}

.mvmp-store-price {
	margin: 0;
	display: flex;
	align-items: baseline;
	gap: 6px;
}

.mvmp-price-label {
	font-size: .78rem;
	color: var(--mvmp-text-muted);
}

.mvmp-price-value {
	font-size: 1.15rem;
	font-weight: 700;
	color: var(--mvmp-primary);
}
.mvmp-price-value .woocommerce-Price-amount { color: var(--mvmp-primary); }

/* --------------------------------------------------------
   Buttons
   -------------------------------------------------------- */
.mvmp-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 9px 18px;
	border-radius: var(--mvmp-radius-sm);
	font-size: .88rem;
	font-weight: 600;
	text-decoration: none;
	border: none;
	cursor: pointer;
	transition: var(--mvmp-transition);
	white-space: nowrap;
}

.mvmp-btn--primary {
	background: var(--mvmp-primary);
	color: #fff;
	margin-top: auto;
}
.mvmp-btn--primary:hover { background: var(--mvmp-primary-dark); color: #fff; transform: none; }

.mvmp-btn--ghost {
	background: transparent;
	color: var(--mvmp-primary);
	border: 1px solid var(--mvmp-primary);
}
.mvmp-btn--ghost:hover { background: var(--mvmp-primary-light); }

.mvmp-btn--sm { padding: 5px 12px; font-size: .8rem; }

/* --------------------------------------------------------
   Loading
   -------------------------------------------------------- */
.mvmp-loading {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 40px;
	justify-content: center;
	color: var(--mvmp-text-muted);
}

.mvmp-spinner,
.mvmp-loading-spinner .mvmp-spinner {
	width: 24px;
	height: 24px;
	border: 3px solid var(--mvmp-primary-light);
	border-top-color: var(--mvmp-primary);
	border-radius: 50%;
	animation: mvmp-spin .7s linear infinite;
	display: inline-block;
}

.mvmp-loading-spinner {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 20px;
	color: var(--mvmp-text-muted);
	font-size: .9rem;
}

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

/* --------------------------------------------------------
   Empty state
   -------------------------------------------------------- */
.mvmp-empty-state {
	text-align: center;
	padding: 60px 20px;
	color: var(--mvmp-text-muted);
}
.mvmp-empty-icon { font-size: 3rem; margin-bottom: 12px; }
.mvmp-empty-state p { font-size: 1rem; margin: 0; }

/* --------------------------------------------------------
   Error
   -------------------------------------------------------- */
.mvmp-error {
	background: #fff5f5;
	border: 1px solid #fc8181;
	color: #c53030;
	padding: 12px 16px;
	border-radius: var(--mvmp-radius-sm);
	margin-bottom: 16px;
	font-size: .9rem;
}

/* --------------------------------------------------------
   Pagination
   -------------------------------------------------------- */
.mvmp-pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	flex-wrap: wrap;
}

.mvmp-page-btn {
	min-width: 36px;
	height: 36px;
	padding: 0 10px;
	border: 1px solid var(--mvmp-border);
	border-radius: var(--mvmp-radius-sm);
	background: var(--mvmp-card);
	color: var(--mvmp-text);
	font-size: .88rem;
	cursor: pointer;
	transition: var(--mvmp-transition);
}
.mvmp-page-btn:hover:not(:disabled) {
	background: var(--mvmp-primary-light);
	border-color: var(--mvmp-primary);
	color: var(--mvmp-primary);
}
.mvmp-page-btn--active {
	background: var(--mvmp-primary);
	border-color: var(--mvmp-primary);
	color: #fff;
}
.mvmp-page-btn:disabled { opacity: .4; cursor: default; }
.mvmp-page-ellipsis { padding: 0 4px; color: var(--mvmp-text-muted); }

/* --------------------------------------------------------
   Single Store Page
   -------------------------------------------------------- */
.mvmp-store-single { max-width: 900px; margin: 0 auto; padding: 0 16px; }

.mvmp-store-hero {
	display: grid;
	grid-template-columns: 200px 1fr;
	gap: 24px;
	align-items: start;
	margin-bottom: 32px;
	padding: 28px;
	background: var(--mvmp-card);
	border: 1px solid var(--mvmp-border);
	border-radius: var(--mvmp-radius-lg);
	box-shadow: var(--mvmp-shadow);
}

.mvmp-store-hero-logo { border-radius: var(--mvmp-radius); overflow: hidden; }
.mvmp-store-hero-logo img { width: 100%; height: auto; display: block; }
.mvmp-store-hero-logo.mvmp-no-logo {
	width: 100%;
	aspect-ratio: 1;
	background: var(--mvmp-primary-light);
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 3rem;
}

.mvmp-store-hero-info h1 { margin: 0 0 8px; font-size: 1.8rem; }
.mvmp-store-meta { list-style: none; margin: 12px 0 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.mvmp-store-meta li { display: flex; align-items: center; gap: 8px; font-size: .9rem; color: var(--mvmp-text-muted); }
.mvmp-store-meta a { color: var(--mvmp-primary); text-decoration: none; }
.mvmp-store-meta a:hover { text-decoration: underline; }

.mvmp-store-products-section h2 { font-size: 1.3rem; margin-bottom: 16px; }

.mvmp-store-products-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 16px;
}

.mvmp-store-product-card {
	background: var(--mvmp-card);
	border: 1px solid var(--mvmp-border);
	border-radius: var(--mvmp-radius);
	padding: 16px;
	text-align: center;
	box-shadow: var(--mvmp-shadow);
}

.mvmp-store-product-card img { max-width: 100%; height: 140px; object-fit: contain; margin-bottom: 10px; }
.mvmp-store-product-name { font-weight: 600; font-size: .9rem; margin-bottom: 6px; }
.mvmp-store-product-price { font-size: 1.1rem; font-weight: 700; color: var(--mvmp-primary); margin-bottom: 12px; }
.mvmp-store-product-price .woocommerce-Price-amount { color: var(--mvmp-primary); }

/* Editor preview */
.mvmp-editor-wrapper { pointer-events: none; }
.mvmp-block-placeholder {
	background: var(--mvmp-primary-light);
	border: 2px dashed var(--mvmp-primary);
	border-radius: var(--mvmp-radius);
	padding: 40px;
	text-align: center;
	color: var(--mvmp-primary);
}
.mvmp-block-placeholder .dashicons { font-size: 3rem; width: auto; height: auto; }

/* --------------------------------------------------------
   Responsive
   -------------------------------------------------------- */
@media ( max-width: 640px ) {
	.mvmp-stores-grid { grid-template-columns: 1fr; }
	.mvmp-store-hero { grid-template-columns: 1fr; }
	.mvmp-store-hero-logo { max-width: 140px; }
	.mvmp-filters { flex-direction: column; }
	.mvmp-country-dropdown { width: 100%; position: fixed; bottom: 0; left: 0; border-radius: var(--mvmp-radius) var(--mvmp-radius) 0 0; max-height: 60vh; }
}
