/* ============================================
   상품 상세 페이지 스타일
   ============================================ */

.product-detail-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 30px 20px;
}

/* 브레드크럼 */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: #666;
    margin-bottom: 30px;
}

.breadcrumb a {
    color: #666;
    text-decoration: none;
}

.breadcrumb a:hover {
    color: #333;
    text-decoration: underline;
}

.breadcrumb span:last-child {
    color: #333;
    font-weight: 500;
}

/* 상품 상세 래퍼 */
.product-detail-wrapper {
    display: flex;
    gap: 60px;
}

/* 상품 이미지 섹션 */
.product-image-section {
    flex: 0 0 500px;
    width: 500px;
}

.product-main-image {
    width: 500px;
    height: 500px;
    background-color: #f5f5f5;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.product-main-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 상품 뱃지 */
.product-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    z-index: 10;
    padding: 6px 14px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    background-color: #ff6b6b;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15);
}

.no-image {
    color: #999;
    font-size: 14px;
}

/* 상품 정보 섹션 */
.product-info-section {
    flex: 1;
}

.product-title {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
    line-height: 1.4;
}

/* 리뷰 별점 */
.product-rating-detail {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 20px;
}

.product-rating-detail .stars {
    display: flex;
    gap: 2px;
}

.product-rating-detail .star {
    font-size: 16px;
    color: #ddd;
}

.product-rating-detail .star.filled {
    color: #FFD700;
}

.product-rating-detail .rating-score {
    font-size: 14px;
    color: #999;
}

/* 가격 영역 */
.product-price-area {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 10px;
}

.price-label {
    font-size: 14px;
    color: #666;
    min-width: 50px;
}

.current-price {
    font-size: 28px;
    font-weight: 700;
    color: #333;
}

.discount-badge {
    background-color: #e53935;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
}

/* 할인가 영역 */
.final-price-area {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e5e5;
}

.final-price-label {
    font-size: 14px;
    color: #e53935;
    min-width: 50px;
}

.final-price {
    font-size: 32px;
    font-weight: 700;
    color: #e53935;
}

/* 배송비 정보 */
.shipping-info {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e5e5;
}

.shipping-label {
    font-size: 14px;
    color: #666;
    min-width: 50px;
}

.shipping-value {
    font-size: 15px;
    font-weight: 500;
}

/* 옵션 선택 섹션 */
.options-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e5e5;
}

.option-group-select {
    margin-bottom: 15px;
}

.option-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
}

.option-select {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 14px;
    color: #333;
    background: #fff;
    cursor: pointer;
    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='%23333' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
}

.option-select:focus {
    outline: none;
    border-color: #648876;
}

/* 수량 선택 섹션 */
.quantity-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e5e5;
}

.quantity-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.quantity-control {
    display: inline-flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
}

.quantity-btn {
    width: 40px;
    height: 40px;
    background: #f5f5f5;
    border: none;
    font-size: 18px;
    color: #333;
    cursor: pointer;
    transition: background 0.2s;
}

.quantity-btn:hover {
    background: #e5e5e5;
}

.quantity-input {
    width: 60px;
    height: 40px;
    border: none;
    border-left: 1px solid #ddd;
    border-right: 1px solid #ddd;
    text-align: center;
    font-size: 15px;
    font-weight: 500;
    -moz-appearance: textfield;
}

.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

.quantity-input:focus {
    outline: none;
}

.min-quantity-notice {
    display: block;
    margin-top: 8px;
    font-size: 12px;
    color: #e53935;
}

/* 상품 설명 */
.product-description {
    margin-bottom: 30px;
    padding: 20px;
    background-color: #f9f9f9;
    border-radius: 8px;
}

.product-description h3 {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 10px;
}

.product-description p {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    white-space: pre-wrap;
}

/* 에러 메시지 */
.error-message {
    background-color: #ffebee;
    border: 1px solid #ef5350;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
}

.error-message p {
    color: #c62828;
    font-size: 14px;
    margin: 0;
}

/* 주문 폼 */
.order-form {
    margin-top: 30px;
}

/* 결제 섹션 */
.payment-section {
    margin-bottom: 30px;
}

.payment-section h3 {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 16px;
}

.payment-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.payment-option {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 14px 16px;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    transition: border-color 0.2s, background-color 0.2s;
}

.payment-option:hover {
    border-color: #648876;
}

.payment-option input[type="radio"] {
    display: none;
}

.payment-option input[type="radio"]:checked + .radio-custom {
    border-color: #648876;
    background-color: #648876;
}

.payment-option input[type="radio"]:checked + .radio-custom::after {
    opacity: 1;
}

.payment-option input[type="radio"]:checked ~ .payment-label {
    color: #648876;
    font-weight: 600;
}

.radio-custom {
    width: 20px;
    height: 20px;
    border: 2px solid #ccc;
    border-radius: 50%;
    position: relative;
    transition: border-color 0.2s, background-color 0.2s;
}

.radio-custom::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 8px;
    height: 8px;
    background-color: #fff;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.2s;
}

