/**
 * Brand-Shop Flat-Rate Shipping Frontend Styles
 * @version 1.149.0
 */

/* Weight Display Container */
.bsfrs-weight-display {
    background: #f7f7f7;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    padding: 20px;
    margin-bottom: 30px;
}

.bsfrs-weight-display h3 {
    margin-top: 0;
    margin-bottom: 15px;
    color: #333;
    font-size: 18px;
    font-weight: 600;
}

.bsfrs-weight-display h4 {
    margin-top: 20px;
    margin-bottom: 10px;
    color: #666;
    font-size: 16px;
    font-weight: 600;
}

/* Weight Details Table */
.bsfrs-weight-details {
    margin-top: 20px;
}

.bsfrs-weight-details table {
    width: 100%;
    margin-bottom: 0;
}

.bsfrs-weight-details th {
    background: #efefef;
    padding: 10px;
    text-align: left;
    font-weight: 600;
    border-bottom: 1px solid #ddd;
}

.bsfrs-weight-details td {
    padding: 10px;
    border-bottom: 1px solid #eee;
}

.bsfrs-weight-details tr:last-child td {
    border-bottom: none;
}

/* Calculation Details */
.bsfrs-calculation-details {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #ddd;
}

.calculation-info {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
    margin-top: 15px;
}

.carrier-calculation {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    padding: 15px;
}

.carrier-calculation h5 {
    margin-top: 0;
    margin-bottom: 10px;
    color: #333;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
}

.carrier-calculation p {
    margin: 5px 0;
    font-size: 13px;
    color: #666;
}

.carrier-calculation p strong {
    color: #333;
    font-size: 14px;
}

/* Cart/Checkout Integration */
.bsfrs-cart-weight th,
.bsfrs-cart-weight td {
    padding: 10px;
    border-top: 1px solid #ddd;
}

.bsfrs-calculation-details th,
.bsfrs-calculation-details td {
    padding: 10px;
    border-top: 1px solid #ddd;
    vertical-align: top;
}

.bsfrs-shipping-calculations {
    font-size: 14px;
}

.bsfrs-shipping-calculations .carrier-calculation {
    margin-bottom: 10px;
    padding: 5px 0;
}

.bsfrs-shipping-calculations .carrier-calculation:last-child {
    margin-bottom: 0;
}

/* Responsive Design */
@media screen and (max-width: 768px) {
    .bsfrs-weight-display {
        padding: 15px;
    }
    
    .bsfrs-weight-display h3 {
        font-size: 16px;
    }
    
    .bsfrs-weight-display h4 {
        font-size: 14px;
    }
    
    .bsfrs-weight-details table {
        font-size: 14px;
    }
    
    .bsfrs-weight-details th,
    .bsfrs-weight-details td {
        padding: 8px 5px;
    }
    
    .calculation-info {
        grid-template-columns: 1fr;
    }
}

/* Integration with WooCommerce Themes */
.woocommerce .bsfrs-weight-display {
    clear: both;
}

.woocommerce-cart .bsfrs-weight-display {
    margin-top: 20px;
}

.woocommerce-checkout .bsfrs-weight-display {
    margin-bottom: 20px;
}

/* Dark Theme Support */
body.theme-dark .bsfrs-weight-display {
    background: #2a2a2a;
    border-color: #444;
    color: #fff;
}

body.theme-dark .bsfrs-weight-display h3,
body.theme-dark .bsfrs-weight-display h4 {
    color: #fff;
}

body.theme-dark .bsfrs-weight-details th {
    background: #333;
    color: #fff;
    border-color: #555;
}

body.theme-dark .bsfrs-weight-details td {
    border-color: #444;
    color: #ddd;
}

body.theme-dark .carrier-calculation {
    background: #333;
    border-color: #555;
}

body.theme-dark .carrier-calculation h5,
body.theme-dark .carrier-calculation p strong {
    color: #fff;
}

body.theme-dark .carrier-calculation p {
    color: #ccc;
}

/* Loading Animation */
.bsfrs-weight-display.loading {
    position: relative;
    min-height: 100px;
}

.bsfrs-weight-display.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border: 3px solid #f3f3f3;
    border-radius: 50%;
    border-top: 3px solid #3498db;
    animation: bsfrs-spin 1s linear infinite;
}

@keyframes bsfrs-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Accessibility */
.bsfrs-weight-display:focus-within {
    outline: 2px solid #0073aa;
    outline-offset: 2px;
}

.screen-reader-text {
    position: absolute !important;
    clip: rect(1px, 1px, 1px, 1px);
    padding: 0 !important;
    border: 0 !important;
    height: 1px !important;
    width: 1px !important;
    overflow: hidden;
}
