/* Custom Product Page Styles */

.custom-product-shortcode-container {
    max-width: 448px;
    margin: 0 auto;
}

/* --- Layout Fix & Image Styles --- */

.custom-product-shortcode-container .images,
.custom-product-shortcode-container .summary {
    width: 100% !important;
    float: none !important;
    margin-right: 0 !important;
}

.custom-product-shortcode-container .images {
    position: relative;
    border-radius: 8px;
    overflow: hidden;
    line-height: 0;
    margin-bottom: 24px !important;
    aspect-ratio: 1 / 1;
}

.custom-product-shortcode-container .images::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.00) 0%, rgba(0, 0, 0, 0.30) 100%);
    pointer-events: none;
}

.custom-product-shortcode-container .images img {
    display: block;
    width: 100% !important;
}

/* --- Typography & Price Layout --- */

.custom-product-shortcode-container .summary h1.product_title {
    color: #000;
    font-family: Pretendard, sans-serif;
    font-size: 20px;
    font-style: normal;
    font-weight: 600;
    line-height: 140%;
    margin-bottom: 0;
}

.custom-product-shortcode-container .summary .custom-summary-header {
    padding: 12px 0;
    border-top: 1px solid #E8E8E8;
    border-bottom: 1px solid #E8E8E8;
}

.custom-product-shortcode-container .summary p.price {
    margin-top: 6px;
    margin-bottom: 0;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
}

.custom-product-options {
    width: 100%;
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.custom-product-option {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 0px !important;
}

.custom-product-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 0px;
    font-family: Pretendard, sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 140%;
    color: #1B1B1E;
    border-top: 1px solid #000000;
}

.custom-product-total__label {
    color: #000000;
}

.custom-product-total__amount {
    display: inline-flex;
    align-items: center;
    color: #5B37ED;
    font-size: 22px;
    font-weight: 700;
}

.custom-product-total__currency {
    font-size: 14px;
    font-weight: 500;
}

.custom-review-summary {
    display: flex;
    flex-direction: row;
    gap: 18px;
    padding: 24px 0;
    border-bottom: 1px solid #E8E8E8;
}

.custom-review-summary__left {
    flex: 1 1 160px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 4px;
}

.custom-review-summary__average {
    font-family: Pretendard, sans-serif;
    font-size: 32px;
    font-weight: 600;
    color: #5B37ED;
}

.custom-review-summary__denominator {
    /* margin-left: 4px; */
    font-size: 24px;
    font-weight: 600;
    color: #80808E;
}

.custom-review-summary__stars {
    display: flex;
    gap: 6px;
}

.custom-review-star svg {
    display: block;
}

.custom-review-star:not(.is-filled) svg path {
    fill: #E0E0E0;
}

.custom-review-summary__count {
    font-size: 13px;
    font-weight: 500;
    color: #80808E;
}

.custom-review-summary + .commentlist,
.commentlist .sts-review-content p {
    margin: 0;
}

