/**
 * All of the CSS for your public-facing functionality should be
 * included in this file.
 */

/* Classic shipping method dropdown styles */
.dswsdm-shipping {
    width: 100%;
}

.wsdm-shipping-select {
    width: 100%;
    padding: 8px 2px;
    border-radius: 4px;
    background-color: #fff;
    line-height: 1.5;
}

.wsdm-shipping-select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 1px #007cba;
}

/* Block-based shipping method dropdown styles */
.wsdm-block-shipping-select {
    width: 100%;
    padding: 12px 16px;
    border-radius: 4px;
    background-color: #fff;
    font-size: 16px;
    line-height: 1.5;
    color: #333;
    background-image: url("data:image/svg+xml;charset=US-ASCII,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 4 5'><path fill='%23666' d='M2 0L0 2h4zm0 5L0 3h4z'/></svg>");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 12px;
    padding-right: 40px;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
}

.wsdm-block-shipping-select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.2);
}

/* Hide original radio buttons when converted to select */
.wsdm-converted input[type="radio"] {
    display: none !important;
}

.wsdm-converted label[for] {
    display: none !important;
}

/* Responsive design */
@media (max-width: 768px) {
    .wsdm-shipping-select,
    .wsdm-block-shipping-select {
        font-size: 16px; /* Prevent zoom on iOS */
        padding: 12px 16px;
    }
    
    .wsdm-block-shipping-select {
        padding-right: 44px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .wsdm-shipping-select,
    .wsdm-block-shipping-select {
        border-width: 2px;
        border-color: #000;
    }
    
    .wsdm-shipping-select:focus,
    .wsdm-block-shipping-select:focus {
        border-color: #005177;
        box-shadow: 0 0 0 2px #005177;
    }
}

/* Hide the original radio methods when in select mode */
.wsdm-shipping-select-mode #shipping_method:has(li + li) li {
    display: none;
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
    body:not(.theme-astra) .wsdm-shipping-select,
    body:not(.theme-astra) .wsdm-block-shipping-select {
        background-color: #1a1a1a;
        border-color: #666;
        color: #fff;
    }
        
    body:not(.theme-astra) .wsdm-shipping-select:focus,
    body:not(.theme-astra) .wsdm-block-shipping-select:focus {
        border-color: #46a7d1;
        box-shadow: 0 0 0 2px rgba(70, 167, 209, 0.2);
    }
}
