/**
 * Abrites WooCommerce Dependencies Frontend Styles
 */

/* Required Products Notice */
.abrites-required-notice {
    background-color: #fff8e5;
    border-left: 3px solid #f7b84b;
    padding: 15px 20px;
    margin-bottom: 20px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.abrites-required-notice h3 {
    color: #b28000;
    margin-top: 0;
    font-size: 16px;
}

.abrites-required-notice ul {
    margin-left: 0;
    list-style: none;
    padding-left: 0;
}

.abrites-required-notice li {
    padding: 10px 0;
    border-bottom: 1px solid rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.abrites-required-notice li:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.abrites-required-notice .product-name {
    flex: 1;
    min-width: 200px;
    font-weight: bold;
    padding-right: 15px;
}

.abrites-required-notice .product-price {
    color: #555;
    margin: 0 15px;
    font-weight: normal;
}

/* Missing Required Products */
.abrites-missing-required-products {
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
    color: #721c24;
    padding: 15px 20px;
    margin-bottom: 20px;
    border-radius: 4px;
}

.abrites-missing-required-products p {
    font-weight: bold;
    margin-top: 0;
}

.abrites-missing-required-products ul {
    margin-top: 10px;
    padding-left: 0;
    list-style: none;
}

.abrites-missing-required-products li {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #f5c6cb;
}

.abrites-missing-required-products li:last-child {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.abrites-missing-required-products .add-all-required {
    display: block;
    width: 100%;
    margin-top: 15px;
    text-align: center;
}

.abrites-missing-required-products .product-name {
    flex: 1;
    min-width: 200px;
    font-weight: bold;
}

/* Dependencies Product Display */
.dependency-products {
    display: flex;
    flex-wrap: wrap;
    margin-left: -15px;
    margin-right: -15px;
}

.dependency-products li.product {
    flex: 0 0 calc(33.333% - 30px);
    margin: 0 15px 30px;
    padding: 15px;
    border: 1px solid #eee;
    border-radius: 4px;
    background-color: #fff;
    transition: box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.dependency-products li.product:hover {
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.dependency-products li.product img {
    margin-bottom: 10px;
    max-width: 100%;
    height: auto;
}

.dependency-products li.product h2 {
    font-size: 16px;
    font-weight: bold;
    margin-bottom: 10px;
}

.dependency-products li.product .price {
    color: #77a464;
    font-weight: bold;
    margin-bottom: 15px;
}

.dependency-products li.product .button {
    margin-top: auto;
    align-self: flex-start;
}

/* Product Tabs Customization */
.woocommerce div.product .woocommerce-tabs ul.tabs li.required_dependencies_tab a,
.woocommerce div.product .woocommerce-tabs ul.tabs li.recommended_dependencies_tab a {
    position: relative;
}

.woocommerce div.product .woocommerce-tabs ul.tabs li.required_dependencies_tab a::after {
    content: "";
    position: absolute;
    right: -5px;
    top: -5px;
    width: 10px;
    height: 10px;
    background-color: #f7b84b;
    border-radius: 50%;
}

/* Recommended Products Section */
.abrites-recommended-products {
    border-top: 1px solid #eee;
    padding-top: 30px;
    margin-top: 30px;
}

.abrites-recommended-products h2 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #333;
}

/* Cart Recommendations */
.abrites-cart-recommendations {
    margin-top: 30px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 4px;
}

.abrites-cart-recommendations h2 {
    margin-top: 0;
    font-size: 18px;
    margin-bottom: 15px;
    color: #333;
}

/* Loading States */
.button.loading {
    opacity: 0.7;
    position: relative;
    padding-right: 30px !important;
}

.button.loading::after {
    content: "";
    position: absolute;
    right: 6px;
    top: 50%;
    width: 16px;
    height: 16px;
    margin-top: -8px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    animation: abrites-spin 0.8s linear infinite;
}

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

/* Confirmation Messages */
.added-confirmation,
.error-confirmation {
    display: inline-block;
    padding: 5px 10px;
    margin-left: 10px;
    border-radius: 3px;
    font-size: 12px;
}

.added-confirmation {
    background-color: #4CAF50;
    color: #fff;
}

.error-confirmation {
    background-color: #f44336;
    color: #fff;
}

/* Responsive Adjustments */
@media (max-width: 991px) {
    .dependency-products li.product {
        flex: 0 0 calc(50% - 30px);
    }
}

@media (max-width: 767px) {
    .dependency-products li.product {
        flex: 0 0 calc(100% - 30px);
    }

    .abrites-required-notice li,
    .abrites-missing-required-products li {
        flex-direction: column;
        align-items: flex-start;
    }

    .abrites-required-notice .product-name,
    .abrites-missing-required-products .product-name {
        margin-bottom: 10px;
    }

    .abrites-required-notice .product-price {
        margin: 5px 0 10px;
    }

    .abrites-required-notice .button,
    .abrites-missing-required-products .button {
        width: 100%;
        text-align: center;
    }
}