/* 리뷰 컨테이너 및 컨텐츠 텍스트 줄바꿈 처리 */
.sts-review-container {
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

.sts-review-content,
.sts-review-content p {
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 100%;
    box-sizing: border-box;
}

.custom-review-summary__right {
    flex: 1 1 260px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.custom-review-title {
    margin: 24px 0 12px 0;
    font-family: Pretendard, sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: #000;
}

.custom-review-login-prompt {
    margin-top: 20px;
    padding: 32px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.custom-review-login-text {
    margin: 0;
    font-size: 14px;
    color: #80808E;
    font-weight: 500;
    flex: 1;
}

.custom-review-login-button {
    padding: 15px 32px;
    border-radius: 100px;
    color: #5B37ED !important;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    border: 1px solid #5B37ED;
}

.custom-review-login-button:hover {
    background: #4527d3;
    color: #fff !important;
}

/* 리뷰 작성 버튼 */
.custom-review-write-prompt,
.custom-review-no-purchase,
.custom-review-completed {
    margin-top: 20px;
    padding: 32px 12px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.custom-review-write-text,
.custom-review-no-purchase p,
.custom-review-completed p {
    margin: 0;
    font-size: 14px;
    color: #80808E;
    font-weight: 500;
    text-align: center;
}

.custom-review-completed p {
    color: #5B37ED;
    font-weight: 600;
}

.custom-review-write-button {
    padding: 15px 32px;
    border-radius: 100px;
    background: #5B37ED;
    color: #fff !important;
    font-size: 16px;
    font-weight: 600;
    text-decoration: none;
    border: none;
    transition: all 0.3s ease;
}

.custom-review-write-button:hover {
    background: #4527d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(91, 55, 237, 0.3);
}

.custom-review-graph-row {
    display: flex;
    align-items: center;
    gap: 5px;
}

.custom-review-graph-row__label {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto;
    font-size: 11px;
    font-weight: 500;
    color: #80808E;
}

.custom-review-graph-row__label svg path {
    fill: #FFD400;
}

.custom-review-graph-row__bar {
    position: relative;
    flex: 1 1 auto;
    height: 12px;
    border-radius: 6px;
    background: #F0F0F5;
    overflow: hidden;
}

.custom-review-graph-row__bar span {
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    border-radius: 6px;
    background: #FFD400;
}

.custom-review-graph-row__count {
    flex: 0 0 auto;
    text-align: right;
    font-size: 11px;
    font-weight: 500;
    color: #80808E;
}
.custom-product-option__label {
    font-family: Pretendard, sans-serif;
    font-size: 16px !important;
    font-weight: 600 !important;
    line-height: 140% !important;
    color: #000 !important;
    margin: 0px !important;
}

.custom-product-option__label .required {
    color: #E16666 !important;
    font-family: Pretendard, sans-serif;
    font-size: 16px !important;
    font-weight: 600 !important;
    line-height: 140% !important;
    margin-left: 0px !important;
}

.custom-product-option__field {
    border: 1px solid #D9D9E0 !important;
    border-radius: 12px !important;
    padding: 12px 12px !important;
    font-family: Pretendard, sans-serif;
    font-size: 14px;
    line-height: 140%;
    color: #1B1B1E;
    background-color: #fff;
    width: 100%;
    box-sizing: border-box;
}

.custom-product-option__field:focus {
    outline: none;
    border-color: #5B37ED;
    box-shadow: 0 0 0 1px rgba(91, 55, 237, 0.15);
}

/* iOS Safari select 스타일링 */
.custom-product-option__field select,
select.custom-product-option__field,
select.sts-option-select {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg width='14' height='8' viewBox='0 0 14 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M1 1L7 7L13 1' stroke='%231B1B1E' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 14px 8px;
    padding-right: 40px !important;
}

.custom-product-option__choices {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

.custom-product-option__choices--time {
    width: 100%;
    justify-content: flex-end;
}

.custom-gender-option {
    display: inline-flex;
    flex: 1 1 calc(50% - 10px);
    cursor: pointer;
}

.custom-buy-now-button {
    width: 100%;
    padding: 15px 10px !important;
    border-radius: 12px;
    background: #5B37ED !important;
    color: #fff !important;
    border: none !important;
    border-radius: 12px !important;
    font-family: Pretendard, sans-serif;
    font-size: 16px !important;
    font-weight: 600 !important;
    line-height: 140%;
}

.custom-buy-now-button:hover {
    background: #4527d3 !important;
}

.custom-gender-option input {
    display: none;
}

.custom-gender-option span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 15px 10px;
    gap: 10px;
    border-radius: 12px;
    background: #C0C1C2;
    font-family: Pretendard, sans-serif;
    font-size: 14px;
    font-weight: 600;
    line-height: 140%;
    color: #1B1B1E;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.custom-gender-option:hover span {
    background: #5B37ED;
    color: #fff;
}

.custom-gender-option input:checked + span {
    background: #5B37ED;
    color: #fff;
}

.custom-calendar-option {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: Pretendard, sans-serif;
    font-size: 16px !important;
    font-weight: 600 !important;
    line-height: 140%;
    color: #C0C1C2 !important;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.custom-calendar-option input {
    display: none;
}

.custom-calendar-option__icon {
    display: inline-flex;
    width: 20px;
    height: 20px;
    align-items: center;
    justify-content: center;
    color: #C0C1C2;
    transition: color 0.2s ease;
}

.custom-calendar-option__icon svg {
    width: 20px;
    height: 20px;
    display: block;
}

.custom-calendar-option__label {
    color: inherit;
    transition: color 0.2s ease;
}

.custom-calendar-option--time {
    width: auto;
}

.custom-calendar-option:hover {
    border-color: #5B37ED;
}

.custom-calendar-option:hover .custom-calendar-option__icon {
    color: #5B37ED;
}

.custom-calendar-option.is-selected {
    color: #5B37ED !important;
}

.custom-calendar-option.is-selected .custom-calendar-option__icon {
    color: #5B37ED;
}

/* 생년월일 라벨과 양력/음력을 같은 라인에 배치 */
.custom-product-option__header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
}

.custom-product-option--birthdate .custom-product-option__label {
    margin-bottom: 0;
}

.custom-product-option__choices--birth-inline {
    display: flex;
    gap: 10px;
    margin: 0;
}

/* 플로팅 구매 버튼 (트리거) */
.custom-floating-buy-button-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 12px 16px;
    z-index: 999;
    max-width: 100%;
    box-sizing: border-box;
}

.custom-floating-buy-button-trigger {
    width: 100%;
    max-width: 420px;
    margin: 0 auto;
    display: block;
    padding: 16px 24px;
    background: #5B37ED;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-family: Pretendard, sans-serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.custom-floating-buy-button-trigger:hover {
    background: #4527d3;
    transform: translateY(-2px);
}

/* 바텀시트 오버레이 */
.custom-floating-bottom-sheet {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 9999;
    pointer-events: none;
    visibility: hidden;
}

.custom-floating-bottom-sheet.is-open {
    pointer-events: auto;
    visibility: visible;
}

.custom-bottom-sheet-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.custom-floating-bottom-sheet.is-open .custom-bottom-sheet-overlay {
    opacity: 1;
}

/* 바텀시트 콘텐츠 */
.custom-bottom-sheet-content {
    position: absolute;
    bottom: 0;
    left: 50%;
    max-width: 448px;
    width: 100%;
    max-height: 80vh;
    background: #fff;
    border-radius: 20px 20px 0 0;
    display: flex;
    flex-direction: column;
    transform: translate(-50%, 100%);
    transition: transform 0.3s ease;
}

.custom-floating-bottom-sheet.is-open .custom-bottom-sheet-content {
    transform: translate(-50%, 0);
}

/* 바텀시트 헤더 */
.custom-bottom-sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 16px;
    border-bottom: 1px solid #E0E0E0;
}

.custom-bottom-sheet-header h3 {
    margin: 0;
    font-family: Pretendard, sans-serif;
    font-size: 18px;
    font-weight: 600;
    color: #1B1B1E;
}

.custom-bottom-sheet-close {
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    font-size: 28px;
    line-height: 1;
    color: #80808E;
    cursor: pointer;
    padding: 0;
}

.custom-bottom-sheet-close:hover {
    color: #1B1B1E;
}

/* 바텀시트 바디 */
.custom-bottom-sheet-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px 16px;
}

