/* CSS for Contact Modal */
.contact-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 3000;
    /* Higher than detail modal */
    display: none;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.contact-modal-overlay.active {
    display: flex;
    opacity: 1;
}

.contact-modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    width: 90%;
    max-width: 600px;
    /* Reduced max-width for better vertical look */
    position: relative;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    text-align: center;
    max-height: 90vh;
    overflow-y: auto;
}

.contact-modal-header {
    margin-bottom: 24px;
}

.contact-modal-header h3 {
    margin: 0;
    font-size: 24px;
    font-weight: 700;
    color: #004b9b;
    text-transform: uppercase;
}

.contact-modal-header p {
    margin: 8px 0 0;
    color: #666;
    font-size: 14px;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
    margin-bottom: 20px;
}

/* Sales Item (First one) - Full width & Highlighted */
.contact-item:first-child {
    grid-column: 1 / -1;
    background: #f0f7ff;
    border: 2px solid #004b9b;
    padding: 24px;
}

.contact-item:first-child .contact-title {
    font-size: 18px;
    color: #004b9b;
}

.contact-item:first-child .contact-phone {
    font-size: 28px;
    color: #d32f2f;
    /* Highlights phone number */
}

/* Standard Items */
.contact-item {
    background: #fff;
    padding: 16px;
    border-radius: 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 1px solid #eee;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
}

.contact-title {
    font-weight: 700;
    color: #004b9b;
    /* Blue Sync */
    margin-bottom: 8px;
    font-size: 14px;
    text-transform: uppercase;
}

.contact-phone {
    font-size: 16px;
    font-weight: 800;
    color: #004b9b;
    /* Blue Sync */
    margin-bottom: 12px;
    text-decoration: none;
    display: block;
}

.contact-phone:hover {
    text-decoration: underline;
}

.contact-qr {
    margin-top: auto;
    background: white;
    padding: 6px;
    border-radius: 4px;
    border: 1px solid #eee;
}

.close-contact-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 28px;
    cursor: pointer;
    color: #999;
    line-height: 1;
    z-index: 10;
}

.close-contact-btn:hover {
    color: #333;
}

/* Mobile Responsive */
@media (max-width: 600px) {
    .contact-grid {
        grid-template-columns: 1fr 1fr;
        /* Keep 2 columns for bottom items */
    }

    .contact-item:first-child {
        grid-column: 1 / -1;
        /* Sales still full width */
        flex-direction: column;
        /* Stack internally */
    }

    /* Sales item internal layout on mobile */
    .contact-item:first-child .contact-qr {
        width: 120px !important;
        height: 120px !important;
    }

    /* Small items on mobile */
    .contact-item {
        padding: 12px;
    }

    .contact-item:not(:first-child) .contact-qr {
        width: 80px !important;
        height: 80px !important;
    }

    .contact-item:not(:first-child) {
        font-size: 12px;
    }

    .contact-item:not(:first-child) .contact-title {
        font-size: 11px;
        min-height: 28px;
        /* Align titles */
        display: flex;
        align-items: center;
    }

    .contact-item:not(:first-child) .contact-phone {
        font-size: 13px;
    }

    /* Override qrcode lib output style */
    .contact-qr img,
    .contact-qr canvas {
        width: 100% !important;
        height: auto !important;
        display: block;
    }
}