/**
 * Product Restrictions Modal Styles
 *
 * Modal for checking product availability by country.
 *
 * @package Orbiano
 */

/* Modal Overlay */
.product-restrictions-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.product-restrictions-modal[aria-hidden="false"] {
    display: flex;
}

.product-restrictions-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    cursor: pointer;
}

.product-restrictions-modal__content {
    position: relative;
    background-color: var(--wp--preset--color--dark-variant, var(--merch-v3-footer-bg, #1a1a1a));
    border-radius: 12px;
    width: 100%;
    max-width: 480px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.3), 0 10px 10px -5px rgba(0, 0, 0, 0.2);
    z-index: 1;
}

.product-restrictions-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid color-mix(in srgb, var(--merch-v3-footer-text) 10%, transparent);
}

.product-restrictions-modal__title {
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    color: var(--merch-v3-footer-text, var(--wp--preset--color--white, #ffffff));
}

.product-restrictions-modal__close {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: var(--merch-v3-footer-text, var(--wp--preset--color--white, #ffffff));
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background-color 0.2s ease;
}

.product-restrictions-modal__close:hover {
    background-color: color-mix(in srgb, var(--merch-v3-footer-text) 10%, transparent);
}

.product-restrictions-modal__close svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
}

.product-restrictions-modal__body {
    padding: 24px;
    flex: 1;
}

.product-restrictions-modal__description {
    color: var(--merch-v3-text-secondary, var(--wp--preset--color--gray-13, #b3b3b3));
    font-size: 14px;
    line-height: 1.5;
    margin: 0 0 20px;
}

.product-restrictions-modal__field {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.product-restrictions-modal__label {
    font-size: 14px;
    font-weight: 500;
    color: var(--merch-v3-footer-text, var(--wp--preset--color--white, #ffffff));
}

.product-restrictions-modal__input {
    padding: 12px 14px;
    background-color: var(--wp--preset--color--background-dark-rgb-33, var(--wp--preset--color--dark, #212121));
    border: 1px solid color-mix(in srgb, var(--merch-v3-footer-text) 10%, transparent);
    border-radius: 8px;
    color: var(--merch-v3-footer-text, var(--wp--preset--color--white, #ffffff));
    font-size: 14px;
    font-family: inherit;
    transition: border-color 0.2s ease;
}

.product-restrictions-modal__input:focus {
    outline: none;
    border-color: var(--wp--preset--color--primary-500, #2437A4);
}

.product-restrictions-modal__input::placeholder {
    color: var(--wp--preset--color--gray-400, var(--merch-v3-text-secondary, #808080));
}

/* Country dropdown list */
.product-restrictions-modal__country-list {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    margin-top: 4px;
    max-height: 240px;
    overflow-y: auto;
    background-color: var(--wp--preset--color--background-dark-rgb-33, var(--wp--preset--color--dark, #212121));
    border: 1px solid color-mix(in srgb, var(--merch-v3-footer-text) 10%, transparent);
    border-radius: 8px;
    z-index: 10;
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}

.product-restrictions-modal__country-list[aria-hidden="true"] {
    display: none;
}

.product-restrictions-modal__country-item {
    padding: 10px 14px;
    font-size: 14px;
    color: var(--merch-v3-footer-text, var(--wp--preset--color--white, #ffffff));
    cursor: pointer;
    transition: background-color 0.15s ease;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
}

.product-restrictions-modal__country-item:hover,
.product-restrictions-modal__country-item:focus {
    background-color: color-mix(in srgb, var(--merch-v3-footer-text) 8%, transparent);
    outline: none;
}

.product-restrictions-modal__country-item--no-results {
    color: color-mix(in srgb, var(--merch-v3-footer-text) 50%, transparent);
    cursor: default;
}

.product-restrictions-modal__country-item--no-results:hover {
    background-color: transparent;
}

/* Result message */
.product-restrictions-modal__result {
    margin-top: 20px;
    padding: 14px 16px;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
}

.product-restrictions-modal__result--available {
    background-color: color-mix(in srgb, var(--wp--preset--color--success-500, #10b981) 15%, transparent);
    border: 1px solid color-mix(in srgb, var(--wp--preset--color--success-500, #10b981) 40%, transparent);
    color: var(--wp--preset--color--success-500, #10b981);
}

.product-restrictions-modal__result--unavailable {
    background-color: color-mix(in srgb, var(--wp--preset--color--danger-red, #ef4444) 15%, transparent);
    border: 1px solid color-mix(in srgb, var(--wp--preset--color--danger-red, #ef4444) 40%, transparent);
    color: var(--wp--preset--color--danger-red, #ef4444);
}

@media (max-width: 1023px) {
    .product-restrictions-modal__content {
        max-width: 100%;
        max-height: 90vh;
        border-radius: 12px 12px 0 0;
    }

    .product-restrictions-modal__body {
        padding: 20px;
    }
}
