/**
 * KB Buy Again - Frontend Styles
 *
 * @author    Starter
 * @copyright 2024
 * @license   http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */

/* ============================================
   Navigation Button Styles
   ============================================ */

.kbba-nav-item {
    position: relative;
}

.kbba-nav-link {
    display: flex;
    align-items: center;
    gap: 5px;
}

.kbba-nav-link i.material-icons {
    font-size: 18px;
}

/* ============================================
   My Account Link Styles
   ============================================ */

#kbba-my-account-link {
    text-decoration: none;
}

#kbba-my-account-link .link-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    transition: all 0.3s ease;
}

#kbba-my-account-link:hover .link-item {
    background: #e9ecef;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
}

#kbba-my-account-link i.material-icons {
    font-size: 32px;
    color: #2fb5d2;
}

/* ============================================
   Buy Again Page Styles
   ============================================ */

.kbba-buyagain-page {
    padding: 20px 0;
}

.kbba-page-description {
    margin-bottom: 30px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    border-left: 4px solid #2fb5d2;
}

.kbba-products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid #e9ecef;
}

.kbba-products-count {
    color: #6c757d;
    font-size: 14px;
}

/* Product Grid */
.kbba-products-grid {
    margin-bottom: 30px;
}

.kbba-product-col {
    margin-bottom: 30px;
}

.kbba-product-miniature {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.kbba-product-miniature:hover {
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transform: translateY(-5px);
}

/* Product Thumbnail */
.kbba-product-thumbnail {
    position: relative;
    overflow: hidden;
    background: #f8f9fa;
}

.kbba-product-thumbnail a {
    display: block;
}

.kbba-product-image {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.kbba-product-miniature:hover .kbba-product-image {
    transform: scale(1.05);
}

/* Badges */
.kbba-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    border-radius: 3px;
    color: #fff;
}

.kbba-badge-out-of-stock {
    background: #dc3545;
}

/* Product Description */
.kbba-product-description {
    padding: 15px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.kbba-product-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 8px 0;
    line-height: 1.4;
}

.kbba-product-title a {
    color: #232323;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.kbba-product-title a:hover {
    color: #2fb5d2;
}

.kbba-product-combination {
    margin: 0 0 8px 0;
    color: #6c757d;
}

.kbba-product-price-and-shipping {
    margin-bottom: 8px;
}

.kbba-price {
    font-size: 18px;
    font-weight: 700;
    color: #232323;
}

.kbba-product-last-ordered {
    color: #6c757d;
    margin-bottom: 15px;
}

.kbba-product-last-ordered i {
    vertical-align: middle;
}

/* Product Actions */
.kbba-product-actions {
    margin-top: auto;
}

.kbba-quantity-wrapper {
    margin-bottom: 10px;
}

.kbba-qty-input {
    max-width: 60px;
}

.kbba-qty-btn {
    padding: 0.25rem 0.5rem;
}

.kbba-qty-btn i {
    font-size: 16px;
    vertical-align: middle;
}

.kbba-add-to-cart-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 100%;
}

.kbba-add-to-cart-btn i {
    font-size: 18px;
}

.kbba-add-to-cart-btn.adding {
    pointer-events: none;
    opacity: 0.7;
}

/* Pagination */
.kbba-pagination-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 30px;
}

.kbba-pagination-wrapper .page-link i {
    font-size: 18px;
    vertical-align: middle;
}

/* No Products */
.kbba-no-products {
    text-align: center;
    padding: 60px 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.kbba-no-products-icon {
    margin-bottom: 20px;
}

.kbba-no-products-icon i {
    font-size: 80px;
    color: #dee2e6;
}

.kbba-no-products h3 {
    margin: 0 0 15px 0;
    color: #495057;
}

.kbba-no-products p {
    color: #6c757d;
    margin-bottom: 25px;
}

/* ============================================
   Cart Suggestions Styles
   ============================================ */

.kbba-cart-suggestions {
    margin-top: 40px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 8px;
}

.kbba-cart-suggestions-header {
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 1px solid #dee2e6;
}

.kbba-cart-suggestions-title {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #232323;
}

.kbba-cart-suggestions-title i {
    color: #2fb5d2;
}

.kbba-cart-product-item {
    margin-bottom: 20px;
}

.kbba-product-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    overflow: hidden;
    height: 100%;
    transition: all 0.3s ease;
}

.kbba-product-card:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.kbba-product-card .kbba-product-image {
    position: relative;
}

.kbba-product-card .kbba-product-image img {
    width: 100%;
    height: auto;
    aspect-ratio: 1;
    object-fit: cover;
}

.kbba-out-of-stock-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    padding: 3px 8px;
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    background: #dc3545;
    color: #fff;
    border-radius: 3px;
}

.kbba-product-card .kbba-product-info {
    padding: 12px;
}

.kbba-product-card .kbba-product-name {
    font-size: 13px;
    font-weight: 600;
    margin: 0 0 8px 0;
    line-height: 1.3;
}

.kbba-product-card .kbba-product-name a {
    color: #232323;
    text-decoration: none;
}

.kbba-product-card .kbba-product-name a:hover {
    color: #2fb5d2;
}

.kbba-product-card .kbba-product-price {
    font-size: 16px;
    font-weight: 700;
    color: #232323;
    margin-bottom: 10px;
}

.kbba-cart-suggestions-footer {
    margin-top: 20px;
    text-align: center;
}

.kbba-cart-suggestions-footer a {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.kbba-cart-suggestions-footer a i {
    font-size: 18px;
}

/* ============================================
   Loading & Success States
   ============================================ */

.kbba-loading {
    position: relative;
    pointer-events: none;
}

.kbba-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #fff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: kbba-spin 0.8s linear infinite;
}

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

.kbba-success {
    background-color: #28a745 !important;
    border-color: #28a745 !important;
}

/* ============================================
   Toast Notification
   ============================================ */

.kbba-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    min-width: 300px;
    max-width: 400px;
    padding: 15px 20px;
    background: #232323;
    color: #fff;
    border-radius: 6px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 9999;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.kbba-toast.show {
    opacity: 1;
    transform: translateY(0);
}

.kbba-toast.success {
    background: #28a745;
}

.kbba-toast.error {
    background: #dc3545;
}

.kbba-toast-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.kbba-toast-icon i {
    font-size: 24px;
}

.kbba-toast-message {
    flex-grow: 1;
}

.kbba-toast-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.2s;
}

.kbba-toast-close:hover {
    opacity: 1;
}

/* ============================================
   Responsive Adjustments
   ============================================ */

@media (max-width: 767px) {
    .kbba-cart-suggestions {
        padding: 15px;
    }

    .kbba-product-miniature {
        margin-bottom: 15px;
    }

    .kbba-pagination-wrapper .page-link {
        padding: 0.375rem 0.5rem;
    }

    .kbba-no-products {
        padding: 40px 15px;
    }

    .kbba-no-products-icon i {
        font-size: 60px;
    }

    .kbba-toast {
        left: 20px;
        right: 20px;
        min-width: auto;
    }
}

@media (max-width: 575px) {
    .kbba-products-header {
        flex-direction: column;
        gap: 10px;
        text-align: center;
    }
}
