/* ============================================================
 * Dreamysites Lot & COA Manager: frontend styles
 * Shortcode lookup page + WooCommerce product page tab.
 * Navy / blue / silver palette. Override via theme CSS as needed.
 * ============================================================ */

.dscoa-lookup {
	max-width: 960px;
	margin: 40px auto;
	padding: 32px;
	background: #f8fafc;
	border-radius: 8px;
	border: 1px solid #e5e7eb;
	font-family: "Sora", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	box-sizing: border-box;
}

.dscoa-lookup *, .dscoa-lookup *::before, .dscoa-lookup *::after { box-sizing: border-box; }

.dscoa-lookup-header {
	text-align: center;
	margin-bottom: 28px;
	padding-bottom: 20px;
	border-bottom: 1px solid #e5e7eb;
}
.dscoa-lookup-header h2 {
	color: #0a1628;
	margin: 0 0 8px;
	font-size: 24px;
	font-weight: 600;
	letter-spacing: -0.01em;
}
.dscoa-lookup-header p {
	color: #4b5563;
	margin: 0;
	font-size: 14px;
}

/* Tabs */
.dscoa-search-tabs {
	display: flex;
	gap: 4px;
	margin-bottom: 20px;
	border-bottom: 2px solid #e5e7eb;
}
.dscoa-search-tabs .dscoa-tab {
	background: transparent;
	border: none;
	padding: 12px 24px;
	font-size: 14px;
	font-weight: 500;
	color: #6b7280;
	cursor: pointer;
	border-bottom: 2px solid transparent;
	margin-bottom: -2px;
	transition: color 0.2s, border-color 0.2s;
	font-family: inherit;
}
.dscoa-search-tabs .dscoa-tab:hover { color: #1a4a87; }
.dscoa-search-tabs .dscoa-tab.active {
	color: #1a4a87;
	border-bottom-color: #2871c7;
	font-weight: 600;
}

/* Search panels */
.dscoa-search-panel {
	display: none;
	padding: 20px 0 10px;
}
.dscoa-search-panel.active { display: block; }

.dscoa-search-panel label {
	display: block;
	font-size: 13px;
	font-weight: 500;
	color: #374151;
	margin-bottom: 10px;
}

.dscoa-hint {
	color: #6b7280;
	font-size: 12px;
	margin: 10px 0 0;
	font-style: italic;
}

.dscoa-search-row {
	display: flex;
	gap: 12px;
	align-items: stretch;
	flex-wrap: wrap;
}

#dscoa-lot-input {
	flex: 0 0 auto;
	width: 220px;
	padding: 14px 18px;
	font-size: 22px;
	font-family: "JetBrains Mono", "Menlo", "Consolas", monospace;
	letter-spacing: 0.2em;
	border: 2px solid #d1d5db;
	border-radius: 6px;
	text-transform: uppercase;
	text-align: center;
	color: #1a4a87;
	background: white;
	font-weight: 600;
}
#dscoa-lot-input:focus {
	border-color: #2871c7;
	outline: none;
	box-shadow: 0 0 0 3px rgba(40, 113, 199, 0.15);
}
#dscoa-lot-input::placeholder { color: #cbd5e1; letter-spacing: 0.2em; }

#dscoa-product-select, #dscoa-lot-select {
	width: 100%;
	max-width: 500px;
	padding: 12px 14px;
	font-size: 14px;
	border: 2px solid #d1d5db;
	border-radius: 6px;
	background: white;
	color: #1f2937;
	font-family: inherit;
}
#dscoa-product-select:focus, #dscoa-lot-select:focus {
	border-color: #2871c7;
	outline: none;
	box-shadow: 0 0 0 3px rgba(40, 113, 199, 0.15);
}

.dscoa-lot-select-wrap { margin-top: 16px; }

