/*
 * DG24 Filter - scoped styles.
 *
 * Keep selectors prefixed to avoid conflicts with Flatsome/WooCommerce.
 */

.dg24-filter {
	margin: 10px 0 5px;
	position: relative;
}


.dg24-filter-inline-header {
	margin-bottom: 12px;
	border-bottom: 0.5px solid rgb(229 229 229 / 70%);
    padding-bottom: 10px;
}

.dg24-filter-title {
	font-size: 16px;
	font-weight: 600;
	margin: 0;
	display: inline-block;
	vertical-align: middle;
	margin-top: 5px;
}

.dg24-filter-inline-bar {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}
.widget_price_filter .ui-slider .ui-slider-range {
    background-color: #4a90e2;
    border-radius: 99px;
    display: block;
    opacity: 1;
}
.widget_price_filter .ui-slider .ui-slider-handle {
    background-color: #1a73e8;
}
.widget_price_filter .price_slider_amount {
    color: #4b4b4b;
}
.dg24-filter-chip {
	appearance: none;
	background: #ffffff;
	border: 1px solid #e1e1e1;
	border-radius: 8px;
	padding: 8px 16px;;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	cursor: pointer;
	font-size: 14px;
	line-height: 1.5;
	color: #1d1d20;
	transition: background 0.2s ease, border-color 0.2s ease;
	margin: 0;
	font-weight: 300 !important;
	text-transform: none !important;
}

.dg24-filter-chip:hover .dg24-chip-arrow svg {
	stroke: #007cba;
}

.dg24-filter-chip--has-active {
	border-color: #4a90e2 !important;
	color: #4a90e2 !important;
}

.dg24-filter-chip--has-active .dg24-chip-arrow svg {
	stroke: #4a90e2 !important;
}

.dg24-filter-chip[data-filter-key].dg24-filter-chip--has-active:hover {
	border-color: #007cba !important;
	color: #007cba !important;
}

.dg24-filter-chip[data-filter-key].dg24-filter-chip--has-active:hover .dg24-chip-arrow svg {
	stroke: #007cba !important;
}
.dg24-inline-filter .dg24-chip-label span {
	line-height: 0;
}

.dg24-filter-chip--advanced {
	border-color: #4a90e2;
    color: #4a90e2;
    background: #ffffff;
    border: 1px solid #4a90e2;
}

.dg24-chip-arrow {
	font-size: 12px;
	opacity: 0.8;
}

.dg24-inline-filter {
	position: relative;
}

.dg24-inline-dropdown {
	position: absolute;
    top: 100%;
    left: 0;
    z-index: 9999;
    min-width: 460px;
    max-width: 50vh;
    margin-top: 8px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 1px 20px rgba(0,0,0,.2);
    border: 1px solid #eee;
    overflow: hidden;
}

.dg24-inline-dropdown-body {
	padding: 14px;
	max-height: 360px;
	overflow: auto;
}

.dg24-inline-dropdown-footer {
	display: flex;
	padding: 0px 14px;
	background: #fff;
}

.dg24-btn {
	padding: 10px 12px;
    line-height: 1;
    transition: background 0.2s ease, border-color 0.2s ease;
    flex: 1;
    background: #fff;
    border: 1px solid #cfcfd3;
    border-radius: 8px;
    color: #18181b;
    font-size: 14px;
    font-weight: 600;
	
}

.dg24-btn--primary {
	background: #d70018;
    border-color: #d70018;
    color: #fff;
}

.dg24-btn--primary:hover {
	background: #ff2e31;
	border-color: #ff2e31;
}

.dg24-btn--secondary {
	background: #fff;
}

.dg24-btn--reset {
	background: #fff;
	border-color: #ddd;
	color: #444;
}

.dg24-btn--apply {
	background: #d70018;
    border-color: #d70018;
	color: #fff;
}

.dg24-filter-section {
	margin-bottom: 18px;
}

.dg24-filter-section h4 {
	font-size: 14px;
	font-weight: 700;
	margin: 0 0 10px;
	color: #4a4a4a;
}

