/**
 * Kompas Favorites - Frontend Styles
 * Minimalist Design
 */

/* ========================================
   Container & Layout
======================================== */

.kompas-favorites-account {
	max-width: 100%;
	margin: 0 auto;
}

/* ========================================
   Empty State
======================================== */

.kompas-favorites-empty {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	padding: 60px 20px;
	text-align: center;
}

.kompas-favorites-empty svg {
	color: #999;
	margin-bottom: 16px;
}

.kompas-favorites-empty p {
	font-size: 16px;
	color: #666;
	margin: 0 0 20px 0;
}

.kompas-btn-primary {
	display: inline-block;
	padding: 10px 24px;
	background: #000;
	color: white !important;
	text-decoration: none;
	border-radius: 4px;
	font-weight: 500;
	transition: opacity 0.2s;
	border: none;
	cursor: pointer;
	font-size: 14px;
}

.kompas-btn-primary:hover {
	opacity: 0.8;
}

.kompas-btn-primary:disabled {
	background: #ccc;
	cursor: not-allowed;
	opacity: 1;
}

.kompas-btn-secondary {
	display: inline-block;
	padding: 10px 24px;
	background: white;
	color: #000 !important;
	text-decoration: none;
	border-radius: 4px;
	font-weight: 500;
	transition: all 0.2s;
	border: 1px solid #ddd;
	cursor: pointer;
	font-size: 14px;
}

.kompas-btn-secondary:hover {
	border-color: #000;
}

.kompas-btn-secondary:disabled {
	border-color: #ddd;
	color: #ccc !important;
	cursor: not-allowed;
}

/* ========================================
   Toolbar
======================================== */

.kompas-favorites-toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 0;
	margin-bottom: 20px;
	border-bottom: 1px solid #eee;
	flex-wrap: wrap;
	gap: 12px;
}

.kompas-select-all {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	font-size: 14px;
	color: #333;
	user-select: none;
}

.kompas-select-all input[type="checkbox"] {
	width: 18px;
	height: 18px;
	cursor: pointer;
}

.kompas-selected-count {
	display: none;
	align-items: center;
	gap: 4px;
	font-size: 14px;
	color: #666;
}

.kompas-selected-count .count-number {
	font-weight: 600;
	color: #000;
}

