/**
 * Kompas Favorites Frontend Styles - Minimalist
 */

/* Reset and Base */
.kompas-favorites-account * {
	box-sizing: border-box;
}

/* Empty State */
.kompas-favorites-empty {
	text-align: center;
	padding: 60px 20px;
}

.kompas-favorites-empty svg {
	color: #e0e0e0;
	margin-bottom: 20px;
}

.kompas-favorites-empty p {
	color: #666 !important;
	margin-bottom: 20px;
	font-size: 14px !important;
}

/* Toolbar */
.kompas-favorites-toolbar {
	display: flex;
	align-items: center;
	gap: 20px;
	padding: 15px 0;
	border-bottom: 1px solid #e0e0e0;
	margin-bottom: 30px;
}

.kompas-select-all {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	font-size: 14px !important;
	color: #333 !important;
}

.kompas-select-all input[type="checkbox"] {
	width: 16px;
	height: 16px;
	cursor: pointer;
}

.kompas-selected-count {
	font-size: 13px !important;
	color: #666 !important;
}

.kompas-selected-count .count-number {
	font-weight: 600;
	color: #0066cc !important;
}

.kompas-toolbar-actions {
	margin-left: auto;
	display: flex;
	gap: 10px;
}

/* Buttons */
.kompas-btn-primary,
.kompas-btn-secondary {
	padding: 8px 16px !important;
	font-size: 13px !important;
	border: none !important;
	border-radius: 4px !important;
	cursor: pointer !important;
	transition: opacity 0.2s !important;
	font-weight: 500 !important;
	text-decoration: none !important;
	display: inline-block !important;
}

.kompas-btn-primary {
	background: #0066cc !important;
	color: white !important;
}

.kompas-btn-primary:hover:not(:disabled) {
	background: #0052a3 !important;
}

.kompas-btn-secondary {
	background: #f0f0f0 !important;
	color: #333 !important;
}

.kompas-btn-secondary:hover:not(:disabled) {
	background: #e0e0e0 !important;
}

.kompas-btn-primary:disabled,
.kompas-btn-secondary:disabled {
	opacity: 0.4 !important;
	cursor: not-allowed !important;
}

/* Category Section */
.kompas-category-section {
	margin-bottom: 40px;
}

.kompas-category-title {
	font-size: 16px !important;
	font-weight: 600 !important;
	color: #333 !important;
	margin-bottom: 20px !important;
	padding-bottom: 10px !important;
	border-bottom: 1px solid #e0e0e0;
}

/* Grid */
.kompas-favorites-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 15px;
}

/* Item Card */
.kompas-favorite-item {
	background: white !important;
	border: 1px solid #e0e0e0;
	border-radius: 4px;
	padding: 10px;
	position: relative;
	transition: all 0.2s;
}

.kompas-favorite-item:hover {
	border-color: #ccc;
}

.kompas-favorite-item.selected {
	border-color: #0066cc;
	background: #f0f7ff !important;
}

/* Checkbox */
.kompas-favorite-item input[type="checkbox"] {
	position: absolute;
	top: 10px;
	left: 10px;
	z-index: 2;
	width: 16px;
	height: 16px;
	cursor: pointer;
}

/* Image */
.kompas-item-image {
	width: 100%;
	height: 120px;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 10px;
	position: relative;
	background: #fafafa;
}

.kompas-item-image img {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
}

.kompas-item-image .out-of-stock {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background: rgba(255, 255, 255, 0.95);
	color: #ff4444;
	padding: 4px 8px;
	border-radius: 3px;
	font-size: 11px !important;
	font-weight: 600;
}

/* Info */
.kompas-item-info {
	padding-top: 10px;
}