/* 바텀시트 내 옵션 간격 */
.custom-bottom-sheet-body .custom-product-options {
    display: flex !important;
    flex-direction: column !important;
    gap: 24px !important;
}

.custom-bottom-sheet-body .custom-product-option {
    margin-bottom: 0 !important;
}

/* 바텀시트 푸터 */
.custom-bottom-sheet-footer {
    padding: 12px 16px;
    border-top: 1px solid #E0E0E0;
    background: #fff;
}

.custom-bottom-sheet-footer .custom-floating-buy-button {
    width: 100%;
    padding: 16px 24px;
    background: #5B37ED;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-family: Pretendard, sans-serif;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.custom-bottom-sheet-footer .custom-floating-buy-button:hover {
    background: #4527d3;
}

.custom-bottom-sheet-footer .custom-floating-buy-button:disabled {
    background: #C0C1C2;
    cursor: not-allowed;
}

/* 1. Discount Percentage */
.custom-product-shortcode-container .summary .custom-discount-percentage {
    color: #393939;
    font-family: Pretendard, sans-serif;
    font-size: 13px;
    font-style: normal;
    font-weight: 700;
    line-height: 140%;
    margin-right: 8px;
}

/* 2. Before-discount price */
.custom-product-shortcode-container .summary p.price del {
    color: #80808E;
    font-family: Pretendard, sans-serif;
    font-size: 13px;
    font-style: normal;
    font-weight: 400;
    line-height: 140%;
    text-decoration-line: line-through;
    margin-right: 8px;
}

