/**
 * Product Manager Frontend Styles
 */

/* Product Upload Form */
.product-upload-form-wrapper {
	max-width: 800px;
	margin: 0 auto;
	padding: 2rem;
}

.product-upload-form {
	background: #f9f9f9;
	padding: 2rem;
	border-radius: 8px;
}

.product-upload-form .form-field {
	margin-bottom: 1.5rem;
}

.product-upload-form .form-row {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem;
}

.product-upload-form label {
	display: block;
	font-weight: 600;
	margin-bottom: 0.5rem;
	color: #333;
}

.product-upload-form .required {
	color: #d63638;
}

.product-upload-form input[type="text"],
.product-upload-form input[type="number"],
.product-upload-form input[type="file"],
.product-upload-form select,
.product-upload-form textarea {
	width: 100%;
	padding: 0.75rem;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 1rem;
}

.product-upload-form .form-submit {
	margin-top: 1.5rem;
}

.product-upload-message {
	margin-top: 1rem;
	padding: 1rem;
	border-radius: 4px;
	display: none;
}

.product-upload-message.success {
	background: #d4edda;
	color: #155724;
	border: 1px solid #c3e6cb;
	display: block;
}

.product-upload-message.error {
	background: #f8d7da;
	color: #721c24;
	border: 1px solid #f5c6cb;
	display: block;
}

/* Product List Grid */
.product-list-wrapper {
	margin: 0;
	padding: 3rem 1.5rem;
	position: relative;
}

/* Background decorative elements (faded architectural motifs) */
/* .product-list-wrapper::before,
.product-list-wrapper::after {
	content: '';
	position: absolute;
	width: 250px;
	height: 250px;
	background: radial-gradient(ellipse at center, rgba(147, 51, 234, 0.02) 0%, transparent 65%);
	border-radius: 50%;
	pointer-events: none;
	z-index: 0;
	opacity: 0.6;
} */

.product-list-wrapper::before {
	top: -50px;
	right: -50px;
}

.product-list-wrapper::after {
	top: -50px;
	left: -50px;
}

.product-list-wrapper > * {
	position: relative;
	z-index: 1;
}

/* Product Filter Header */
.product-filter-header {
	display: flex;
	align-items: center;
	gap: 1rem;
	margin-bottom: 1.5rem;
	flex-wrap: wrap;
}

.filter-toggle-btn {
	background: #A4296A !important;
	color: #fff !important;
	border: none;
	border-radius: 8px !important;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	display: flex;
	align-items: center;
	gap: 0.5rem;
	transition: background 0.3s ease;
}

.filter-toggle-btn:hover {
	background: #7c3aed;
}


/* Active Filter Tags */
.active-filter-tags {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	flex: 1;
}

.filter-tag {
	background: #fff;
	color: #000;
	padding: 0.5rem 1rem;
	border-radius: 8px;
	font-size: 0.9rem;
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	border: 1px solid #E0E0E0;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.filter-tag-remove {
	cursor: pointer;
	font-size: 1.2rem;
	line-height: 1;
	color: #666;
	transition: color 0.3s ease;
	margin-left: 0.25rem;
}

.filter-tag-remove:hover {
	color: #9A0056;
}

/* Filter Panel */
.product-filter-panel {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 9998;
	display: none;
	opacity: 0;
	transition: opacity 0.3s ease;
}

.product-filter-panel.active {
	display: block;
	opacity: 1;
}

body.filter-panel-open {
	overflow: hidden;
}

.filter-panel-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
	cursor: pointer;
}

.filter-panel-content {
	position: absolute;
	bottom: 0;
	left: 0;
	width: 100%;
	height: 80%;
	background: #fff;
	border-radius: 20px 20px 0 0;
	display: flex;
	flex-direction: row;
	transform: translateY(100%);
	transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
	box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
}

.product-filter-panel.active .filter-panel-content {
	transform: translateY(0);
}

/* Filter Categories Sidebar */
.filter-categories {
	background: #FFF6F6;
	border-right: 1px solid #e0e0e0;
	width: 200px;
	flex-shrink: 0;
	overflow-y: auto;
}

.filter-category-list {
	padding: 1rem 0;
}

.filter-category-item {
	padding: 1rem 1.5rem;
	cursor: pointer;
	color: #666;
	font-size: 1rem;
	transition: all 0.3s ease;
	border-left: 3px solid transparent;
}

.filter-category-item:hover {
	background: #f0f0f0;
	color: #333;
}

.filter-category-item.active {
	background: #fff;
	color: #9A0056;
	font-weight: 600;
	border-left-color: #9A0056;
}

/* Filter Options */
.filter-options {
	flex: 1;
	overflow-y: auto;
	padding: 1.5rem;
	background: #fff;
}