.payment-label {
    font-size: 15px;
    color: #333;
}

.point-balance {
    font-size: 13px;
    color: #666;
    margin-left: auto;
}

/* 로그인 안내 */
.login-notice {
    background-color: #fff3e0;
    border: 1px solid #ffb74d;
    border-radius: 8px;
    padding: 12px 16px;
    margin-bottom: 20px;
}

.login-notice p {
    color: #e65100;
    font-size: 14px;
    margin: 0;
}

.login-notice a {
    color: #e65100;
    font-weight: 600;
    text-decoration: underline;
}

/* 버튼 그룹 */
.button-group {
    display: flex;
    gap: 12px;
    margin-top: 20px;
}

/* 장바구니 버튼 */
.cart-button {
    flex: 1;
    padding: 18px;
    background-color: #fff;
    color: #648876;
    border: 2px solid #648876;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.cart-button:hover {
    background-color: #648876;
    color: #fff;
}

.cart-button:disabled {
    background-color: #f5f5f5;
    color: #ccc;
    border-color: #ccc;
    cursor: not-allowed;
}

/* 결제 버튼 */
.order-button {
    flex: 1;
    padding: 18px;
    background-color: #648876;
    color: #fff;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s;
}

.order-button:hover {
    background-color: #4a6a5a;
}

.order-button:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

/* 안내 문구 */
.notice-text {
    font-size: 12px;
    color: #999;
    margin-top: 12px;
    line-height: 1.5;
}

/* ============================================
   상품 상세 내용 (에디터 콘텐츠)
   ============================================ */

.product-detail-content {
    margin-top: 60px;
    padding-top: 40px;
    border-top: 1px solid #e5e5e5;
}

.detail-content-title {
    font-size: 20px;
    font-weight: 600;
    color: #333;
    margin-bottom: 30px;
    text-align: center;
}

.detail-content-body {
    max-width: 800px;
    margin: 0 auto;
    font-size: 15px;
    line-height: 1.8;
    color: #333;
}

.detail-content-body img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 20px auto;
    border-radius: 8px;
}

.detail-content-body h1,
.detail-content-body h2,
.detail-content-body h3,
.detail-content-body h4,
.detail-content-body h5,
.detail-content-body h6 {
    margin-top: 30px;
    margin-bottom: 15px;
    font-weight: 600;
    color: #222;
}

.detail-content-body h1 { font-size: 28px; }
.detail-content-body h2 { font-size: 24px; }
.detail-content-body h3 { font-size: 20px; }
.detail-content-body h4 { font-size: 18px; }
.detail-content-body h5 { font-size: 16px; }
.detail-content-body h6 { font-size: 14px; }

.detail-content-body p {
    margin-bottom: 15px;
}

.detail-content-body ul,
.detail-content-body ol {
    margin: 15px 0;
    padding-left: 30px;
}

.detail-content-body li {
    margin-bottom: 8px;
}

.detail-content-body blockquote {
    border-left: 4px solid #648876;
    padding-left: 20px;
    margin: 20px 0;
    color: #666;
    font-style: italic;
}

.detail-content-body a {
    color: #648876;
    text-decoration: underline;
}

.detail-content-body a:hover {
    color: #4a6a5a;
}

.detail-content-body strong {
    font-weight: 700;
}

.detail-content-body em {
    font-style: italic;
}

.detail-content-body u {
    text-decoration: underline;
}

.detail-content-body s {
    text-decoration: line-through;
}

.detail-content-body pre {
    background-color: #f5f5f5;
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    font-family: monospace;
    font-size: 14px;
}

.detail-content-body .ql-align-center {
    text-align: center;
}

.detail-content-body .ql-align-right {
    text-align: right;
}

.detail-content-body .ql-align-justify {
    text-align: justify;
}

/* PC에서 모바일 요소 숨김 */
.mobile-purchase-bar {
    display: none;
}

.mobile-option-overlay {
    display: none;
}

/* ============================================
   반응형 디자인 - 모바일 (900px 이하)
   ============================================ */

