/* ============================================
   YUNO Cross-Sell - Frontend Styles
   ============================================ */

/* --- Cross-Sell Section --- */
.yuno-cross-sell-section {
    margin: 20px 0 25px;
    padding: 0;
    border-top: 1px solid #e8e8e8;
    padding-top: 18px;
}

.yuno-cs-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin: 0 0 12px;
    letter-spacing: 0.01em;
}

/* --- Single Item (Checkbox Row) --- */
.yuno-cs-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    margin-bottom: 8px;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.2s ease, background-color 0.2s ease;
    user-select: none;
}

.yuno-cs-item:hover {
    border-color: #ccc;
    background-color: #fafafa;
}

.yuno-cs-item.yuno-cs-checked {
    border-color: #333;
    background-color: #f7f7f7;
}

/* Hidden items (beyond max_visible) */
.yuno-cs-item.yuno-cs-hidden {
    display: none;
}

.yuno-cross-sell-section.yuno-cs-expanded .yuno-cs-item.yuno-cs-hidden {
    display: flex;
    animation: yunoSlideDown 0.3s ease forwards;
}

@keyframes yunoSlideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* --- Checkbox --- */
.yuno-cs-checkbox-wrap {
    flex-shrink: 0;
}

.yuno-cs-checkbox {
    width: 18px;
    height: 18px;
    accent-color: #333;
    cursor: pointer;
    margin: 0;
}

/* --- Item Info --- */
.yuno-cs-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
}

.yuno-cs-item-name {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.yuno-cs-color-label {
    font-weight: 400;
    color: #888;
}

.yuno-cs-item-price {
    font-size: 13px;
    color: #666;
}

.yuno-cs-item-price del {
    color: #999;
    font-size: 12px;
}

.yuno-cs-item-price ins {
    text-decoration: none;
    font-weight: 600;
}

/* --- Color Swatches --- */
.yuno-cs-swatches {
    display: flex;
    gap: 4px;
    margin-top: 3px;
    flex-wrap: wrap;
}

.yuno-cs-swatch {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    border: 2px solid #ddd;
    cursor: pointer;
    transition: border-color 0.2s, transform 0.15s;
    display: inline-block;
    box-sizing: border-box;
}

.yuno-cs-swatch:hover {
    border-color: #999;
    transform: scale(1.1);
}

.yuno-cs-swatch.yuno-cs-swatch-active {
    border-color: #333;
    box-shadow: 0 0 0 1px #333;
}

/* Weisse/helle Swatches brauchen sichtbaren Rand */
.yuno-cs-swatch[style*="f0eeeb"],
.yuno-cs-swatch[style*="f5f0e1"],
.yuno-cs-swatch[style*="e8d5b7"] {
    border-color: #ccc;
}

/* --- Product Image --- */
.yuno-cs-item-image {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    border-radius: 4px;
    overflow: hidden;
}

.yuno-cs-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* --- Expand Button --- */
.yuno-cs-expand {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background: none;
    border: none;
    padding: 6px 0;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s;
}

.yuno-cs-expand:hover {
    color: #333;
}

.yuno-cs-chevron {
    transition: transform 0.3s ease;
}

.yuno-cross-sell-section.yuno-cs-expanded .yuno-cs-chevron {
    transform: rotate(180deg);
}

.yuno-cross-sell-section.yuno-cs-expanded .yuno-cs-expand {
    display: none;
}

/* --- Shipping Progress Bar --- */
.yuno-shipping-bar {
    margin: 0 0 18px;
    padding: 12px 16px;
    background: #f8f8f8;
    border-radius: 8px;
    border: 1px solid #eee;
}

.yuno-shipping-text {
    font-size: 13px;
    color: #555;
    margin: 0 0 8px;
}

.yuno-shipping-text strong {
    color: #333;
}

.yuno-shipping-free {
    color: #2d8a4e;
}

.yuno-shipping-free strong {
    color: #2d8a4e;
}

.yuno-shipping-track {
    width: 100%;
    height: 6px;
    background: #e0e0e0;
    border-radius: 3px;
    overflow: hidden;
}

.yuno-shipping-progress {
    height: 100%;
    background: linear-gradient(90deg, #333, #555);
    border-radius: 3px;
    transition: width 0.6s ease;
    min-width: 0;
}

.yuno-shipping-bar[data-reached="true"] .yuno-shipping-progress {
    background: linear-gradient(90deg, #2d8a4e, #3daa5e);
}

/* --- Lightbox --- */
.yuno-cs-lightbox-trigger {
    cursor: zoom-in;
}

.yuno-cs-lightbox-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.7);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
    backdrop-filter: blur(2px);
}

.yuno-cs-lightbox-overlay.yuno-cs-lightbox-visible {
    opacity: 1;
}

.yuno-cs-lightbox-content {
    position: relative;
    background: #fff;
    border-radius: 10px;
    max-width: 420px;
    width: 90vw;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.95);
    transition: transform 0.25s ease;
}

.yuno-cs-lightbox-visible .yuno-cs-lightbox-content {
    transform: scale(1);
}

.yuno-cs-lightbox-image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    display: block;
}

.yuno-cs-lightbox-info {
    padding: 16px 20px;
}

.yuno-cs-lightbox-name {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    margin: 0 0 4px;
}

.yuno-cs-lightbox-price {
    font-size: 14px;
    color: #666;
    margin: 0 0 12px;
}

.yuno-cs-lightbox-link {
    display: inline-block;
    font-size: 13px;
    color: #333;
    text-decoration: underline;
    text-underline-offset: 2px;
}

.yuno-cs-lightbox-link:hover {
    color: #000;
}

.yuno-cs-lightbox-close {
    position: absolute !important;
    top: 8px !important;
    right: 8px !important;
    left: auto !important;
    width: 32px !important;
    height: 32px !important;
    padding: 0 !important;
    margin: 0 !important;
    background: none !important;
    border: none !important;
    border-radius: 0 !important;
    box-shadow: none !important;
    font-size: 24px !important;
    line-height: 32px !important;
    text-align: center !important;
    cursor: pointer !important;
    color: #fff !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    z-index: 2 !important;
    float: none !important;
}

.yuno-cs-lightbox-close:hover {
    color: #ddd !important;
    background: none !important;
}

/* --- Responsive --- */
@media (max-width: 480px) {
    .yuno-cs-item {
        padding: 8px 10px;
        gap: 10px;
    }

    .yuno-cs-item-image {
        width: 42px;
        height: 42px;
    }

    .yuno-cs-item-name {
        font-size: 12px;
    }
}
