/* Frontend styles for WCRP */
.wcrp-recommended-products {
    margin: 40px 0;
    padding: 0 15px;
}

/* ========== Mini-Cart Offcanvas Recommendations ========== */
.wcrp-mini-cart-recommendations {
    border-top: 1px solid #e7e7e7;
    padding: 15px 0 0;
    margin-top: 15px;
}

.wcrp-mini-cart-title {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 12px;
    padding: 0 5px;
    color: #333;
}

.wcrp-mini-cart-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.wcrp-mini-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px;
    border: 1px solid #f0f0f0;
    border-radius: 6px;
    background: #fafafa;
}

.wcrp-mini-item-image {
    flex-shrink: 0;
    width: 55px;
    height: 55px;
}

.wcrp-mini-item-image img {
    width: 55px;
    height: 55px;
    object-fit: cover;
    border-radius: 4px;
}

.wcrp-mini-item-details {
    flex: 1;
    min-width: 0;
}

.wcrp-mini-item-name {
    font-size: 12px;
    font-weight: 500;
    color: #333;
    text-decoration: none;
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}

.wcrp-mini-item-name:hover {
    color: #007cba;
}

.wcrp-mini-item-price {
    font-size: 13px;
    font-weight: 600;
    color: #444;
    margin-bottom: 4px;
}

.wcrp-mini-item-price del {
    font-size: 11px;
    color: #999;
    margin-right: 3px;
}

.wcrp-mini-item-price ins {
    text-decoration: none;
}

.wcrp-mini-add-btn {
    font-size: 11px;
    padding: 2px 10px;
    background: #333;
    color: #fff;
    border: none;
    border-radius: 3px;
    cursor: pointer;
    line-height: 1.8;
}

.wcrp-mini-add-btn:hover {
    background: #555;
}

.wcrp-mini-add-btn.adding {
    opacity: 0.6;
    pointer-events: none;
}

.wcrp-mini-add-btn.added {
    background: #7fad39;
}

/* ========== Product Page Recommendations ========== */

.wcrp-section-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    text-align: center;
}

/* Grid fallback (non-slider mode) */
.wcrp-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

/* Swiper overrides */
.wcrp-products-wrapper.swiper {
    padding: 0 40px 40px;
}

.wcrp-products-wrapper .swiper-button-prev,
.wcrp-products-wrapper .swiper-button-next {
    color: #333;
}

.wcrp-products-wrapper .swiper-pagination-bullet-active {
    background: #333;
}

/* Product card */
.wcrp-product-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 8px;
    overflow: hidden;
    transition: box-shadow 0.2s;
    text-align: center;
}

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

.wcrp-product-image {
    position: relative;
    overflow: hidden;
}

.wcrp-product-image img {
    width: 100%;
    height: auto;
    display: block;
}

.wcrp-onsale {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #e2401c;
    color: #fff;
    padding: 4px 10px;
    font-size: 12px;
    font-weight: 700;
    border-radius: 3px;
    z-index: 1;
}

.wcrp-product-info {
    padding: 15px;
}

.wcrp-product-name {
    font-size: 14px;
    font-weight: 600;
    margin: 0 0 8px;
}

.wcrp-product-name a {
    color: #333;
    text-decoration: none;
}

.wcrp-product-name a:hover {
    color: #007cba;
}

.wcrp-product-rating {
    margin-bottom: 8px;
    min-height: 20px;
}

.wcrp-product-rating .star-rating {
    margin: 0 auto;
}

.wcrp-product-price {
    font-size: 16px;
    font-weight: 700;
    color: #333;
    margin-bottom: 12px;
}

.wcrp-product-price del {
    color: #999;
    font-weight: 400;
    margin-right: 5px;
}

.wcrp-product-price ins {
    text-decoration: none;
}

.wcrp-add-to-cart {
    width: 100%;
    padding: 10px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
}

.wcrp-add-to-cart.adding {
    opacity: 0.6;
    pointer-events: none;
}

.wcrp-add-to-cart.added {
    background: #7fad39;
    border-color: #7fad39;
    color: #fff;
}

/* Spinner */
.wcrp-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 2px solid #fff;
    border-radius: 50%;
    border-top-color: transparent;
    animation: wcrp-spin 0.6s linear infinite;
    margin-right: 5px;
    vertical-align: middle;
}

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

/* Responsive */
@media (max-width: 768px) {
    .wcrp-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .wcrp-products-wrapper.swiper {
        padding: 0 25px 35px;
    }

    .wcrp-section-title {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .wcrp-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
}
