/**
 * ScooterDiscounter / BandenvoorScooters - Cross-sell & Tire Links CSS
 * 
 * Locatie: skin/frontend/scooterdiscounter/default/css/sd-crosssell.css
 * 
 * @version 1.0.0
 * 
 * Features:
 * - Product header styling (titel boven gallery)
 * - Compact horizontal slider for cross-sell products
 * - Responsive tire size/profile links
 * - Touch-friendly on mobile
 * - Fade effect to indicate more items
 * - Toast notifications for add-to-cart feedback
 */

/* ===== PRODUCT HEADER (titel boven gallery) ===== */
.sd-product-header {
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 1px solid var(--sd-border, #e5e7eb);
}

.sd-product-header .sd-product-title {
    font-size: 26px;
    font-weight: 700;
    color: var(--sd-dark, #1f2937);
    line-height: 1.3;
    margin: 0 0 10px 0;
}

.sd-product-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    flex-wrap: wrap;
}

.sd-product-meta-row .sd-review-summary-wrap {
    flex: 1;
    min-width: 0;
}

.sd-product-meta-row .sd-product-brand {
    flex-shrink: 0;
}

@media (max-width: 768px) {
    .sd-product-header .sd-product-title {
        font-size: 22px;
    }
    
    .sd-product-meta-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
}

/* ===== CROSS-SELL SLIDER ===== */
.sd-crosssell {
    background: var(--sd-bg, #f8f9fa);
    border: 1px solid var(--sd-border, #e5e7eb);
    border-radius: var(--sd-radius, 8px);
    padding: 10px;
    margin: 14px 0;
}

.sd-crosssell-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
    padding: 0 2px;
}

.sd-crosssell-title {
    font-size: 12px;
    font-weight: 700;
    color: var(--sd-dark, #1f2937);
    display: flex;
    align-items: center;
    gap: 5px;
}

.sd-crosssell-title .icon {
    font-size: 14px;
}

.sd-crosssell-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.sd-crosssell-indicator {
    font-size: 11px;
    color: var(--sd-text-muted, #9ca3af);
}

.sd-crosssell-arrow {
    width: 24px;
    height: 24px;
    background: var(--sd-white, #fff);
    border: 1px solid var(--sd-border, #e5e7eb);
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    color: var(--sd-text-light, #6b7280);
    transition: border-color 0.15s, color 0.15s;
}

.sd-crosssell-arrow:hover {
    border-color: var(--sd-orange, #f97316);
    color: var(--sd-orange, #f97316);
}

.sd-crosssell-arrow:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.sd-crosssell-arrow:disabled:hover {
    border-color: var(--sd-border, #e5e7eb);
    color: var(--sd-text-light, #6b7280);
}

/* Slider Container */
.sd-crosssell-slider {
    position: relative;
    overflow: hidden;
}

.sd-crosssell-track {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding-bottom: 2px;
}

.sd-crosssell-track::-webkit-scrollbar {
    display: none;
}

/* Fade effect on right side */
.sd-crosssell-slider::after {
    content: '';
    position: absolute;
    top: 0;
    right: 0;
    width: 40px;
    height: 100%;
    background: linear-gradient(to right, transparent, var(--sd-bg, #f8f9fa));
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.2s;
}

.sd-crosssell-slider.at-end::after {
    opacity: 0;
}

/* Individual Item */
.sd-crosssell-item {
    flex: 0 0 90px;
    background: var(--sd-white, #fff);
    border: 1px solid var(--sd-border, #e5e7eb);
    border-radius: 6px;
    padding: 6px;
    text-align: center;
    transition: border-color 0.2s, background-color 0.2s;
    position: relative;
}

.sd-crosssell-item:hover {
    border-color: var(--sd-orange, #f97316);
}

/* Checkbox styling */
.sd-crosssell-label {
    display: block;
    cursor: pointer;
    position: relative;
}

.sd-crosssell-checkbox {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    z-index: 2;
}

.sd-crosssell-input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.sd-crosssell-checkmark {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    background: var(--sd-white, #fff);
    border: 2px solid var(--sd-border, #e5e7eb);
    border-radius: 4px;
    color: transparent;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.2s;
}

.sd-crosssell-input:checked ~ .sd-crosssell-checkmark {
    background: var(--sd-orange, #f97316);
    border-color: var(--sd-orange, #f97316);
    color: #fff;
}

.sd-crosssell-item:has(.sd-crosssell-input:checked) {
    border-color: var(--sd-orange, #f97316);
    background: rgba(249, 115, 22, 0.05);
}

/* Fallback for browsers without :has() support */
.sd-crosssell-item.selected {
    border-color: var(--sd-orange, #f97316);
    background: rgba(249, 115, 22, 0.05);
}

.sd-crosssell-img {
    width: 36px;
    height: 36px;
    margin: 4px auto;
    display: flex;
    align-items: center;
    justify-content: center;
}

.sd-crosssell-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.sd-crosssell-name {
    font-size: 10px;
    color: var(--sd-text, #374151);
    margin-bottom: 2px;
    line-height: 1.2;
    height: 24px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sd-crosssell-name a {
    color: inherit;
    text-decoration: none;
}

.sd-crosssell-name a:hover {
    color: var(--sd-orange, #f97316);
}

.sd-crosssell-price {
    font-size: 12px;
    font-weight: 700;
    color: var(--sd-dark, #1f2937);
    margin-bottom: 4px;
}

/* Footer with total */
.sd-crosssell-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--sd-border, #e5e7eb);
}

.sd-crosssell-total {
    font-size: 13px;
    color: var(--sd-text, #374151);
}

.sd-crosssell-total strong {
    font-size: 15px;
    color: var(--sd-dark, #1f2937);
    font-weight: 700;
}

.sd-crosssell-hint {
    font-size: 11px;
    color: var(--sd-text-muted, #9ca3af);
    font-style: italic;
}

/* Swipe hint (mobile) */
@keyframes swipeHint {
    0%, 100% { transform: translateX(0); opacity: 0.7; }
    50% { transform: translateX(6px); opacity: 1; }
}

.sd-crosssell-swipe-hint {
    display: none;
    align-items: center;
    gap: 3px;
    font-size: 10px;
    color: var(--sd-text-muted, #9ca3af);
}

.sd-crosssell-swipe-hint .arrow {
    animation: swipeHint 1.5s ease-in-out 3;
}

/* Empty state */
.sd-crosssell-empty {
    padding: 16px;
    text-align: center;
    color: var(--sd-text-muted, #9ca3af);
    font-size: 13px;
}

/* ===== TIRE LINKS ===== */
.sd-tire-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    margin: 14px 0;
}

.sd-tire-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: var(--sd-bg, #f8f9fa);
    border: 1px solid var(--sd-border, #e5e7eb);
    border-radius: var(--sd-radius, 8px);
    text-decoration: none;
    color: var(--sd-text, #374151);
    transition: border-color 0.2s, background 0.2s;
}

.sd-tire-link:hover {
    border-color: var(--sd-orange, #f97316);
    background: #fff7ed;
    text-decoration: none;
}

/* Icon zonder achtergrond - simpel emoji */
.sd-tire-link-icon {
    font-size: 18px;
    flex-shrink: 0;
    line-height: 1;
}

.sd-tire-link-text {
    font-size: 12px;
    line-height: 1.3;
    min-width: 0;
    flex: 1;
}

.sd-tire-link-text strong {
    display: block;
    font-weight: 700;
    color: var(--sd-dark, #1f2937);
    font-size: 12px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* ===== TOAST NOTIFICATION ===== */
.sd-toast {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--sd-dark, #1f2937);
    color: #fff;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.25);
    z-index: 9999;
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
    pointer-events: none;
}

.sd-toast.show {
    transform: translateX(-50%) translateY(0);
    opacity: 1;
}

.sd-toast .icon {
    color: var(--sd-green, #22c55e);
}

/* ===== MOBILE RESPONSIVE ===== */
@media (max-width: 768px) {
    /* Cross-sell: show swipe hint, hide arrows */
    .sd-crosssell-swipe-hint {
        display: flex;
    }
    
    .sd-crosssell-arrow {
        display: none;
    }
    
    .sd-crosssell-item {
        flex: 0 0 85px;
    }
    
    .sd-crosssell-img {
        width: 32px;
        height: 32px;
    }
    
    /* Tire links: BLIJVEN naast elkaar op mobiel, maar compacter */
    .sd-tire-links {
        grid-template-columns: 1fr 1fr;
        gap: 6px;
    }
    
    .sd-tire-link {
        padding: 8px;
        gap: 6px;
    }
    
    .sd-tire-link-icon {
        font-size: 16px;
    }
    
    .sd-tire-link-text {
        font-size: 10px;
    }
    
    .sd-tire-link-text strong {
        font-size: 11px;
    }
    
    /* Toast smaller on mobile */
    .sd-toast {
        left: 16px;
        right: 16px;
        transform: translateX(0) translateY(100px);
        font-size: 13px;
        padding: 10px 16px;
    }
    
    .sd-toast.show {
        transform: translateX(0) translateY(0);
    }
}

/* Very small screens - hide count text */
@media (max-width: 360px) {
    .sd-tire-link {
        padding: 6px;
    }
    
    .sd-tire-link-text strong {
        font-size: 10px;
    }
}

/* ===== RELATED TIRES TAB ===== */
.sd-related-tires {
    padding: 10px 0;
}

.sd-related-section {
    margin-bottom: 30px;
}

.sd-related-section:last-child {
    margin-bottom: 0;
}

.sd-related-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--sd-dark, #1f2937);
    margin: 0 0 16px 0;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--sd-border, #e5e7eb);
}

.sd-related-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
    margin-bottom: 16px;
}

.sd-related-item {
    display: block;
    background: var(--sd-bg, #f8f9fa);
    border: 1px solid var(--sd-border, #e5e7eb);
    border-radius: var(--sd-radius, 8px);
    padding: 12px;
    text-decoration: none;
    color: inherit;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.sd-related-item:hover {
    border-color: var(--sd-orange, #f97316);
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    text-decoration: none;
}

.sd-related-img {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 10px;
}

.sd-related-img img {
    max-width: 100%;
    height: auto;
    object-fit: contain;
}

.sd-related-info {
    text-align: center;
}

.sd-related-size {
    display: block;
    font-size: 11px;
    font-weight: 600;
    color: var(--sd-orange, #f97316);
    margin-bottom: 4px;
}

.sd-related-name {
    display: block;
    font-size: 13px;
    color: var(--sd-text, #374151);
    line-height: 1.3;
    margin-bottom: 6px;
    height: 34px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.sd-related-price {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: var(--sd-dark, #1f2937);
}

.sd-related-view-all {
    display: inline-block;
    font-size: 14px;
    font-weight: 600;
    color: var(--sd-orange, #f97316);
    text-decoration: none;
}

.sd-related-view-all:hover {
    text-decoration: underline;
}

.sd-no-related {
    color: var(--sd-text-muted, #9ca3af);
    font-style: italic;
    padding: 20px 0;
}

@media (max-width: 768px) {
    .sd-related-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .sd-related-item {
        padding: 10px;
    }
    
    .sd-related-name {
        font-size: 12px;
        height: 32px;
    }
    
    .sd-related-price {
        font-size: 14px;
    }
}

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