.dg24-filter-options {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.dg24-option {
	position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px;
    border: 1px solid #eaeaea;
    border-radius: 50px;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s ease, border-color 0.2s ease;
    background: #f2f2f3;
    color: #1d1d20;
    font-size: 14px;
    height: 40px;
    box-shadow: 0 0 0 1px #e4e4e7;
}

.dg24-option input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.dg24-option:hover {
	background: #f9f9f9;
	border-color: #ddd;
}

.dg24-option.is-active {
	background: #eff5ff;
    box-shadow: 0 0 0 1px #2570eb;
    color: #2570eb;
}

.dg24-option.is-disabled {
	opacity: 0.45;
	cursor: not-allowed;
	pointer-events: none;
}

.dg24-option-image {
	width: 22px;
	height: 22px;
	border-radius: 4px;
	object-fit: contain;
	background: #fff;
}

.dg24-option-label {
	font-size: 14px;
	color: #222;
}

.dg24-option-count {
	font-size: 12px;
	color: #666;
}


.dg24-active-filters {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 12px;
}
.dg24-active-filter-tag.dg24-active-filter-clear {
	background: #f2f4f7;
    border: none;
    color: #2570eb;
}
.dg24-active-filter-tag {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    border: 1px solid #fd6709;
    padding: 0px 16px;
    font-size: 13px;
    background: #f7f7f8;
    color: #fd6709;
    border-radius: 999px;
    margin: 0;
    font-weight: 500 !important;
}

.dg24-active-filter-tag .dg24-tag-remove {
	font-weight: 700;
	opacity: 0.7;
}

.dg24-active-filter-tag:hover {
	background: #fafafa;
}

.dg24-active-filter-clear {
	border-color: #ff4d4f;
	color: #ff4d4f;
}

/* Popup */
.dg24-popup-overlay {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	z-index: 99999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.dg24-popup {
	background: #fff;
	border-radius: 14px;
	width: 100%;
	max-width: 820px;
	max-height: 85vh;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

.dg24-popup-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 18px;
	border-bottom: 1px solid #f0f0f0;
}
.dg24-popup-header .dg24-popup-close {
margin:0;
padding: 0px;
}

.dg24-popup-header h3 {
	margin: 0;
	font-size: 18px;
	font-weight: 700;
}

.dg24-popup-close {
	appearance: none;
	border: 0;
	background: transparent;
	/* Make the close button a centered square so SVG is vertically centered */
	width: 40px;
	height: 40px;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 8px;
	cursor: pointer;
	color: #333;
}
.dg24-popup-close svg {
	width: 16px;
	height: 16px;
	display: block;
}

@media (max-width: 768px) {
	.dg24-popup-close {
		width: 36px;
		height: 36px;
	}
	.dg24-popup-close svg {
		width: 14px;
		height: 14px;
	}
}

.dg24-popup-body {
	padding: 18px;
	overflow: auto;
}

.dg24-popup-footer {
	display: flex;
	padding: 16px 18px;
	background: #fff;
}

/* Hide WooCommerce price filter submit button - we use plugin's "XEM KẾT QUẢ" button instead */
.dg24-woocommerce-price-filter button[type="submit"],
.dg24-woocommerce-price-filter input[type="submit"],
.dg24-woocommerce-price-filter .button,
.dg24-woocommerce-price-filter .price_slider_amount button {
	display: none !important;
}
.dg24-price-slider-wrap > .price_label{
	display: none !important;
  }
/* Hide price display text if it exists separately */
.dg24-woocommerce-price-filter .price_slider_amount {
	margin-bottom: 0;
}

@media (max-width: 768px) {
	.dg24-inline-dropdown {
		position: fixed;
		left: 12px;
		right: 12px;
		top: 80px;
		max-width: none;
		min-width: 0;
	}

	.dg24-filter-title {
		font-size: 18px;
	}
}

/* ==================================================
   SORTING STYLES
   ================================================== */

/* Sorting dropdown in filter bar */
.dg24-sorting-dropdown {
	position: relative;
	display: inline-block;
}

.dg24-sorting-trigger {
	display: inline-flex;
    align-items: center;
    padding: 8px 16px;
    border: 1px solid #4a90e2;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
    cursor: pointer;
    justify-content: space-between;
    font-size: 14px;
    line-height: 1.5;
    color: #4a90e2;
    background: #ffffff;
}

.dg24-sorting-trigger .dg24-chip-arrow svg {
	stroke: #4a90e2;
}

.dg24-sorting-trigger:hover {
	border-color: #007cba;
	color: #007cba;
	text-decoration: none;
}

.dg24-sorting-trigger:hover .dg24-chip-arrow svg {
	stroke: #007cba;
}

.dg24-sorting-trigger--active {
	border-color: #007cba;
	background: #007cba;
	color: #fff;
}

.dg24-sorting-trigger--active .dg24-chip-arrow svg {
	stroke: #fff;
}

.dg24-sorting-trigger--active:hover {
	border-color: #005a87;
	background: #005a87;
	color: #fff;
}

.dg24-sorting-trigger--active:hover .dg24-chip-arrow svg {
	stroke: #fff;
}

.dg24-chip-arrow {
	margin-left: 8px;
	transition: transform 0.2s ease;
}

.dg24-chip-arrow svg {
	width: 12px;
	height: 8px;
	transition: stroke 0.2s ease;
}

.dg24-sorting-dropdown--open .dg24-chip-arrow {
	transform: rotate(180deg);
}

.dg24-sorting-dropdown-panel {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	z-index: 1000;
	margin-top: 4px;
	padding: 8px 0;
	background: #fff;
	border: 1px solid #e1e1e1;
	border-radius: 8px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
	min-width: 200px;
}

.dg24-sorting-dropdown-option {
	display: flex;
	align-items: center;
	padding: 10px 16px;
	color: #666;
	text-decoration: none;
	font-size: 14px;
	transition: all 0.2s ease;
	border: none;
	background: none;
	width: 100%;
	text-align: left;
	cursor: pointer;
}

.dg24-sorting-dropdown-option:hover {
	background: #f8f9fa;
	color: #007cba;
	text-decoration: none;
}

.dg24-sorting-dropdown-option--active {
	background: #007cba;
	color: #fff;
}

.dg24-sorting-dropdown-option--active:hover {
	background: #005a87;
	color: #fff;
}

.dg24-sorting-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	margin-right: 10px;
	flex-shrink: 0;
}

.dg24-sorting-icon svg {
	width: 18px;
	height: 18px;
}

.dg24-sorting-label {
	font-weight: 500;
}

/* Sorting popup styles */
.dg24-sorting-section {
	margin-bottom: 24px;
	padding-bottom: 16px;
	border-bottom: 1px solid #f0f0f0;
}

.dg24-sorting-section:last-child {
	border-bottom: none;
	margin-bottom: 0;
	padding-bottom: 0;
}

.dg24-sorting-section h4 {
	margin: 0 0 12px 0;
	font-size: 16px;
	font-weight: 600;
	color: #333;
}

.dg24-sorting-options {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.dg24-sorting-option {
	display: flex;
	align-items: center;
	padding: 12px 16px;
	border: 1px solid #e1e1e1;
	border-radius: 8px;
	background: #fff;
	color: #666;
	text-decoration: none;
	font-size: 14px;
	transition: all 0.2s ease;
}

.dg24-sorting-option:hover {
	border-color: #007cba;
	color: #007cba;
	text-decoration: none;
}

.dg24-sorting-option--active {
	border-color: #007cba;
	background: #007cba;
	color: #fff;
}

.dg24-sorting-option--active:hover {
	border-color: #005a87;
	background: #005a87;
	color: #fff;
}

.dg24-option-label {
	font-size: 14px;
	font-weight: 500;
}

/* Mobile responsive */
@media (max-width: 768px) {
	.dg24-sorting-dropdown {
		margin-left: 0;
		margin-top: 0;
	}

	.dg24-sorting-trigger {
		justify-content: space-between;
	}

	.dg24-chip-arrow svg {
		width: 14px;
		height: 8px;
	}

	.dg24-filter-chip .dg24-chip-arrow svg {
		width: 12px;
		height: 8px;
	}

	.dg24-sorting-dropdown-panel {
		position: fixed;
		top: auto;
		left: 16px;
		right: 16px;
		z-index: 9999;
		margin-top: 8px;
		box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
		border: 1px solid #e1e1e1;
		max-height: 70vh;
		overflow-y: auto;
	}

	.dg24-sorting-dropdown-option {
		padding: 14px 18px;
		font-size: 15px;
	}

	.dg24-sorting-section {
		margin-bottom: 20px;
	}

	.dg24-sorting-option {
		padding: 14px 18px;
		font-size: 15px;
	}
}
