body {
    background: #f7f8fa;
}

.mercedes-configurator-wrapper {
    max-width: 1300px;
    margin: 30px auto;
    padding: 30px 30px 40px 30px;
}

/* Шапка */
.configurator-header {
    background: #222;
    border-left: 5px solid #4a90e2;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: #fff;
    box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}
.header-left h1 {
    font-size: 22px !important;
    margin: 0;
    color: #fff;
    font-weight: 600;
    letter-spacing: 0.5px;
}
.header-right {
    text-align: right;
    font-size: 15px;
    color: #e0e0e0;
    margin-top: 6px;
}
.total-price {
    font-size: 20px;
    font-weight: bold;
    color: #fff;
}
.price-label {
    margin-right: 10px;
}
.price-value {
    color: #4a90e2;
}

/* Вкладки */
.configurator-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 10px;
}
.tab {
    padding: 8px 12px;
    cursor: pointer;
    box-sizing: border-box;
    font-size: 15px;
    border-radius: 8px;
    transition: all 0.2s;
    background: #252525;
}
.tab:hover {
    background: #4e4e4e;
}
.tab.active {
    background: #4a90e2;
    color: white;
}

/* Контент вкладок */
.configurator-content {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 10px;
    padding: 30px;
}
.tab-content {
    display: none;
}
.tab-content.active {
    display: block;
}

.tab-detail {
    display: flex;
    box-sizing: border-box;
    background: #f5f5f5;
    color: #777;
    font-size: 15px;
    font-weight: 500;
    padding: 10px;
    border-radius: 8px;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.options-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-top: 20px;
}


/* Карточки моделей и опций */
.option-item {
    border: 1px solid #f0f0f0;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.2s;
    position: relative;
    background: #fff;
    width: 280px;
    min-height: 320px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
}
.option-item:hover {
    border-color: #4a90e2;
}
.option-item input[type="radio"],
.option-item input[type="checkbox"] {
    display: none;
}
.option-item label {
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    flex-grow: 1;
    padding: 18px 12px 18px 12px;
    cursor: pointer;
    position: relative;
    width: 100%;
    text-align: center;
    background: transparent;
    border-radius: 0 0 14px 14px;
    transition: all 0.2s;
}
.option-item .image-wrapper {
    position: relative;
    width: 100%;
    cursor: pointer;
}
.option-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
    transition: opacity 0.2s;
}
.option-item img:hover {
    opacity: 0.9;
}
.option-item h3 {
    margin: 0 0 10px;
    font-size: 17px;
    color: #222;
    font-weight: 500;
}
.option-price {
    color: #4a90e2;
    font-weight: bold;
    font-size: 16px;
}

.zoom-icon {
    position: absolute;
    top: 10px;
    left: 10px;
    width: 32px;
    height: 32px;
    background: #d4d4d4;
    color: #ffffff;
    
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 3;
    transition: all 0.2s;
}

.zoom-icon:hover {
    transform: scale(1.1);
}

.zoom-icon::before {
    content: '';
    width: 16px;
    height: 16px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23333' d='M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.5);
    z-index: 10000;
    overflow-y: auto;
    overflow-x: hidden;
}
.modal-content {
    position: fixed;
    top: 50%;
    color: #000;
    left: 50%;
    transform: translate(-50%, -50%);
    background: #fff;
    width: 60vw;
    max-width: 400px;
    max-height: 80vh;
    margin: 0;
    padding: 30px;
    border-radius: 10px;
    box-shadow: 0 4px 32px rgba(0,0,0,0.10);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}
.modal-content h2 {
    font-size: 22px;
    margin-bottom: 15px;
    text-align: center;
    font-weight: 600;
}
.selected-configuration p {
    font-size: 12px;
}
.close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}
.close:hover {
    color: #222;
}
.form-group {
    margin-bottom: 20px;
}
.form-group label {
    display: block;
    margin-bottom: 5px;
    color: #333;
}
.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
}
.form-group textarea {
    height: 100px;
    resize: vertical;
}
.submit-button {
    background: #4a90e2;
    color: #fff;
    border: none;
    padding: 14px 30px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 17px;
    font-weight: 600;
    transition: background 0.2s;
    box-shadow: 0 2px 8px rgba(74,144,226,0.13);
}
.submit-button:hover {
    background: #357abd;
}

.trims-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    width: 100%;
}