.kompas-item-info h4 {
	font-size: 13px !important;
	font-weight: 500 !important;
	color: #333 !important;
	margin: 0 0 8px 0 !important;
	line-height: 1.3 !important;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* Attributes */
.kompas-attributes {
	display: flex;
	flex-wrap: wrap;
	gap: 5px;
	margin-bottom: 8px;
}

.kompas-attributes span {
	font-size: 11px !important;
	color: #666 !important;
	background: #f5f5f5;
	padding: 2px 6px;
	border-radius: 3px;
}

/* Price */
.kompas-price {
	font-size: 14px !important;
	font-weight: 600 !important;
	color: #0066cc !important;
	margin-bottom: 10px;
}

.kompas-price del {
	color: #999 !important;
	font-size: 12px !important;
	font-weight: 400;
}

.kompas-price ins {
	text-decoration: none !important;
}

/* Actions */
.kompas-actions {
	display: flex;
	gap: 5px;
}

.kompas-add-cart {
	flex: 1;
	padding: 6px 10px !important;
	font-size: 12px !important;
	background: #0066cc !important;
	color: white !important;
	border: none !important;
	border-radius: 3px !important;
	cursor: pointer !important;
	transition: background 0.2s !important;
}

.kompas-add-cart:hover {
	background: #0052a3 !important;
}

.kompas-add-cart.loading {
	opacity: 0.7;
	pointer-events: none;
}

.kompas-remove {
	width: 28px;
	height: 28px;
	padding: 0 !important;
	background: #f0f0f0 !important;
	color: #666 !important;
	border: none !important;
	border-radius: 3px !important;
	cursor: pointer !important;
	font-size: 18px !important;
	line-height: 1 !important;
	transition: all 0.2s !important;
}

.kompas-remove:hover {
	background: #ff4444 !important;
	color: white !important;
}

/* Notification */
.kompas-notification {
	position: fixed;
	bottom: 20px;
	right: 20px;
	background: #333;
	color: white;
	padding: 12px 20px;
	border-radius: 4px;
	font-size: 13px !important;
	z-index: 9999;
	animation: slideUp 0.3s ease;
}

.kompas-notification.success {
	background: #4caf50;
}

.kompas-notification.error {
	background: #ff4444;
}

@keyframes slideUp {
	from {
		transform: translateY(100%);
		opacity: 0;
	}
	to {
		transform: translateY(0);
		opacity: 1;
	}
}

/* Modal Styles - Beautiful Minimalist Design */
.kompas-favorites-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: none;
}

.kompas-favorites-modal.is-open {
	display: block;
}

.kompas-favorites-modal .modal-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.6);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
}

.kompas-favorites-modal .modal-container {
	position: fixed;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
	pointer-events: none;
}

.kompas-favorites-modal .modal-content {
	position: relative;
	width: 100%;
	max-width: 720px;
	max-height: 85vh;
	background: #ffffff;
	border-radius: 16px;
	display: flex;
	flex-direction: column;
	pointer-events: auto;
	box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
	overflow: hidden;
}

/* Modal Header */
.kompas-favorites-modal .modal-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 24px;
	border-bottom: 1px solid #f0f0f0;
	background: #ffffff;
}

.kompas-favorites-modal .modal-title {
	margin: 0;
	font-size: 18px !important;
	font-weight: 600 !important;
	color: #1a1a1a !important;
	letter-spacing: -0.025em;
}

.kompas-favorites-modal .modal-close {
	width: 32px;
	height: 32px;
	padding: 0;
	background: transparent;
	border: none;
	color: #999;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 8px;
	transition: all 0.2s ease;
}

.kompas-favorites-modal .modal-close:hover {
	background: #f5f5f5;
	color: #333;
	transform: rotate(90deg);
}

.kompas-favorites-modal .modal-close svg {
	width: 20px;
	height: 20px;
}

/* Modal Body */
.kompas-favorites-modal .modal-body {
	flex: 1;
	overflow-y: auto;
	padding: 24px;
	background: #fafafa;
}

/* Loading State */
.kompas-favorites-modal .modal-loading {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 200px;
	text-align: center;
}

.kompas-favorites-modal .spinner {
	width: 40px;
	height: 40px;
	border: 3px solid #e5e7eb;
	border-top-color: #0066cc;
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}

.kompas-favorites-modal .modal-loading p {
	margin-top: 16px;
	color: #666;
	font-size: 14px !important;
}

/* Variations Info */
.kompas-favorites-modal .variations-info {
	margin-bottom: 20px;
}

.kompas-favorites-modal .info-text {
	color: #666 !important;
	font-size: 14px !important;
	margin: 0;
}

