/* =============================================================================
   AYAL TOURS AND TRAVEL — INQUIRY MODAL STYLES
   Built by Vanquish Brand Design | vanquish.co.ke
   ============================================================================= */


/* =============================================================================
   1. MODAL BACKDROP & WRAPPER
   ============================================================================= */

.ayal-modal {
    position: fixed;
    inset: 0;
    z-index: var(--z-modal);
    display: flex;
    align-items: center;
    justify-content: flex-end;  /* Panel slides in from right */
}

/* Hidden state */
.ayal-modal[hidden] {
    display: none;
}

/* Semi-transparent backdrop */
.ayal-modal__backdrop {
    position: absolute;
    inset: 0;
    background-color: rgba(10, 14, 8, 0.60);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    cursor: pointer;
    animation: ayal-backdrop-in var(--duration-slow) var(--ease) forwards;
}

@keyframes ayal-backdrop-in {
    from { opacity: 0; }
    to   { opacity: 1; }
}


/* =============================================================================
   2. MODAL PANEL
   ============================================================================= */

.ayal-modal__panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 520px;
    height: 100%;
    background-color: var(--ayal-ivory);
    overflow-y: auto;
    overscroll-behavior: contain;
    display: flex;
    flex-direction: column;
    animation: ayal-panel-in var(--duration-slow) var(--ease) forwards;
    box-shadow: -8px 0 48px rgba(10, 14, 8, 0.18);
}

@keyframes ayal-panel-in {
    from { transform: translateX(100%); }
    to   { transform: translateX(0); }
}

/* Closing animation — applied via JS if needed */
.ayal-modal__panel.is-closing {
    animation: ayal-panel-out var(--duration-base) var(--ease) forwards;
}

@keyframes ayal-panel-out {
    from { transform: translateX(0); }
    to   { transform: translateX(100%); }
}


/* =============================================================================
   3. CLOSE BUTTON
   ============================================================================= */

.ayal-modal__close {
    position: absolute;
    top: var(--space-20);
    right: var(--space-20);
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: none;
    border: 1px solid var(--ayal-border);
    color: var(--ayal-charcoal-3);
    cursor: pointer;
    transition:
        border-color     var(--duration-base) var(--ease),
        color            var(--duration-base) var(--ease),
        background-color var(--duration-base) var(--ease);
    z-index: 2;
    flex-shrink: 0;
}

.ayal-modal__close:hover {
    border-color: var(--ayal-charcoal);
    color: var(--ayal-charcoal);
    background-color: var(--ayal-ivory-2);
}

.ayal-modal__close:focus-visible {
    outline: 2px solid var(--ayal-green);
    outline-offset: 2px;
}


/* =============================================================================
   4. MODAL HEADER
   ============================================================================= */

.ayal-modal__header {
    padding: var(--space-48) var(--space-40) var(--space-32);
    background-color: var(--ayal-green);
    flex-shrink: 0;
}

.ayal-modal__header .ayal-eyebrow {
    color: var(--ayal-sand);
    margin-bottom: var(--space-8);
}

.ayal-modal__title {
    font-family: var(--font-heading);
    font-size: clamp(24px, 3vw, 32px);
    font-weight: var(--weight-light);
    color: var(--ayal-white);
    letter-spacing: var(--tracking-tight);
    line-height: var(--leading-snug);
    margin-bottom: var(--space-8);
}

.ayal-modal__subtitle {
    font-size: var(--text-body-sm);
    line-height: var(--leading-relaxed);
    color: rgba(247, 245, 239, 0.72);
    margin: 0;
}

/* Safari name tag — shown when triggered from a specific safari */
.ayal-modal__safari-tag {
    display: inline-block;
    margin-top: var(--space-16);
    padding: 4px 12px;
    background-color: rgba(247, 245, 239, 0.12);
    border: 1px solid rgba(247, 245, 239, 0.20);
    font-family: var(--font-body);
    font-size: var(--text-caption);
    font-weight: var(--weight-bold);
    letter-spacing: var(--tracking-wider);
    text-transform: uppercase;
    color: rgba(247, 245, 239, 0.80);
}

.ayal-modal__safari-tag:empty {
    display: none;
}

/* Close button colour on green header */
.ayal-modal__close {
    border-color: rgba(247, 245, 239, 0.25);
    color: rgba(247, 245, 239, 0.70);
    background: transparent;
}

.ayal-modal__close:hover {
    border-color: rgba(247, 245, 239, 0.60);
    color: var(--ayal-white);
    background-color: rgba(247, 245, 239, 0.08);
}


/* =============================================================================
   5. MODAL BODY / FORM
   ============================================================================= */

