/* Frontend styles for Halal & Global Deal Filter */
.hgdf-deal-settings {
    margin-bottom: 20px;
}

.hgdf-mode-selector {
    display: flex !important;
    flex-direction: column;
    gap: 15px;
    padding: 10px;
}

.hgdf-mode-options {
    display: flex !important;
    gap: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.hgdf-mode-option {
    display: flex !important;
    align-items: center;
    gap: 8px;
    padding: 12px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
    width: 200px;
    transition: border-color 0.2s ease;
}

.hgdf-mode-option:hover:not(.disabled) {
    border-color: #f99220;
}

.hgdf-mode-option input[type="radio"] {
    margin-right: 8px;
}

.hgdf-mode-option input[type="radio"]:disabled {
    cursor: not-allowed;
}

.hgdf-mode-option.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.hgdf-mode-icon {
    width: 28px;
    height: 28px;
    vertical-align: middle;
}

.hgdf-mode-notice {
    font-style: italic;
    color: #555;
    font-size: 14px;
}

/* Confirmation Popup */
.hgdf-confirmation-popup {
    display: none !important;
    position: fixed !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
    background: #fff !important;
    padding: 20px !important;
    border-radius: 8px !important;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.3) !important;
    z-index: 1000 !important;
    text-align: center !important;
    max-width: 400px !important;
    width: 90% !important;
}

.hgdf-confirmation-popup.halal {
    background: #e6f4ea !important; /* Light green for Halal mode */
}

.hgdf-confirmation-popup.global {
    background: #e6f0fa !important; /* Light blue for Global mode */
}

.hgdf-confirmation-popup.neutral {
    background: #f5f5f5 !important; /* Distinct light gray for Neutral mode */
}

.hgdf-confirmation-popup.show {
    display: block !important;
}

.hgdf-popup-header {
    display: flex !important;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.hgdf-popup-icon {
    width: 32px;
    height: 32px;
}

.hgdf-popup-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

.hgdf-confirmation-popup p {
    margin: 0 0 20px;
    font-size: 16px;
}

.hgdf-confirmation-popup button {
    padding: 10px 20px;
    margin: 0 10px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
}

.hgdf-confirmation-popup .confirm-btn {
    background: #28a745 !important;
    color: #fff !important;
}

.hgdf-confirmation-popup .cancel-btn {
    background: #dc3545 !important;
    color: #fff !important;
}

.hgdf-overlay {
    display: none !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100% !important;
    height: 100% !important;
    background: rgba(0, 0, 0, 0.5) !important;
    z-index: 999 !important;
}

.hgdf-overlay.show {
    display: block !important;
}

/* Mobile Styles */
@media (max-width: 768px) {
    .hgdf-mode-selector {
        gap: 10px;
        padding: 8px;
    }

    .hgdf-mode-options {
        gap: 15px;
        flex-wrap: wrap;
    }

    .hgdf-mode-option {
        width: 160px;
        padding: 8px;
        gap: 6px;
    }

    .hgdf-mode-icon {
        width: 20px;
        height: 20px;
    }

    .hgdf-mode-notice {
        font-size: 12px;
    }

    .hgdf-confirmation-popup {
        max-width: 85% !important;
        padding: 15px !important;
    }

    .hgdf-popup-header {
        gap: 8px;
    }

    .hgdf-popup-icon {
        width: 24px;
        height: 24px;
    }

    .hgdf-popup-header h3 {
        font-size: 16px;
    }

    .hgdf-confirmation-popup p {
        font-size: 14px;
    }

    .hgdf-confirmation-popup button {
        padding: 8px 15px;
        font-size: 12px;
        margin: 0 5px;
    }
}

/* Hide perpage filter when deal mode is active */
.hgdf-mode-selector ~ .wcfm_filters_box select[name="perpage"],
.hgdf-mode-selector ~ .wcfm_filters_box .perpage,
.hgdf-mode-selector ~ .wcfm_filters_box .filterSelect[data-class*="perpage"] {
    display: none !important;
}

/* Hide the entire filters box if it only contains perpage filter */
.wcfm_filters_box:only-child {
    display: none !important;
}