/**
 * Push Logic GF WooCommerce Product Select - Frontend Styles
 */

/* Base Select Styles */
.gfield .plgf-wc-product-select {
    width: 100%;
    max-width: 100%;
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #fff;
    font-size: 16px;
    line-height: 1.5;
    color: #333;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23333' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px 12px;
    padding-right: 40px;
}

.gfield .plgf-wc-product-select:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 2px rgba(0, 115, 170, 0.2);
}

.gfield .plgf-wc-product-select:hover {
    border-color: #999;
}

/* Multiselect Styles */
.gfield .plgf-wc-product-multiselect {
    min-height: 150px;
    padding-right: 12px;
    background-image: none;
}

.gfield .plgf-wc-product-multiselect option {
    padding: 8px 10px;
    border-bottom: 1px solid #f0f0f0;
}

.gfield .plgf-wc-product-multiselect option:last-child {
    border-bottom: none;
}

.gfield .plgf-wc-product-multiselect option:checked {
    background: linear-gradient(0deg, #0073aa 0%, #0073aa 100%);
    color: #fff;
}

.gfield .plgf-wc-product-multiselect option:hover {
    background-color: #f7f7f7;
}

/* Disabled state */
.gfield .plgf-wc-product-select:disabled {
    background-color: #f5f5f5;
    color: #999;
    cursor: not-allowed;
}

/* Error state */
.gfield_error .plgf-wc-product-select {
    border-color: #c02b0a;
}

.gfield_error .plgf-wc-product-select:focus {
    border-color: #c02b0a;
    box-shadow: 0 0 0 2px rgba(192, 43, 10, 0.2);
}

/* Size variations */
.gfield .plgf-wc-product-select.small {
    max-width: 200px;
}

.gfield .plgf-wc-product-select.medium {
    max-width: 400px;
}

.gfield .plgf-wc-product-select.large {
    max-width: 100%;
}

/* Mobile responsive */
@media screen and (max-width: 640px) {
    .gfield .plgf-wc-product-select {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 12px 40px 12px 12px;
    }

    .gfield .plgf-wc-product-multiselect {
        min-height: 200px;
        padding-right: 12px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .gfield .plgf-wc-product-select {
        border-width: 2px;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    .gfield .plgf-wc-product-select {
        background-color: #2d2d2d;
        border-color: #555;
        color: #fff;
        background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23fff' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    }

    .gfield .plgf-wc-product-select:hover {
        border-color: #777;
    }

    .gfield .plgf-wc-product-select:focus {
        border-color: #0096dd;
        box-shadow: 0 0 0 2px rgba(0, 150, 221, 0.3);
    }

    .gfield .plgf-wc-product-multiselect option:hover {
        background-color: #3d3d3d;
    }
}

/* RTL Support */
[dir="rtl"] .gfield .plgf-wc-product-select {
    background-position: left 12px center;
    padding-left: 40px;
    padding-right: 12px;
}

[dir="rtl"] .gfield .plgf-wc-product-multiselect {
    padding-left: 12px;
}
