/**
 * WC Powerhouse Country Popup Styles
 */

.wc-powerhouse-country-popup-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 999999;
    opacity: 0;
    animation: fadeIn 0.3s forwards;
}

@keyframes fadeIn {
    to {
        opacity: 1;
    }
}

.wc-powerhouse-country-popup {
    background: #fff;
    border-radius: 8px;
    max-width: 500px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    transform: scale(0.9);
    opacity: 0;
    transition: all 0.3s ease;
}

.wc-powerhouse-country-popup.active {
    transform: scale(1);
    opacity: 1;
}

.vwc-powerhouse-country-popup-overlay .wc-powerhouse-country-popup-close {
    position: absolute;
    top: 15px;
    inset-inline-end: 15px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    transition: color 0.2s;
    z-index: 10;
}

.vwc-powerhouse-country-popup-overlay .wc-powerhouse-country-popup-close:hover {
    color: #000;
}

.wc-powerhouse-country-popup-content {
    padding: 30px;
}

.wc-powerhouse-country-popup-content .wc-powerhouse-country-popup-title {
    margin: 0 0 15px;
    font-size: 24px;
    font-weight: 600;
    color: var(--wcp-primary);
}

.wc-powerhouse-country-popup-description {
    margin: 0 0 25px;
    color: #666;
    font-size: 14px;
    line-height: 1.5;
}

.wc-powerhouse-current-country {
    margin-bottom: 25px;
    padding: 15px;
    background: #f5f5f5;
    border-radius: 5px;
}

.wc-powerhouse-current-country p {
    margin: 0 0 5px;
    font-size: 14px;
    color: #666;
}

.wc-powerhouse-current-country .current-country-name {
    font-size: 16px;
    margin: 0;
}

.wc-powerhouse-current-country strong {
    color: var(--wcp-primary);
}

.wc-powerhouse-country-selector {
    margin-bottom: 20px;
}

.wc-powerhouse-country-selector label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: var(--wcp-primary);
    font-size: 14px;
}

#wc-powerhouse-country-select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 15px;
    background: #fff;
    cursor: pointer;
    transition: border-color 0.2s;
}

#wc-powerhouse-country-select:hover {
    border-color: #999;
}

#wc-powerhouse-country-select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.wc-powerhouse-country-popup-actions {
    margin-top: 20px;
}

.wc-powerhouse-country-confirm {
    width: 100%;
    padding: 14px 20px;
    background: #007cba;
    color: #fff;
    border: none;
    border-radius: 5px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.wc-powerhouse-country-confirm:hover:not(:disabled) {
    background: #005f8a;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3);
}

.wc-powerhouse-country-confirm:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.wc-powerhouse-country-popup-message {
    margin-top: 15px;
    padding: 12px 15px;
    border-radius: 5px;
    font-size: 14px;
    text-align: center;
}

.wc-powerhouse-country-popup-message.success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.wc-powerhouse-country-popup-message.error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* Country display in header/cart */
.wc-powerhouse-current-delivery-country {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 14px;
}

.wc-powerhouse-current-delivery-country .country-label {
    color: #666;
}

.wc-powerhouse-current-delivery-country .country-name {
    color: var(--wcp-primary);
    font-weight: 600;
}

.wc-powerhouse-current-delivery-country .wc-powerhouse-country-change-btn {
    padding: 4px 10px;
    border: 1px solid var(--wcp-button-bg-color);
    border-radius: 3px;
    cursor: pointer;
    font-size: 13px;
    color: #007cba;
    transition: all 0.2s;
    margin-inline-start: auto;
    color: var(--wcp-button-bg-color);
}

.wc-powerhouse-current-delivery-country .wc-powerhouse-country-change-btn:focus,
.wc-powerhouse-current-delivery-country .wc-powerhouse-country-change-btn:hover {
    background-color: var(--wcp-button-bg-hover-color);
    border: 1px solid var(--wcp-button-bg-hover-color);
}

/* Prevent body scroll when popup is open */
body.wc-powerhouse-popup-open {
    overflow: hidden;
}

/* Responsive */
@media (max-width: 768px) {
    .wc-powerhouse-country-popup {
        max-width: 95%;
        margin: 20px;
    }

    .wc-powerhouse-country-popup-content {
        padding: 20px;
    }

    .wc-powerhouse-country-popup-content h3 {
        font-size: 20px;
    }
}

/* Compact version for sidecart header */
.wc-powerhouse-current-delivery-country.compact {
    display: inline-flex;
    margin-left: 10px;
}

.wc-powerhouse-current-delivery-country.compact .compact-country-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.wc-powerhouse-current-delivery-country.compact .country-label {
    color: #666;
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    line-height: 1;
}

.wc-powerhouse-current-delivery-country.compact .compact-country-content {
    display: flex;
    align-items: center;
    gap: 6px;
}

.wc-powerhouse-current-delivery-country.compact .country-name {
    color: var(--wcp-primary);
    font-weight: 600;
    font-size: 13px;
    line-height: 1;
}

.wc-powerhouse-current-delivery-country.compact .wc-powerhouse-country-change-btn {
    padding: 2px 6px;
    border: 1px solid #ddd;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s;
    display: inline-flex;
    align-items: center;
    margin: 0;
    color: #666;
    font-size: 11px;
    border-radius: 3px;
}

.wc-powerhouse-current-delivery-country.compact .wc-powerhouse-country-change-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    border-color: #999;
    color: var(--wcp-primary);
}

/* Integration with sidecart */
.wc-powerhouse-sidecart .wc-powerhouse-current-delivery-country:not(.compact) {
    padding: 15px 0;
    background: #f9f9f9;
    border-radius: 5px;
    margin-bottom: 15px;
    display: flex;
    /* justify-content: space-between; */
    align-items: center;
}

/* Integration with cart page */
.woocommerce-cart .wc-powerhouse-current-delivery-country {
    margin-bottom: 20px;
    padding: 15px 20px;
    background: #f9f9f9;
    border: 1px solid #e5e5e5;
    border-radius: 5px;
}

/* Integration with checkout page */
.woocommerce-checkout .wc-powerhouse-current-delivery-country {
    margin-bottom: 20px;
    padding: 15px 20px;
    background: #f9f9f9;
    border: 1px solid #e5e5e5;
    border-radius: 5px;
}

/* Country trigger button styling */
.wc-powerhouse-country-trigger {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    color: var(--wcp-primary);
    transition: all 0.2s;
}

.wc-powerhouse-country-trigger:hover {
    background: #f5f5f5;
    border-color: #999;
}

.wc-powerhouse-country-trigger svg {
    flex-shrink: 0;
}
