/*
 * 24-7 MedCare Opencare Booking -- booking.css
 * All selectors prefixed #dr2-247-* -- zero conflict with existing #medcare-* styles
 *
 * Brand colours matched from existing medcare popup:
 *   Dark:    #003346
 *   Red:     #ed1846
 *   Muted:   #666666
 */

#dr2-247-overlay {
    display: none;
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 999999;
    background: rgba(0, 0, 0, 0.65);
    justify-content: center;
    align-items: flex-start;
    padding: 20px;
    box-sizing: border-box;
    overflow-y: auto;
}

#dr2-247-overlay.dr2-247-open {
    display: flex;
}

#dr2-247-dialog {
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.28);
    width: 100%;
    max-width: 760px;
    margin: auto;
    overflow: hidden;
    box-sizing: border-box;
    position: relative;
}

/* Header -- matches brand dark colour */
#dr2-247-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid #e8e8e8;
    background: #f7f7f7;
    box-sizing: border-box;
}

#dr2-247-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #003346;
    line-height: 1.3;
    padding-right: 10px;
}

/* Close button -- matches existing #aaa / #333 hover */
#dr2-247-close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    min-width: 44px;
    padding: 0;
    margin: 0;
    flex-shrink: 0;
    border: none;
    border-radius: 6px;
    background: transparent;
    box-shadow: none;
    font-size: 20px;
    font-weight: normal;
    line-height: 1;
    color: #aaaaaa;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: background-color 0.15s ease, color 0.15s ease;
}

#dr2-247-close:hover { background-color: #eeeeee; color: #333333; }

#dr2-247-close:focus {
    outline: 3px solid #003346;
    outline-offset: 2px;
}

#dr2-247-close:focus:not(:focus-visible) { outline: none; }
#dr2-247-close:focus-visible {
    outline: 3px solid #003346;
    outline-offset: 2px;
}

/* Loader -- spinner matches brand red */
#dr2-247-loader {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 640px;
    background: #ffffff;
    gap: 14px;
}

#dr2-247-spinner {
    width: 38px;
    height: 38px;
    border: 3px solid #f0f0f0;
    border-top-color: #ed1846;
    border-radius: 50%;
    animation: dr2-247-spin 0.75s linear infinite;
    flex-shrink: 0;
}

@keyframes dr2-247-spin {
    to { transform: rotate(360deg); }
}

#dr2-247-loader-text {
    margin: 0;
    font-size: 13.5px;
    color: #666666;
    font-family: inherit;
    font-weight: normal;
}

/* iframe */
#dr2-247-dialog iframe {
    display: block;
    width: 100%;
    height: 640px;
    border: none;
    outline: none;
    background: #ffffff;
}

/* Mobile */
@media (max-width: 480px) {
    #dr2-247-overlay { padding: 0; align-items: flex-end; }
    #dr2-247-dialog { border-radius: 12px 12px 0 0; max-height: 92vh; overflow-y: auto; }
    #dr2-247-dialog iframe, #dr2-247-loader { height: 520px; }
}

@media (min-width: 481px) and (max-width: 768px) {
    #dr2-247-dialog iframe, #dr2-247-loader { height: 580px; }
}

@media (prefers-reduced-motion: reduce) {
    #dr2-247-close { transition: none; }
    #dr2-247-spinner {
        animation: none;
        background: #ed1846;
        border: none;
        border-radius: 50%;
        width: 12px;
        height: 12px;
    }
}
