/**
 * Mặc định ẩn toàn bộ trên desktop
 *
 * @format
 */

.open-filter-btn-mobile,
.filter-popup-mobile {
	display: none;
}

/* Chỉ hiện trên mobile */
@media (max-width: 768px) {
	/* Hide standalone filter buttons, but show the one inside search bar */
	.open-filter-btn-mobile {
		display: none !important;
	}

	/* Show filter button inside the search bar */
	.title-section .open-filter-btn-mobile {
		display: inline-flex !important;
		align-items: center;
		justify-content: center;
		gap: 6px;
		background: transparent;
		border: none;
		color: #555;
		font-size: 14px;
		font-weight: 500;
		padding: 8px 12px;
		cursor: pointer;
		white-space: nowrap;
	}

	.title-section .open-filter-btn-mobile i {
		font-size: 16px;
	}

	.title-section .open-filter-btn-mobile:hover {
		color: #ed1c24;
	}

	/* Filter popup overlay */
	.filter-popup-overlay {
		display: none;
		position: fixed;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		background: rgba(0, 0, 0, 0.5);
		z-index: 1999;
	}

	.filter-popup-overlay.active {
		display: block;
	}

	.filter-popup-mobile {
		display: none;
		position: fixed;
		bottom: 0;
		left: 0;
		right: 0;
		width: 100%;
		max-height: 70vh;
		background: #fff;
		border-radius: 20px 20px 0 0;
		box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
		z-index: 2000;
	}

	.filter-popup-mobile.active {
		display: block;
		animation: slideUp 0.3s ease-out;
	}

	@keyframes slideUp {
		from {
			transform: translateY(100%);
		}
		to {
			transform: translateY(0);
		}
	}

	.filter-popup-header {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 16px 20px;
		border-bottom: 1px solid #f0f0f0;
	}

	.back-btn {
		background: #f5f5f5;
		border: none;
		font-size: 16px;
		cursor: pointer;
		color: #666;
		padding: 10px;
		border-radius: 50%;
		width: 36px;
		height: 36px;
		display: flex;
		align-items: center;
		justify-content: center;
		transition: background 0.2s ease;
	}

	.back-btn:active {
		background: #e8e8e8;
	}

	.popup-title {
		font-weight: 600;
		font-size: 17px;
		color: #222;
	}

	.filter-popup-body {
		padding: 20px;
		overflow-y: auto;
		max-height: calc(70vh - 140px);
	}

	.filter-popup-body label {
		display: block;
		margin: 16px 0 8px;
		font-size: 14px;
		font-weight: 500;
		color: #444;
	}

	.filter-popup-body label:first-child {
		margin-top: 0;
	}

	.filter-popup-body select {
		width: 100%;
		padding: 12px 14px;
		border: 1px solid #e0e0e0;
		border-radius: 10px;
		font-size: 15px;
		color: #333;
		background: #fafafa;
		appearance: none;
		background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
		background-repeat: no-repeat;
		background-position: right 14px center;
	}

	.filter-popup-body select:focus {
		outline: none;
		border-color: #ed1c24;
		background-color: #fff;
	}

	.filter-popup-footer {
		padding: 16px 20px;
		border-top: 1px solid #f0f0f0;
		background: #fff;
	}

	.apply-filter-btn {
		width: 100%;
		padding: 14px;
		background: #ed1c24;
		border: none;
		color: #fff;
		font-size: 16px;
		font-weight: 600;
		border-radius: 12px;
		cursor: pointer;
		transition: background 0.2s ease;
	}

	.apply-filter-btn:active {
		background: #c91a20;
	}
}
/* CSS */
.mobile-only {
	display: none;
}

.mobile-only input {
	flex: 1;
	min-width: 0;
	padding: 12px 16px;
	border: none;
	border-radius: 25px;
	font-size: 15px;
	outline: none;
	background: #f5f5f5;
}

.mobile-only input:focus {
	background: #f0f0f0;
	border: none;
}

/* Mobile filter group styling */
.mobile-only .filter-group {
	display: flex;
	align-items: center;
	gap: 10px;
	width: 100%;
}

.mobile-only .filter-box {
	flex: 1;
	min-width: 0;
}

/* ==========================================================================
   CLEAN MOBILE SEARCH BAR STYLES
   ========================================================================== */
