/**
* 2007-2025 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
*
*  @author    PrestaShop SA <contact@prestashop.com>
*  @copyright 2007-2025 PrestaShop SA
*  @license   http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
*/

/* Preset Selector Modal */
#preset-selector-modal .modal-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #fff;
    border-bottom: none;
    padding: 20px 30px;
}

#preset-selector-modal .modal-title {
    font-size: 24px;
    font-weight: 600;
}

#preset-selector-modal .modal-header .close {
    color: #fff;
    opacity: 0.8;
    text-shadow: none;
}

#preset-selector-modal .modal-header .close:hover {
    opacity: 1;
}

#preset-selector-modal .modal-body {
    padding: 30px;
    background: #f8f9fa;
}

#preset-selector-modal .modal-footer {
    background: #fff;
    border-top: 1px solid #e9ecef;
    padding: 20px 30px;
}

#skip-preset-btn {
    padding: 12px 30px;
    font-weight: 600;
}

/* Constructor Controls */
.constructor-controls .alert-info {
    background: linear-gradient(135deg, #e3f2fd 0%, #f1f8ff 100%);
    border-left: 4px solid #2196F3;
    border-radius: 6px;
    padding: 15px 20px;
    line-height: 1.8;
}

.constructor-controls .alert-info strong {
    color: #1976D2;
    font-size: 16px;
}

.constructor-controls .control-group {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.constructor-controls .control-group button {
    flex: 0 0 auto;
}

/* Change Configuration Button */
#change-preset-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border: none;
    color: #fff;
    font-weight: 600;
    transition: all 0.3s ease;
    padding: 8px 16px;
}

#change-preset-btn:hover {
    background: linear-gradient(135deg, #764ba2 0%, #667eea 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    transform: translateY(-2px);
    color: #fff;
}

#change-preset-btn:active {
    transform: translateY(0);
}

#change-preset-btn i {
    margin-right: 5px;
}

/* Add Parts Section in Sidebar */
.add-parts-section {
    border-top: 2px solid #e0e0e0;
    padding-top: 20px;
    margin-top: 20px;
}

.add-parts-section .option-group-title {
    display: flex;
    align-items: center;
    gap: 8px;
}

.add-parts-section .option-group-title i {
    color: #667eea;
    font-size: 18px;
}

