/* 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;
}

.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: 12px;
}

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

/* person_info 타입 내부의 중첩된 옵션들 간 간격 */
.custom-product-option--person_info_1,
.custom-product-option--person_info_2,
.custom-product-option--person_info_dynamic {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

.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;
}

.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;
}

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

.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,
.custom-gender-option.is-selected 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;
}

/* 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: 24px !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 {
    width: 100%;
    height: auto;
    display: block;
    margin: 0;
    padding: 0;
}

.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;
}

/* 생년월일 라벨과 양력/음력 옵션을 같은 라인에 */
.sts-birthdate-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sts-birthdate-label {
    margin: 0 !important;
}

.sts-birthdate-header .custom-product-option__choices--birth {
    gap: 8px;
    margin: 0;
}

/* 플로팅 구매하기 버튼 */
.custom-floating-buy-button {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 448px;
    z-index: 9999;
    padding: 16px 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.6) 70%, transparent 100%);
}

.custom-floating-buy-btn {
    width: 100%;
    padding: 16px 24px;
    background: #5B37ED;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.custom-floating-buy-btn:hover {
    background: #4A2BC0;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(91, 55, 237, 0.3);
}

.custom-floating-buy-btn:active {
    transform: translateY(0);
}

/* ==================== 플로팅 구매하기 버튼 (트리거) ==================== */
.custom-floating-buy-button-container {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 448px;
    z-index: 999998;
    padding: 16px 20px;
}

.custom-floating-buy-button-trigger {
    width: 100%;
    padding: 16px;
    background: #5B37ED;
    color: white;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

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

/* ==================== 바텀시트 ==================== */
.custom-floating-bottom-sheet {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
}

.custom-floating-bottom-sheet.is-open {
    display: flex;
    flex-direction: column;
}

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

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.custom-bottom-sheet-content {
    position: absolute;
    bottom: -100%;
    left: 50%;
    max-width: 448px;
    width: 100%;
    transform: translateX(-50%);
    background: white;
    border-radius: 16px 16px 0 0;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    transition: bottom 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.custom-floating-bottom-sheet.is-open .custom-bottom-sheet-content {
    bottom: 0;
}

.custom-bottom-sheet-header {
    padding: 20px 16px;
    border-bottom: 1px solid #E0E0E0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0;
    position: relative;
}

/* 진행 표시 스타일 */
.sts-progress-indicator {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    font-size: 14px;
    font-weight: 600;
    color: #666;
}

.sts-progress-indicator .sts-progress-current {
    color: #5B37ED;
}

.custom-bottom-sheet-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
}

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

.custom-bottom-sheet-body {
    flex: 1;
    overflow-y: auto;
    padding: 0px 16px;
}

.custom-bottom-sheet-footer {
    padding: 14px;
}

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

.custom-bottom-sheet-submit:hover {
    background: #4A2BC0;
}

.custom-bottom-sheet-submit:active {
    background: #3E24A0;
}

/* ==================== 카카오 로그인 모달 ==================== */
.custom-kakao-login-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000000;
}

.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: 12px;
    right: 12px;
    background: none;
    border: none;
    font-size: 28px;
    color: #999;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    line-height: 1;
}

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

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

.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: all 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 1s ease-in-out infinite;
    outline: none !important;
}

/* ==================== 패키지 옵션 하이라이트 ==================== */
.custom-product-option[data-option-type="select"].needs-input-highlight .custom-product-option__field,
.custom-product-option[data-option-type="select"].needs-input-highlight select,
.custom-product-option[data-option-type="package"].needs-input-highlight .custom-product-option__field,
.custom-product-option[data-option-type="package"].needs-input-highlight select {
    border-color: #FEE500 !important;
    border-width: 2px !important;
    animation: border-sparkle 1s ease-in-out infinite;
    outline: none !important;
}

@keyframes border-sparkle {
    0%, 100% {
        border-color: #FEE500;
        box-shadow: 0 0 0 2px rgba(254, 229, 0, 0.4),
                    0 0 10px rgba(254, 229, 0, 0.6),
                    0 0 20px rgba(254, 229, 0, 0.4);
    }
    50% {
        border-color: #FFD700;
        box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.7),
                    0 0 20px rgba(255, 215, 0, 0.9),
                    0 0 40px rgba(255, 215, 0, 0.7);
    }
}

/* ==================== 동적세트 1명/2명 선택 영역 하이라이트 ==================== */
/* 전체 선택 영역에 테두리 펄스 */
.custom-product-option__choices--person-count.needs-input-highlight {
    padding: 8px;
    border-radius: 12px;
    border: 2px solid #FEE500;
    animation: person-count-border-pulse 1s ease-in-out infinite;
    background: rgba(254, 229, 0, 0.05);
}

@keyframes person-count-border-pulse {
    0%, 100% {
        border-color: #FEE500;
        box-shadow: 0 0 0 2px rgba(254, 229, 0, 0.3),
                    0 0 10px rgba(254, 229, 0, 0.5),
                    0 0 20px rgba(254, 229, 0, 0.3);
        background: rgba(254, 229, 0, 0.05);
    }
    50% {
        border-color: #FFD700;
        box-shadow: 0 0 0 4px rgba(255, 215, 0, 0.6),
                    0 0 20px rgba(255, 215, 0, 0.8),
                    0 0 40px rgba(255, 215, 0, 0.6);
        background: rgba(255, 215, 0, 0.1);
    }
}

/* ==================== 모바일 대응 ==================== */
@media (max-width: 768px) {
    .custom-floating-buy-button-container {
        max-width: 100%;
    }
    
    .custom-bottom-sheet-content {
        max-width: 100%;
        border-radius: 20px 20px 0 0;
    }
    
    .custom-kakao-modal-content {
        width: 85%;
    }
}

/* --- Person Info Set Styles --- */
.sts-person-set {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 4px;
}

/* 2번 사람 앞에 구분선 추가 */
.sts-person-divider {
    padding-top: 20px;
    border-top: 1px solid #E5E5E5;
    margin-top: 8px;
}

/* 슬라이드 컨테이너 스타일 */
.sts-person-slider-wrapper {
    width: 100%;
    overflow: hidden;
    position: relative;
    min-height: 100px;
}

.sts-person-slider-container {
    display: flex;
    transition: transform 0.3s ease-in-out;
    transform: translateX(0px);
    will-change: transform;
    position: relative;
}

.sts-person-slide {
    flex-shrink: 0;
    padding: 4px;
    box-sizing: border-box;
    min-width: 0;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* 슬라이드 내부 패딩 */
.sts-person-slide .sts-person-set {
    padding: 0;
}

/* 버튼 레이아웃 개선 */
.custom-bottom-sheet-footer {
    display: flex;
    gap: 8px;
}

.custom-bottom-sheet-footer .sts-person-prev-btn {
    flex: 0 0 auto;
    width: auto !important;
    min-width: 80px;
    margin-right: 0 !important;
}

.custom-bottom-sheet-footer .sts-person-next-btn,
.custom-bottom-sheet-footer .custom-bottom-sheet-submit {
    flex: 1;
}
