/* Popup styles for Halal & Global Deal Filter */
.hgdf-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    padding: 15px;
    box-sizing: border-box;
}

.hgdf-popup-overlay.active {
    opacity: 1;
    visibility: visible;
}

.hgdf-popup-container {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    max-width: 500px;
    width: 100%;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    transform: translateY(20px);
    transition: transform 0.3s ease;
    max-height: 90vh;
    overflow-y: auto;
    box-sizing: border-box;
}

.hgdf-popup-overlay.active .hgdf-popup-container {
    transform: translateY(0);
}

.hgdf-popup-header {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
    text-align: left; /* Align text to the left */
    justify-content: flex-start; /* Align content to the left */
    white-space: nowrap; /* Prevent text wrapping */
    overflow: hidden; /* Hide overflow */
}

.hgdf-popup-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
    white-space: nowrap; /* Prevent text wrapping */
    overflow: hidden; /* Hide overflow */
    text-overflow: ellipsis; /* Add ellipsis if text is too long */
}

.hgdf-popup-icon {
    width: 64px;
    height: 64px;
    flex-shrink: 0;
}

.hgdf-popup-content {
    margin-bottom: 25px;
    text-align: center;
}

.hgdf-popup-content p {
    font-size: 16px;
    line-height: 1.6;
    color: #555;
    margin: 0 0 15px 0;
}

.hgdf-guest-notice {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    border-left: 4px solid #f99220;
    margin: 0 0 20px 0;
}

.hgdf-guest-notice p {
    margin: 0 0 12px 0;
    font-weight: 500;
    color: #2c3e50;
    text-align: center;
    font-size: 16px;
    line-height: 1.5;
}

.hgdf-guest-notice p:last-child {
    margin-bottom: 0;
}

.hgdf-login-button {
    display: inline-block;
    background: #f99220;
    color: #fff !important;
    padding: 12px 24px;
    border-radius: 6px;
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    font-size: 16px;
    text-align: center;
    height: 44px; /* Fixed height */
    line-height: 20px; /* Center text vertically */
    box-sizing: border-box;
}

.hgdf-login-button:hover {
    background: #e58215;
    color: #fff;
}

.hgdf-popup-footer {
    border-top: 1px solid #f0f0f0;
    padding-top: 20px;
}

.hgdf-dismiss-checkbox {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    cursor: pointer;
    justify-content: center;
}

.hgdf-dismiss-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
}

.hgdf-dismiss-checkbox span {
    font-size: 14px;
    color: #666;
}

.hgdf-popup-actions {
    display: flex;
    gap: 15px;
    justify-content: space-between; /* Left and right alignment */
    align-items: center;
    flex-wrap: nowrap; /* Prevent wrapping to multiple rows */
}

/* Close button styles */
.hgdf-close-button {
    background: transparent !important; /* Override any default background */
    color: #f89922 !important; /* Font color */
    border: 1px solid #f89922 !important; /* Border color */
    padding: 12px 24px;
    border-radius: 6px; /* Consistent border radius */
    cursor: pointer;
    font-weight: 600;
    transition: all 0.3s ease;
    font-size: 16px;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    min-width: 120px; /* Ensure consistent width */
    height: 44px; /* Fixed height */
    line-height: 20px; /* Center text vertically */
    box-sizing: border-box;
    margin-left: auto; /* Push to the right */
}

.hgdf-close-button:hover {
    background: #f89922 !important; /* Background color on hover */
    color: #fff !important; /* Font color on hover */
}

/* Settings button styles */
.hgdf-settings-button {
    background: transparent !important; /* Override any default background */
    color: #f89922 !important; /* Font color */
    border: 1px solid #f89922 !important; /* Border color */
    padding: 12px 24px;
    border-radius: 6px; /* Consistent border radius */
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    white-space: nowrap;
    font-size: 16px;
    text-align: center;
    min-width: 120px; /* Ensure consistent width */
    height: 44px; /* Fixed height */
    line-height: 20px; /* Center text vertically */
    box-sizing: border-box;
    margin-right: auto; /* Keep on the left */
}

.hgdf-settings-button:hover {
    background: #f89922 !important; /* Background color on hover */
    color: #fff !important; /* Font color on hover */
}

.hgdf-guest-button {
    background: transparent !important;
    color: #28a745 !important;
    border: 1px solid #28a745 !important;
    border-radius: 6px; /* Consistent border radius */
    height: 44px; /* Fixed height */
    line-height: 20px; /* Center text vertically */
}

.hgdf-guest-button:hover {
    background: #28a745 !important;
    color: #fff !important;
}

