/* ======================================
   Wild Bunny Wzory - elegant UI (czarny)
   ====================================== */

.wbw-selector-wrap *,
.wbw-modal *,
.wbw-selector-wrap,
.wbw-modal {
    box-sizing: border-box;
}

.wbw-modal button,
.wbw-selector-wrap button {
    all: unset;
    box-sizing: border-box;
    cursor: pointer;
    font-family: inherit;
}

/* ===== Selector na stronie produktu ===== */
.wbw-selector-wrap {
    margin: 24px 0;
    padding: 0;
    background: transparent;
    border: none;
    width: 100%;
}

.wbw-field-label {
    display: block;
    font-weight: 500;
    margin-bottom: 12px;
    font-size: 14px;
    color: #000;
    letter-spacing: 0.5px;
    text-transform: uppercase;
}

.wbw-selector-preview {
    display: flex;
    align-items: stretch;
    gap: 10px;
    flex-wrap: wrap;
}

.wbw-selected-placeholder {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 200px;
    padding: 12px 16px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 12px;
    transition: all 0.25s ease;
}

.wbw-selected-placeholder.wbw-has-selection {
    background: #fff;
    border-color: #000;
    border-style: solid;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.wbw-selected-placeholder img {
    width: 52px;
    height: 52px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.wbw-placeholder-text {
    color: #888;
    font-style: italic;
    font-size: 14px;
}

.wbw-selected-text {
    font-weight: 600;
    color: #000;
    font-size: 14px;
    letter-spacing: 0.3px;
}

.wbw-selected-placeholder small {
    color: #666;
    font-size: 12px;
}

.wbw-open-gallery {
    padding: 12px 24px !important;
    font-weight: 500 !important;
    font-size: 14px !important;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    background: #000 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 12px !important;
    cursor: pointer;
    transition: all 0.2s ease !important;
    min-width: 160px;
}

.wbw-open-gallery:hover {
    background: #333 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* ===== Modal ===== */
.wbw-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: wbw-fade-in 0.2s ease;
}

@keyframes wbw-fade-in {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes wbw-slide-up {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

.wbw-modal[hidden] {
    display: none !important;
}

.wbw-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.wbw-modal-box {
    position: relative;
    background: #fff;
    border-radius: 16px;
    width: 95%;
    max-width: 1100px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
    overflow: hidden;
    animation: wbw-slide-up 0.3s ease;
}

.wbw-modal-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 20px 28px !important;
    border-bottom: 1px solid #eee !important;
    gap: 16px !important;
    flex-shrink: 0 !important;
}

.wbw-modal-header h2 {
    margin: 0 !important;
    font-size: 22px !important;
    font-weight: 600 !important;
    color: #000 !important;
    letter-spacing: 0.3px !important;
    flex: 1 !important;
    padding: 0 !important;
    line-height: 1.3 !important;
}

.wbw-modal-close {
    background: #f0f0f0 !important;
    border: none !important;
    font-size: 22px !important;
    cursor: pointer !important;
    color: #000 !important;
    padding: 0 !important;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px !important;
    max-width: 40px !important;
    line-height: 1 !important;
    border-radius: 50% !important;
    transition: all 0.2s ease !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    text-align: center !important;
    box-shadow: none !important;
    outline: none !important;
    font-weight: 300 !important;
}

.wbw-modal-close:hover {
    background: #000 !important;
    color: #fff !important;
    transform: rotate(90deg);
}

.wbw-modal-toolbar {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px 28px;
    border-bottom: 1px solid #eee;
    background: #fafafa;
    flex-wrap: wrap;
}

.wbw-category-tabs {
    display: flex;
    gap: 8px;
    flex: 1;
    flex-wrap: wrap;
}

.wbw-tab {
    padding: 8px 18px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 24px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    color: #555;
    transition: all 0.2s ease;
    letter-spacing: 0.3px;
}

.wbw-tab:hover {
    background: #f0f0f0;
    border-color: #000;
    color: #000;
}

.wbw-tab-active {
    background: #000 !important;
    color: #fff !important;
    border-color: #000 !important;
}

.wbw-search-input {
    padding: 10px 16px;
    border: 1px solid #ddd;
    border-radius: 24px;
    font-size: 13px;
    min-width: 220px;
    background: #fff;
    transition: border-color 0.2s ease;
    outline: none;
}

.wbw-search-input:focus {
    border-color: #000;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.wbw-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px 28px;
    background: #fff;
}

.wbw-modal-body::-webkit-scrollbar {
    width: 8px;
}
.wbw-modal-body::-webkit-scrollbar-track {
    background: #f5f5f5;
    border-radius: 4px;
}
.wbw-modal-body::-webkit-scrollbar-thumb {
    background: #999;
    border-radius: 4px;
}
.wbw-modal-body::-webkit-scrollbar-thumb:hover {
    background: #000;
}

.wbw-patterns-grid {
    display: grid;
    grid-template-columns: repeat(var(--wbw-cols, 4), 1fr);
    gap: 14px;
}

@media (max-width: 768px) {
    .wbw-patterns-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
    .wbw-modal-toolbar {
        flex-direction: column;
        align-items: stretch;
    }
    .wbw-search-input {
        min-width: 0;
        width: 100%;
    }
    .wbw-modal-header {
        padding: 16px 20px !important;
    }
    .wbw-modal-body {
        padding: 16px 20px;
    }
}

.wbw-pattern-item {
    position: relative;
    aspect-ratio: 1/1;
    border: 2px solid transparent;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.25s ease;
    background: #f5f5f5;
}

.wbw-pattern-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.wbw-pattern-item.wbw-selected {
    border-color: #000;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.wbw-pattern-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.wbw-pattern-item:hover img {
    transform: scale(1.05);
}

.wbw-pattern-number {
    position: absolute;
    top: 8px;
    left: 8px;
    background: rgba(255, 255, 255, 0.92);
    color: #000;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    backdrop-filter: blur(4px);
    letter-spacing: 0.3px;
    z-index: 1;
}

.wbw-pattern-item.wbw-selected::after {
    content: '\2713';
    position: absolute;
    top: 8px;
    right: 8px;
    width: 32px;
    height: 32px;
    background: #000;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
    animation: wbw-check-in 0.3s ease;
}

@keyframes wbw-check-in {
    from { transform: scale(0); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.wbw-loading,
.wbw-no-results {
    text-align: center;
    padding: 60px 20px;
    color: #888;
    font-style: italic;
    grid-column: 1 / -1;
    font-size: 15px;
}

.wbw-modal-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 28px;
    border-top: 1px solid #eee;
    background: #fafafa;
    gap: 12px;
}

.wbw-selected-info {
    font-size: 14px;
    color: #000;
    font-weight: 500;
}

.wbw-confirm-selection {
    padding: 12px 32px !important;
    font-weight: 500 !important;
    font-size: 14px !important;
    background: #000 !important;
    color: #fff !important;
    border: none !important;
    border-radius: 24px !important;
    cursor: pointer !important;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    transition: all 0.2s ease !important;
}

.wbw-confirm-selection:hover:not(:disabled) {
    background: #333 !important;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

.wbw-confirm-selection:disabled {
    background: #ccc !important;
    cursor: not-allowed;
    color: #888 !important;
}

body.wbw-modal-open {
    overflow: hidden;
}
