/**
 * Style frontend - boczny panel z zakładkami + zwinięty mini pasek z miniaturkami.
 */

#wcr-panel,
#wcr-panel * {
    box-sizing: border-box;
}

#wcr-panel {
    position: fixed;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
}

/* === POZYCJE === */
#wcr-panel.wcr-pos-right-middle { top: 50%; right: 0; transform: translateY(-50%); }
#wcr-panel.wcr-pos-right-top    { top: 80px; right: 0; }
#wcr-panel.wcr-pos-right-bottom { bottom: 20px; right: 0; }
#wcr-panel.wcr-pos-left-middle  { top: 50%; left: 0; transform: translateY(-50%); }
#wcr-panel.wcr-pos-left-top     { top: 80px; left: 0; }
#wcr-panel.wcr-pos-left-bottom  { bottom: 20px; left: 0; }

/* === PEŁNY BOCZNY PANEL === */
.wcr-panel-inner {
    width: 320px;
    max-height: 80vh;
    background: var(--wcr-background, #fff);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform 0.3s ease, opacity 0.25s ease;
}

#wcr-panel.wcr-pos-right-middle .wcr-panel-inner,
#wcr-panel.wcr-pos-right-top .wcr-panel-inner,
#wcr-panel.wcr-pos-right-bottom .wcr-panel-inner {
    border-radius: 12px 0 0 12px;
}

#wcr-panel.wcr-pos-left-middle .wcr-panel-inner,
#wcr-panel.wcr-pos-left-top .wcr-panel-inner,
#wcr-panel.wcr-pos-left-bottom .wcr-panel-inner {
    border-radius: 0 12px 12px 0;
}

/* Stan zwinięty - pełny panel ukryty */
#wcr-panel.wcr-state-closed .wcr-panel-inner {
    display: none;
}


/* === MINI PASEK Z MINIATURKAMI - karuzela === */
.wcr-mini-strip {
    display: none;
    background: var(--wcr-background, #fff);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    /* Szerokość = N kafelków (88px) + odstępy między (8px * (N-1)) + padding (12px*2) + strzałki (40px*2) */
    width: calc(var(--wcr-mini-count, 4) * 88px + (var(--wcr-mini-count, 4) - 1) * 8px + 24px + 80px);
    max-width: calc(100vw - 40px);
    flex-direction: column;
    animation: wcr-strip-in 0.3s ease;
}

#wcr-panel.wcr-state-closed .wcr-mini-strip { display: flex; }

@keyframes wcr-strip-in {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

#wcr-panel.wcr-pos-right-middle .wcr-mini-strip,
#wcr-panel.wcr-pos-right-top .wcr-mini-strip,
#wcr-panel.wcr-pos-right-bottom .wcr-mini-strip {
    border-radius: 12px 0 0 12px;
}

#wcr-panel.wcr-pos-left-middle .wcr-mini-strip,
#wcr-panel.wcr-pos-left-top .wcr-mini-strip,
#wcr-panel.wcr-pos-left-bottom .wcr-mini-strip {
    border-radius: 0 12px 12px 0;
}