.trim-item {
    background: #fff;
    border: 1px solid #e1e1e1;
    border-radius: 10px;
    padding: 20px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.trim-item:hover {
    border-color: #4a90e2;
    box-shadow: 0 2px 8px rgba(74,144,226,0.1);
}

.trim-item.selected {
    border: 2px solid #4a90e2;
    background: #f0f8ff;
}

.trim-item img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 10px;
}

.trim-title {
    font-size: 18px;
    font-weight: 600;
    color: #333;
    margin: 0;
}

.trim-price {
    font-size: 16px;
    font-weight: 500;
    color: #4a90e2;
}

.trim-item[style*="display: none"] {
    display: none !important;
}


#tab-models > .options-grid {
    display: flex !important;
    width: 100% !important;   
}

#tab-trims > .options-grid {
    display: flex !important;
    width: 100% !important;   
}


#tab-trims > .options-grid > .trims-list {
    display: flex !important;
    width: 100% !important;   
}


#tab-trims > .options-grid > .trims-list > .trim-item {
    flex-grow: 1;
}


#tab-models > .options-grid > .option-item {
    flex-grow: 1;
    width: 100%;
    min-height: 380px;
}
#tab-models > .options-grid > .option-item > img {
    height: 250px;
}


/* Адаптивность */
@media (max-width: 900px) {
    .mercedes-configurator-wrapper {
        padding: 10px 2vw 20px 2vw;
    }
    .configurator-header {
        flex-direction: column;
        text-align: center;
        padding: 18px 10px 16px 10px;
    }
    .header-right {
        margin-top: 16px;
        text-align: center;
    }
    .configurator-tabs {
        flex-direction: column;
        gap: 0;
    }
    .tab {
        text-align: center;
        border-radius: 10px 10px 0 0;
        margin-bottom: 4px;
    }
    .tab.get-price {
        margin: 10px 0 0;
    }
    .options-grid {
        grid-template-columns: 1fr;
    }
    .option-item {
        min-height: 220px;
    }
    #tab-trims > .options-grid > .trims-list{
        display: grid !important;
    }
    #tab-models > .options-grid {
        display: grid !important;
    }
    #tab-models > .options-grid > .option-item img {
        object-fit: contain;
    }
}

.selected-configuration {
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin: 0 0 20px 0;
    box-shadow: 0 2px 4px rgba(0,0,0,0.05);
    display: none;
}

.selected-model h4,
.selected-trim h4 {
    color: #2c3e50;
    margin: 0 0 10px 0;
    font-size: 18px;
    font-weight: 600;
}

.selected-model p,
.selected-trim p {
    color: #34495e;
    font-size: 16px;
    margin: 0 0 15px 0;
    font-weight: 500;
}

.trim-price {
    color: #27ae60;
    font-size: 16px;
    font-weight: 600;
    margin: 10px 0;
    padding: 8px 12px;
    background-color: #f1f8e9;
    border-radius: 4px;
    display: inline-block;
}

.included-options {
    margin-top: 20px;
    background-color: #fff;
    border-radius: 6px;
    padding: 15px;
    border: 1px solid #e9ecef;
}

.included-options h5 {
    color: #2c3e50;
    margin: 0 0 15px 0;
    font-size: 16px;
    font-weight: 600;
}

.included-options ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 8px;
}

.included-options li {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 15px;
    background-color: #f8f9fa;
    border: 1px solid #e9ecef;
    border-radius: 4px;
    transition: all 0.2s;
}

.included-options li:hover {
    background-color: #f1f8e9;
    border-color: #c8e6c9;
}

.included-options .option-name {
    color: #34495e;
    font-size: 14px;
}

.included-options .option-included {
    color: #27ae60;
    font-weight: bold;
    font-size: 16px;
    background-color: #e8f5e9;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

.option-item.selected {
    border: 1px solid #4a90e2 !important;
    background: #f8f9fa !important;
    box-shadow: 0 2px 8px rgba(74,144,226,0.15);
}

.option-item.selected label h3 {
    color: #4a90e2 !important;
}

.option-item.selected label:after {
    content: '';
    position: absolute;
    top: 14px;
    right: 15px;
    width: 32px;
    height: 32px;
    background: #4a90e2;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='%23fff' d='M9 16.17L5.53 12.7a.996.996 0 1 0-1.41 1.41l4.18 4.18c.39.39 1.02.39 1.41 0L20.29 7.71a.996.996 0 1 0-1.41-1.41z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 20px;
}

@media (max-width: 600px) {
    .modal-content {
        padding: 12px 4vw;
        max-width: 98vw;
    }
}

#selected-options > li {
    font-size: 14px;
}
body.modal-open {
    overflow: hidden;
}

