/* product_detail.css (새로운 디자인 - 최종) */

body {
    font-family: 'Noto Sans KR', sans-serif;
    background-color: #f9f9f9;
    margin: 0;
    padding-bottom: 80px;
    text-align: left;
}

.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1050;
    overflow: hidden;
    justify-content: center;
    align-items: center;
    padding: 15px;
}

.modal-content {
    position: relative;
    background-color: #fff;
    margin: 1.5rem auto;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
    width: 90%;
    max-width: 1200px;
    display: flex;
    flex-direction: column; /* 주요 항목들을 세로로 배치 */
    overflow-y: auto; /* 팝업창 내용이 넘칠 경우 스크롤 생성 */
    max-height: 90vh; /* 필요에 따라 최대 높이 설정 */
}

.close-button {
    position: absolute;
    top: 15px;
    right: 20px;
    font-size: 24px;
    font-weight: bold;
    color: #aaa;
    cursor: pointer;
    border: none;
    background: none;
    padding: 0;
    outline: none;
    z-index: 1051;
}

.close-button:hover,
.close-button:focus {
    color: #333;
    text-decoration: none;
}

.product-detail-container {
    display: flex;
    flex-direction: column; /* 주요 항목들을 세로로 배치 */
    gap: 30px;
}

.product-layout-row {
    display: flex;
    flex-direction: row; /* 이미지와 정보 영역을 가로로 배치 */
    gap: 30px;
    margin-bottom: 30px; /* 상세 정보와의 간격 */
}

/* 상품 이미지 영역 */
.product-image-area {
    flex: 0 0 45%; /* 비율 조정 */
    display: flex;
    flex-direction: column;
    align-items: center;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    background-color: #f9f9f9;
    padding: 20px;
    max-height: 600px;
}

#modal-product-image {
    max-width: 80%;
    height: auto;
    max-height: 400px;
    border-radius: 8px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
    margin-bottom: 15px;
    display: block;
    object-fit: contain;
    margin-left: auto;
    margin-right: auto;
}
.additional-images {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    margin-top: 10px;
    padding-bottom: 10px;
}

.additional-images img {
    width: 70px;
    height: 70px;
    border: 1px solid #ddd;
    border-radius: 6px;
    cursor: pointer;
    opacity: 0.8;
    transition: opacity 0.2s ease-in-out;
}

.additional-images img:hover {
    opacity: 1;
    border-color: #bbb;
}

/* 상품 정보 영역 */
.product-info-area {
    flex: 0 0 50%; /* 비율 조정 */
    display: flex;
    flex-direction: column;
    gap: 20px;

}

#modal-product-title {
    font-size: 28px;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
}

#modal-product-price {
    font-size: 24px;
    color: #e44d26;
    font-weight: bold;
    margin-bottom: 15px;
    text-align: right; /* 추가: 오른쪽 정렬 */
}

.product-options {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 15px;
    padding-left: 100px;

}

.option {
    display: flex;
    align-items: center;
    gap: 15px;
}

.option label {
    width: 90px;
    font-weight: bold;
    color: #555;
}

.option select,
.quantity input[type="number"] {
    padding: 10px 12px;
    border: 1px solid #ccc;
    border-radius: 8px;
    flex-grow: 1;
    max-width: 220px;
    font-size: 16px;
    appearance: none;
    background-image: url('data:image/svg+xml;utf8,<svg fill="currentColor" height="20" viewBox="0 0 24 24" width="20" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/><path d="M0 0h24v24H0z" fill="none"/></svg>');
    background-repeat: no-repeat;
    background-position-x: 95%;
    background-position-y: center;
}

.quantity {
    display: flex;
    align-items: center;
    gap: 15px;
}

.quantity label {
    width: 90px;
    font-weight: bold;
    color: #555;
}

.quantity input[type="number"] {
    width: 120px;
}

.product-actions {
    display: flex;
    gap: 15px;
    margin-top: 25px;
    align-items: center;
    justify-content: center; /* 추가: 가로 방향 가운데 정렬 */
}

.product-actions button {
    padding: 14px 24px;
    border: none;
    border-radius: 25px;
    cursor: pointer;
    font-weight: bold;
    font-size: 16px;
    transition: background-color 0.3s ease;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

#modal-add-to-cart-btn {
    background-color: #27ae60;
    color: white;
}

#modal-add-to-cart-btn:hover {
    background-color: #219b56;
}

#modal-buy-now-btn {
    background-color: #3498db;
    color: white;
}

#modal-buy-now-btn:hover {
    background-color: #2a8bcc;
}

/* 상품 상세 정보 영역 */
.product-details {
    padding: 0 20px;
}

.product-details > div {
    margin-bottom: 40px;
    padding-bottom: 30px;
    border-bottom: 1px solid #eee;
}

.product-details > div:last-child {
    border-bottom: none;
}

.product-details h3 {
    font-size: 20px;
    color: #333;
    margin-top: 0;
    margin-bottom: 15px;
    font-weight: bold;
}

#modal-product-description {
    color: #555;
    line-height: 1.6;
}

.product-specs-section table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
}

.product-specs-section th,
.product-specs-section td {
    padding: 10px 15px;
    border: 1px solid #eee;
    text-align: left;
}

.product-specs-section th {
    background-color: #f8f8f8;
    font-weight: bold;
    width: 120px;
}

#modal-delivery {
    color: #555;
    line-height: 1.6;
}

#modal-reviews {
    color: #555;
    line-height: 1.6;
}

/* 관련 상품 영역 */
.related-products {
    padding: 30px 20px;
    background-color: #f9f9f9;
    border-radius: 10px;
    margin-top: 40px;
}

.related-products h3 {
    font-size: 20px;
    color: #333;
    margin-top: 0;
    margin-bottom: 20px;
    font-weight: bold;
}

.related-products-list {
    display: flex;
    gap: 20px;
    overflow-x: auto;
    padding-bottom: 15px;
}

.related-products-list .related-product-item {
    flex: 0 0 auto;
    width: 200px;
    border: 1px solid #eee;
    border-radius: 8px;
    padding: 15px;
    text-align: center;
    background-color: #fff;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
}

.related-products-list .related-product-item img {
    max-width: 100%;
    height: auto;
    margin-bottom: 10px;
    border-radius: 4px;
}

.related-products-list .related-product-item p {
    font-size: 16px;
    color: #333;
    margin-bottom: 5px;
    font-weight: bold;
}

.price-container {
    display: flex;
    align-items: center;
    gap: 5px;
}

.original-price {
    color: #777;
    font-size: 0.9em;
}

.discount-badge {
    background-color: #dc3545; /* 빨간색 계열 */
    color: white;
    padding: 3px 5px;
    border-radius: 5px;
    font-size: 0.8em;
}

.price-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    width: 100%;
    text-align: left;
}

.price-info .price {
    color: #e44d26;
    font-size: 1.2em;
    font-weight: bold;
    margin-bottom: 3px;
}

.price-info .original-price {
    color: #777;
    font-size: 0.9em;
    text-decoration: line-through;
    margin-bottom: 0;
}

.price-info .discount-rate {
    background-color: #dc3545;
    color: white;
    padding: 3px 6px;
    border-radius: 5px;
    font-size: 0.8em;
}