.kompas-toolbar-actions {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

/* ========================================
   Accordion - Product Groups
======================================== */

.kompas-products-accordion {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.kompas-accordion-item {
	border: 1px solid #eee;
	border-radius: 0;
	overflow: hidden;
	background: white;
}

.kompas-accordion-header {
	cursor: pointer;
	padding: 16px;
	background: #fafafa;
	border-bottom: 1px solid #eee;
	transition: background 0.2s;
}

.kompas-accordion-header:hover {
	background: #f5f5f5;
}

.kompas-accordion-item.active .kompas-accordion-header {
	background: white;
}

.kompas-accordion-header-content {
	display: flex;
	align-items: center;
	gap: 16px;
}

.kompas-product-thumb {
	width: 60px;
	height: 60px;
	object-fit: cover;
	border: 1px solid #eee;
	flex-shrink: 0;
}

.kompas-product-info {
	flex: 1;
	min-width: 0;
}

.kompas-product-info h3 {
	margin: 0 0 6px 0;
	font-size: 15px;
	margin-bottom: 8px !important;
	font-weight: 500;
	color: #000;
	line-height: 1.4;
}

.kompas-categories {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
}

.kompas-category-badge {
	font-size: 11px;
	padding: 3px 8px;
	background: #f5f5f5;
	color: #666;
	border-radius: 2px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.kompas-accordion-meta {
	display: flex;
	align-items: center;
	gap: 12px;
	flex-shrink: 0;
}

.kompas-variation-count {
	font-size: 13px;
	color: #666;
	white-space: nowrap;
}

.kompas-accordion-toggle {
	background: none;
	border: none;
	padding: 4px;
	cursor: pointer;
	transition: transform 0.3s;
	display: flex;
	align-items: center;
	justify-content: center;
	color: #666;
}

.kompas-accordion-item.active .kompas-accordion-toggle {
	transform: rotate(180deg);
}

.kompas-accordion-content {
	max-height: 0;
	overflow: hidden;
	transition: max-height 0.3s ease;
}

.kompas-accordion-item.active .kompas-accordion-content {
	max-height: 10000px;
}

/* ========================================
   Favorites Grid - Items
======================================== */

.kompas-favorites-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: 16px;
	padding: 16px;
	background: white;
}

.kompas-favorite-item {
	background: white;
	border: 1px solid #eee;
	padding: 12px;
	position: relative;
	transition: all 0.2s;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.kompas-favorite-item:hover {
	border-color: #ddd;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.kompas-favorite-item.selected {
	border-color: #000;
	background: #fafafa;
}

.kompas-favorite-item input[type="checkbox"] {
	position: absolute;
	top: 10px;
	left: 10px;
	width: 18px;
	height: 18px;
	cursor: pointer;
	z-index: 10;
}

.kompas-favorite-item input[type="checkbox"]:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

/* ========================================
   Item Image
======================================== */

.kompas-item-image {
	position: relative;
	width: 100%;
	aspect-ratio: 1;
	overflow: hidden;
	background: #fafafa;
	border: 1px solid #eee;
}

.kompas-item-image img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.kompas-item-image .out-of-stock {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background: rgba(0, 0, 0, 0.85);
	color: white;
	padding: 6px 12px;
	font-weight: 500;
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

/* ========================================
   Item Info
======================================== */

.kompas-item-info {
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex: 1;
}

.kompas-sku {
	font-size: 11px;
	color: #999;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 0.5px;
}

.kompas-item-info h4 {
	margin: 0;
	font-size: 14px;
	font-weight: 500;
	color: #000;
	line-height: 1.4;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

/* ========================================
   Attributes
======================================== */

.kompas-attributes {
	display: flex;
	flex-wrap: wrap;
	gap: 4px;
}

.kompas-attribute-pill {
	display: inline-block;
	background: #f5f5f5;
	color: #666;
	padding: 4px 8px;
	font-size: 11px;
	line-height: 1.3;
}

.kompas-attribute-pill strong {
	font-weight: 600;
	color: #000;
}

/* ========================================
   Price
======================================== */

.kompas-price {
	font-size: 16px;
	font-weight: 600;
	color: #000;
	margin: 4px 0;
}

.kompas-price del {
	opacity: 0.5;
	font-weight: 400;
	font-size: 14px;
	margin-right: 6px;
}

/* ========================================
   Actions
======================================== */

.kompas-actions {
	display: flex;
	gap: 6px;
	margin-top: auto;
}

.kompas-add-cart {
	flex: 1;
	padding: 8px 12px;
	background: #000;
	color: white;
	border: none;
	font-weight: 500;
	font-size: 13px;
	cursor: pointer;
	transition: opacity 0.2s;
}

.kompas-add-cart:hover {
	opacity: 0.8;
}

.kompas-add-cart.loading {
	opacity: 0.6;
	cursor: wait;
	pointer-events: none;
}

.kompas-remove {
	width: 32px;
	height: 32px;
	padding: 0;
	background: white;
	color: #000;
	border: 1px solid #ddd;
	font-size: 20px;
	font-weight: 400;
	cursor: pointer;
	transition: all 0.2s;
	display: flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.kompas-remove:hover {
	background: #000;
	color: white;
	border-color: #000;
}

/* ========================================
   Notification
======================================== */

.kompas-notification {
	position: fixed;
	bottom: 20px;
	right: 20px;
	padding: 12px 20px;
	font-size: 14px;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
	z-index: 9999;
	max-width: 350px;
	border: 1px solid #ddd;
	background: white;
}

.kompas-notification.success {
	background: #000;
	color: white;
	border-color: #000;
}

.kompas-notification.error {
	background: #fff;
	color: #000;
	border-color: #000;
}

/* ========================================
   Responsive Design
======================================== */

@media (max-width: 768px) {
	.kompas-favorites-toolbar {
		flex-direction: column;
		align-items: stretch;
	}

	.kompas-toolbar-actions {
		width: 100%;
	}

	.kompas-toolbar-actions button {
		flex: 1;
	}

	.kompas-accordion-header {
		padding: 12px;
	}

	.kompas-accordion-header-content {
		gap: 12px;
	}

	.kompas-product-thumb {
		width: 50px;
		height: 50px;
	}

	.kompas-product-info h3 {
		font-size: 14px;
	}

	.kompas-accordion-meta {
		flex-direction: column;
		align-items: flex-end;
		gap: 6px;
	}

	.kompas-favorites-grid {
		grid-template-columns: 1fr;
		padding: 12px;
		gap: 12px;
	}

	.kompas-notification {
		left: 20px;
		right: 20px;
		bottom: 20px;
	}
}

/* ========================================
   Loading State
======================================== */

.kompas-loading {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 40px;
}

.kompas-spinner {
	width: 32px;
	height: 32px;
	border: 2px solid #eee;
	border-top-color: #000;
	border-radius: 50%;
	animation: spin 0.8s linear infinite;
}

@keyframes spin {
	to {
		transform: rotate(360deg);
	}
}