.ayal-modal__body {
    padding: var(--space-32) var(--space-40) var(--space-48);
    display: flex;
    flex-direction: column;
    gap: var(--space-20);
    flex-grow: 1;
}

/* Two-column row for paired fields */
.ayal-modal__row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: var(--space-16);
}

/* Form field wrapper */
.ayal-field {
    display: flex;
    flex-direction: column;
    gap: var(--space-8);
}

/* Label */
.ayal-label {
    font-family: var(--font-body);
    font-size: var(--text-eyebrow);
    font-weight: var(--weight-bold);
    letter-spacing: var(--tracking-widest);
    text-transform: uppercase;
    color: var(--ayal-charcoal-3);
}

/* Required asterisk */
.ayal-label span[aria-hidden] {
    color: var(--ayal-error);
    margin-left: 2px;
}

/* Inputs */
.ayal-input,
.ayal-textarea,
.ayal-select {
    width: 100%;
    font-family: var(--font-body);
    font-size: var(--text-body);
    color: var(--ayal-charcoal);
    background-color: var(--ayal-white);
    border: 1px solid var(--ayal-border);
    padding: 13px 14px;
    border-radius: var(--radius-none);
    transition:
        border-color var(--duration-base) var(--ease),
        box-shadow   var(--duration-base) var(--ease);
    -webkit-appearance: none;
    appearance: none;
    line-height: var(--leading-normal);
}

.ayal-input::placeholder,
.ayal-textarea::placeholder {
    color: var(--ayal-charcoal-4);
    font-style: italic;
}

.ayal-input:focus,
.ayal-textarea:focus,
.ayal-select:focus {
    outline: none;
    border-color: var(--ayal-green);
    box-shadow: 0 0 0 3px var(--ayal-green-muted);
}

.ayal-textarea {
    min-height: 100px;
    resize: vertical;
    line-height: var(--leading-relaxed);
}

/* Custom select arrow */
.ayal-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%236B6B6B' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 38px;
    cursor: pointer;
}

/* Month input — remove native styling inconsistencies */
.ayal-input[type="month"] {
    cursor: pointer;
}

/* Submit button — full width inside modal */
.ayal-modal__body .ayal-btn--primary {
    margin-top: var(--space-4);
    width: 100%;
    justify-content: center;
    padding: 16px;
    font-size: var(--text-body-sm);
}

.ayal-modal__body .ayal-btn--primary:disabled {
    opacity: 0.60;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Privacy note */
.ayal-modal__privacy {
    display: flex;
    align-items: center;
    gap: var(--space-8);
    font-size: var(--text-micro);
    color: var(--ayal-charcoal-4);
    margin: 0;
    line-height: var(--leading-normal);
}

.ayal-modal__privacy svg {
    flex-shrink: 0;
    color: var(--ayal-green);
    opacity: 0.70;
}


/* =============================================================================
   6. TOAST NOTIFICATION
   ============================================================================= */

.ayal-toast {
    position: fixed;
    bottom: var(--space-32);
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    z-index: var(--z-toast);
    background-color: var(--ayal-charcoal);
    color: var(--ayal-white);
    font-family: var(--font-body);
    font-size: var(--text-body-sm);
    font-weight: var(--weight-regular);
    padding: 14px var(--space-24);
    max-width: 420px;
    width: calc(100% - var(--space-40));
    text-align: center;
    pointer-events: none;
    opacity: 0;
    transition:
        opacity   var(--duration-base) var(--ease),
        transform var(--duration-base) var(--ease);
    box-shadow: var(--shadow-lg);
}

.ayal-toast.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

.ayal-toast.is-error {
    background-color: var(--ayal-error);
}


/* =============================================================================
   7. RESPONSIVE
   ============================================================================= */

@media (max-width: 767px) {

    .ayal-modal {
        align-items: flex-end;
        justify-content: center;
    }

    .ayal-modal__panel {
        max-width: 100%;
        height: 92dvh;
        border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        animation: ayal-panel-in-mobile var(--duration-slow) var(--ease) forwards;
        box-shadow: 0 -8px 48px rgba(10, 14, 8, 0.18);
    }

    @keyframes ayal-panel-in-mobile {
        from { transform: translateY(100%); }
        to   { transform: translateY(0); }
    }

    .ayal-modal__header {
        padding: var(--space-32) var(--space-24) var(--space-24);
    }

    .ayal-modal__body {
        padding: var(--space-24) var(--space-24) var(--space-40);
        gap: var(--space-16);
    }

    .ayal-modal__row {
        grid-template-columns: 1fr;
        gap: var(--space-16);
    }

    .ayal-modal__close {
        top: var(--space-16);
        right: var(--space-16);
    }

}

@media (max-width: 400px) {

    .ayal-modal__panel {
        height: 96dvh;
    }

}
