/* Базові стилі */
.configurator-section { background: #f9f9f9; padding: 40px 20px 80px; min-height: calc(100vh - 100px); }
.cfg-container { max-width: 1300px; margin: 0 auto; display: flex; gap: 40px; align-items: flex-start; }

/* ОРГАНІЧНИЙ ПРЕМІУМ-ЗАГОЛОВОК */
.cfg-hero-section {
    max-width: 800px;
    margin: 0 auto 50px auto;
    text-align: center;
    padding: 0 20px;
    animation: popIn 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.cfg-hero-heading {
    font-size: 48px; 
    font-weight: 900;
    color: #111;
    margin-bottom: 20px;
    line-height: 1.15;
    letter-spacing: -1.5px;
}
.cfg-hero-highlight { color: #00a046; }
.cfg-hero-text {
    font-size: 17px;
    color: #555;
    line-height: 1.6;
    max-width: 600px;
    margin: 0 auto;
}

/* Ліва частина */
.cfg-products { flex: 1; }
.cfg-products h2 { font-size: 20px; margin-bottom: 20px; font-weight: 800; }
.cfg-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 20px; }
.cfg-card { background: white; border: 1px solid #eaeaea; border-radius: 12px; padding: 15px; text-align: center; position: relative; display: flex; flex-direction: column; transition: 0.3s; }
.cfg-card:hover { border-color: #00a046; box-shadow: 0 8px 20px rgba(0,160,70,0.08); }
.cfg-card img { width: 100%; height: 130px; object-fit: contain; margin-bottom: 10px; cursor: pointer; transition: 0.3s; }
.cfg-card img:hover { transform: scale(1.05); }
.cfg-card h4 { font-size: 13px; margin-bottom: 10px; min-height: 35px; color: #111; cursor: pointer; }
.cfg-card .cfg-price { font-size: 18px; font-weight: 900; color: #111; margin-bottom: 10px; }
.cfg-card-btns { display: flex; gap: 10px; }
.btn-info { flex: 1; background: #f5f5f5; border: 1px solid #ddd; border-radius: 6px; cursor: pointer; font-size: 13px; font-weight: 600; }
.btn-info:hover { background: #e0e0e0; }

/* Кнопка додавання товару */
.btn-add { 
    flex: 2; 
    padding: 10px; 
    background: #b71c1c; 
    border: 2px solid #b71c1c; 
    color: white; 
    border-radius: 6px; 
    font-weight: 700; 
    cursor: pointer; 
    transition: all 0.3s ease; 
    position: relative;
    overflow: hidden;
}
.btn-add:hover:not(:disabled) { 
    background: #9c1515; 
    border-color: #9c1515;
    box-shadow: 0 5px 15px rgba(183, 28, 28, 0.45); 
    transform: translateY(-2px); 
}
.btn-add::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
    transition: left 0.6s ease;
    pointer-events: none;
}
.btn-add:hover:not(:disabled)::before {
    left: 100%;
}
.btn-add.disabled-btn { 
    background: #f5f5f5 !important; 
    color: #aaa !important; 
    border-color: #ddd !important; 
    cursor: not-allowed; 
    box-shadow: none !important;
    transform: none !important;
}
.btn-add.disabled-btn::before {
    display: none;
}

/* Права панель */
.cfg-sidebar { 
    width: 400px; 
    position: sticky; 
    top: 110px; 
    align-self: flex-start; 
    z-index: 10;
}

.total-price-wrapper { 
    display: flex; 
    flex-direction: column; 
    align-items: flex-end; 
    line-height: 1.1; 
}
#cfgTotalOldPrice { 
    font-size: 15px; 
    color: #999; 
    font-weight: 600; 
    text-decoration: line-through; 
    margin-bottom: 4px; 
}
.cfg-summary-box { background: white; border: 1px solid #eaeaea; border-radius: 16px; padding: 25px; box-shadow: 0 5px 25px rgba(0,0,0,0.05); }
.cfg-summary-header { display: flex; justify-content: space-between; align-items: baseline; border-bottom: 1px solid #eee; padding-bottom: 15px; margin-bottom: 20px; }
.cfg-summary-header h3 { font-size: 18px; font-weight: 800; margin: 0; }

/* НОВИЙ ДИЗАЙН КНОПКИ Wyczyść */
.cfg-clear-btn { 
    background: #fff0f0; 
    border: 1px solid #ffcccc; 
    border-radius: 20px;
    padding: 6px 14px;
    font-size: 12px; 
    color: #b71c1c; 
    cursor: pointer; 
    font-weight: 700; 
    transition: all 0.3s ease; 
    display: none; 
    box-shadow: 0 2px 5px rgba(183, 28, 28, 0.05);
}
.cfg-clear-btn:hover { 
    background: #b71c1c; 
    color: white; 
    border-color: #b71c1c;
    box-shadow: 0 4px 10px rgba(183, 28, 28, 0.15);
}

/* ШКАЛА */
.cfg-discount-scale { margin-bottom: 20px; padding-bottom: 20px; border-bottom: 1px dashed #eee; }
.cfg-scale-track { width: 100%; height: 6px; background: #eee; border-radius: 10px; margin-bottom: 10px; position: relative; }
.cfg-scale-fill { height: 100%; background: #b71c1c; border-radius: 10px; transition: width 0.4s ease; }
.cfg-scale-steps { display: flex; justify-content: space-between; font-size: 11px; color: #777; text-align: center; }
.cfg-step.active { color: #b71c1c; font-weight: bold; }
.cfg-step span { display: block; font-size: 13px; margin-top: 2px; }

/* ВІЗУАЛЬНІ СЛОТИ ТА ПІДКАЗКИ */
.cfg-smart-hint {
    font-size: 13px;
    color: #444;
    background: #fff;
    border-left: 4px solid #ff9800;
    padding: 12px 15px;
    margin-bottom: 20px;
    border-radius: 6px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    font-weight: 600;
    line-height: 1.4;
    transition: all 0.3s ease;
}

.cfg-slots-container {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 20px;
}
.cfg-slot {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 8px 12px;
    border-radius: 10px;
    border: 2px dashed #e0e0e0;
    background: #fafafa;
    min-height: 60px;
    transition: all 0.3s ease;
}
.cfg-slot.empty { justify-content: center; }
.empty-icon { font-size: 20px; font-weight: 300; color: #ccc; margin-right: 8px; }
.empty-text { font-size: 13px; font-weight: 600; color: #aaa; }
.cfg-slot.filled {
    border: 1px solid #00a046;
    background: #f0fdf4;
    box-shadow: 0 4px 12px rgba(0, 160, 70, 0.08);
    justify-content: flex-start;
}
.cfg-slot.filled img {
    width: 44px;
    height: 44px;
    object-fit: contain;
    background: white;
    border-radius: 6px;
    padding: 2px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}
.slot-info { flex: 1; }
.slot-name { font-size: 12px; font-weight: 700; color: #111; line-height: 1.3; }

/* НОВИЙ ДИЗАЙН ХРЕСТИКА ВИДАЛЕННЯ */
.slot-remove {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    min-width: 28px;
    min-height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    line-height: 1;
    color: #888;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
    padding: 0;
    margin: 0;
}
.slot-remove:hover {
    color: #fff;
    border-color: #b71c1c;
    background: #b71c1c;
    transform: scale(1.1);
    box-shadow: 0 4px 10px rgba(183, 28, 28, 0.2);
}

/* АНІМАЦІЯ ПОЛЬОТУ ТОВАРУ */
.flying-img {
    position: fixed;
    z-index: 9999;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 15px 35px rgba(0,0,0,0.2);
    transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
    pointer-events: none;
}

/* ІНДИКАТОР ВИГОДИ (GREEN) */
.cfg-savings-callout {
    background: #00a046;
    color: white;
    padding: 15px;
    border-radius: 12px;
    text-align: center;
    margin-bottom: 20px;
    box-shadow: 0 8px 20px rgba(0, 160, 70, 0.25);
    animation: popIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    gap: 5px;
}
.cfg-savings-callout span {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 1px;
    font-weight: 600;
    opacity: 0.9;
}
.cfg-savings-callout strong {
    font-size: 24px;
    font-weight: 900;
    letter-spacing: -0.5px;
}

.cfg-total-row { display: flex; justify-content: space-between; align-items: center; font-size: 16px; font-weight: 700; border-top: 2px solid #eee; padding-top: 15px; margin-bottom: 20px; }
.cfg-total-row strong { font-size: 26px; color: #111; }

.cfg-add-to-cart-btn { width: 100%; padding: 15px; background: #00a046; color: white; font-size: 15px; font-weight: 800; border: none; border-radius: 8px; cursor: pointer; transition: 0.2s; }
.cfg-add-to-cart-btn:hover:not(:disabled) { background: #008a3c; }

/* QUICK VIEW MODAL */
.cfg-modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.6); display: none; align-items: center; justify-content: center; z-index: 1000; }
.cfg-modal-overlay.active { display: flex; }
.cfg-modal-content { background: white; width: 90%; max-width: 800px; border-radius: 16px; position: relative; padding: 30px; animation: popIn 0.3s ease; }
@keyframes popIn { from { transform: scale(0.95); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.cfg-modal-close { position: absolute; top: 15px; right: 20px; font-size: 28px; background: none; border: none; cursor: pointer; color: #555; }
.cfg-qv-layout { display: flex; gap: 30px; }
.cfg-qv-gallery { flex: 1; display: flex; flex-direction: column; align-items: center; }
.qv-main-img { width: 100%; max-width: 300px; height: 300px; object-fit: contain; margin-bottom: 15px; }
.qv-thumbnails { display: flex; gap: 10px; overflow-x: auto; max-width: 100%; padding-bottom: 5px; }
.qv-thumbnails img { width: 60px; height: 60px; object-fit: contain; border: 1px solid #ddd; border-radius: 6px; cursor: pointer; }
.qv-thumbnails img.active { border: 2px solid #b71c1c; }
.cfg-qv-info { flex: 1; display: flex; flex-direction: column; }
.cfg-qv-info h2 { font-size: 22px; font-weight: 800; margin-bottom: 10px; }
.qv-price { font-size: 24px; font-weight: 900; color: #b71c1c; margin-bottom: 20px; }

.qv-attributes { list-style: none; padding: 0; margin-bottom: 25px; font-size: 14px; color: #444; }
.qv-attributes li { margin-bottom: 8px; display: flex; justify-content: space-between; border-bottom: 1px dashed #eee; padding-bottom: 5px; }
.qv-attributes li strong { color: #111; }
.qv-actions { display: flex; flex-direction: column; gap: 10px; margin-top: auto; }
.qv-add-btn { width: 100%; padding: 14px; background: #b71c1c; color: white; font-weight: bold; border: none; border-radius: 8px; cursor: pointer; transition: 0.2s;}
.qv-add-btn:hover { background: #9c1515; }
.qv-details-btn { display: block; text-align: center; width: 100%; padding: 12px; background: #f5f5f5; color: #333; font-weight: 600; border: 1px solid #ddd; border-radius: 8px; text-decoration: none; transition: 0.2s; font-size: 14px; }
.qv-details-btn:hover { background: #e0e0e0; color: #111; border-color: #ccc; }

@media (max-width: 900px) {
    .cfg-container { flex-direction: column; }
    .cfg-sidebar { width: 100%; position: static; }
    .cfg-qv-layout { flex-direction: column; }
    .cfg-hero-section { margin-bottom: 40px; }
    .cfg-hero-heading { font-size: 34px; letter-spacing: -1px; }
    .cfg-hero-text { font-size: 15px; }
}

@keyframes glowGreen {
    0% { box-shadow: 0 0 5px rgba(0, 160, 70, 0.4); }
    50% { box-shadow: 0 0 20px rgba(0, 160, 70, 0.8), 0 0 30px rgba(0, 160, 70, 0.6); transform: scale(1.02); }
    100% { box-shadow: 0 0 5px rgba(0, 160, 70, 0.4); }
}
.cfg-add-to-cart-btn.glow-active {
    animation: glowGreen 1.5s infinite alternate;
    background: #00a046;
    border: 2px solid #00a046;
    color: white;
    z-index: 10;
    position: relative;
}

/* ПРЕМІАЛЬНИЙ ДИЗАЙН ПРЕСЕТІВ */
.cfg-presets-section { margin-bottom: 35px; }
.cfg-presets-header { margin-bottom: 15px; }
.cfg-presets-header h3 { font-size: 18px; font-weight: 800; color: #111; margin-bottom: 4px; text-transform: none; }
.cfg-presets-header p { font-size: 14px; color: #666; margin: 0; }
.cfg-presets-grid { display: flex; gap: 15px; flex-wrap: wrap; }
.cfg-preset-card { flex: 1; min-width: 260px; background: #fff; border: 2px solid #fff; border-radius: 12px; padding: 16px 20px; display: flex; justify-content: space-between; align-items: center; cursor: pointer; transition: all 0.3s ease; box-shadow: 0 4px 15px rgba(0,0,0,0.04); }
.cfg-preset-card:hover { border-color: #00a046; box-shadow: 0 8px 25px rgba(0, 160, 70, 0.12); transform: translateY(-3px); }
.preset-info { display: flex; flex-direction: column; gap: 6px; }
.preset-title { font-size: 16px; color: #111; font-weight: 800; }
.preset-details { font-size: 12px; color: #666; display: flex; align-items: center; gap: 6px; font-weight: 500; }
.preset-details::before { content: ''; display: inline-block; width: 6px; height: 6px; background: #b71c1c; border-radius: 50%; }
.preset-visuals { display: flex; align-items: center; gap: 15px; }
.preset-icons { display: flex; }
.preset-icons img { width: 42px; height: 42px; object-fit: contain; background: white; border: 2px solid #fff; border-radius: 50%; padding: 3px; margin-left: -15px; box-shadow: 0 3px 8px rgba(0,0,0,0.1); position: relative; transition: transform 0.3s ease; }
.preset-icons img:nth-child(1) { z-index: 3; margin-left: 0; }
.preset-icons img:nth-child(2) { z-index: 2; }
.preset-icons img:nth-child(3) { z-index: 1; }
.cfg-preset-card:hover .preset-icons img { transform: translateX(-4px); }
.cfg-preset-card:hover .preset-icons img:nth-child(1) { transform: translateX(0); }
.preset-btn { width: 32px; height: 32px; border-radius: 50%; background: #f5f5f5; color: #aaa; display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: bold; transition: all 0.3s ease; }
.cfg-preset-card:hover .preset-btn { background: #00a046; color: white; transform: translateX(3px); }

/* Мобільна Липка Панель */
.cfg-mobile-sticky { display: none; }
@media (max-width: 900px) {
    .configurator-section { padding-bottom: 100px; }
    .cfg-mobile-sticky { display: flex; justify-content: space-between; align-items: center; position: fixed; bottom: 0; left: 0; width: 100%; background: white; padding: 15px 20px; box-shadow: 0 -4px 20px rgba(0,0,0,0.15); z-index: 999; transform: translateY(100%); transition: transform 0.3s ease; }
    .cfg-mobile-sticky.active { transform: translateY(0); }
    .cms-info { display: flex; flex-direction: column; }
    .cms-info span { font-size: 12px; color: #555; font-weight: 600; margin-bottom: 2px;}
    .cms-info strong { font-size: 18px; color: #111; font-weight: 900; }
    .cms-btn { background: #00a046; color: white; border: none; padding: 12px 25px; font-size: 15px; font-weight: bold; border-radius: 8px; cursor: pointer; transition: 0.2s;}
    .cms-btn:disabled { background: #ccc; cursor: not-allowed; }
    .cms-btn.glow-active { animation: glowGreen 1.5s infinite alternate; }
}

/* DRAG AND DROP */
.cfg-card[draggable="true"] { cursor: grab; }
.cfg-card[draggable="true"]:active { cursor: grabbing; }
.cfg-card.is-dragging { opacity: 0.3; transform: scale(0.98); border: 2px dashed #ccc; box-shadow: none; background: #fdfdfd; filter: grayscale(50%); }

.cfg-slots-container { transition: all 0.3s ease; border: 2px dashed transparent; border-radius: 12px; padding: 5px; margin: -5px; }
.cfg-slots-container.highlight-dropzone { border-color: #ff9800; background: #fffdf5; }
.cfg-slots-container.drag-over { border-color: #00a046; background: #f0fdf4; transform: scale(1.02); box-shadow: 0 8px 20px rgba(0, 160, 70, 0.1); }

/* ПРЕМІАЛЬНІ МАРКЕТИНГОВІ БЕЙДЖІ */
.cfg-badge {
    position: absolute; top: -10px; left: -10px; z-index: 10; padding: 4px 10px; border-radius: 12px; font-size: 9px; font-weight: 800; text-transform: uppercase; letter-spacing: 0.5px; box-shadow: 0 4px 12px rgba(0,0,0,0.15); pointer-events: none;
    display: inline-flex; width: fit-content; white-space: nowrap; align-items: center; gap: 4px; animation: popBadge 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275) backwards;
}
@keyframes popBadge { 0% { transform: scale(0) rotate(-10deg); opacity: 0; } 100% { transform: scale(1) rotate(0); opacity: 1; } }
.badge-hot { background: linear-gradient(135deg, #ff416c, #ff4b2b); color: white; }
.badge-pro { background: linear-gradient(135deg, #36d1dc, #5b86e5); color: white; }
.badge-new { background: linear-gradient(135deg, #00b09b, #96c93d); color: white; }

/* АНІМАЦІЯ ШКАЛИ ДОСТАВКИ */
.cfg-shipping-box { position: relative; overflow: hidden; transition: all 0.4s ease; border: 2px solid transparent !important; }
.cfg-shipping-box.near-free { border-color: rgba(255, 152, 0, 0.3) !important; background: #fffdf5 !important; box-shadow: 0 4px 15px rgba(255, 152, 0, 0.08); }
.cfg-shipping-box.free-reached { border-color: rgba(0, 160, 70, 0.3) !important; background: #f0fdf4 !important; box-shadow: 0 4px 15px rgba(0, 160, 70, 0.1); }
.cfg-shipping-fill { height: 100%; border-radius: 10px; transition: width 0.6s cubic-bezier(0.25, 1, 0.5, 1), background-color 0.4s ease; }
.cfg-shipping-fill.shimmer {
    background-color: #ff9800;
    background-image: linear-gradient(-45deg, rgba(255, 255, 255, 0.2) 25%, transparent 25%, transparent 50%, rgba(255, 255, 255, 0.2) 50%, rgba(255, 255, 255, 0.2) 75%, transparent 75%, transparent);
    background-size: 30px 30px; animation: move-stripes 1.5s linear infinite;
}
.cfg-shipping-fill.success { background-color: #00a046; background-image: none; }
@keyframes move-stripes { 0% { background-position: 0 0; } 100% { background-position: 30px 0; } }