/* Variations List */
.kompas-favorites-modal .variations-list {
	background: #ffffff;
	border-radius: 12px;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
	margin-bottom: 20px;
	max-height: 400px;
	overflow-y: auto;
}

.kompas-favorites-modal .variation-item {
	border-bottom: 1px solid #f5f5f5;
	transition: all 0.2s ease;
}

.kompas-favorites-modal .variation-item:last-child {
	border-bottom: none;
}

.kompas-favorites-modal .variation-item:hover {
	background: #fafafa;
}

.kompas-favorites-modal .variation-item.is-favorite {
	opacity: 0.6;
	background: #f9f9f9;
}

.kompas-favorites-modal .variation-label {
	display: block;
	padding: 16px;
	cursor: pointer;
	position: relative;
}

.kompas-favorites-modal .variation-checkbox {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.kompas-favorites-modal .variation-content {
	display: flex;
	align-items: center;
	gap: 16px;
	padding-left: 28px;
	position: relative;
}

/* Custom Checkbox */
.kompas-favorites-modal .variation-content::before {
	content: '';
	position: absolute;
	left: 0;
	width: 18px;
	height: 18px;
	border: 2px solid #d1d5db;
	border-radius: 4px;
	background: white;
	transition: all 0.2s ease;
}

.kompas-favorites-modal .variation-checkbox:checked + .variation-content::before {
	background: #0066cc;
	border-color: #0066cc;
}

.kompas-favorites-modal .variation-checkbox:checked + .variation-content::after {
	content: '';
	position: absolute;
	left: 5px;
	top: 2px;
	width: 8px;
	height: 12px;
	border: solid white;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.kompas-favorites-modal .variation-checkbox:disabled + .variation-content {
	opacity: 0.5;
	cursor: not-allowed;
}

/* Variation Image */
.kompas-favorites-modal .variation-image {
	width: 60px;
	height: 60px;
	flex-shrink: 0;
	background: #f9f9f9;
	border-radius: 8px;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}

.kompas-favorites-modal .variation-image img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	padding: 4px;
}

/* Variation Info */
.kompas-favorites-modal .variation-info {
	flex: 1;
	min-width: 0;
}

.kompas-favorites-modal .variation-name {
	display: block;
	font-size: 14px !important;
	font-weight: 500;
	color: #1a1a1a !important;
	margin-bottom: 4px;
	line-height: 1.4;
}

.kompas-favorites-modal .variation-attributes {
	display: block;
	font-size: 13px !important;
	color: #666 !important;
	margin-bottom: 6px;
}

.kompas-favorites-modal .variation-meta {
	display: flex;
	align-items: center;
	gap: 12px;
	font-size: 13px !important;
}

.kompas-favorites-modal .variation-price {
	font-weight: 600;
	color: #0066cc !important;
}

.kompas-favorites-modal .variation-stock {
	color: #999 !important;
	font-size: 12px !important;
}

.kompas-favorites-modal .variation-stock.in-stock {
	color: #10b981 !important;
}

.kompas-favorites-modal .variation-stock.out-of-stock {
	color: #ef4444 !important;
}

/* Already Favorite Badge */
.kompas-favorites-modal .already-favorite {
	display: inline-block;
	padding: 4px 8px;
	background: #fff3cd;
	color: #856404;
	font-size: 11px !important;
	font-weight: 500;
	border-radius: 4px;
	text-transform: uppercase;
	letter-spacing: 0.025em;
}

/* Variations Actions */
.kompas-favorites-modal .variations-actions {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 20px;
	background: white;
	border-radius: 12px;
	margin-top: 20px;
}

.kompas-favorites-modal .select-all-wrapper {
	display: flex;
	align-items: center;
}

.kompas-favorites-modal .select-all-wrapper label {
	display: flex;
	align-items: center;
	gap: 10px;
	cursor: pointer;
	font-size: 14px !important;
	color: #333 !important;
	font-weight: 500;
}

.kompas-favorites-modal .select-all-wrapper input[type="checkbox"] {
	width: 18px;
	height: 18px;
	cursor: pointer;
	accent-color: #0066cc;
}

.kompas-favorites-modal .action-buttons {
	display: flex;
	gap: 12px;
}

/* Modal Buttons */
.kompas-favorites-modal .button {
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	gap: 8px !important;
	padding: 10px 20px !important;
	font-size: 14px !important;
	font-weight: 500 !important;
	border: none !important;
	border-radius: 8px !important;
	cursor: pointer !important;
	transition: all 0.2s ease !important;
	white-space: nowrap;
}

.kompas-favorites-modal .button-primary {
	background: #0066cc !important;
	color: white !important;
}

.kompas-favorites-modal .button-primary:hover:not(:disabled) {
	background: #0052a3 !important;
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(0, 102, 204, 0.25);
}

.kompas-favorites-modal .cancel-button {
	background: #f5f5f5 !important;
	color: #666 !important;
}

.kompas-favorites-modal .cancel-button:hover {
	background: #e8e8e8 !important;
	color: #333 !important;
}

.kompas-favorites-modal .button:disabled {
	opacity: 0.5 !important;
	cursor: not-allowed !important;
	transform: none !important;
}

.kompas-favorites-modal .button.is-loading {
	position: relative;
	color: transparent !important;
}

.kompas-favorites-modal .button.is-loading::after {
	content: '';
	position: absolute;
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-top-color: white;
	border-radius: 50%;
	animation: spin 0.6s linear infinite;
}

/* Success State */
.kompas-favorites-modal .modal-success {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 250px;
	text-align: center;
	padding: 20px;
}

.kompas-favorites-modal .success-icon {
	width: 64px;
	height: 64px;
	background: #10b981;
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 20px;
	animation: scaleIn 0.3s ease;
}

.kompas-favorites-modal .success-icon svg {
	width: 32px;
	height: 32px;
	color: white;
}

.kompas-favorites-modal .success-message {
	font-size: 16px !important;
	color: #1a1a1a !important;
	margin-bottom: 24px;
	font-weight: 500;
}

/* Error State */
.kompas-favorites-modal .modal-error {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 200px;
	text-align: center;
	padding: 20px;
}

.kompas-favorites-modal .error-message {
	color: #ef4444 !important;
	font-size: 14px !important;
	margin-bottom: 20px;
}

.kompas-favorites-modal .retry-button {
	background: #ef4444 !important;
	color: white !important;
}

.kompas-favorites-modal .retry-button:hover {
	background: #dc2626 !important;
}

/* Animations */
@keyframes spin {
	to { transform: rotate(360deg); }
}

@keyframes scaleIn {
	from {
		transform: scale(0);
		opacity: 0;
	}
	to {
		transform: scale(1);
		opacity: 1;
	}
}

/* Scrollbar Styling */
.kompas-favorites-modal .variations-list::-webkit-scrollbar {
	width: 6px;
}

.kompas-favorites-modal .variations-list::-webkit-scrollbar-track {
	background: #f5f5f5;
	border-radius: 3px;
}

.kompas-favorites-modal .variations-list::-webkit-scrollbar-thumb {
	background: #d1d5db;
	border-radius: 3px;
}

.kompas-favorites-modal .variations-list::-webkit-scrollbar-thumb:hover {
	background: #9ca3af;
}

/* Responsive */
@media (max-width: 640px) {
	.kompas-favorites-modal .modal-content {
		max-width: 100%;
		max-height: 100%;
		height: 100%;
		border-radius: 0;
	}
	
	.kompas-favorites-modal .modal-container {
		padding: 0;
	}
	
	.kompas-favorites-modal .variations-actions {
		flex-direction: column;
		gap: 16px;
	}
	
	.kompas-favorites-modal .action-buttons {
		width: 100%;
		flex-direction: column;
	}
	
	.kompas-favorites-modal .button {
		width: 100%;
	}
}

/* Responsive */
@media (max-width: 768px) {
	.kompas-favorites-toolbar {
		flex-wrap: wrap;
	}
	
	.kompas-toolbar-actions {
		width: 100%;
		margin-left: 0;
		margin-top: 10px;
	}
	
	.kompas-favorites-grid {
		grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
		gap: 10px;
	}
	
	.kompas-item-image {
		height: 100px;
	}
}