/*シミュレータ*/
.simulator * {
    box-sizing: border-box;
    font-weight: normal;
    line-height: initial !important;
}

.simulator {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;

    padding: 20px;
}

body.simulator-modal-open {
    overflow: hidden;
}

.simulator .container-s {
    max-width: 1400px;
    margin: 0 auto;
}

.simulator .product-viewer {
    display: flex;
    gap: 30px;
    background: white;
    border-radius: 1px;
    /*box-shadow: 0 2px 2px rgba(0, 0, 0, 0.1);*/
    overflow: visible;
}


.simulator .image-section {
    flex: 1;
    background: #ffffff;
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 600px;
}

.simulator .product-image {
    max-width: 100%;
    /* max-height: 500px;*/
    object-fit: contain;
    margin-bottom: 0px;
}


.simulator .product-image.fade-in {
    animation: fadeIn 0.5s ease-in;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}


.simulator .product-code-s {
    color: #666;
    font-size: 0.9em;
    text-align: center;
    margin-bottom: 10px;
}

.simulator .productPrice {
    font-size: 1em;
    margin-bottom: 10px;
}

.simulator .detail-btn {
    display: inline-block;
    padding: 20px 60px;
    background-color: #575757;
    color: white;
    text-decoration: none;
    border-radius: 1px;
    font-size: 1em;
    font-weight: 600;
    transition: background-color 0.3s;
    cursor: pointer;
}

.simulator .detail-btn:hover {
    /*background-color: #2d3748;*/
}

.simulator .options-section {
    flex: 1;
    padding: 40px;
    background-color: #fafafa;
    overflow: visible;
}

#optionsContainer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    column-gap: 30px;
}

.simulator .option-group {
    margin-bottom: 0;
}

.simulator .options-title {
    font-size: 1.3em;
    font-weight: bold;
    margin-bottom: 20px;
    color: #333;
    display: block;
}


.simulator .option-label {
    font-size: 0.8em;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    display: block;
}

.simulator .option-select {
    width: 100%;
    padding: 12px;
    border: 1px solid #d1d5db;
    border-radius: 1px;
    font-size: 15px;
    background-color: white;
    cursor: pointer;
}

.simulator .option-select:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.simulator .no-image {
    color: #999;
    font-size: 18px;
    text-align: center;
}

.simulator .select-spec-btn {
    display: none;
    width: 100%;
    padding: 16px;
    background-color: #575757;
    color: white;
    border: none;
    border-radius: 1px;
    font-size: 0.8em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.3s;
}

.simulator .select-spec-btn:hover {
    background-color: #575757;
}

.simulator .select-spec-btn:active {
    background-color: #575757;
}

/* モーダルスタイル */
.simulator .spec-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 9999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.simulator .spec-modal.show {
    display: flex;
    align-items: center;
    justify-content: center;
}

.simulator .spec-modal.active {
    opacity: 1;
}

.simulator .modal-panel {
    background: white;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.simulator .spec-modal.active .modal-panel {
    transform: translateY(0);
}

.simulator .modal-header-s {
    padding: 20px;
    border-bottom: 1px solid #000000;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
}

.simulator .modal-header-s-title {
    font-size: 20px;
    font-weight: 700;
    color: #333;
}

.simulator .modal-close-btn {
    background: none;
    border: none;
    font-size: 32px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.simulator .modal-options-container {
    padding: 20px;
    overflow-y: auto;
    flex: 1;
}

.simulator .modal-option-group {
    margin-bottom: 24px;
}

.simulator .modal-option-label {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 12px;
    display: block;
}

.simulator .modal-option-select {
    width: 100%;
    padding: 14px;
    border: 1px solid #000000;
    border-radius: 1px;
    font-size: 16px;
    background-color: white;
    cursor: pointer;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23666' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
}

.simulator .modal-option-select:focus {
    outline: none;
    border-color: #3b82f6;
}



/* カスタムドロップダウン */
.simulator .custom-select {
    position: relative;
    width: 100%;
}

.simulator .custom-select-trigger {
    width: 100%;
    padding: 14px;
    border: 1px solid #000000;
    border-radius: 1px;
    font-size: 0.8em;
    background-color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.simulator .custom-select-trigger:hover {
    border-color: #d1d5db;
}

.simulator .custom-select-trigger.active {
    border-color: #000;
}

.simulator .custom-select-content {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

.simulator .custom-select-thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    background-color: #f3f4f6;
    display: block;
    /* ← この行を追加 */
}

.simulator .custom-select-arrow {
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 6px solid #666;
    transition: transform 0.3s;
}

.simulator .custom-select-trigger.active .custom-select-arrow {
    transform: rotate(180deg);
}

.simulator .custom-select-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #000000;
    border-radius: 1px;
    max-height: 350px;
    overflow-y: auto;
    z-index: 1000;
    display: none;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.simulator .custom-select-dropdown.active {
    display: block;
}

/* 通常は下に表示 */
.simulator .custom-select-dropdown {
    top: calc(100% + 4px);
    bottom: auto;
}

/* 画面下部にはみ出す場合は上に表示 */
.simulator .custom-select-dropdown.dropdown-up {
    top: auto;
    bottom: calc(100% + 4px);
}


.simulator .custom-select-option {
    padding: 12px 14px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: background-color 0.2s;
    font-size: 0.8em;
}

.simulator .custom-select-option:hover {
    background-color: #f9fafb;
}

.simulator .custom-select-option.selected {
    background-color: #f6f6f6;
    color: #000000;
    font-weight: 600;
}

.simulator .custom-select-option-thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
    background-color: #f3f4f6;
    display: block;
    /* ← この行を追加 */
    flex-shrink: 0;
    /* ← この行を追加 */
}

.simulator .reset-btn {
    width: 100%;
    padding: 14px;
    background-color: #FFF;
    color: #000;
    border: none;
    border-radius: 1px;
    font-size: 0.8em;
    font-weight: 600;
    cursor: pointer;
    margin-top: 20px;
    /*transition: background-color 0.3s;*/
    border: 1px solid;
}

.simulator .reset-btn:hover {
    /*background-color: #d1d5db;*/
    opacity: .7;
}

.simulator .reset-btn:active {
    background-color: #c2c7cf;
}

/* モバイル用スタイル */
@media (max-width: 768px) {
    .simulator {
        padding: 0;
    }

    .simulator .product-viewer {
        flex-direction: column;
        border-radius: 0;
        min-height: 100vh;
    }

    .simulator .image-section {
        min-height: 0;
        padding: 0px;
    }

    .simulator .product-image {
        /*max-height: 300px;*/
    }

    .simulator .product-code-s {
        font-size: 16px;
        margin-bottom: 8px;
    }

    .simulator .options-section {
        padding: 20px;
    }

    .simulator .options-title {
        font-size: 1em;
        margin-bottom: 16px;
    }

    #optionsContainer {
        display: none;
    }

    .simulator .select-spec-btn {
        display: block;
    }

    .simulator .detail-btn {
        padding: 20px 40px;
        font-size: 0.9em;
    }

    .simulator .options-title {
        display: none;
    }

}

@media (min-width: 769px) {
    .simulator .spec-modal {
        display: none !important;
    }
}