/* Responsive styles for mobile devices */
@media (max-width: 768px) {
    .hgdf-popup-container {
        padding: 20px;
        margin: 0;
        max-height: 85vh;
    }
    
    .hgdf-popup-header {
        flex-direction: row; /* Keep in one row */
        text-align: left; /* Maintain left alignment */
        justify-content: flex-start; /* Maintain left alignment */
        gap: 10px;
    }
    
    .hgdf-popup-header h3 {
        font-size: 20px;
        white-space: nowrap; /* Prevent text wrapping */
        overflow: hidden; /* Hide overflow */
        text-overflow: ellipsis; /* Add ellipsis if text is too long */
        max-width: 70%; /* Limit width to prevent overflow */
    }
    
    .hgdf-popup-icon {
        width: 48px;
        height: 48px;
    }
    
    .hgdf-popup-content p {
        font-size: 14px;
    }
    
    .hgdf-guest-notice {
        padding: 15px;
    }
    
    .hgdf-guest-notice p {
        font-size: 14px;
    }
    
    .hgdf-popup-actions {
        flex-direction: row; /* Keep buttons in one row */
        gap: 10px;
        flex-wrap: nowrap; /* Prevent wrapping */
        justify-content: space-between; /* Maintain left-right alignment */
        overflow-x: auto; /* Allow horizontal scrolling if needed */
        padding-bottom: 5px; /* Space for scrollbar */
    }
    
    .hgdf-login-button,
    .hgdf-close-button,
    .hgdf-settings-button {
        width: auto; /* Allow buttons to shrink */
        text-align: center;
        padding: 10px 15px;
        min-width: 110px; /* Smaller min-width for mobile */
        flex-shrink: 0; /* Prevent buttons from shrinking */
        height: 40px; /* Slightly smaller height for mobile */
        line-height: 18px; /* Adjust line height for mobile */
        font-size: 14px;
    }
    
    .hgdf-dismiss-checkbox {
        flex-wrap: wrap;
    }
}

/* Extra small devices */
@media (max-width: 480px) {
    .hgdf-popup-container {
        padding: 15px;
    }
    
    .hgdf-popup-header {
        text-align: left; /* Maintain left alignment */
        justify-content: flex-start; /* Maintain left alignment */
    }
    
    .hgdf-popup-header h3 {
        font-size: 18px;
        max-width: 65%; /* Further reduce width on very small screens */
    }
    
    .hgdf-popup-icon {
        width: 40px;
        height: 40px;
    }
    
    .hgdf-popup-content p {
        font-size: 13px;
    }
    
    .hgdf-guest-notice {
        padding: 12px;
    }
    
    .hgdf-guest-notice p {
        font-size: 13px;
    }
    
    .hgdf-popup-actions {
        gap: 8px; /* Smaller gap on very small screens */
    }
    
    .hgdf-login-button,
    .hgdf-close-button,
    .hgdf-settings-button {
        padding: 8px 12px;
        font-size: 14px;
        min-width: 100px; /* Even smaller min-width for very small screens */
        height: 38px; /* Slightly smaller height for very small screens */
        line-height: 16px; /* Adjust line height */
    }
}

/* Animation for popup */
@keyframes hgdfPopupFadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.hgdf-popup-container {
    animation: hgdfPopupFadeIn 0.3s ease-out;
}

/* Prevent body scroll when popup is open */
body.hgdf-popup-open {
    overflow: hidden;
    position: fixed;
    width: 100%;
}

/* Force specific styles to override any theme defaults */
.hgdf-close-button,
.hgdf-settings-button {
    background: transparent !important;
    color: #f89922 !important;
    border: 1px solid #f89922 !important;
    border-radius: 6px !important; /* Force consistent border radius */
}

.hgdf-close-button:hover,
.hgdf-settings-button:hover {
    background: #f89922 !important;
    color: #fff !important;
}

/* Ensure buttons maintain their style even if theme has strong defaults */
.hgdf-popup-actions .hgdf-close-button,
.hgdf-popup-actions .hgdf-settings-button {
    background: transparent !important;
    color: #f89922 !important;
    border: 1px solid #f89922 !important;
    border-radius: 6px !important; /* Force consistent border radius */
}

.hgdf-popup-actions .hgdf-close-button:hover,
.hgdf-popup-actions .hgdf-settings-button:hover {
    background: #f89922 !important;
    color: #fff !important;
}

/* Specific alignment for guest layout */
.hgdf-popup-actions.guest-layout {
    justify-content: center;
    gap: 15px;
}

/* Force buttons to be the same height */
.hgdf-login-button,
.hgdf-close-button,
.hgdf-settings-button {
    height: 44px !important;
    line-height: 20px !important;
    box-sizing: border-box !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    vertical-align: middle !important;
}

.hgdf-deal-mode-notice {
    padding: 10px 15px;
    margin-bottom: 15px;
    border-left: 3px solid #f99220;
    font-size: 13px;
    color: #856404;
    text-align: left;
    border-radius: 5px
}

.hgdf-deal-mode-notice em {
    font-style: italic;
}

/* Adjust header to account for the notice */
.hgdf-popup-header {
    border-top-left-radius: 0;
    border-top-right-radius: 0;
}

/* Mobile responsiveness for deal mode notice */
@media screen and (max-width: 768px) {
    .hgdf-deal-mode-notice {
        font-size: 11px;
        padding: 8px 10px;
        line-height: 1.3;
    }
}

/* Extra small devices */
@media screen and (max-width: 480px) {
    .hgdf-deal-mode-notice {
        font-size: 10px;
        padding: 6px 8px;
    }
}