/**
 * WooCommerce Address Book Places Autocomplete
 * Styles for autocomplete elements and confirmation popup
 */

/* Autocomplete container */
#wc-address-book-places-container {
    margin-bottom: 8px;
    position: relative;
    z-index: 100;
}

/* Style for Google Places Autocomplete Element */
#wc-address-book-places-container .places-autocomplete-element {
    width: 100%;
    font-size: 16px;
    padding: 8px 12px;
    box-sizing: border-box;
    border-radius: 4px;
    border: 1px solid #aaa;
}

/* Overlay for confirmation popup */
.wc-address-book-places-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 999999;
}

/* Modal for confirmation popup */
.wc-address-book-places-modal {
    background-color: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    max-width: 500px;
    width: 90%;
    padding: 20px;
}

/* Modal content */
.wc-address-book-places-modal-content {
    text-align: center;
}

/* Modal title */
.wc-address-book-places-modal-content h3 {
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 1.3em;
}

/* Address display */
.wc-address-book-places-address {
    margin-bottom: 20px;
    padding: 10px;
    background-color: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 3px;
}

/* Buttons container */
.wc-address-book-places-buttons {
    display: flex;
    justify-content: center;
    gap: 10px;
}

/* Confirm button */
.wc-address-book-places-confirm-button {
    background-color: #4CAF50;
    color: white;
    border: none;
    padding: 10px 20px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    border-radius: 4px;
    cursor: pointer;
}

/* Edit button */
.wc-address-book-places-edit-button {
    background-color: #f1f1f1;
    color: #333;
    border: 1px solid #ddd;
    padding: 10px 20px;
    text-align: center;
    text-decoration: none;
    display: inline-block;
    font-size: 16px;
    border-radius: 4px;
    cursor: pointer;
}

/* Button hover effects */
.wc-address-book-places-confirm-button:hover {
    background-color: #45a049;
}

.wc-address-book-places-edit-button:hover {
    background-color: #e9e9e9;
}

/* Responsive styles */
@media (max-width: 768px) {
    .wc-address-book-places-modal {
        width: 95%;
        padding: 15px;
    }
    
    .wc-address-book-places-buttons {
        flex-direction: column;
    }
    
    .wc-address-book-places-confirm-button,
    .wc-address-book-places-edit-button {
        width: 100%;
        margin-bottom: 10px;
    }
}

/* Adjust Google's Autocomplete dropdown styling */
.pac-container {
    z-index: 100000 !important;
    font-family: inherit;
    border-radius: 0 0 4px 4px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.pac-item {
    padding: 8px 10px;
    font-size: 14px;
}

.pac-item:hover {
    background-color: #f5f5f5;
}

.pac-item-selected {
    background-color: #f0f0f0;
}

/* Hide the powered by Google logo (make sure this complies with Google's terms) */
.pac-container:after {
    content: none !important;
}

/* Fix for WooCommerce My Account Address Book compatibility */
.woocommerce-address-fields__field-wrapper #wc-address-book-places-container input {
    width: 100%;
    padding: 10px;
    border-radius: 4px;
    border: 1px solid #ddd;
    line-height: 1.5;
    height: auto;
}

/* Fix for Select2 z-index */
.select2-dropdown {
    z-index: 99999;
} 