.filter-option-group {
	display: none;
}

.filter-option-group.active {
	display: block;
}

.filter-checkbox-label {
	display: flex;
	align-items: center;
	padding: 0.75rem 0;
	cursor: pointer;
	transition: background 0.2s ease;
	border-radius: 4px;
	padding-left: 0.5rem;
	margin-left: -0.5rem;
}

.filter-checkbox-label:hover {
	background: #f9f9f9;
}

.filter-checkbox {
	width: 20px;
	height: 20px;
	margin-right: 0.75rem;
	cursor: pointer;
	accent-color: #9A0056;
	flex-shrink: 0;
}

.filter-checkbox-label span:not(.filter-count) {
	flex: 1;
	color: #333;
	font-size: 1rem;
}

.filter-count {
	color: #666;
	font-size: 0.9rem;
	margin-left: auto;
	padding-left: 0.5rem;
}

.metal-filter-section {
	margin-bottom: 2rem;
}

.metal-filter-section:last-child {
	margin-bottom: 0;
}

.metal-filter-section h4 {
	margin: 0 0 1rem 0;
	color: #333;
	font-size: 1.1rem;
	font-weight: 600;
	padding-bottom: 0.5rem;
	border-bottom: 1px solid #e0e0e0;
}

/* Filter Panel Actions */
.filter-panel-actions {
	display: flex;
	gap: 1rem;
	padding: 1.5rem;
	border-top: 1px solid #e0e0e0;
	background: #fff;
	border-radius: 0 0 20px 20px;
	position: sticky;
	top: 100%;
	z-index: 10;
	box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}

.filter-close-btn {
	flex: 0 0 auto;
	background: transparent;
	border: none;
	color: #666;
	font-size: 1rem;
	cursor: pointer;
	padding: 0.75rem 1.5rem;
	text-decoration: underline;
	transition: color 0.3s ease;
	min-width: auto;
}


.filter-apply-btn {
	background-color: #9A0056 !important;
    color: #fff !important;
	border: none;
	padding: 0.75rem 2rem;
	border-radius: 8px;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	transition: background 0.3s ease;
	margin-left: auto;
	min-width: 120px;
}

.filter-apply-btn:hover {
	background: #7c3aed;
}

.filter-apply-btn:active {
	transform: scale(0.98);
}

.product-loading,
.no-products-found {
	text-align: center;
	padding: 3rem;
	font-size: 1.1rem;
	color: #666;
	grid-column: 1 / -1;
}

.product-grid-container {
	max-width: 1200px;
	margin: 0 auto;
	position: relative;
	z-index: 1;
}

/* Gradient overlay to fade last row of products (80% visibility) - encourages clicking Load More */
.product-grid-container.has-more-products::after {
	content: '';
	position: absolute;
	bottom: 0;
	left: 0;
	right: 0;
	height: 350px;
	background: linear-gradient(to bottom, 
		rgba(255, 248, 236, 0) 0%,
		rgba(255, 248, 236, 0.05) 20%,
		rgba(255, 248, 236, 0.1) 40%,
		rgba(255, 248, 236, 0.15) 60%,
		rgba(255, 248, 236, 0.2) 100%
	);
	pointer-events: none;
	z-index: 2;
}

.product-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
	gap: 1.25rem;
	margin-bottom: 3rem;
}

.product-list-wrapper[data-columns="2"] .product-grid {
	grid-template-columns: repeat(2, 1fr);
}

.product-list-wrapper[data-columns="3"] .product-grid {
	grid-template-columns: repeat(3, 1fr);
}

.product-list-wrapper[data-columns="4"] .product-grid {
	grid-template-columns: repeat(4, 1fr);
	max-width: 1200px;
	margin-left: auto;
	margin-right: auto;
}

.product-list-wrapper[data-columns="5"] .product-grid {
	grid-template-columns: repeat(5, 1fr);
}

.product-list-wrapper[data-columns="6"] .product-grid {
	grid-template-columns: repeat(6, 1fr);
}

/* Product Card */
.product-card {
	background: #fff;
	border-radius: 10px;
	overflow: hidden;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
	transition: transform 0.3s ease, box-shadow 0.3s ease;
	cursor: pointer;
	display: flex;
	flex-direction: column;
}