/* 3. After-discount price (Container) */
.custom-product-shortcode-container .summary p.price ins {
    flex-basis: 100%;
    margin-top: 4px;
    text-decoration: none; /* Remove default underline */
}

/* 4. After-discount price (Number) */
.custom-product-shortcode-container .summary p.price ins .custom-price-amount--sale {
    color: #5B37ED;
    font-family: Pretendard, sans-serif;
    font-size: 20px;
    font-style: normal;
    font-weight: 700;
    line-height: 140%;
}

/* 5. After-discount price (Currency Symbol) */
.custom-product-shortcode-container .summary p.price ins .custom-price-currency--sale {
    color: #5B37ED;
    font-family: Pretendard, sans-serif;
    font-size: 15px;
    font-style: normal;
    font-weight: 700;
    line-height: 140%;
}


/* Style for the custom KakaoTalk button */
.kakao-chat-button {
    display: flex !important;
    justify-content: center;
    align-items: center;
    height: 52px;
    padding: 15px 10px !important;
    gap: 10px;
    align-self: stretch;
    border-radius: 12px !important;
    border: none !important;
    background: #FBE64D !important;
    color: #000 !important;
    font-family: Pretendard, sans-serif;
    font-size: 14px !important;
    font-style: normal;
    font-weight: 600;
    line-height: 140% !important;
    width: 100%;
    margin-top: 12px;
    margin-bottom: 12px !important;
}

.kakao-chat-button__icon {
    width: 16px;
    height: 16px;
    display: block;
}

.kakao-chat-button__label {
    color: inherit;
    font: inherit;
    line-height: inherit;
}

/* .kakao-chat-button:hover {
    background: #FAD600 !important;
    color: #000 !important;
} */

/* Custom Tabs */
.custom-tabs-wrapper {
    margin-top: 20px;
    clear: both;
}

ul.custom-tabs-nav {
    list-style: none !important;
    margin: 0 0 20px 0 !important;
    padding: 0 !important;
    display: flex;
    justify-content: space-between;
    border-bottom: 1px solid #80808E;
}

ul.custom-tabs-nav li {
    flex: 1 1 50%;
    list-style: none !important;
    margin: 0 !important;
    padding-top: 0px !important;
    padding-bottom: 6px !important;
    cursor: pointer;
    border-bottom: none;
    position: relative;
    bottom: -2px;
    text-align: center;
}

ul.custom-tabs-nav li.active {
    border-bottom: 2px solid #000000;
}

ul.custom-tabs-nav li.active a {
    font-weight: bold;
    color: #000000 !important;
}

ul.custom-tabs-nav li a {
    text-decoration: none;
    color: #80808E;
    display: inline-block;
    width: 100%;
}

.product-gallery-tab-content {
    line-height: 0;
}

.product-gallery-tab-content img {
    display: block;
    width: 100%;
    height: auto;
    margin: 0;
    padding: 0;
}

.custom-tab-content {
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

.custom-tab-content #reviews #comments {
    padding: 0;
}

.custom-tab-content #review_form_wrapper {
    padding: 0;
}

.woocommerce #reviews #comments ol.commentlist {
    margin: 0 12px !important;
    width: auto !important;
}

.woocommerce #reviews #comments ol.commentlist li {
    padding: 12px 16px !important;
    background-color: #F7F7F8 !important;
    border-radius: 8px !important;
    margin-bottom: 4px !important;
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

.sts-review-item {
    max-width: 100%;
    overflow-x: hidden;
    box-sizing: border-box;
}

.sts-review-header {
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

.sts-review-author {
    max-width: 100%;
    box-sizing: border-box;
    overflow-x: hidden;
}

/* ========================================
   카카오 로그인 모달
   ======================================== */

.custom-kakao-login-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
}

