/* No bottom padding needed, override global rule */
.page-contact .content-area {
    padding-bottom: 0;
}


/* =====================================================
   Contact Us Banner
===================================================== */

.contact-page-header {
    background-image: url("../img/banner-quick-draw.jpg");
    background-position: center 10%;
}

/* Phones below page heading */
.contact-header-phones {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;

    margin-top: 4px;

    font-size: 18px;
    font-weight: 600;
}

.contact-header-phones img {
    width: 20px;
    height: auto;
    display: block;
}

.contact-header-phones a {
    color: #fdfdfd;
    text-decoration: none;
}


/* =====================================================
   Contact Section Layout
===================================================== */

.contact-section {
    background: #f3f5f8;
    padding: 50px 60px 40px 60px;
    box-sizing: border-box;
}

.contact-layout {
    display: grid;
    grid-template-columns: 1fr 1.35fr;
    gap: 40px;
    align-items: stretch;
}

.contact-form-column,
.contact-map-column {
    width: 100%;
    box-sizing: border-box;
}


/* =====================================================
   Contact Form
===================================================== */

.contact-form {
    width: 100%;
    box-sizing: border-box;
    background: #fdfdfd;
    padding: 32px;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.contact-form::before {
    content: "";
    display: block;
    height: 4px;
    background: #a51b25;
    border-radius: 8px 8px 0 0;
    margin: -32px -32px 24px -32px;
}

.form-row {
    margin-bottom: 18px;
}

.form-row.two-col {
    display: flex;
    gap: 20px;
}

/* Adjust column widths for phone/email row */
.form-row.two-col .form-group:first-child {
    flex: 0 0 30%;
}

.form-row.two-col .form-group:last-child {
    flex: 1;
}

.form-group {
    display: flex;
    flex-direction: column;
    width: 100%;
}

.form-group label {
    margin-bottom: 6px;
    font-weight: 600;
    font-size: 16px;
    color: #111;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 9px 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 16px;
    font-family: inherit;
    box-sizing: border-box;
    background: #fff;
}

.form-group textarea {
    resize: none;
    height: 155px;
}

.form-error {
    margin-top: -4px;
}

#errorReport1 {
    font-size: 0.95em;
    color: #c6212e;
}

.form-submit {
    display: flex;
    justify-content: center;
    margin-top: 25px;
    gap: 30px;
}

.contact-form .btn-primary {
    background-color: #1a3f74;
    border: none;
    padding: 12px 32px;
    font-size: 15px;
    cursor: pointer;
    transition: background-color 0.2s ease;
}


/* =====================================================
   Contact Map Area
===================================================== */

.contact-map-column {
    display: flex;
}

.contact-map-area {
    width: 100%;
    height: 100%;
    background: #1a3f74;
    padding: 5px;
    border-radius: 14px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    box-sizing: border-box;

    display: flex;
    flex: 1;
    min-height: 0;
}

#map {
    position: relative;
    width: 100%;
    height: 100%;
    flex: 1;
    min-height: 0;
    min-width: 0;
    overflow: hidden;
    border-radius: 10px;
}

/* Mobile map legend off on desktop */
#map-legend-mobile {
    display: none;
}


/* =====================================================
   Contact Location Lists
===================================================== */

.contact-location-lists {
    background: #f3f5f8;
    padding: 0 60px 60px 60px;
    box-sizing: border-box;
}

.location-list-block {
    padding-top: 10px;
}

.location-list-block:not(:last-child) {
    margin-bottom: 10px;
    padding-bottom: 35px;
    border-bottom: 2px solid #cfcfcf;
}

.location-list-toggle {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 0;
    margin: 0 0 18px 0;
    border: none;
    background: transparent;
    cursor: default;
    text-align: left;
}

.location-list-header-text {
    font-size: 30px;
    font-weight: 750;
    color: #1a3f74;
    line-height: 1.2;
}

/* Only being used for drop-off note beside Quick Draw Branches title */
.location-list-note {
    font-size: 20px;
    font-weight: 600;
    opacity: 0.9;
    line-height: 1.35;
    color: #a51b25;
}

.location-list-arrow {
    display: none;
    width: 12px;
    height: 12px;
    margin-left: 16px;
    flex-shrink: 0;

    border-right: 3px solid #1a3f74;
    border-bottom: 3px solid #1a3f74;
    transform: rotate(45deg);
    transition: transform 0.2s ease;
}

.location-list-content {
    display: block;
}

.location-card-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 300px));
    gap: 20px;
}