@media (max-width: 768px) {
	.mobile-only .filter-bar {
		display: flex !important;
		flex-direction: row !important;
		align-items: center !important;
		background: #ffffff !important;
		border-radius: 28px !important;
		padding: 6px 6px 6px 16px !important;
		box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1) !important;
		border: 1px solid #e8e8e8 !important;
		gap: 0 !important;
		width: 100% !important;
		margin: 0 !important;
	}

	.mobile-only .filter-bar input[type="text"] {
		flex: 1 !important;
		min-width: 0 !important;
		border: none !important;
		background: transparent !important;
		padding: 10px 8px !important;
		font-size: 15px !important;
		color: #333 !important;
		outline: none !important;
	}

	.mobile-only .filter-bar input[type="text"]::placeholder {
		color: #999 !important;
	}

	.mobile-only .filter-bar .separator {
		color: #ddd !important;
		font-size: 18px !important;
		font-weight: 300 !important;
		margin: 0 4px !important;
	}

	.mobile-only .filter-bar .title-section {
		display: flex !important;
		align-items: center !important;
	}

	.mobile-only .filter-bar .title-section .open-filter-btn-mobile {
		display: inline-flex !important;
		align-items: center !important;
		gap: 4px !important;
		background: transparent !important;
		border: none !important;
		color: #666 !important;
		font-size: 13px !important;
		font-weight: 500 !important;
		padding: 8px 10px !important;
		cursor: pointer !important;
		white-space: nowrap !important;
		transition: color 0.2s ease !important;
	}

	.mobile-only .filter-bar .title-section .open-filter-btn-mobile i {
		font-size: 14px !important;
		color: #888 !important;
	}

	.mobile-only .filter-bar .title-section .open-filter-btn-mobile:active {
		color: #ed1c24 !important;
	}

	/* Search button styling */
	.mobile-only .filter-header__apply-button,
	.mobile-only .sc-iRFsWr button {
		background: #ed1c24 !important;
		border: none !important;
		border-radius: 22px !important;
		width: 44px !important;
		height: 44px !important;
		min-width: 44px !important;
		display: flex !important;
		align-items: center !important;
		justify-content: center !important;
		cursor: pointer !important;
		flex-shrink: 0 !important;
		margin-left: 8px !important;
	}

	.mobile-only .filter-header__apply-button svg,
	.mobile-only .sc-iRFsWr button svg {
		width: 20px !important;
		height: 20px !important;
	}
}

/* Chỉ hiện ở mobile */
@media (max-width: 768px) {
	.mobile-only {
		display: block;
	}
	ul {
	margin-top: 0;
	padding-left: initial;
}
}


@media (max-width: 428px) {
    /* Điều chỉnh nút mở filter trên iPhone 12 */
    .open-filter-btn-mobile {
        width: 70px;
        height: 35px;
        font-size: 14px;
        padding: 5px;
    }

    /* Điều chỉnh popup filter trên iPhone 12 */
    .filter-popup-mobile {
        width: 90%;
        left: 5%;
        bottom: 20px;
        border-radius: 10px;
    }

    .filter-popup-header {
        padding: 10px 12px;
    }

    .popup-title {
        font-size: 15px;
    }

    .back-btn {
        font-size: 16px;
    }

    .filter-popup-body {
        padding: 12px;
    }

    .filter-popup-body label {
        font-size: 13px;
        margin: 8px 0 4px;
    }

    .filter-popup-body select {
        padding: 6px;
        font-size: 13px;
    }

    .filter-popup-footer {
        padding: 12px;
    }

    .apply-filter-btn {
        padding: 8px;
        font-size: 14px;
        border-radius: 5px;
    }

    /* Điều chỉnh input mobile-only cho iPhone 12 */
    .mobile-only input {
        width: 200px;
        padding: 6px 10px;
        font-size: 13px;
    }
}

@media (min-width: 360px) and (max-width: 412px) {
    /* Điều chỉnh nút mở filter trên Samsung */
    .open-filter-btn-mobile {
        width: 75px;
        height: 38px;
        font-size: 14px;
        padding: 5px;
    }

    /* Điều chỉnh popup filter trên Samsung */
    .filter-popup-mobile {
        width: 92%;
        left: 4%;
        bottom: 25px;
        border-radius: 8px;
    }

    .filter-popup-header {
        padding: 10px 14px;
    }

    .popup-title {
        font-size: 15px;
    }

    .back-btn {
        font-size: 17px;
    }

    .filter-popup-body {
        padding: 14px;
    }

    .filter-popup-body label {
        font-size: 13px;
        margin: 9px 0 5px;
    }

    .filter-popup-body select {
        padding: 7px;
        font-size: 13px;
    }

    .filter-popup-footer {
        padding: 14px;
    }

    .apply-filter-btn {
        padding: 9px;
        font-size: 14px;
        border-radius: 6px;
    }

    /* Điều chỉnh input mobile-only cho Samsung */
    .mobile-only input {
        width: 210px;
        padding: 7px 11px;
        font-size: 13px;
    }
}

/* ============================================
   Mobile Navbar Fix - Icons aligned to right
   ============================================ */
@media (max-width: 768px) {
    .sc-jJoQJp.jlkUCc .navbar-header {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
    }

    .sc-jJoQJp.jlkUCc .navbar-header .header-menu {
        display: flex !important;
        flex-direction: row !important;
        align-items: center !important;
        gap: 8px !important;
        margin-left: auto !important;
        margin-right: 0 !important;
        justify-content: flex-end !important;
    }

    .sc-jJoQJp.jlkUCc .navbar-header .header-logo {
        flex-shrink: 0 !important;
    }

    .main-header-nav .container {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
}