.custom-kakao-login-modal.is-open {
    display: block;
}

.custom-kakao-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
}

.custom-kakao-modal-content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 16px;
    padding: 32px 24px;
    max-width: 400px;
    width: 90%;
    text-align: center;
}

.custom-kakao-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
}

.custom-kakao-modal-close:hover {
    color: #333;
}

.custom-kakao-modal-content h3 {
    font-size: 20px;
    font-weight: 600;
    margin: 0 0 12px 0;
    color: #1B1B1E;
}

.custom-kakao-modal-content p {
    font-size: 14px;
    color: #666;
    margin: 0 0 24px 0;
}

.custom-kakao-login-button {
    width: 100%;
    padding: 16px;
    background: #FEE500;
    border: none;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    color: #000000;
    cursor: pointer;
    transition: background 0.2s;
}

.custom-kakao-login-button:hover {
    background: #FDD835;
}

/* 태어난 시간 필드 입력 필요 시각적 효과 */
.custom-product-option--time.needs-input-highlight .custom-product-option__field,
.custom-product-option--time.needs-input-highlight select {
    border-color: #FEE500 !important;
    border-width: 2px !important;
    animation: border-sparkle 1.2s ease-in-out infinite;
    position: relative;
}

@keyframes border-sparkle {
    0%, 100% {
        border-color: #FEE500;
        box-shadow: 0 0 0 2px rgba(254, 229, 0, 0.3),
                    0 0 8px rgba(254, 229, 0, 0.5),
                    0 0 16px rgba(254, 229, 0, 0.3);
    }
    25% {
        border-color: #FFD700;
        box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.5),
                    0 0 12px rgba(255, 215, 0, 0.7),
                    0 0 24px rgba(255, 215, 0, 0.5);
    }
    50% {
        border-color: #FDD835;
        box-shadow: 0 0 0 4px rgba(253, 216, 53, 0.6),
                    0 0 16px rgba(253, 216, 53, 0.8),
                    0 0 32px rgba(253, 216, 53, 0.6);
    }
    75% {
        border-color: #FFD700;
        box-shadow: 0 0 0 3px rgba(255, 215, 0, 0.5),
                    0 0 12px rgba(255, 215, 0, 0.7),
                    0 0 24px rgba(255, 215, 0, 0.5);
    }
}

/* 모바일 반응형 스타일 */
@media (max-width: 768px) {
    /* 상품평 탭 컨텐츠 너비 제한 */
    .custom-tab-content {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
        box-sizing: border-box;
        padding: 0;
    }
    
    /* 상품평 요약 - 모바일에서 세로 배치 */
    .custom-review-summary {
        flex-direction: column;
        gap: 16px;
        padding: 20px 16px;
    }
    
    .custom-review-summary__left {
        flex: 1 1 auto;
        width: 100%;
    }
    
    .custom-review-summary__right {
        flex: 1 1 auto;
        width: 100%;
    }
    
    /* 플로팅 구매 버튼 컨테이너 - 모바일 대응 */
    .custom-floating-buy-button-container {
        max-width: 100vw;
        left: 0;
        right: 0;
        padding: 12px 16px;
        box-sizing: border-box;
    }
    
    .custom-floating-buy-button-trigger {
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* 리뷰 리스트 모바일 대응 */
    .woocommerce #reviews #comments ol.commentlist {
        margin: 0 16px !important;
        width: calc(100% - 32px) !important;
        box-sizing: border-box;
    }
    
    /* 리뷰 그래프 행 모바일 대응 */
    .custom-review-graph-row {
        flex-wrap: nowrap;
        min-width: 0;
    }
    
    .custom-review-graph-row__bar {
        min-width: 0;
        flex: 1 1 auto;
    }
    
    /* 리뷰 컨테이너 및 컨텐츠 모바일 대응 */
    .sts-review-container {
        max-width: 100%;
        overflow-x: hidden;
        box-sizing: border-box;
    }
    
    .sts-review-content,
    .sts-review-content p {
        word-break: break-word;
        overflow-wrap: break-word;
        max-width: 100%;
        box-sizing: border-box;
    }
}