@media (max-width: 900px) {
    .product-detail-wrapper {
        flex-direction: column;
        gap: 30px;
    }

    .product-title {
        font-size: 20px;
    }

    .current-price {
        font-size: 24px;
    }

    .final-price {
        font-size: 28px;
    }

    .product-detail-content {
        margin-top: 40px;
        padding-top: 30px;
    }

    .detail-content-title {
        font-size: 18px;
        margin-bottom: 20px;
    }

    .detail-content-body {
        font-size: 14px;
    }

    .product-detail-container {
        padding: 20px 16px;
        padding-bottom: 180px;
    }

    .breadcrumb {
        font-size: 12px;
        margin-bottom: 20px;
    }

    .product-image-section {
        flex: none;
        width: 100%;
        max-width: 100%;
        margin: 0 auto;
    }

    .product-main-image {
        width: 100%;
        height: 0;
        padding-bottom: 100%; /* 1:1 비율 유지 */
        max-height: none;
        border-radius: 8px;
        position: relative;
    }

    .product-main-image img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .product-title {
        font-size: 18px;
    }

    .product-price-area {
        flex-wrap: wrap;
    }

    .current-price {
        font-size: 22px;
    }

    .final-price {
        font-size: 24px;
    }

    .order-button {
        padding: 16px;
        font-size: 15px;
    }

    /* 모바일에서 기존 버튼 그룹 숨김 */
    .button-group {
        display: none;
    }

    /* 모바일 하단 고정 구매 바 */
    .mobile-purchase-bar {
        display: flex;
        flex-direction: column;
        position: fixed;
        bottom: 68px;
        left: 0;
        right: 0;
        background: #fff;
        border-top: 1px solid #e5e5e5;
        z-index: 900;
        box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
        transition: transform 0.3s ease;
    }

    /* 오버레이 */
    .mobile-option-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.4);
        z-index: 899;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .mobile-option-overlay.show {
        display: block;
        opacity: 1;
    }

    /* 토글 핸들 */
    .mobile-option-toggle {
        display: flex;
        justify-content: center;
        padding: 10px 0 6px;
        cursor: pointer;
    }

    .toggle-handle {
        width: 40px;
        height: 4px;
        background: #ddd;
        border-radius: 2px;
    }

    /* 옵션 패널 */
    .mobile-option-panel {
        display: none;
        padding: 0 16px;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.3s ease, padding 0.3s ease;
    }

    .mobile-purchase-bar.expanded .mobile-option-panel {
        display: block;
        max-height: 300px;
        padding: 0 16px 16px;
    }

    /* 옵션 드롭다운 */
    .mobile-option-dropdown {
        margin-bottom: 12px;
    }

    .mobile-option-dropdown.hide {
        display: none;
    }

    .mobile-option-select {
        width: 100%;
        padding: 14px 40px 14px 16px;
        border: 1px solid #e5e5e5;
        border-radius: 8px;
        font-size: 15px;
        color: #666;
        background: #fff;
        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 8L1 3h10z'/%3E%3C/svg%3E");
        background-repeat: no-repeat;
        background-position: right 16px center;
        cursor: pointer;
    }

    .mobile-option-select:focus {
        outline: none;
        border-color: #648876;
    }

    /* 선택된 옵션 영역 */
    .mobile-selected-option {
        display: none;
        background: #f8f8f8;
        border-radius: 8px;
        padding: 14px 16px;
    }

    .mobile-selected-option.show {
        display: block;
    }

    .selected-option-info {
        display: flex;
        justify-content: space-between;
        align-items: flex-start;
        margin-bottom: 12px;
    }

    .selected-option-name {
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    .option-product-name {
        font-size: 14px;
        font-weight: 500;
        color: #333;
    }

    .option-variant {
        font-size: 13px;
        color: #666;
    }

    .option-remove-btn {
        width: 24px;
        height: 24px;
        border: none;
        background: transparent;
        font-size: 20px;
        color: #999;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        padding: 0;
    }

    .option-remove-btn:hover {
        color: #333;
    }

    .selected-option-controls {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    /* 수량 조절 */
    .mobile-quantity-control {
        display: flex;
        align-items: center;
        border: 1px solid #ddd;
        border-radius: 4px;
        background: #fff;
    }

    .mobile-qty-btn {
        width: 32px;
        height: 32px;
        border: none;
        background: transparent;
        font-size: 16px;
        color: #333;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    .mobile-qty-btn:active {
        background: #f0f0f0;
    }

    .mobile-qty-value {
        min-width: 30px;
        text-align: center;
        font-size: 14px;
        font-weight: 500;
        color: #333;
    }

    /* 가격 */
    .mobile-option-price {
        font-size: 16px;
        font-weight: 700;
        color: #333;
    }

    /* 구매 버튼 영역 */
    .mobile-purchase-buttons {
        display: flex;
        gap: 10px;
        padding: 12px 16px;
    }

    .mobile-cart-btn {
        flex: 1;
        padding: 16px;
        background: #fff;
        color: #333;
        border: 1px solid #ddd;
        border-radius: 8px;
        font-size: 15px;
        font-weight: 600;
        cursor: pointer;
        transition: all 0.2s;
    }

    .mobile-cart-btn:hover {
        border-color: #648876;
        color: #648876;
    }

    .mobile-cart-btn:disabled {
        background: #f5f5f5;
        color: #ccc;
        border-color: #e5e5e5;
        cursor: not-allowed;
    }

    .mobile-buy-btn {
        flex: 1;
        padding: 16px;
        background: #648876;
        color: #fff;
        border: none;
        border-radius: 8px;
        font-size: 15px;
        font-weight: 600;
        cursor: pointer;
        transition: background 0.2s;
    }

    .mobile-buy-btn:hover {
        background: #4a6a5a;
    }

    .mobile-buy-btn:disabled {
        background: #ccc;
        cursor: not-allowed;
    }
}