.add-parts-buttons {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.btn-add-part {
    border: none;
    color: #fff;
    font-weight: 600;
    transition: all 0.3s ease;
    text-align: left;
    width: 100%;
    border-radius: 4px;
}

.btn-add-part:hover {
    transform: translateY(-2px);
    color: #fff;
}

.btn-add-part:active {
    transform: translateY(0);
}

.btn-add-part i {
    margin-right: 5px;
}

/* Notification Animations */
@keyframes slideInRight {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

@keyframes slideOutRight {
    from {
        transform: translateX(0);
        opacity: 1;
    }
    to {
        transform: translateX(100%);
        opacity: 0;
    }
}

/* Delete Button - Floating Above Part */
.part-delete-button {
    animation: fadeInScale 0.3s ease;
}

@keyframes fadeInScale {
    from {
        opacity: 0;
        transform: scale(0.5);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 3D Constructor Container */
.sofa-constructor-container {
    margin: 20px 0;
    /* padding: 20px; */
    background: #fff5e2;
    border-radius: 8px;
  height: 100%;
}

.constructor-header {
    text-align: center;
    margin-bottom: 20px;
}

.constructor-header h3 {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.constructor-description {
    color: #666;
    font-size: 14px;
}

/* Canvas Container */
.canvas-container {
    position: relative;
    width: 100%;
    height: max-content;
    background: #fff5e2;
    border-radius: 4px;
    margin-bottom: 20px;
    overflow: hidden;
}

.canvas-container canvas {
    display: block;
    width: 100%;
}

.loading-message {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    text-align: center;
    color: #666;
    font-size: 18px;
}

.loading-message i {
    display: block;
    font-size: 48px;
    margin-bottom: 15px;
}

/* Loading Overlay for Preset Changes */
.sofa-loading-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* background: rgba(255, 255, 255, 0.95); */
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    backdrop-filter: blur(4px);
}

.sofa-loading-overlay.active {
    display: flex;
}

.sofa-loading-content {
    text-align: center;
    color: #ff6e00;
}

.sofa-loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid rgba(255, 107, 53, 0.2);
    border-top: 4px solid #ff6e00;
    border-radius: 50%;
    animation: sofa-spin 1s linear infinite;
    margin: 0 auto 20px;
}

.sofa-loading-text {
    font-size: 18px;
    font-weight: 600;
    color: #ff6e00;
    margin-bottom: 10px;
}

.sofa-loading-subtext {
    font-size: 14px;
    color: #666;
}

@keyframes sofa-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* Constructor Controls */
.constructor-controls {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
    margin-top: 15px;
}

.constructor-controls .control-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.constructor-controls .control-label {
    font-weight: 600;
    font-size: 13px;
    color: #333;
    margin-bottom: 5px;
}

.constructor-controls .btn-group {
    display: flex;
    gap: 5px;
    flex-wrap: wrap;
}

/* Part selection buttons */
.sofa-part-btn {
    transition: all 0.3s ease;
}

.sofa-part-btn.active {
    background-color: #0275d8;
    color: white;
    border-color: #025aa5;
}

.sofa-part-btn:hover {
    background-color: #e9ecef;
}

.sofa-part-btn.active:hover {
    background-color: #025aa5;
}

/* Transform mode buttons */
.transform-mode-btn.active {
    background-color: #5bc0de;
    color: white;
    border-color: #46b8da;
}

.constructor-controls .btn {
    padding: 10px 20px;
    font-size: 14px;
    font-weight: 500;
}

/* Construction Options Panel */
.constructor-options-panel {
    margin: 30px 0;
    padding: 20px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
}

.constructor-options-panel h4 {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
}

.options-container {
    display: grid;
    gap: 25px;
}

.option-group {
    padding: 15px;
    background: #f8f9fa;
    border-radius: 4px;
}

.option-group-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 15px;
    color: #555;
    text-transform: capitalize;
}

.option-items {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 10px;
}

.option-item {
    position: relative;
}

.option-item label {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    background: #fff;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.option-item label:hover {
    border-color: #007bff;
    box-shadow: 0 2px 4px rgba(0,123,255,0.1);
}

.option-item input[type="radio"] {
    margin-right: 10px;
}

.option-item input[type="radio"]:checked + .option-name {
    font-weight: 600;
}

.option-item label:has(input:checked) {
    border-color: #007bff;
    background: #e7f3ff;
}

.option-name {
    flex: 1;
    font-size: 14px;
    color: #333;
}

.price-impact {
    font-size: 13px;
    font-weight: 600;
    color: #28a745;
    margin-left: 10px;
}

.total-price-impact {
    margin-top: 20px;
    padding: 15px;
    background: #e7f3ff;
    border-radius: 4px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 16px;
    font-weight: 600;
}

.total-price-impact .label {
    color: #555;
}

.total-price-impact .price {
    color: #007bff;
    font-size: 18px;
}

.no-options-message {
    padding: 20px;
    text-align: center;
    color: #999;
    font-style: italic;
}

.constructor-content {
  height: 100%;
}

.sofa-constructor-wrapper {
  height: 100%;
}

.first-product-block {
  padding-top: 40px;
}


/* Responsive Design */
@media (max-width: 768px) {
    .canvas-container {
        height: 400px;
    }

    .option-items {
        grid-template-columns: 1fr;
    }

    .constructor-controls {
        flex-direction: column;
    }

    .constructor-controls .btn {
        width: 100%;
    }

    .sofa-constructor-container {
        margin: 0 !important;
        background: #fff5e2 !important;
        box-shadow: none !important;
        border-radius: 0 !important;
    }

    .first-product-block {
        background: #fff5e2 !important;
        padding-right: calc(var(--bs-gutter-x) * 0.5);
        padding-left: calc(var(--bs-gutter-x) * 0.5);
        padding-bottom: 10px;

        /* width: 0 !important;
        position:  none !important;
        left:  0 !important;
        right:  0 !important;
        margin-left:  0 !important;
        margin-right:  0 !important;
        background:  none !important;
        padding-left:  0 !important;
        height:  0 !important; */
    }
}