.is-layout-constrained .modal,
.is-layout-constrained .modal-content {
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    left: 0 !important;
    right: 0 !important;
    transform: none !important;
    position: fixed !important;
}
.is-layout-constrained .modal-content {
    max-width: 500px !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
}
.info-icon {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 28px;
    height: 28px;
    background: #d4d4d4;
    color: #ffffff;
    border-radius: 50%;
    text-align: center;
    cursor: pointer;
    transition: background 0.2s;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
}
.info-icon::before {
    content: '';
    width: 26px;
    height: 26px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%23ffffff' d='m8.93 6.588l-2.29.287l-.082.38l.45.083c.294.07.352.176.288.469l-.738 3.468c-.194.897.105 1.319.808 1.319c.545 0 1.178-.252 1.465-.598l.088-.416c-.2.176-.492.246-.686.246c-.275 0-.375-.193-.304-.533zM9 4.5a1 1 0 1 1-2 0a1 1 0 0 1 2 0'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}
.info-icon:hover {
    background: #b5b5b5;
}
.description-modal {
    display: flex;
    position: fixed;
    z-index: 11000;
    left: 0; top: 0; right: 0; bottom: 0;
    width: 100vw;
    max-width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.45);
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s;
}
.description-modal.active {
    opacity: 1;
    pointer-events: auto;
}
.description-modal-content {
    background: #fff;
    max-width: 420px;
    width: 90vw;
    padding: 28px 24px 18px 24px;
    border-radius: 10px;
    box-shadow: 0 4px 32px rgba(0,0,0,0.13);
    position: relative;
    animation: modalShow 0.22s cubic-bezier(.4,1.3,.6,1) 1;
}
.metaslider .caption-wrap {
    position: absolute;
    bottom: 0;
    font-size:14px;
    left: 0;
}
.slides li {
    position: relative !important;
}
@keyframes modalShow {
    from { transform: scale(0.95) translateY(30px); opacity: 0; }
    to   { transform: scale(1) translateY(0); opacity: 1; }
}
.description-close {
    position: absolute;
    right: 18px;
    top: 12px;
    font-size: 22px;
    color: #888;
    cursor: pointer;
    font-weight: bold;
}
.description-close:hover {
    color: #222;
}
.description-text {
    font-size: 15px;
    color: #222;
    line-height: 1.6;
    margin-top: 10px;
    white-space: pre-line;
}

.option-item.included {
    border-color: #4CAF50;
    background-color: #f1f8e9;
}

.option-item.included label {
    background-color: #f1f8e9;
}

.option-item.included input[type="checkbox"]:disabled + h3 {
    color: #4CAF50;
}

.option-item.included .option-price {
    color: #4CAF50;
}

.tab.get-price {
    margin-left: auto;
    background: #4a90e2;
    margin-bottom: 5px;
    color: #fff;
    border-radius: 8px;
    font-weight: 600;
    transition: background 0.2s;
}
.tab.get-price:hover {
    background: #357abd;
}

.included-options-preview {
    margin-top: 15px;
    padding: 15px;
    background-color: #f8f9fa;
    border-top: 1px solid #e9ecef;
    border-radius: 0 0 10px 10px;
    box-sizing: border-box;
    display: none;
}

.included-options-preview.active {
    display: block !important;
    width: 100%;
}

.included-options-preview h4 {
    color: #2c3e50;
    margin: 0 0 15px 0;
    font-size: 14px;
    font-weight: 600;
}

.included-options-grid {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    overflow-x: auto;
    padding-bottom: 10px;
    scrollbar-width: thin;
    -webkit-overflow-scrolling: touch;
}

.included-options-grid::-webkit-scrollbar {
    height: 6px;
}

.included-options-grid::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.included-options-grid::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.included-options-grid::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

.included-option-item {
    flex: 0 0 auto;
    width: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 8px;
    position: relative;
    transition: all 0.2s;
}

.included-option-item:hover {
    border-color: #4a90e2;
    box-shadow: 0 2px 8px rgba(74,144,226,0.1);
}

.included-option-item img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    margin-bottom: 8px;
    border-radius: 4px;
}

