/* Полотно (Canvas) */
.wclc-app-container { margin-bottom: 30px; width: 100%; position: relative; }
.wclc-canvas-wrapper { position: relative; width: 100%; padding-bottom: 100%; background: #f9f9f9; border-radius: 8px; overflow: hidden; }

/* Мобільна адаптація: Режим Picture-in-Picture */
@media (max-width: 768px) {
    /* Стилі для липкої мініатюри */
    .wclc-app-container.wclc-pip-mode {
        position: fixed;
        top: 80px; /* Відступ від липкої шапки WoodMart (за потреби підкоригуй) */
        right: 15px;
        width: 140px; /* Розмір мініатюри */
        background: #fff;
        border-radius: 8px;
        box-shadow: 0 10px 30px rgba(0,0,0,0.25);
        z-index: 999999;
        transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
        border: 2px solid #eee;
        padding: 5px;
        margin-bottom: 0;
    }
    
    /* Приховуємо кастомну галерею, коли конструктор у режимі міні-вікна */
    .wclc-app-container.wclc-pip-mode .wclc-custom-gallery {
        display: none !important;
    }

    /* Блок-заглушка, щоб текст не стрибнув вгору, коли картинка стане fixed */
    .wclc-sticky-placeholder {
        display: none;
        width: 100%;
        padding-bottom: 100%; /* Пропорції оригінального квадрата */
    }

    /* Фікс для WoodMart */
    .product-images, .product-image-summary, .product-image-summary-inner, body .site-content {
        overflow: visible !important;
    }
}

/* Примусове приховування стандартних галерей будь-яких тем */
.woocommerce-product-gallery, .woodmart-show-product-gallery-wrap, .product-additional-galleries, .wd-nav-arrows, .wd-gallery-images {
    display: none !important;
}

.wclc-base-image, .wclc-layer-group { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.wclc-base-image { object-fit: contain; z-index: 1; }
.wclc-layer-group { z-index: 2; transition: opacity 0.3s ease; }

.wclc-layer-color { position: absolute; top: 0; left: 0; width: 100%; height: 100%; transition: background-color 0.3s ease; -webkit-mask-size: contain; -webkit-mask-repeat: no-repeat; -webkit-mask-position: center; mask-size: contain; mask-repeat: no-repeat; mask-position: center; }
.wclc-layer-texture { position: absolute; top: 0; left: 0; width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; pointer-events: none; }

/* Панель керування */
.wclc-controls-wrapper { background: #fff; padding: 20px; border-radius: 8px; border: 1px solid #eee; margin-bottom: 25px; }
.wclc-controls-title { margin-top: 0; margin-bottom: 20px; font-size: 18px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.wclc-control-block { margin-bottom: 20px; padding-bottom: 15px; border-bottom: 1px solid #f5f5f5; }
.wclc-control-block:last-child { border-bottom: none; margin-bottom: 0; padding-bottom: 0; }
.wclc-control-header { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }

/* Опції та Кольори */
.wclc-optional-toggle { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 14px; margin-bottom: 10px; }
.wclc-colors-palette { display: flex; flex-wrap: wrap; gap: 10px; }
.wclc-color-swatch { width: 34px; height: 34px; border-radius: 50%; padding: 3px; border: 2px solid transparent; cursor: pointer; transition: all 0.2s; }
.wclc-color-swatch span { display: block; width: 100%; height: 100%; border-radius: 50%; box-shadow: inset 0 1px 3px rgba(0,0,0,0.1); }
.wclc-color-swatch:hover { transform: scale(1.1); }
.wclc-color-swatch.active { border-color: #111; }

/* Кастомний випадаючий список (Dropdown) */
.wclc-color-dropdown { position: relative; width: 100%; max-width: 300px; user-select: none; }
.wclc-dropdown-selected { display: flex; align-items: center; justify-content: space-between; padding: 8px 12px; border: 1px solid #ccc; border-radius: 4px; cursor: pointer; background: #fff; }
.wclc-dropdown-selected:hover { border-color: #999; }
.wclc-dropdown-arrow { font-size: 10px; color: #666; }
.wclc-dropdown-thumb { display: inline-block; width: 20px; height: 20px; border-radius: 50%; border: 1px solid #e0e0e0; flex-shrink: 0; margin-right: 10px; }
.wclc-dropdown-name { flex-grow: 1; font-size: 14px; color: #333; }
.wclc-dropdown-options { position: absolute; top: 100%; left: 0; right: 0; background: #fff; border: 1px solid #ccc; border-top: none; border-radius: 0 0 4px 4px; box-shadow: 0 4px 10px rgba(0,0,0,0.1); display: none; z-index: 10; max-height: 250px; overflow-y: auto; }
.wclc-dropdown-option { display: flex; align-items: center; padding: 8px 12px; cursor: pointer; border-bottom: 1px solid #f5f5f5; }
.wclc-dropdown-option:last-child { border-bottom: none; }
.wclc-dropdown-option:hover { background: #f9f9f9; }
.wclc-dropdown-option.active { background: #f0f8ff; font-weight: 600; }

/* Спливаюча підказка */
.wclc-tooltip-icon { position: relative; display: inline-flex; justify-content: center; align-items: center; width: 18px; height: 18px; background: #eee; border-radius: 50%; font-size: 11px; cursor: help; color: #555; }
.wclc-tooltip-content { position: absolute; bottom: 120%; left: 50%; transform: translateX(-50%); width: 200px; background: #fff; border: 1px solid #ddd; padding: 10px; border-radius: 6px; box-shadow: 0 5px 15px rgba(0,0,0,0.1); opacity: 0; visibility: hidden; transition: all 0.2s; z-index: 100; pointer-events: none; }
.wclc-tooltip-icon:hover .wclc-tooltip-content { opacity: 1; visibility: visible; bottom: 130%; }
.wclc-tooltip-content img { width: 100%; height: auto; border-radius: 4px; margin-bottom: 8px; }
.wclc-tooltip-content p { margin: 0; font-size: 12px; line-height: 1.4; color: #333; font-weight: normal; }

/* Кастомна міні-галерея під конструктором */
.wclc-custom-gallery {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    overflow-x: auto;
    padding-bottom: 8px;
    scrollbar-width: thin;
}
.wclc-custom-gallery::-webkit-scrollbar { height: 4px; }
.wclc-custom-gallery::-webkit-scrollbar-thumb { background: #ccc; border-radius: 4px; }

.wclc-gallery-thumb {
    width: 65px;
    height: 65px;
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    opacity: 0.6;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    flex-shrink: 0;
    transition: all 0.2s ease;
}
.wclc-gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.wclc-gallery-thumb:hover { opacity: 0.9; }
.wclc-gallery-thumb.active {
    opacity: 1;
    border-color: #111;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}