/* ==================================================================
   ETA request  --  the "Contact us for ETA" button on an out-of-stock
   product, and the modal it opens.

   Used by includes/eta.request.modal.cfm on every PDP. Base font size
   here matches the site's 16px body / 18px input scale -- these fields
   are the same fields as the main enquiry form and should not read
   smaller just because they're in a modal.
   ================================================================== */

/* ---------- the trigger ---------- */

/* Both states are inline elements: they render inside the PDP's existing
   <p class="despatches-in">, where a block-level element would close the
   paragraph out from under them. */
.eta-request-wrap {
    display: inline;
}

.eta-request-trigger {
    display: inline-block;
    margin: 0;
    padding: 0;
    border: 0;
    background: none;
    color: #FF3200;
    font-family: inherit;
    font-size: 16px;
    font-weight: bold;
    text-decoration: underline;
    cursor: pointer;
}

.eta-request-trigger:hover,
.eta-request-trigger:focus {
    text-decoration: none;
}

/* The state a customer sees once they've asked. Deliberately not a
   button: there is nothing left to click, and an inert-looking button
   invites them to keep trying. */
.eta-request-done {
    display: block;
    margin: 0;
    color: #2D4646;
    font-size: 16px;
    font-weight: bold;
}

.eta-request-done .eta-tick {
    color: #3C8500;
    margin-right: 4px;
    font-weight: bold;
}

.eta-request-done small {
    display: block;
    margin-top: 2px;
    color: #666;
    font-size: 14px;
    font-weight: normal;
}

/* ---------- the modal ---------- */

.eta-modal[hidden] {
    display: none;
}

.eta-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    overflow-y: auto;
    padding: 24px 16px;
}

.eta-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    border: 0;
    padding: 0;
    margin: 0;
    cursor: pointer;
}

.eta-modal-panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 520px;
    margin: auto;
    background: #fff;
    border-radius: 6px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    padding: 28px;
}

.eta-modal-panel h2 {
    margin: 0 0 6px;
    font-size: 24px;
    color: #2D4646;
}

.eta-modal-intro {
    margin: 0 0 18px;
    font-size: 16px;
    line-height: 1.5;
    color: #555;
}

.eta-modal-close {
    position: absolute;
    top: 10px;
    right: 12px;
    border: 0;
    background: none;
    font-size: 28px;
    line-height: 1;
    color: #999;
    cursor: pointer;
    padding: 4px 8px;
}

.eta-modal-close:hover {
    color: #333;
}

/* What they're asking about. Read-only on purpose -- it's context, not
   an input, and letting it be edited would decouple the ticket from the
   page it was raised on. */
.eta-modal-part {
    background: #F4F6F6;
    border-left: 3px solid #FF3200;
    padding: 12px 14px;
    margin: 0 0 18px;
    font-size: 15px;
    line-height: 1.5;
}

.eta-modal-part strong {
    font-size: 16px;
    color: #2D4646;
}

/* The vehicle the request is for: a select so it can be swapped for a saved
   vehicle or cleared -- the page's selected vehicle is frequently not the
   one the part is for. */
.eta-modal-part .eta-modal-vehicle {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 8px;
    color: #666;
}

.eta-modal-part .eta-modal-vehicle[hidden] {
    display: none;
}

.eta-modal-part .eta-modal-vehicle label {
    flex: 0 0 auto;
    font-size: 15px;
    font-weight: bold;
    color: #333;
}

.eta-modal-part .eta-modal-vehicle select {
    flex: 1 1 auto;
    min-width: 0;
    padding: 8px 10px;
    border: 1px solid #CCC;
    border-radius: 4px;
    background: #fff;
    font-family: inherit;
    font-size: 16px;
    color: #333;
}

.eta-modal-part .eta-modal-vehicle select:focus {
    border-color: #2D4646;
    outline: 2px solid rgba(45, 70, 70, 0.2);
}

@media (max-width: 480px) {
    .eta-modal-part .eta-modal-vehicle { display: block; }
    .eta-modal-part .eta-modal-vehicle[hidden] { display: none; }
    .eta-modal-part .eta-modal-vehicle label { display: block; margin-bottom: 4px; }
    .eta-modal-part .eta-modal-vehicle select { width: 100%; box-sizing: border-box; }
}

.eta-modal .field {
    margin: 0 0 14px;
}

.eta-modal .field label {
    display: block;
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: bold;
    color: #333;
    text-align: left;
    width: auto;
}

.eta-modal .field .req {
    color: #FF3200;
}

.eta-modal .field input[type="text"],
.eta-modal .field input[type="email"],
.eta-modal .field textarea {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid #CCC;
    border-radius: 4px;
    font-family: inherit;
    font-size: 18px;
    color: #333;
}

.eta-modal .field input:focus,
.eta-modal .field textarea:focus {
    border-color: #2D4646;
    outline: 2px solid rgba(45, 70, 70, 0.2);
}

.eta-modal .field-hint {
    margin: 4px 0 0;
    font-size: 14px;
    color: #777;
}

.eta-modal-row {
    display: flex;
    gap: 12px;
}

.eta-modal-row .field {
    flex: 1 1 50%;
    min-width: 0;
}

@media (max-width: 480px) {
    .eta-modal-panel { padding: 22px 18px; }
    .eta-modal-row   { display: block; }
}

.eta-modal-actions {
    margin-top: 20px;
}

.eta-modal-actions button {
    width: 100%;
}

.eta-modal-error {
    margin: 0 0 14px;
    padding: 10px 12px;
    background: #FDECEA;
    border-left: 3px solid #C0392B;
    color: #922B21;
    font-size: 15px;
}

.eta-modal-error[hidden] {
    display: none;
}

.eta-modal-busy {
    opacity: 0.6;
    pointer-events: none;
}