.included-option-item .option-name {
    color: #34495e;
    font-size: 12px;
    line-height: 1.3;
    margin-bottom: 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    height: 32px;
}

.included-option-item .option-included {
    position: absolute;
    top: 4px;
    right: 4px;
    color: #27ae60;
    font-weight: bold;
    font-size: 14px;
    background-color: #e8f5e9;
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    box-shadow: 0 2px 4px rgba(39,174,96,0.2);
}

.option-item {
    display: flex;
    flex-direction: column;
}

.included-options-preview {
    flex: 1 1 auto;
    min-height: 0;
}

.trim-modal {
    position: fixed;
    z-index: 9999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: none;
}

.trim-modal-content {
    position: relative;
    background: #fff;
    margin: 10% auto;
    padding: 30px;
    width: 80%;
    max-width: 600px;
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
}

.trim-modal-close {
    position: absolute;
    right: 20px;
    top: 20px;
    font-size: 24px;
    cursor: pointer;
    color: #666;
}

.trim-modal-title {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #333;
}

.trim-modal-desc {
    display: flex;
    flex-direction: column;
    gap: 5px;
    max-height: 700px;
    overflow: auto;
    max-height: 62vh;
    line-height: 1.6;
    color: #666;
}

.trim-modal-desc .metaslider {
    margin: 20px 0;
    min-height: 360px;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
}

.trim-modal-desc .metaslider .slides {
    margin: 0;
    padding: 0;
}

.trim-modal-desc .metaslider .slides img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}

.trim-modal-desc .metaslider .flex-control-nav {
    display: none;
    bottom: 10px;
    z-index: 10;
}

.trim-modal-desc .metaslider .flex-direction-nav a {
    opacity: 0.7;
    height: 40px;
    line-height: 40px;
    margin-top: -20px;
    background: rgba(0,0,0,0.5);
    border-radius: 4px;
}

.trim-modal-desc .metaslider .flex-direction-nav a:hover {
    opacity: 1;
    background: rgba(0,0,0,0.7);
}

.trim-modal-desc .metaslider .flex-control-paging li a {
    background: rgba(255,255,255,0.5);
    box-shadow: none;
}

.trim-modal-desc .metaslider .flex-control-paging li a.flex-active {
    background: #fff;
}

.trim-modal-desc .metaslider .flex-direction-nav a:before {
    
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 20px;
}

.trim-modal-desc .metaslider .flex-direction-nav .flex-prev {
    left: 10px;
}

.trim-modal-desc .metaslider .flex-direction-nav .flex-next {
    right: 10px;
}

.trim-modal-desc .metaslider .flex-direction-nav .flex-prev {
    font-size: 0;
}
.metaslider .flex-direction-nav .flex-next {
    text-indent: 0 !important;
    font-size: 0;
}

.trim-modal-included-options {
    margin: 20px 0;
}

.included-options-list h4 {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.included-options-list ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.included-options-list li {
    padding: 8px 0;
    border-bottom: 1px solid #eee;
    color: #666;
}

.trim-modal-footer {
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.trim-modal-price {
    font-size: 20px;
    font-weight: 600;
    color: #4a90e2;
}

.trim-modal-select {
    background: #4a90e2;
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 4px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.trim-modal-select:hover {
    background: #357abd;
}

.photo-modal {
    display: none;
    position: fixed;
    z-index: 11000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    overflow: auto;
}

.photo-modal-content {
    margin: auto;
    display: block;
    max-width: 90%;
    max-height: 90vh;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    border-radius: 4px;
}

.photo-modal-description {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 15px;
    font-size: 14px;
    line-height: 1.4;
    border-radius: 0 0 4px 4px;
    max-height: 30vh;
    overflow-y: auto;
}

.photo-modal-close {
    position: absolute;
    right: 25px;
    top: 15px;
    color: #f1f1f1;
    font-size: 35px;
    font-weight: bold;
    cursor: pointer;
    z-index: 11001;
}

.photo-modal-close:hover {
    color: #bbb;
}

.tab-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid #e1e1e1;
}

.tab-navigation button {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.tab-navigation .prev-tab {
    background: #f5f5f5;
    color: #333;
}

.tab-navigation .prev-tab:hover {
    background: #e0e0e0;
}

.tab-navigation .next-tab {
    background: #4a90e2;
    color: #fff;
}

.tab-navigation .next-tab:hover {
    background: #357abd;
}

.tab-navigation button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}
