/**
 * Nasreddine Compare — Frontend structural CSS.
 *
 * Decorative colours and typography are applied via Elementor controls.
 *
 * @package NasreddineCompare
 */

/* ------------------------------------------------------------------ */
/*  Listing grid                                                      */
/* ------------------------------------------------------------------ */

.nc-phone-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 20px;
}

.nc-phone-card {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	padding: 16px;
	cursor: pointer;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.nc-phone-card:hover {
	box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.nc-card-check {
	position: absolute;
	top: 8px;
	right: 8px;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	background: #e0e0e0;
	color: transparent;
	transition: all 0.2s;
}

.nc-card-selected .nc-card-check {
	background: #4caf50;
	color: #fff;
}

.nc-card-thumbnail {
	width: 100%;
	max-width: 180px;
	margin-bottom: 12px;
}

.nc-card-thumbnail img {
	width: 100%;
	height: auto;
	display: block;
}

.nc-card-brand {
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-bottom: 4px;
}

.nc-card-name {
	font-size: 16px;
	font-weight: 600;
	margin-bottom: 12px;
}

.nc-card-specs {
	width: 100%;
	margin-bottom: 12px;
}

.nc-card-specs .nc-spec-row {
	display: flex;
	justify-content: space-between;
	padding: 4px 0;
	border-bottom: 1px solid #f0f0f0;
	font-size: 13px;
}

.nc-add-compare-btn {
	width: 100%;
	padding: 8px 16px;
	border: 1px solid #ddd;
	border-radius: 4px;
	background: #f5f5f5;
	cursor: pointer;
	font-size: 14px;
	transition: all 0.2s;
}

.nc-add-compare-btn:hover {
	background: #e8e8e8;
}

.nc-add-compare-btn.nc-btn-added {
	background: #e8f5e9;
	border-color: #4caf50;
	color: #2e7d32;
}

/* ------------------------------------------------------------------ */
/*  Compare Bar (floating)                                            */
/* ------------------------------------------------------------------ */

.nc-compare-bar {
	position: fixed;
	bottom: 0;
	left: 0;
	right: 0;
	z-index: 9999;
	background: #fff;
	border-top: 2px solid #1976d2;
	box-shadow: 0 -2px 12px rgba(0,0,0,0.12);
	transform: translateY(100%);
	transition: transform 0.3s ease;
}

.nc-compare-bar.nc-bar-visible {
	transform: translateY(0);
}

.nc-bar-inner {
	max-width: 1200px;
	margin: 0 auto;
	padding: 12px 20px;
	display: flex;
	align-items: center;
	gap: 12px;
}

.nc-bar-slots {
	display: flex;
	gap: 8px;
	flex: 1;
}

.nc-bar-slot {
	flex: 1;
	max-width: 200px;
	padding: 8px 12px;
	border: 1px dashed #ccc;
	border-radius: 6px;
	font-size: 13px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 36px;
}

.nc-bar-slot.nc-bar-slot-filled {
	border-style: solid;
	background: #f5f5f5;
}

.nc-bar-slot-remove {
	background: none;
	border: none;
	cursor: pointer;
	font-size: 14px;
	padding: 0 4px;
	color: #999;
}

.nc-bar-slot-remove:hover {
	color: #d32f2f;
}

.nc-bar-compare-btn {
	padding: 10px 24px;
	border: none;
	border-radius: 6px;
	background: #1976d2;
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.2s;
}

.nc-bar-compare-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.nc-bar-compare-btn:not(:disabled):hover {
	background: #1565c0;
}

.nc-bar-clear-btn {
	padding: 8px 16px;
	border: 1px solid #ccc;
	border-radius: 6px;
	background: transparent;
	cursor: pointer;
	font-size: 13px;
}

/* ------------------------------------------------------------------ */
/*  Compare Table                                                     */
/* ------------------------------------------------------------------ */

.nc-compare-wrapper {
	overflow-x: auto;
	--nc-label-col-width: 180px;
}

.nc-compare-placeholder {
	text-align: center;
	padding: 60px 20px;
	font-size: 16px;
	color: #666;
}

.nc-grid {
	display: grid;
}

.nc-table-header {
	border-bottom: 2px solid #e0e0e0;
}

.nc-header-cell {
	padding: 16px 12px;
	text-align: center;
	min-width: 140px;
}

.nc-label-col {
	display: flex;
	align-items: flex-end;
	font-weight: 700;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 1px;
	color: #666;
}

.nc-phone-col {
	display: flex;
	flex-direction: column;
	align-items: center;
	position: relative;
}

.nc-phone-thumb {
	margin-bottom: 8px;
}

.nc-phone-thumb img {
	max-width: 100px;
	height: auto;
}

.nc-phone-placeholder {
	font-size: 48px;
}

.nc-phone-brand {
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.nc-phone-col .nc-phone-name {
	font-size: 15px;
	font-weight: 600;
	margin-bottom: 8px;
}

.nc-remove-btn {
	position: absolute;
	top: 4px;
	right: 4px;
	background: none;
	border: none;
	cursor: pointer;
	font-size: 16px;
	color: #999;
	padding: 4px;
	line-height: 1;
}

.nc-remove-btn:hover {
	color: #d32f2f;
}

.nc-change-btn {
	padding: 4px 12px;
	border: 1px solid #ddd;
	border-radius: 4px;
	background: #fafafa;
	cursor: pointer;
	font-size: 13px;
	margin-top: 4px;
}

.nc-change-btn:hover {
	background: #eee;
}

/* Add phone slot */
.nc-add-phone-col {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	border: 2px dashed #ccc;
	border-radius: 8px;
	min-width: 140px;
	cursor: pointer;
	transition: border-color 0.2s;
}

.nc-add-phone-col:hover {
	border-color: #1976d2;
}

.nc-add-phone-trigger {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	color: #888;
	font-size: 14px;
}

.nc-add-icon {
	font-size: 40px;
	line-height: 1;
}

/* Section headers */
.nc-section-header {
	background: #f0f4f8;
}

.nc-section-label {
	padding: 10px 16px;
	font-weight: 700;
	font-size: 13px;
	text-transform: uppercase;
	letter-spacing: 1px;
}

/* Spec rows */
.nc-spec-row {
	border-bottom: 1px solid #eee;
}

.nc-spec-row:nth-child(even) {
	background: #fafafa;
}

.nc-cell {
	padding: 10px 12px;
	font-size: 14px;
	min-width: 120px;
	word-break: break-word;
}

.nc-label-cell {
	font-weight: 500;
	color: #555;
}

.nc-value-cell {
	text-align: center;
}

.nc-empty-cell {
	min-width: 120px;
}

.nc-winner {
	background: #e8f5e9 !important;
	font-weight: 700;
	color: #2e7d32;
}

/* ------------------------------------------------------------------ */
/*  Search dropdown                                                   */
/* ------------------------------------------------------------------ */

.nc-search-dropdown {
	position: relative;
	z-index: 10;
	width: 100%;
	margin-top: 8px;
}

.nc-search-input-wrap {
	display: flex;
	align-items: center;
	border: 1px solid #ccc;
	border-radius: 4px;
	overflow: hidden;
	background: #fff;
}

.nc-search-icon {
	padding: 6px 8px;
	font-size: 14px;
}

.nc-search-input {
	flex: 1;
	border: none;
	outline: none;
	padding: 8px 8px 8px 0;
	font-size: 14px;
}

.nc-search-results {
	max-height: 220px;
	overflow-y: auto;
	border: 1px solid #ddd;
	border-top: none;
	border-radius: 0 0 4px 4px;
	background: #fff;
}

.nc-search-result-item {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 8px 10px;
	cursor: pointer;
	transition: background 0.15s;
}

.nc-search-result-item:hover {
	background: #f0f4f8;
}

.nc-search-result-disabled {
	opacity: 0.35;
	cursor: not-allowed;
	pointer-events: none;
}

.nc-sri-thumb {
	width: 40px;
	height: 40px;
	flex-shrink: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 24px;
}

.nc-sri-thumb img {
	width: 40px;
	height: 40px;
	object-fit: cover;
	border-radius: 4px;
}

.nc-sri-info {
	flex: 1;
	text-align: left;
}

.nc-sri-brand {
	font-size: 11px;
	text-transform: uppercase;
	color: #888;
}

.nc-sri-name {
	font-size: 14px;
	font-weight: 500;
}

.nc-sri-badge {
	font-size: 11px;
	padding: 2px 6px;
	border-radius: 3px;
	background: #e0e0e0;
	color: #555;
}

.nc-sri-badge-added {
	background: #fff3e0;
	color: #e65100;
}

.nc-cancel-search {
	display: block;
	width: 100%;
	padding: 6px;
	border: none;
	background: #f5f5f5;
	cursor: pointer;
	font-size: 13px;
	text-align: center;
}

.nc-cancel-search:hover {
	background: #eee;
}

.nc-no-results {
	padding: 16px;
	text-align: center;
	color: #999;
	font-size: 14px;
}

/* ------------------------------------------------------------------ */
/*  Toast                                                             */
/* ------------------------------------------------------------------ */

.nc-toast {
	position: fixed;
	top: 20px;
	right: 20px;
	z-index: 99999;
	padding: 12px 20px;
	border-radius: 6px;
	font-size: 14px;
	color: #fff;
	background: #333;
	opacity: 0;
	transform: translateY(-10px);
	transition: opacity 0.3s, transform 0.3s;
	pointer-events: none;
}

.nc-toast-visible {
	opacity: 1;
	transform: translateY(0);
}

.nc-toast-info {
	background: #1976d2;
}

.nc-toast-success {
	background: #388e3c;
}

.nc-toast-error {
	background: #d32f2f;
}

/* ------------------------------------------------------------------ */
/*  Responsive                                                        */
/* ------------------------------------------------------------------ */

@media (max-width: 768px) {
	.nc-bar-inner {
		flex-wrap: wrap;
	}
	.nc-bar-slots {
		width: 100%;
	}
	.nc-bar-slot {
		max-width: none;
	}
}
