/**
 * Frontend styles for compatible cartridges.
 */

/* =====================================================
   CAROUSEL — Single Product Page (Aarke-style cards)
   ===================================================== */

.wccf-carousel-section {
    position: relative;
    margin: 20px 0 10px;
    padding: 0;
}

.wccf-carousel-track {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 4px 0;
}

.wccf-carousel-track::-webkit-scrollbar {
    display: none;
}

/* Card — horizontal layout: image left, info+button right */
.wccf-carousel-card {
    flex: 0 0 auto;
    width: 280px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    background: #fff;
    transition: border-color 0.2s ease;
}

.wccf-carousel-card:hover {
    border-color: #ccc;
}

/* Featured cartridge — subtle blue background */
.wccf-carousel-card--featured {
    background: #f0f7ff;
    border-color: #d0e3f7;
}

.wccf-carousel-card--featured:hover {
    border-color: #a8cdef;
}

/* Image — left side */
.wccf-carousel-card__image {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 90px;
    flex-shrink: 0;
    padding: 8px;
}

.wccf-carousel-card__image img {
    width: 100% !important;
    height: auto;
    object-fit: contain;
    display: block;
    mix-blend-mode: multiply;
}

/* Body — right side */
.wccf-carousel-card__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 12px 10px 12px 0;
    min-width: 0;
}

/* Info */
.wccf-carousel-card__info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.wccf-carousel-card__name {
    font-size: 12px;
    font-weight: 500;
    line-height: 1.3;
    color: #333;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin-bottom: 5px;
}

.wccf-carousel-card__name:hover {
    color: #24317C;
}

.wccf-carousel-card__cycle {
    font-size: 11px;
    color: #888;
    line-height: 1.2;
    margin: 0 !important;
}

/* Add button */
.wccf-carousel-card__add {
    display: inline-block;
    margin-top: 6px;
    padding: 5px 10px;
    border: none;
    border-radius: 4px;
    background: #24317C;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    cursor: pointer;
    text-align: center;
    transition: background 0.2s ease;
    line-height: 1.3;
    align-self: flex-start;
}

.wccf-carousel-card__add:hover {
    background: #1a2560;
    color: #fff !important;
}

.wccf-carousel-card__add .woocommerce-Price-amount {
    font-weight: 700;
}

.wccf-carousel-card__add.wccf-added {
    background: #2E9E3E !important;
    border-color: #2E9E3E !important;
    color: #fff !important;
    pointer-events: none;
}

.wccf-carousel-card__add.wccf-loading {
    opacity: 0.6;
    pointer-events: none;
}

.wccf-carousel-card__unavailable {
    display: inline-block;
    margin-top: 6px;
    font-size: 12px;
    color: #999;
    font-style: italic;
}

/* Arrows */
.wccf-carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 2;
    color: #24317C;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: opacity 0.3s ease, background 0.2s ease, transform 0.2s ease;
    opacity: 1;
}

.wccf-carousel-arrow:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-50%) scale(1.08);
}

.wccf-carousel-arrow.wccf-hidden {
    opacity: 0;
    pointer-events: none;
}

.wccf-carousel-arrow--prev {
    left: -6px;
}

.wccf-carousel-arrow--next {
    right: -6px;
}

/* Responsive */
@media (max-width: 768px) {
    .wccf-carousel-card {
        width: 250px;
    }

    .wccf-carousel-card__image {
        width: 70px;
    }
}

@media (max-width: 480px) {
    .wccf-carousel-card {
        width: 230px;
    }

    .wccf-carousel-card__image {
        width: 60px;
    }
}

/* =====================================================
   REVERSE INFO
   ===================================================== */

.wccf-reverse-info {
    margin: 10px 0;
    padding: 10px 14px;
    background: #f0f7ff;
    border: 1px solid #d0e3f7;
    border-radius: 6px;
    font-size: 13px;
}

.wccf-reverse-info h4 {
    margin: 0 0 6px;
    font-size: 13px;
    font-weight: 600;
}

.wccf-reverse-info ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.wccf-reverse-info li {
    margin: 3px 0;
}

.wccf-reverse-info a {
    color: #24317C;
    text-decoration: none;
}

.wccf-reverse-info a:hover {
    text-decoration: underline;
}

/* =====================================================
   CART / CHECKOUT UPSELL
   ===================================================== */

.wccf-cart-upsell {
    margin: 1.5em 0;
    padding: 16px 20px;
    background: #f9f9f9;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
}

.wccf-cart-upsell__title {
    margin: 0 0 10px;
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.wccf-carousel-section--cart {
    margin: 0;
}

/* Wider cards in cart to fit bundle buttons */
.wccf-carousel-card--cart {
    width: 300px;
}

.wccf-carousel-card__buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin-top: 6px;
}

.wccf-carousel-card__bundle {
    padding: 3px 8px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    font-size: 11px;
    font-weight: 500;
    color: #555;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease;
    line-height: 1.3;
}

.wccf-carousel-card__bundle:hover {
    border-color: #24317C;
    color: #24317C;
}

.wccf-carousel-card__bundle.wccf-added {
    background: #2E9E3E !important;
    border-color: #2E9E3E !important;
    color: #fff !important;
    pointer-events: none;
}

.wccf-carousel-card__bundle.wccf-loading {
    opacity: 0.6;
    pointer-events: none;
}

@media (max-width: 768px) {
    .wccf-carousel-card--cart {
        width: 260px;
    }
}

.wp-block-woocommerce-checkout ~ .wccf-blocks-container .wccf-cart-upsell,
.wc-block-checkout ~ .wccf-blocks-container .wccf-cart-upsell {
    margin-top: 1.5em;
}

.wccf-blocks-container {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
}

.wc-block-components-radio-control .wc-block-components-radio-control__input {
    left: 16px;
}
