/* ==========================================================================
   MDM Frontend Styles — Healthcare theme
   ========================================================================== */

/* --- Base --- */
.mdm-wrap *,
.mdm-wrap *::before,
.mdm-wrap *::after {
	box-sizing: border-box;
}

.mdm-wrap {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, Ubuntu, sans-serif;
	color: #1a202c;
	line-height: 1.6;
	max-width: 1100px;
	margin: 0 auto;
	padding: 24px 16px;
}

/* --- Search Section --- */
.mdm-search-section {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 32px;
	margin-bottom: 32px;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.06);
}

.mdm-search-section h2 {
	margin: 0 0 20px;
	font-size: 22px;
	color: #1a202c;
}

.mdm-search-form {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

.mdm-search-form input[type="search"] {
	flex: 1 1 280px;
	padding: 11px 16px;
	border: 1px solid #cbd5e0;
	border-radius: 8px;
	font-size: 15px;
	outline: none;
	transition: border-color 0.2s;
}

.mdm-search-form input[type="search"]:focus {
	border-color: #3b82f6;
}

/* --- Buttons --- */
.mdm-btn {
	display: inline-block;
	padding: 11px 22px;
	background: #2563eb;
	color: #fff;
	border: 2px solid transparent;
	border-radius: 8px;
	font-size: 15px;
	font-weight: 600;
	cursor: pointer;
	text-decoration: none;
	transition: background 0.2s, color 0.2s;
	white-space: nowrap;
}

.mdm-btn:hover {
	background: #1d4ed8;
	color: #fff;
	text-decoration: none;
}

.mdm-btn-outline {
	background: #fff;
	color: #2563eb;
	border-color: #2563eb;
}

.mdm-btn-outline:hover {
	background: #eff6ff;
	color: #1d4ed8;
}

.mdm-btn-sm {
	padding: 7px 14px;
	font-size: 13px;
	border-radius: 6px;
}

/* --- Results Header --- */
.mdm-results-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 16px;
}

.mdm-results-header p {
	margin: 0;
	color: #64748b;
	font-size: 14px;
}

/* --- Medicine Grid --- */
.mdm-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 20px;
}

/* --- Medicine Card --- */
.mdm-card {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	padding: 22px;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
	transition: box-shadow 0.2s, transform 0.2s;
}

.mdm-card:hover {
	box-shadow: 0 4px 16px rgba(37, 99, 235, 0.12);
	transform: translateY(-2px);
}

.mdm-card-brand {
	font-size: 18px;
	font-weight: 700;
	color: #1e3a8a;
	margin: 0 0 4px;
}

.mdm-card-generic {
	font-size: 13px;
	color: #64748b;
	margin: 0 0 12px;
}

.mdm-card-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 14px;
}

.mdm-card-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding-top: 12px;
	border-top: 1px solid #f1f5f9;
}

.mdm-card-company {
	font-size: 12px;
	color: #94a3b8;
}

/* --- Badges --- */
.mdm-badge {
	display: inline-block;
	padding: 3px 10px;
	border-radius: 20px;
	font-size: 12px;
	font-weight: 600;
}

