/* Advanced Shipping Public Styles */

/* Distance Shipping Options */
.distance-shipping-option {
    position: relative;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    padding: 10px;
    margin: 5px 0;
    background: #f9f9f9;
    transition: all 0.3s ease;
}

.distance-shipping-option:hover {
    border-color: #007cba;
    background: #f0f8ff;
}

.distance-shipping-option.selected {
    border-color: #007cba;
    background: #e6f3ff;
}

/* Shipping Distance Info */
.shipping-distance-info {
    margin-top: 5px;
    padding: 3px 0;
    color: #666;
    font-size: 0.9em;
}

.shipping-distance-info small {
    color: #888;
    font-style: italic;
}

/* Address Completion Feedback */
.address-completed {
    border-color: #46b450 !important;
    box-shadow: 0 0 2px rgba(70, 180, 80, 0.3);
}

.address-completed:focus {
    border-color: #46b450 !important;
    box-shadow: 0 0 5px rgba(70, 180, 80, 0.5);
}

/* Shipping Loader */
.shipping-loader {
    text-align: center;
    padding: 20px;
    margin: 10px 0;
    background: #f0f8ff;
    border: 1px solid #d0e0f0;
    border-radius: 4px;
    font-style: italic;
    color: #666;
}

.shipping-loader span {
    display: inline-block;
    animation: pulse 1.5s infinite;
}

@keyframes pulse {

    0%,
    100% {
        opacity: 1;
    }

    50% {
        opacity: 0.5;
    }
}

/* Shipping Method Enhancement */
.woocommerce-shipping-methods {
    list-style: none;
}

.woocommerce-shipping-methods li {
    margin-bottom: 8px;
    padding: 8px;
    border-radius: 3px;
    transition: background-color 0.2s ease;
}

.woocommerce-shipping-methods li:hover {
    background-color: #f5f5f5;
}

.woocommerce-shipping-methods li label {
    cursor: pointer;
    display: block;
    padding: 5px 0;
}

/* Distance Badge */
.distance-shipping-option::before {
    content: "📍";
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: 14px;
    opacity: 0.6;
}

/* Responsive Design */
@media (max-width: 768px) {
    .distance-shipping-option {
        padding: 8px;
        margin: 3px 0;
    }

    .shipping-distance-info {
        font-size: 0.85em;
    }

    .shipping-loader {
        padding: 15px;
        font-size: 0.9em;
    }
}

/* Checkout Page Specific */
.woocommerce-checkout .distance-shipping-option {
    background: #fff;
    border: 2px solid #e0e0e0;
}

.woocommerce-checkout .distance-shipping-option:hover {
    border-color: #007cba;
}

.woocommerce-checkout .distance-shipping-option input[type="radio"]:checked+label {
    font-weight: 600;
    color: #007cba;
}

/* Cart Page Specific */
.woocommerce-cart .shipping-calculator-form {
    background: #f9f9f9;
    padding: 15px;
    border-radius: 5px;
    margin: 15px 0;
}

.woocommerce-cart .shipping-calculator-form h2 {
    margin-top: 0;
    color: #333;
}

/* Loading Animation Enhancement */
.shipping-loader::after {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #007cba;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    margin-left: 10px;
    vertical-align: middle;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Error States */
.shipping-error {
    background: #ffebee;
    border: 1px solid #ffcdd2;
    color: #c62828;
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
}

/* Success States */
.shipping-success {
    background: #e8f5e8;
    border: 1px solid #c8e6c9;
    color: #2e7d32;
    padding: 10px;
    border-radius: 4px;
    margin: 10px 0;
}

/* Enhanced WooCommerce Cart Shipping Calculator */
.woocommerce-cart .shipping-calculator-form {
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 5px;
    padding: 20px;
    margin: 20px 0;
}

.woocommerce-cart .shipping-calculator-form h2 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-size: 1.2em;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

.woocommerce-cart .shipping-calculator-form p {
    margin-bottom: 15px;
}

.woocommerce-cart .shipping-calculator-form .form-row {
    margin-bottom: 15px;
}

.woocommerce-cart .shipping-calculator-form select,
.woocommerce-cart .shipping-calculator-form input {
    width: 100%;
    max-width: 200px;
    padding: 8px;
    border: 1px solid #ccc;
    border-radius: 3px;
    font-size: 14px;
}

.woocommerce-cart .shipping-calculator-form button {
    background: #007cba;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 14px;
    margin-top: 10px;
}

.woocommerce-cart .shipping-calculator-form button:hover {
    background: #005a87;
}

/* Responsive Design for Calculator */
@media (max-width: 768px) {
    .woocommerce-cart .shipping-calculator-form {
        padding: 15px;
        margin: 15px 0;
    }

    .woocommerce-cart .shipping-calculator-form select,
    .woocommerce-cart .shipping-calculator-form input {
        max-width: 100%;
        margin-bottom: 10px;
    }
}