.dscoa-search-btn {
	padding: 14px 32px;
	background: #2871c7;
	color: white;
	border: none;
	border-radius: 6px;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.05em;
	cursor: pointer;
	text-transform: uppercase;
	font-family: inherit;
	transition: background 0.15s;
}
.dscoa-search-btn:hover { background: #1a4a87; }
.dscoa-search-btn:active { background: #0a1628; }

/* Result area */
.dscoa-result {
	margin-top: 30px;
	padding-top: 30px;
	border-top: 1px solid #e5e7eb;
}

.dscoa-loading {
	text-align: center;
	padding: 40px;
	color: #6b7280;
	font-style: italic;
}

/* Display grid (metadata + PDF) */
.dscoa-display {
	display: grid;
	grid-template-columns: minmax(260px, 320px) 1fr;
	gap: 24px;
	background: white;
	border-radius: 8px;
	padding: 24px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
	border: 1px solid #e5e7eb;
}
@media (max-width: 768px) {
	.dscoa-display { grid-template-columns: 1fr; }
}

.dscoa-metadata {
	display: flex;
	flex-direction: column;
	gap: 0;
}

.dscoa-meta-row {
	display: flex;
	flex-direction: column;
	gap: 3px;
	padding: 12px 0;
	border-bottom: 1px solid #f3f4f6;
}
.dscoa-meta-row:first-child { padding-top: 0; }
.dscoa-meta-row:last-child { border-bottom: none; }

.dscoa-meta-label {
	font-size: 11px;
	color: #6b7280;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	font-weight: 500;
}
.dscoa-meta-value {
	font-size: 14px;
	color: #111827;
	font-weight: 500;
	word-break: break-word;
}
.dscoa-meta-value a { color: #1a4a87; text-decoration: none; }
.dscoa-meta-value a:hover { text-decoration: underline; }
.dscoa-meta-value code {
	font-family: "JetBrains Mono", "Menlo", "Consolas", monospace;
	background: #eff6ff;
	color: #1a4a87;
	padding: 4px 10px;
	border-radius: 4px;
	letter-spacing: 0.08em;
	font-weight: 700;
	font-size: 15px;
}

/* PDF viewer panel */
.dscoa-pdf-viewer {
	display: flex;
	flex-direction: column;
	border: 1px solid #e5e7eb;
	border-radius: 6px;
	overflow: hidden;
	min-height: 520px;
}
.dscoa-pdf-toolbar {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 12px 16px;
	background: #f9fafb;
	border-bottom: 1px solid #e5e7eb;
	font-size: 12px;
	color: #6b7280;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.05em;
}
.dscoa-download-btn {
	color: #2871c7 !important;
	text-decoration: none !important;
	font-weight: 600;
	padding: 5px 12px;
	border: 1px solid #2871c7;
	border-radius: 4px;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	transition: background 0.15s, color 0.15s;
}
.dscoa-download-btn:hover {
	background: #2871c7;
	color: white !important;
}
.dscoa-pdf-embed {
	flex: 1;
	width: 100%;
	min-height: 520px;
	border: none;
	background: #f3f4f6;
}

.dscoa-no-pdf {
	display: flex;
	align-items: center;
	justify-content: center;
	background: #f9fafb;
	color: #6b7280;
	font-style: italic;
	padding: 60px 20px;
	border: 1px dashed #d1d5db;
	border-radius: 6px;
	text-align: center;
}
.dscoa-no-pdf p { margin: 0; }

/* Error and info states */
.dscoa-error {
	padding: 16px 20px;
	background: #fef2f2;
	border-left: 4px solid #dc2626;
	color: #991b1b;
	border-radius: 4px;
	font-weight: 500;
}
.dscoa-error p { margin: 0; }

.dscoa-info {
	padding: 16px 20px;
	background: #eff6ff;
	border-left: 4px solid #2871c7;
	color: #1a4a87;
	border-radius: 4px;
}
.dscoa-info p { margin: 0; }

/* ============================================================
 * WooCommerce single-product page tab
 * ============================================================ */
.dscoa-product-tab {
	padding: 24px 0;
}
.dscoa-tab-header {
	margin-bottom: 24px;
	padding-bottom: 16px;
	border-bottom: 1px solid #e5e7eb;
}
.dscoa-tab-select-row {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
}
.dscoa-tab-select-row label {
	font-weight: 500;
	color: #374151;
	font-size: 14px;
	margin: 0;
}
.dscoa-tab-lot-select {
	padding: 8px 14px;
	border: 1px solid #d1d5db;
	border-radius: 4px;
	font-size: 14px;
	background: white;
	min-width: 240px;
	font-family: inherit;
}
.dscoa-tab-lot-select:focus {
	border-color: #2871c7;
	outline: none;
	box-shadow: 0 0 0 2px rgba(40, 113, 199, 0.15);
}
.dscoa-tab-content { transition: opacity 0.2s; }

/* ============================================================
 * v1.5.0: Multi-line HPLC retention times display
 * ============================================================ */
.dscoa-retention-list {
	list-style: none;
	margin: 0;
	padding: 0;
	font-size: 13px;
}
.dscoa-retention-list li {
	padding: 3px 0;
	color: #111827;
}
.dscoa-retention-compound {
	font-weight: 600;
	color: #1a4a87;
	margin-right: 4px;
}

/* ============================================================
 * 2.2.0: cannabinoid profile additions
 * ============================================================ */

.dscoa-disclosure {
	background: #fffbeb;
	border: 1px solid #fcd34d;
	border-left: 4px solid #f59e0b;
	color: #78350f;
	padding: 12px 16px;
	border-radius: 6px;
	font-size: 14px;
	line-height: 1.5;
	margin-bottom: 16px;
}

.dscoa-summary {
	display: flex;
	flex-wrap: wrap;
	gap: 10px 18px;
	align-items: center;
	margin-bottom: 16px;
	font-size: 15px;
}
.dscoa-overall {
	display: inline-block;
	padding: 6px 12px;
	border-radius: 999px;
	font-weight: 700;
	letter-spacing: .02em;
}
.dscoa-overall-pass { background: #d1fae5; color: #065f46; }
.dscoa-overall-fail { background: #fee2e2; color: #991b1b; }
.dscoa-thc { color: #374151; }
.dscoa-thc em { color: #6b7280; font-style: normal; font-size: 13px; }
.dscoa-muted { color: #6b7280; font-weight: 400; }

.dscoa-potency {
	width: 100%;
	border-collapse: collapse;
	margin: 16px 0;
	font-size: 14px;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 6px;
	overflow: hidden;
}
.dscoa-potency th,
.dscoa-potency td {
	text-align: left;
	padding: 10px 14px;
	border-bottom: 1px solid #f1f5f9;
}
.dscoa-potency th {
	background: #f8fafc;
	font-weight: 600;
	color: #374151;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: .05em;
}
.dscoa-potency tbody tr:last-child td { border-bottom: none; }
.dscoa-potency td:nth-child(2), .dscoa-potency td:nth-child(3),
.dscoa-potency th:nth-child(2), .dscoa-potency th:nth-child(3) { text-align: right; white-space: nowrap; }

.dscoa-panels {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 10px;
	margin: 16px 0;
}
.dscoa-panel {
	border: 1px solid #e5e7eb;
	border-radius: 6px;
	padding: 10px 12px;
	background: #fff;
	display: flex;
	flex-direction: column;
	gap: 4px;
}
.dscoa-panel-name { font-size: 13px; color: #374151; }
.dscoa-panel-status { font-weight: 700; font-size: 13px; letter-spacing: .04em; text-transform: uppercase; }
.dscoa-panel-pass       { border-color: #a7f3d0; } .dscoa-panel-pass .dscoa-panel-status { color: #065f46; }
.dscoa-panel-fail       { border-color: #fecaca; } .dscoa-panel-fail .dscoa-panel-status { color: #991b1b; }
.dscoa-panel-tested     { border-color: #bfdbfe; } .dscoa-panel-tested .dscoa-panel-status { color: #1e40af; }
.dscoa-panel-not_tested { background: #f9fafb; } .dscoa-panel-not_tested .dscoa-panel-status { color: #9ca3af; }

/* ============================================================
 * 2.2.0: [dscoa_directory]
 * ============================================================ */

.dscoa-directory {
	max-width: 960px;
	margin: 0 auto;
	font-family: inherit;
}
.dscoa-directory-title { margin: 0 0 8px; }
.dscoa-directory-intro { color: #4b5563; margin: 0 0 24px; }
.dscoa-directory-cat { margin: 0 0 32px; }
.dscoa-directory-cat-title {
	font-size: 22px;
	margin: 0 0 12px;
	padding-bottom: 8px;
	border-bottom: 2px solid #e5e7eb;
}
.dscoa-directory-product {
	background: #f8fafc;
	border: 1px solid #e5e7eb;
	border-radius: 6px;
	margin-bottom: 8px;
}
.dscoa-directory-product summary {
	list-style: none;
	cursor: pointer;
	padding: 14px 44px 14px 16px;
	position: relative;
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 6px 12px;
	font-weight: 600;
}
.dscoa-directory-product summary::-webkit-details-marker { display: none; }
.dscoa-directory-product summary::after {
	content: "+";
	position: absolute;
	right: 16px;
	top: 50%;
	transform: translateY(-50%);
	font-size: 22px;
	font-weight: 400;
	color: #6b7280;
	line-height: 1;
}
.dscoa-directory-product[open] summary::after { content: "–"; }
.dscoa-directory-product-meta { font-weight: 400; color: #6b7280; font-size: 14px; }
.dscoa-directory-count {
	margin-left: auto;
	font-weight: 400;
	font-size: 13px;
	color: #6b7280;
}
.dscoa-directory-lots {
	list-style: none;
	margin: 0;
	padding: 0 16px 14px;
}
.dscoa-directory-lot {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 12px;
	padding: 10px 0;
	border-top: 1px solid #e5e7eb;
	font-size: 14px;
}
.dscoa-directory-lot-code code {
	font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
	font-size: 14px;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 4px;
	padding: 2px 6px;
}
.dscoa-directory-shipping {
	background: #d1fae5;
	color: #065f46;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: .05em;
	padding: 2px 8px;
	border-radius: 999px;
}
.dscoa-directory-rules, .dscoa-directory-lot-meta { color: #6b7280; }
.dscoa-directory-files { margin-left: auto; display: flex; gap: 8px; flex-wrap: wrap; }
.dscoa-directory-pdf {
	display: inline-block;
	padding: 6px 12px;
	background: #1a4a87;
	color: #fff !important;
	border-radius: 4px;
	text-decoration: none !important;
	font-size: 13px;
	font-weight: 600;
}
.dscoa-directory-pdf:hover { background: #0a1628; }
.dscoa-directory-pending { color: #9ca3af; font-style: italic; margin-left: auto; }

@media (max-width: 600px) {
	.dscoa-directory-files, .dscoa-directory-count, .dscoa-directory-pending { margin-left: 0; width: 100%; }
}

/* combo / bundle products */
.dscoa-combo-intro { color: #4b5563; margin: 0 0 16px; }
.dscoa-component { margin: 0 0 28px; padding: 0 0 20px; border-bottom: 1px solid #e5e7eb; }
.dscoa-component:last-child { border-bottom: none; }
.dscoa-component-title { margin: 0 0 12px; font-size: 18px; }

/* product page link (Link display mode) */
.dscoa-product-link { margin: 8px 0; font-size: 14px; }
.dscoa-product-link a { text-decoration: underline; }
.dscoa-directory-product.is-target { box-shadow: 0 0 0 2px #1a4a87; }

/* ============================================================
 * 2.2.2: close button on lookup results
 * ============================================================ */
.dscoa-result-bar {
	grid-column: 1 / -1;
	display: flex;
	justify-content: flex-end;
	margin: -4px 0 -8px;
}
.dscoa-close-btn {
	background: none;
	border: 1px solid #d1d5db;
	border-radius: 6px;
	padding: 6px 14px;
	cursor: pointer;
	font-size: 13px;
	font-weight: 500;
	color: #4b5563;
	font-family: inherit;
	line-height: 1.4;
	transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.dscoa-close-btn:hover {
	background: #f3f4f6;
	color: #0a1628;
	border-color: #9ca3af;
}
.dscoa-close-btn:focus-visible {
	outline: none;
	border-color: #2871c7;
	box-shadow: 0 0 0 3px rgba(40, 113, 199, 0.15);
}