/* =====================================================
   Location Cards
===================================================== */

.location-card {
    background: #fdfdfd;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
}

.location-card-image {
    width: 100%;
    height: 80px;
    display: block;
}

.location-card-body {
    padding: 16px;
    font-size: 16px;
}

.location-card-title {
    margin: 0 0 8px 0;
    font-size: 16px;
    font-weight: 700;
}

.location-card-address {
    margin: 0 0 10px 0;
    line-height: 1.4;
    color: #444;
}

.location-card-table a {
    color: #1a3f74;
    text-decoration: none;
    font-weight: 500;
    border-bottom: 1px solid rgba(26, 63, 116, 0.25);
    transition: color 0.2s ease, border-color 0.2s ease;
}

.location-card-table {
    font-size: 16px;
    margin-bottom: 10px;
}

.location-card-table td:first-child {
    padding-right: 6px;
    font-weight: 600;
}

.location-card-map-link {
    display: inline-block;
    margin-top: 6px;
    font-weight: 600;
    color: #1a3f74;
    text-decoration: none;
}


/* =====================================================
   Media Queries
===================================================== */

@media (max-width: 899px) {

    .contact-header-phones {
        font-size: 15px;
        gap: 14px;
    }

    .contact-section {
        padding: 30px 20px 40px 20px;
    }

    .contact-layout {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .contact-form {
        padding: 24px;
    }

    .contact-map-area {
        padding: 5px;
    }

    .contact-form::before {
        margin: -24px -24px 20px -24px;
    }

    .form-row.two-col {
        flex-direction: column;
        gap: 18px;
    }

    .form-group label {
        font-size: 15px;
    }

    .form-group input,
    .form-group select,
    .form-group textarea {
        font-size: 16px;
    }

    .form-group textarea {
        height: 140px;
    }

    .form-submit {
        flex-direction: column;
        align-items: center;
        gap: 14px;
        margin-top: 20px;
    }

    .contact-form .btn-primary {
        width: 100%;
        max-width: 280px;
    }

    /* Stack mobile legend above map */
    .contact-map-column {
        display: flex;
        flex-direction: column;
    }

    .contact-map-area {
        display: block;
        height: auto;
    }

    #map {
        width: 100%;
        height: 380px;
        min-height: 380px;
    }


    /* =====================================================
       Mobile Map Legend
    ===================================================== */
    #map-legend-mobile {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        gap: 10px;

        margin-bottom: 14px;
        padding: 12px 10px;

        background: #fdfdfd;
        border-radius: 14px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
        box-sizing: border-box;
    }

    #map-legend-mobile .map-legend-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
    }

    #map-legend-mobile .map-legend-item img {
        width: 24px;
        height: 24px;
        display: block;
        object-fit: contain;
        margin: 0 auto;
    }

    #map-legend-mobile .map-legend-item span {
        display: block;
        font-size: 14px;
        line-height: 1.1;
    }


    /* =====================================================
       Location Lists
    ===================================================== */

    .contact-location-lists {
        padding: 0 20px 40px 20px;
    }

    .location-list-toggle {
        margin-bottom: 0;
        padding: 4px 0 14px 0;
        cursor: pointer;
    }

    .location-list-header-text {
        display: flex;
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
        font-size: 24px;
    }

    .location-list-note {
        font-size: 14px;
        line-height: 1.35;
        color: #a51b25;
    }

    .location-list-arrow {
        display: inline-block;
    }

    .location-list-content {
        display: none;
        padding-top: 6px;
    }

    .location-list-block.is-open .location-list-content {
        display: block;
    }

    .location-list-block.is-open .location-list-arrow {
        transform: rotate(225deg);
    }

    .location-card-grid {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .location-card {
        width: 100%;
        max-width: 340px;
    }

    .location-card-body {
        font-size: 15px;
    }

    .location-card-table {
        font-size: 15px;
    }
}

/* Only apply hover effects on desktop (when hover is supported) */
@media (hover: hover) and (pointer: fine) {

    .location-card-table a:hover {
        color: #a51b25;
        border-bottom-color: #a51b25;
    }

    .location-card-map-link:hover {
        color: #a51b25;
    }

    .contact-header-phones a:hover {
        text-decoration: underline;
        text-decoration-color: #c6212e;
        text-underline-offset: 3px;
        text-decoration-thickness: 2px;
    }

    .contact-form .btn-submit:hover {
        background-color: #28a745;
    }

    .contact-form .btn-clear:hover {
        background-color: #a51b25;
    }
}