.product-card:hover {
	transform: translateY(-2px);
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.product-card-image {
	width: 100%;
	overflow: hidden;
	flex-shrink: 0;
	padding: 8px;
	padding-bottom: 0;
}

.product-card-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.product-card-content {
	padding: 1.25rem 1.5rem;
	background: #fff;
	flex: 1;
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.product-card-title {
	font-size: 1rem;
	margin: 0 0 0.5rem 0;
	color: #000;
	font-weight: 500;
	line-height: 1.4;
}

.product-card-code {
	margin: 0;
	color: #666;
	font-size: 0.875rem;
	line-height: 1.4;
}

/* Load More Button */
.product-load-more-wrapper {
	text-align: center;
	margin-top: 3rem;
	margin-bottom: 2rem;
	position: relative;
	z-index: 1;
}

/* Hide wrapper when button is hidden */
.product-load-more-wrapper:has(.load-more-button[style*="display: none"]),
.product-load-more-wrapper:has(.load-more-button.hidden) {
	display: none;
}

/* White overlay behind button - positioned to extend downward only, not overlapping products above */
.product-load-more-wrapper::before {
	content: '';
	position: absolute;
	top: 0;
	left: 50%;
	transform: translateX(-50%);
	width: calc(100% + 4rem);
	height: 200px;
	background: rgba(255, 255, 255, 0.9);
	z-index: -1;
	backdrop-filter: blur(10px);
	background: linear-gradient(180deg, rgba(255, 248, 236, 0) 2.45%, rgba(255, 248, 236, 0.637838) 32.98%, rgba(255, 248, 236, 0.9) 55.8%, rgba(255, 248, 236, 0.95) 69.29%);
	pointer-events: none;
}

.load-more-button {
	background: #B52372;
	color: #fff !important;
	border: none;
	padding: 0.875rem 2rem;
	border-radius: 12px;
	font-size: 1rem;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.3s ease;
	display: inline-flex;
	align-items: center;
	gap: 0.75rem;
	position: relative;
	z-index: 1;
	box-shadow: 0 2px 8px rgba(217, 70, 239, 0.3);
}

.load-more-button:hover {
	background: #BE0066;
	box-shadow: 0 4px 12px rgba(217, 70, 239, 0.4);
	transform: translateY(-1px);
}

.load-more-button .arrow {
	font-size: 1.1rem;
	transition: transform 0.3s ease;
	line-height: 1;
}

.load-more-button:hover .arrow {
	transform: translateY(2px);
}

.load-more-button:disabled {
	opacity: 0.6;
	cursor: not-allowed;
	transform: none;
}

.load-more-button:disabled:hover {
	background: #BE0066;
	box-shadow: 0 2px 8px rgba(217, 70, 239, 0.3);
}

/* Product Popup Modal - Slides from bottom at 80% height */
.product-popup {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 9999;
	display: none;
}

.product-popup.active {
	display: block;
}

.product-popup-overlay {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: rgba(0, 0, 0, 0.5);
	opacity: 0;
	transition: opacity 0.3s ease;
}

.product-popup.active .product-popup-overlay {
	opacity: 1;
}

.product-popup-content {
	position: absolute;
	bottom: 0;
	left: 0;
	width: 100%;
	height: 80%;
	background: #fff;
	border-radius: 20px 20px 0 0;
	transform: translateY(100%);
	transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
	display: flex;
	flex-direction: column;
	box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.2);
}

.product-popup.active .product-popup-content {
	transform: translateY(0);
}

.product-popup-close {
	position: absolute;
	top: 1rem;
	right: 1rem;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: #E5E5E5;
	color: #fff;
	border: none;
	font-size: 24px;
	line-height: 1;
	cursor: pointer;
	z-index: 10;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: background 0.3s ease;
}

.product-popup-close:hover {
	background: #c5c5c5;
}

.product-popup-body {
	flex: 1;
	overflow-y: auto;
	padding: 1.5rem;
	-webkit-overflow-scrolling: touch;
}

.product-popup-loading {
	text-align: center;
	padding: 3rem;
	font-size: 1.1rem;
	color: #666;
}

/* Product Popup Details */
.product-popup-details {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 2rem;
}

.product-popup-image {
	width: 100%;
	overflow: hidden;
	border-radius: 12px;
}

.product-popup-image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.product-popup-info {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.product-popup-title {
	font-size: 18px;
	margin: 0 0 1rem 0;
	color: #87054F;
	font-weight: 600;
}

.product-popup-section {
	padding: 1.5rem;
	border-radius: 8px;
}

.product-popup-section:last-child {
	margin-bottom: 0;
}

/* Product Details section - white background */
.product-details-section {
	background: #fff;
    padding-bottom: 0;
    padding: 0;
    margin-bottom: 0;
}

/* Gold Information section - information box background */
.gold-information-section {
	background: #FFFAEC;
}

/* Diamond Information section - information box background */
.diamond-information-section {
	background: #FFFAEC;
}

.product-popup-section-title {
	font-size: 13px;
	margin: 0 0 1rem 0;
	color: #87054F;
	font-weight: 600;
	display: flex;
	align-items: center;
	gap: 0.5rem;
	background: #FBF3DC;
	border-top-right-radius: 5px;
	border-top-left-radius: 5px;
	padding: 0.75rem 1rem;
	margin-left: -1.5rem;
	margin-right: -1.5rem;
	margin-top: -1.5rem;
	margin-bottom: 1rem;
}

/* Product Details section title - no background, black color */
.product-details-section .product-popup-section-title {
	background: transparent;
	color: #000;
	padding: 0;
	margin-left: 0;
	margin-right: 0;
	margin-top: 0;
	margin-bottom: 1rem;
	border-radius: 0;
}

.product-popup-section-title .icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	flex-shrink: 0;
}

.product-popup-section-title .icon img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

.product-popup-section p {
	margin: 0.5rem 0;
	color: #333;
	line-height: 1.6;
	font-size: 12px;
}

.product-popup-section strong {
	color: #333;
	font-weight: 600;
	font-size: 12px;
}

/* Make values bold (the text after the label) */
.product-popup-section p .value {
	font-weight: 700;
	font-size: 12px;
	color: #333;
}

.product-popup-sku,
.product-popup-code {
	font-size: 12px;
	margin: 0.5rem 0;
	font-weight: 400;
	font-style: normal;
}

.product-popup-sku,
.product-popup-code {
	color: #8C8C8C;
}

.product-popup-sku strong,
.product-popup-code strong {
	color: #8C8C8C;
	font-weight: 400;
}

.product-popup-description {
	color: #555;
	line-height: 1.8;
}

/* Responsive */
@media (max-width: 768px) {
	.filter-panel-content {
		height: 90%;
		flex-direction: row;
	}

	.filter-categories {
		width: 150px;
		border-right: 1px solid #e0e0e0;
		border-bottom: none;
		max-height: none;
	}

	.filter-category-list {
		display: block;
		overflow-y: auto;
		padding: 0.5rem 0;
		gap: 0;
	}

	.filter-category-item {
		padding: 0.75rem 1rem;
		white-space: normal;
		border-left: 3px solid transparent;
		border-bottom: none;
		border-radius: 0;
		min-width: auto;
	}

	.filter-category-item.active {
		border-left-color: #9A0056;
		border-bottom: none;
		background: #fff;
	}

	.filter-options {
		padding: 1rem;
		padding-bottom: 100px; /* Space for sticky buttons */
		overflow-y: auto;
	}

	.filter-panel-actions {
		padding: 1rem;
		gap: 0.75rem;
	}

	.filter-close-btn {
		padding: 0.625rem 1rem;
		font-size: 0.9rem;
	}

	.filter-apply-btn {
		padding: 0.625rem 1.5rem;
		font-size: 0.9rem;
		min-width: 100px;
	}

	.product-grid {
		grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
		gap: 1rem;
	}

	.filter-toggle-btn {
		padding: 0.625rem 1.25rem;
		font-size: 0.9rem;
	}

	.active-filter-tags {
		width: 100%;
	}

	.product-list-wrapper {
		padding: 0;
	}

	.product-grid-container {
		max-width: 100%;
	}

	.product-grid-container.has-more-products::after {
		height: 250px;
	}

	.product-load-more-wrapper::before {
		width: calc(100% + 2rem);
		height: 70px;
	}

	.load-more-button {
		padding: 0.75rem 1.5rem;
		font-size: 0.9rem;
	}

	.product-list-wrapper[data-columns="2"] .product-grid,
	.product-list-wrapper[data-columns="3"] .product-grid,
	.product-list-wrapper[data-columns="4"] .product-grid,
	.product-list-wrapper[data-columns="5"] .product-grid,
	.product-list-wrapper[data-columns="6"] .product-grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.product-popup-content {
		height: 90%;
	}

	.product-popup-details {
		grid-template-columns: 1fr;
		gap: 1.5rem;
	}

	.product-popup-image {
		height: 300px;
	}

	.product-upload-form .form-row {
		grid-template-columns: 1fr;
	}
}

@media (max-width: 480px) {
	.product-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 0.75rem;
	}

	.product-card-content {
		padding: 1rem;
	}

	.product-card-title {
		font-size: 0.8rem;
	}

	.product-card-code {
		font-size: 0.8rem;
	}

	.product-grid-container.has-more-products::after {
		height: 200px;
	}

	.product-load-more-wrapper::before {
		width: calc(100% + 1rem);
		height: 60px;
		border-radius: 15px;
	}

	.load-more-button {
		padding: 0.625rem 1.25rem;
		font-size: 0.85rem;
	}

	.product-popup-content {
		height: 95%;
		border-radius: 0;
	}
}

