/**
 * COA Search Styles
 *
 * @package Supreme_COA
 * @since   1.0.1
 */

.coa-search-wrap {
	max-width: 900px;
	margin: 0 auto;
	font-family: inherit;
}

.coa-search-intro {
	font-size: 16px;
	margin-bottom: 24px;
	text-align: center;
}

/* Search Form */
.coa-search-form {
	display: flex;
	gap: 12px;
	margin-bottom: 24px;
	align-items: center;
}

.coa-search-input {
	flex: 1;
	padding: 14px 16px;
	font-size: 16px;
	border: 1px solid #ccc;
	border-radius: 4px;
	outline: none;
}

.coa-search-input:focus {
	border-color: #999;
}

/* Shared primary button — see also coa-form.css for the duplicate definition. */
.coa-btn-primary {
	padding: 0.6rem 1rem;
	font-size: 16px;
	font-weight: 700;
	color: #fff !important;
	background-color: #3D264F !important;
	border: none !important;
	border-radius: 5px;
	cursor: pointer;
	letter-spacing: 0.5px;
	white-space: nowrap;
}

.coa-btn-primary:hover {
	background-color: #FD7521 !important;
}

.coa-btn-primary.coa-loading,
.coa-btn-primary.coa-submitting {
	background-color: #FD7521 !important;
	pointer-events: none;
}

/* Clear Search Button */
.coa-clear-search {
	padding: 0.42rem 1rem;
	font-size: 16px;
	font-weight: 700;
	color: #3D264F !important;
	background-color: #fff !important;
	border: 1px solid #3D264F !important;
	border-radius: 5px;
	cursor: pointer;
	letter-spacing: 0.5px;
	white-space: nowrap;
}

.coa-clear-search:hover {
	padding: 0.5rem 1rem;
	background-color: #FD7521 !important;
	color: #fff !important;
	border-color: #FD7521 !important;
}

/* Table Controls: Summary + Per Page */
.coa-table-controls {
	display: none; /* shown via JS when results load */
	justify-content: space-between;
	align-items: center;
	margin-bottom: 12px;
}

.coa-results-summary {
	font-size: 14px;
	margin: 0;
}

.coa-results-summary strong {
	font-weight: 700;
}

.coa-per-page-wrap {
	display: flex;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: #666;
}

.coa-per-page {
	padding: 6px 10px;
	font-size: 13px;
	border: 1px solid #ccc;
	border-radius: 4px;
	outline: none;
}

/* Results Table */
.coa-results-table {
	width: 100%;
	border-collapse: collapse;
	table-layout: fixed;
}

.coa-col-product-type,
.coa-results-table thead th:nth-child(3) {
	width: 200px;
	max-width: 200px;
	word-wrap: break-word;
	overflow-wrap: break-word;
}

.coa-results-table thead th {
	background-color: #4A2040;
	color: #fff;
	text-align: left;
	padding: 12px 16px;
	font-size: 14px;
	font-weight: 700;
}

.coa-results-table tbody td {
	padding: 14px 16px;
	font-size: 14px;
	border-bottom: 1px solid #eee;
	vertical-align: middle;
}

.coa-results-table tbody tr:hover {
	background-color: #f9f9f9;
}

.coa-doc-link {
	color: #E5571F;
	text-decoration: none;
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.coa-doc-link:hover {
	text-decoration: underline;
}

.coa-doc-link .coa-pdf-icon {
	width: 18px;
	height: 18px;
	display: inline-block;
}

/* Pagination */
.coa-pagination {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 4px;
	margin-top: 24px;
	flex-wrap: wrap;
}

.coa-page-btn {
	padding: 8px 14px;
	font-size: 13px;
	font-weight: 600;
	color: #333;
	background: #fff;
	border: 1px solid #ccc;
	border-radius: 4px;
	cursor: pointer;
}

.coa-page-btn:hover:not([disabled]):not(.coa-page-active) {
	background-color: #f5f5f5;
	border-color: #999;
}

.coa-page-btn.coa-page-active {
	background-color: #3D264F;
	color: #fff;
	border-color: #3D264F;
	cursor: default;
}

.coa-page-btn[disabled] {
	opacity: 0.4;
	cursor: not-allowed;
}

.coa-page-ellipsis {
	padding: 8px 6px;
	font-size: 13px;
	color: #999;
}

.coa-page-prev,
.coa-page-next {
	font-weight: 600;
}

/* No Results */
.coa-no-results {
	text-align: center;
	padding: 24px;
	color: #666;
}

/* Elementor bottom section — hidden until search is performed (not in Elementor editor) */
body:not(.elementor-editor-active) .coa-form-bottom {
	display: none;
}

/* Error Message */
.coa-error-message {
	text-align: center;
	padding: 16px 24px;
	color: #b91c1c;
	background-color: #fef2f2;
	border: 1px solid #fecaca;
	border-radius: 4px;
}

/* Skeleton Loader */
.coa-skeleton-row td {
	padding: 14px 16px;
	border-bottom: 1px solid #eee;
}

.coa-skeleton-bar {
	height: 14px;
	background: #e0e0e0;
	border-radius: 4px;
	background-image: linear-gradient(90deg, #e0e0e0 0%, #f0f0f0 40%, #e0e0e0 80%);
	background-size: 200% 100%;
	animation: coa-shimmer 1.5s infinite ease-in-out;
}

.coa-skeleton-bar.coa-sk-short {
	width: 60%;
}

.coa-skeleton-bar.coa-sk-medium {
	width: 45%;
}

.coa-skeleton-bar.coa-sk-long {
	width: 75%;
}

@keyframes coa-shimmer {
	0%   { background-position: 200% 0; }
	100% { background-position: -200% 0; }
}


/* Responsive */
@media (max-width: 600px) {
	.coa-search-form {
		flex-direction: column;
	}

	.coa-btn-primary,
	.coa-clear-search {
		width: 100%;
	}

	.coa-table-controls {
		flex-direction: column;
		gap: 10px;
		align-items: flex-start;
	}

	.coa-results-table {
		table-layout: auto;
	}

	.coa-col-product-type,
	.coa-results-table thead th:nth-child(3) {
		width: auto;
		max-width: 120px;
	}

	.coa-results-table thead th,
	.coa-results-table tbody td {
		padding: 8px 6px;
		font-size: 12px;
		word-wrap: break-word;
		overflow-wrap: break-word;
	}

	.coa-pagination {
		gap: 2px;
	}

	.coa-page-btn {
		padding: 6px 10px;
		font-size: 12px;
	}
}
