/* ============================================
   Alshams Enquiry — Modal Popup
   CSS variables injected by PHP via wp_head.
   ============================================ */

:root {
    --aef-tab-bg:   #1a1a1a;
    --aef-accent:   #c9a84c;
    --aef-tab-text: #ffffff;
    --aef-panel-bg: #ffffff;
}

/* ============================================
   Sticky trigger tab (always visible, right edge)
   ============================================ */
#alshams-enq-tab {
    position: fixed;
    right: 0;
    top: 50%;
    transform: translateY(-50%) rotate(180deg);
    z-index: 99998;
    background: var(--aef-tab-bg);
    color: var(--aef-tab-text);
    border: none;
    padding: 22px 10px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 3px;
    text-transform: uppercase;
    white-space: nowrap;
    writing-mode: vertical-rl;
    text-orientation: mixed;
    transition: background 0.25s;
    line-height: 1;
    user-select: none;
}

#alshams-enq-tab:hover,
#alshams-enq-tab[aria-expanded="true"] {
    background: var(--aef-accent);
}

/* ============================================
   Dark overlay
   ============================================ */
#alshams-enq-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.72);
    z-index: 99999;
    /* centres the modal */
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

#alshams-enq-overlay.aef-open {
    display: flex;
}

/* ============================================
   Modal box
   ============================================ */
#alshams-enq-modal {
    background: var(--aef-panel-bg);
    width: 100%;
    max-width: 480px;
    max-height: 92vh;
    overflow-y: auto;
    padding: 36px 40px 28px;
    box-sizing: border-box;
    position: relative;
    border-radius: 2px;
    box-shadow: 0 12px 48px rgba(0, 0, 0, 0.35);
}

/* ---- Gold circle close button ---- */
#alshams-enq-close {
    position: absolute;
    top: 6px;
    right: 4px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--aef-accent);
    color: #fff;
    border: none;
    font-size: 20px;
    line-height: 36px;
    text-align: center;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 400;
}

#alshams-enq-close:hover {
    background: var(--aef-tab-bg);
}

/* ---- Modal header ---- */
.aef-modal-header {
    margin-bottom: 24px;
}

.aef-contact-label {
    display: block;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 3px;
    color: var(--aef-accent);
    text-transform: uppercase;
    margin-bottom: 8px;
}

.aef-modal-header h2 {
    margin: 0;
    font-size: 24px;
    font-weight: 800;
    color: #1a1a1a;
    line-height: 1.3;
}

/* ============================================
   Form fields — underline style
   ============================================ */
.aef-field {
    margin-bottom: 18px;
}

.aef-row {
    display: flex;
    gap: 24px;
}

.aef-row .aef-field {
    flex: 1;
    min-width: 0;
}

/* Uppercase label above each field */
.aef-field > label:first-child {
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #555;
    margin-bottom: 6px;
}

.aef-field input[type="text"],
.aef-field input[type="email"],
.aef-field input[type="tel"],
.aef-field select,
.aef-field textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 6px 0;
    border: none;
    border-bottom: 1px solid #bbbbbb;
    border-radius: 0;
    background: transparent;
    font-size: 14px;
    color: #222;
    font-family: inherit;
    transition: border-color 0.2s;
    outline: none;
}

.aef-field input:focus,
.aef-field select:focus,
.aef-field textarea:focus {
    border-bottom-color: var(--aef-accent);
}

.aef-field input.aef-invalid,
.aef-field select.aef-invalid,
.aef-field textarea.aef-invalid {
    border-bottom-color: #e53935;
}

/* Custom select arrow */
.aef-field select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' viewBox='0 0 10 6'%3E%3Cpath d='M0 0l5 6 5-6z' fill='%23777'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 2px center;
    padding-right: 18px;
    cursor: pointer;
}

.aef-field textarea {
    resize: none;
    display: block;
}

/* Conditional "Other" input */
.aef-other {
    margin-top: 10px;
}

.aef-other label {
    font-size: 10px !important;
    color: #888 !important;
}

/* ---- Terms checkbox ---- */
.aef-terms > label {
    display: flex !important;
    align-items: center;
    gap: 8px;
    font-size: 13px !important;
    font-weight: 400 !important;
    letter-spacing: 0 !important;
    text-transform: none !important;
    color: #444 !important;
    cursor: pointer;
}

.aef-terms input[type="checkbox"] {
    width: 15px;
    height: 15px;
    flex-shrink: 0;
    accent-color: var(--aef-accent);
    cursor: pointer;
}

.aef-terms a {
    color: var(--aef-accent);
    text-decoration: underline;
}

/* ---- Status message ---- */
#aef-msg {
    font-size: 13px;
    text-align: center;
    min-height: 16px;
    margin-bottom: 8px;
}

#aef-msg.aef-success { color: #2e7d32; }
#aef-msg.aef-error   { color: #c62828; }

/* ---- Submit button ---- */
.aef-submit {
    width: 100%;
    padding: 14px;
    background: var(--aef-tab-bg);
    color: var(--aef-tab-text);
    border: none;
    border-radius: 2px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
    cursor: pointer;
    transition: background 0.25s;
    font-family: inherit;
    margin-top: 4px;
}

.aef-submit:hover  { background: var(--aef-accent); }
.aef-submit:disabled {
    background: #999;
    cursor: not-allowed;
}

/* ---- Footer note ---- */
.aef-footer-note {
    font-size: 11px;
    color: #888;
    text-align: center;
    margin: 12px 0 0;
    line-height: 1.5;
}

.aef-footer-note a {
    color: var(--aef-accent);
    text-decoration: underline;
}

/* ============================================
   Mobile
   ============================================ */
@media (max-width: 600px) {
    /* Keep tab on the right side — avoids WhatsApp icon at bottom-right */
    #alshams-enq-tab {
        top: 35%;
        right: 0;
        transform: translateY(-50%) rotate(180deg);
        writing-mode: vertical-rl;
        text-orientation: mixed;
        padding: 18px 8px;
        font-size: 10px;
        letter-spacing: 2px;
        width: auto;
        left: auto;
        bottom: auto;
    }

    #alshams-enq-overlay {
        padding: 16px;
        align-items: center;
    }

    #alshams-enq-modal {
        padding: 28px 20px 20px;
        max-height: 88vh;
    }

    #alshams-enq-close {
        top: 6px;
        right: 4px;
    }

    .aef-modal-header h2 {
        font-size: 20px;
    }

    .aef-row {
        flex-direction: column;
        gap: 0;
    }
}