.mdm-badge-blue   { background: #dbeafe; color: #1e40af; }
.mdm-badge-green  { background: #dcfce7; color: #166534; }
.mdm-badge-gray   { background: #f1f5f9; color: #475569; }
.mdm-badge-purple { background: #ede9fe; color: #5b21b6; }

/* --- Empty / No Results --- */
.mdm-no-results {
	text-align: center;
	padding: 48px 16px;
	color: #64748b;
}

.mdm-no-results svg {
	display: block;
	margin: 0 auto 12px;
	opacity: 0.4;
}

/* --- Shortcode Pagination --- */
.mdm-shortcode-pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	margin-top: 28px;
	flex-wrap: wrap;
}

.mdm-page-info {
	font-size: 14px;
	color: #64748b;
}

/* ==========================================================================
   Detail Page
   ========================================================================== */

/* Breadcrumb */
.mdm-breadcrumb {
	font-size: 13px;
	color: #94a3b8;
	margin-bottom: 20px;
}

.mdm-breadcrumb a {
	color: #2563eb;
	text-decoration: none;
}

.mdm-breadcrumb a:hover {
	text-decoration: underline;
}

.mdm-breadcrumb span {
	margin: 0 6px;
}

/* Detail Header Card */
.mdm-detail-header {
	background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 100%);
	color: #fff;
	border-radius: 16px;
	padding: 36px 32px;
	margin-bottom: 28px;
}

.mdm-detail-title {
	font-size: 32px;
	font-weight: 800;
	margin: 0 0 6px;
	color: #fff;
}

.mdm-detail-generic {
	font-size: 16px;
	opacity: 0.85;
	margin: 0 0 18px;
	color: #fff;
}

.mdm-detail-badges {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	align-items: center;
}

.mdm-badge-white {
	background: rgba(255, 255, 255, 0.2);
	color: #fff;
	padding: 4px 14px;
	border-radius: 20px;
	font-size: 13px;
	font-weight: 600;
}

.mdm-price-tag {
	background: #fff;
	color: #2563eb;
	padding: 6px 18px;
	border-radius: 20px;
	font-size: 16px;
	font-weight: 800;
}

/* Meta boxes row */
.mdm-detail-meta-row {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 16px;
	margin-bottom: 28px;
}

.mdm-meta-box {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 10px;
	padding: 16px 20px;
}

.mdm-meta-box-label {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: #94a3b8;
	margin-bottom: 4px;
}

.mdm-meta-box-value {
	font-size: 15px;
	font-weight: 600;
	color: #1a202c;
}

.mdm-price-value {
	color: #059669;
}

/* Content Sections */
.mdm-sections {
	display: flex;
	flex-direction: column;
	gap: 20px;
}

.mdm-section {
	background: #fff;
	border: 1px solid #e2e8f0;
	border-radius: 12px;
	overflow: hidden;
}

.mdm-section-title {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 16px 20px;
	background: #f8fafc;
	border-bottom: 1px solid #e2e8f0;
	font-size: 15px;
	font-weight: 700;
	color: #1e3a8a;
	margin: 0;
}

.mdm-section-icon {
	font-size: 18px;
	line-height: 1;
}

.mdm-section-body {
	padding: 18px 20px;
	color: #374151;
	font-size: 15px;
}

.mdm-section-body p {
	margin: 0 0 8px;
}

.mdm-section-body p:last-child {
	margin-bottom: 0;
}

/* Related Medicines */
.mdm-related {
	margin-top: 36px;
}

.mdm-related-title {
	font-size: 20px;
	font-weight: 700;
	color: #1a202c;
	margin-bottom: 16px;
	padding-bottom: 10px;
	border-bottom: 2px solid #e2e8f0;
}

.mdm-related-generic {
	font-weight: 400;
	color: #64748b;
	font-size: 16px;
}

/* ==========================================================================
   Taxonomy Archive Pages (Generic / Company)
   ========================================================================== */

/* Archive header */
.mdm-archive-header {
	border-radius: 16px;
	padding: 36px 32px;
	margin-bottom: 28px;
	color: #fff;
}

.mdm-archive-generic {
	background: linear-gradient( 135deg, #065f46 0%, #059669 100% );
}

.mdm-archive-company {
	background: linear-gradient( 135deg, #4c1d95 0%, #7c3aed 100% );
}

.mdm-archive-type-badge {
	display: inline-block;
	background: rgba( 255, 255, 255, 0.2 );
	color: #fff;
	padding: 4px 14px;
	border-radius: 20px;
	font-size: 13px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	margin-bottom: 12px;
}

.mdm-archive-title {
	font-size: 32px;
	font-weight: 800;
	color: #fff;
	margin: 0 0 8px;
}

.mdm-archive-subtitle {
	font-size: 15px;
	color: rgba( 255, 255, 255, 0.8 );
	margin: 0;
}

/* Archive pagination */
.mdm-archive-pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	margin-top: 32px;
	flex-wrap: wrap;
}

/* Clickable taxonomy links inside cards */
.mdm-tax-link {
	color: #2563eb;
	text-decoration: none;
	font-size: 13px;
}

.mdm-tax-link:hover {
	text-decoration: underline;
	color: #1d4ed8;
}

.mdm-card-company {
	font-size: 12px;
	color: #94a3b8;
	text-decoration: none;
	transition: color 0.15s;
}

.mdm-card-company:hover {
	color: #2563eb;
	text-decoration: underline;
}

/* Clickable links in detail page header */
.mdm-detail-generic-link {
	color: rgba( 255, 255, 255, 0.9 );
	text-decoration: underline;
	text-decoration-color: rgba( 255, 255, 255, 0.4 );
	text-underline-offset: 3px;
}

.mdm-detail-generic-link:hover {
	color: #fff;
	text-decoration-color: #fff;
}

.mdm-badge-link {
	text-decoration: none;
	cursor: pointer;
	transition: background 0.15s;
}

.mdm-badge-link:hover {
	background: rgba( 255, 255, 255, 0.35 );
	color: #fff;
	text-decoration: none;
}

/* Clickable links in detail meta boxes */
.mdm-meta-link {
	color: #2563eb;
	text-decoration: none;
	font-weight: 600;
}

.mdm-meta-link:hover {
	text-decoration: underline;
	color: #1d4ed8;
}

/* Clickable generic name in Related section */
.mdm-related-generic {
	color: #64748b;
	font-weight: 400;
	font-size: 16px;
	text-decoration: none;
	margin-left: 4px;
}

.mdm-related-generic:hover {
	color: #2563eb;
	text-decoration: underline;
}

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 640px) {
	.mdm-search-form {
		flex-direction: column;
	}

	.mdm-search-form input[type="search"] {
		width: 100%;
	}

	.mdm-btn {
		width: 100%;
		text-align: center;
	}

	.mdm-btn-sm {
		width: auto;
	}

	.mdm-detail-title {
		font-size: 24px;
	}

	.mdm-detail-header {
		padding: 24px 18px;
	}

	.mdm-shortcode-pagination .mdm-btn {
		width: auto;
	}
}