/* Header */
.wcr-mini-header {
    background: var(--wcr-primary, #FFC107);
    color: var(--wcr-text, #000);
    padding: 12px 16px;
    font-size: 14px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    border: none;
    width: 100%;
    text-align: left;
    font-family: inherit;
    transition: filter 0.2s ease;
}

.wcr-mini-header:hover { filter: brightness(0.97); }

.wcr-percent-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    background: rgba(0, 0, 0, 0.08);
    border-radius: 50%;
    font-size: 12px;
    font-weight: 700;
    flex-shrink: 0;
}

.wcr-mini-title { flex: 1; }

.wcr-mini-arrow {
    margin-left: auto;
    font-size: 18px;
    line-height: 1;
    opacity: 0.6;
}

/* === KARUZELA === */
.wcr-mini-products-wrapper {
    position: relative;
    background: var(--wcr-background, #fff);
    padding: 14px 0;
}

.wcr-mini-products-viewport {
    overflow: hidden;
    padding: 4px 12px;
    margin: 0 40px;
}

.wcr-mini-products {
    display: flex;
    gap: 8px;
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
    will-change: transform;
}

.wcr-mini-item {
    flex: 0 0 auto;
    width: 88px;
    height: 88px;
    display: block;
    text-decoration: none;
    border: 1px solid #ececec;
    border-radius: 10px;
    overflow: hidden;
    background: #fff;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
    position: relative;
}

.wcr-mini-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
    border-color: var(--wcr-primary, #FFC107);
    z-index: 2;
}

.wcr-mini-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.wcr-mini-item-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, rgba(0, 0, 0, 0.5) 60%, rgba(0, 0, 0, 0) 100%);
    color: #fff;
    padding: 18px 6px 6px;
    font-size: 10px;
    line-height: 1.2;
    opacity: 0;
    transform: translateY(4px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

.wcr-mini-item:hover .wcr-mini-item-info {
    opacity: 1;
    transform: translateY(0);
}

.wcr-mini-item-name {
    display: block;
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-bottom: 2px;
}

.wcr-mini-item-price {
    display: block;
    font-weight: 700;
    color: var(--wcr-primary, #FFC107);
    font-size: 11px;
}

/* === STRZAŁKI === */
.wcr-mini-arrow-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #fff;
    border: 1px solid #e5e5e5;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
    z-index: 3;
    color: #444;
    line-height: 1;
    padding: 0;
    transition: all 0.2s ease;
    font-family: inherit;
}

.wcr-mini-arrow-btn:hover:not(:disabled) {
    background: var(--wcr-primary, #FFC107);
    color: var(--wcr-text, #000);
    border-color: var(--wcr-primary, #FFC107);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
    transform: translateY(-50%) scale(1.08);
}

.wcr-mini-arrow-btn:active:not(:disabled) {
    transform: translateY(-50%) scale(0.96);
}

.wcr-mini-arrow-btn:disabled {
    opacity: 0;
    cursor: default;
    pointer-events: none;
}

.wcr-mini-arrow-btn svg { display: block; }

.wcr-mini-arrow-prev { left: 4px; }
.wcr-mini-arrow-next { right: 4px; }

/* === KROPKI === */
.wcr-mini-dots {
    display: flex;
    justify-content: center;
    gap: 6px;
    padding: 8px 0 12px;
}

.wcr-mini-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #d4d4d8;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all 0.25s ease;
}

.wcr-mini-dot:hover { background: #a1a1aa; }

.wcr-mini-dot.is-active {
    background: var(--wcr-primary, #FFC107);
    width: 20px;
    border-radius: 3px;
}

/* === GRADIENTY NA KRAWĘDZIACH === */
.wcr-mini-products-wrapper::before,
.wcr-mini-products-wrapper::after {
    content: '';
    position: absolute;
    top: 14px;
    bottom: 14px;
    width: 28px;
    pointer-events: none;
    z-index: 2;
    transition: opacity 0.2s ease;
}

.wcr-mini-products-wrapper::before {
    left: 36px;
    background: linear-gradient(to right, var(--wcr-background, #fff) 0%, transparent 100%);
}

.wcr-mini-products-wrapper::after {
    right: 36px;
    background: linear-gradient(to left, var(--wcr-background, #fff) 0%, transparent 100%);
}

.wcr-mini-products-wrapper.is-at-start::before { opacity: 0; }
.wcr-mini-products-wrapper.is-at-end::after { opacity: 0; }

/* Bez karuzeli (mieści się wszystko) */
.wcr-mini-products-wrapper.no-carousel .wcr-mini-arrow-btn,
.wcr-mini-products-wrapper.no-carousel + .wcr-mini-dots,
.wcr-mini-products-wrapper.no-carousel::before,
.wcr-mini-products-wrapper.no-carousel::after {
    display: none;
}


/* === ZAKŁADKI w pełnym panelu === */
.wcr-tabs {
    display: flex;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.wcr-tab {
    flex: 1;
    background: none;
    border: none;
    padding: 14px 8px;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    color: #666;
    border-bottom: 3px solid transparent;
    transition: all 0.2s ease;
    font-family: inherit;
}

.wcr-tab:hover {
    color: #333;
}

.wcr-tab-active {
    color: var(--wcr-tab-active, #1E88E5);
    border-bottom-color: var(--wcr-tab-active, #1E88E5);
    font-weight: 600;
}

/* Treść zakładki */
.wcr-tab-content {
    display: none;
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

.wcr-tab-content-active {
    display: block;
}

.wcr-empty {
    text-align: center;
    color: #999;
    padding: 30px 10px;
    font-size: 14px;
    margin: 0;
}

/* === LISTA PRODUKTÓW w pełnym panelu === */
.wcr-products-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.wcr-product-item {
    display: flex;
    gap: 10px;
    padding: 10px 0;
    border-bottom: 1px solid #f0f0f0;
}

.wcr-product-item:last-child {
    border-bottom: none;
}

.wcr-product-image-link {
    flex-shrink: 0;
    display: block;
    width: 80px;
    height: 80px;
    border: 1px solid #eee;
    border-radius: 4px;
    overflow: hidden;
}

.wcr-product-image-link img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.wcr-product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
}

.wcr-product-name {
    color: #333;
    text-decoration: none;
    font-size: 14px;
    line-height: 1.3;
    margin-bottom: 4px;
    display: block;
    word-wrap: break-word;
}

.wcr-product-name:hover {
    color: var(--wcr-tab-active, #1E88E5);
}

.wcr-product-price {
    font-size: 15px;
    font-weight: 700;
    color: #000;
    margin-bottom: 8px;
}

.wcr-button-show {
    display: inline-block;
    background: var(--wcr-primary, #FFC107);
    color: var(--wcr-text, #000) !important;
    text-decoration: none;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: 600;
    text-align: center;
    transition: opacity 0.2s ease;
}

.wcr-button-show:hover {
    opacity: 0.85;
}

/* === PRZYCISK ZAMKNIJ === */
.wcr-close-button {
    background: none;
    border: none;
    border-top: 1px solid #eee;
    padding: 12px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    flex-shrink: 0;
    font-family: inherit;
}

.wcr-close-button:hover {
    color: #000;
    background: #f9f9f9;
}

.wcr-close-icon {
    font-size: 18px;
    line-height: 1;
}

/* === POZYCJONOWANIE MINI PASKA === */
/* Mini pasek przy pozycjach right - wystaje od prawej */
#wcr-panel.wcr-pos-right-middle.wcr-state-closed,
#wcr-panel.wcr-pos-right-top.wcr-state-closed,
#wcr-panel.wcr-pos-right-bottom.wcr-state-closed {
    /* mini pasek "wisi" w tej samej pozycji co panel */
}

/* Dla pozycji środkowej - mini pasek może być na dole prawej, jak na zdjęciu */
#wcr-panel.wcr-pos-right-bottom.wcr-state-closed,
#wcr-panel.wcr-pos-left-bottom.wcr-state-closed {
    /* już jest na dole z .wcr-pos-*-bottom */
}

/* === MOBILE - PANEL CAŁKOWICIE UKRYTY === */
@media (max-width: 600px) {
    #wcr-panel {
        display: none !important;
    }
}
