/* 상품 상세 페이지 커스텀 스타일 — 캡처 레퍼런스 디자인 */

/* ===== 바디 배경 & Astra 오버라이드 ===== */
body.single-product {
    background-color: #fff !important;
}

body.single-product .ast-container {
    max-width: 100% !important;
    padding: 0 !important;
}

body.single-product .site-content > .ast-container {
    display: block;
}

body.single-product #primary {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    float: none !important;
}

body.single-product #secondary {
    display: none !important;
}

body.single-product .woocommerce-product-gallery,
body.single-product .summary.entry-summary {
    width: 100% !important;
    float: none !important;
    max-width: 100% !important;
}

/* ===== 2단 헤더 레이아웃 ===== */
.product-header-wrapper {
    display: flex;
    gap: 40px;
    margin-bottom: 0;
    align-items: flex-start;
    max-width: 1000px;
    margin-left: auto;
    margin-right: auto;
    padding: 30px 20px 40px;
}

/* ===== 좌측: 이미지 영역 ===== */
.product-left-section {
    flex: 1;
    min-width: 0;
}

.product-thumbnail-column {
    width: 100%;
    position: relative;
    border-radius: 0;
    overflow: hidden;
    background: #f5f5f5;
}

.product-featured-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* 갤러리 썸네일 */
.product-gallery-thumbs {
    display: flex;
    gap: 8px;
    margin-top: 12px;
    overflow-x: auto;
}

.product-gallery-thumbs .gallery-thumb {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 0;
    overflow: hidden;
    border: 1px solid #e5e5e5;
    cursor: pointer;
    transition: border-color 0.2s;
    background: #f9f9f9;
}

.product-gallery-thumbs .gallery-thumb:hover,
.product-gallery-thumbs .gallery-thumb.active {
    border-color: #333;
}

.product-gallery-thumbs .gallery-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* ===== 우측: 사이드바 ===== */
.product-right-section {
    width: 380px;
    flex-shrink: 0;
}

.product-sidebar-inner {
    background: #ffffff;
    border: none;
    border-radius: 0;
    padding: 0;
}

/* ===== 사이드바: 제목 ===== */
.product-sidebar-inner .product-info-top {
    padding: 0 0 20px 0;
    margin-bottom: 20px;
    border-bottom: 1px solid #e5e5e5;
}

.product-sidebar-inner .product-title {
    font-size: 20px;
    font-weight: 700;
    margin: 0 0 8px;
    line-height: 1.4;
    color: #111;
}

.product-sidebar-inner .product-info-top .stock {
    font-size: 14px;
    margin: 0;
}

.product-sidebar-inner .product-info-top .stock.in-stock {
    color: #4CAF50;
}

.product-sidebar-inner .product-info-top .stock.out-of-stock {
    color: #e74c3c;
}

/* ===== 사이드바: 가격 ===== */
.product-price-wrapper {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e5e5e5;
}

.product-discount-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 6px;
}

.product-discount-badge {
    display: inline-block;
    background: transparent;
    color: #e85454;
    padding: 0;
    border-radius: 0;
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 0;
}

.product-price-info {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.product-regular-price {
    font-size: 16px;
    color: #999;
    text-decoration: line-through;
    font-weight: 400;
}

.product-regular-price .price-unit {
    font-size: 14px;
    color: #999;
    text-decoration: line-through;
}

.product-sale-price,
.product-current-price {
    font-size: 26px;
    font-weight: 700;
    color: #111;
    letter-spacing: -0.5px;
}

.price-unit {
    font-size: 16px;
    margin-left: 2px;
    font-weight: 400;
}

/* ===== 사이드바: 액션 버튼 ===== */
.product-action-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.product-icons {
    display: flex;
    align-items: center;
    gap: 6px;
}

/* 인라인 구매 폼 */
.product-icons .product-buy-form {
    flex: 1;
    margin: 0;
    padding: 0;
}

.product-icons .icon-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    background: #fff;
    border: 1px solid #d5d5d5;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.2s ease;
    color: #555;
    padding: 0;
    flex-shrink: 0;
}

.product-icons .icon-btn:hover {
    border-color: #999;
    color: #333;
    background: #f9f9f9;
}

.product-icons .icon-btn svg {
    pointer-events: none;
    flex-shrink: 0;
    width: 20px;
    height: 20px;
}

.product-icons .icon-btn span:not(.product-wishlist-count) {
    display: none;
}

/* 찜하기 버튼 */
.product-icons .icon-btn.product-wishlist-btn {
    position: relative;
}

.product-icons .icon-btn.product-wishlist-btn img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    transition: all 0.2s ease;
    /* 흰색 아이콘을 어두운색으로 변경 */
    filter: brightness(0) saturate(100%) invert(40%);
}

.product-icons .icon-btn.product-wishlist-btn.wishlisted img {
    filter: none;
}

/* 찜하기 카운트 배지 */
.product-icons .icon-btn.product-wishlist-btn .product-wishlist-count {
    position: absolute;
    top: -6px;
    right: -6px;
    background-color: #e85454;
    color: white;
    font-size: 10px;
    padding: 0 4px;
    border-radius: 50%;
    min-width: 16px;
    height: 16px;
    text-align: center;
    box-sizing: border-box;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

/* 장바구니 아이콘 버튼 */
.product-icons .icon-btn.cart-btn {
    position: relative;
}

/* 구매/장바구니 담기 버튼 — 아이콘 옆 인라인 */
.btn-buy-now {
    width: 100%;
    padding: 0 16px;
    height: 46px;
    background: #e85454;
    border: none;
    border-radius: 5px;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.btn-buy-now:hover {
    background: #d44;
}

.btn-buy-now:disabled {
    background: #ccc;
    color: #fff;
    cursor: not-allowed;
}

/* ===== 가변 상품: 옵션 인라인 ===== */
.product-variations-inline {
    margin-top: 0;
    padding-top: 0;
    border-top: none;
}

.product-variations-inline .variations {
    width: 100%;
    border: 0;
    border-collapse: collapse;
}

.product-variations-inline .variations tr {
    display: flex;
    flex-direction: column;
    margin-bottom: 12px;
}

.product-variations-inline .variations tr:last-child {
    margin-bottom: 0;
}

.product-variations-inline .variations th.label {
    text-align: left;
    padding: 0;
    margin-bottom: 6px;
}

.product-variations-inline .variations th.label label {
    font-size: 14px;
    font-weight: 600;
    color: #333;
}

.product-variations-inline .variations td.value {
    padding: 0;
}

.product-variations-inline .variations td.value select {
    width: 100%;
    padding: 11px 14px;
    border: 1px solid #d5d5d5;
    border-radius: 0;
    font-size: 14px;
    background: #fff;
    color: #333;
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    cursor: pointer;
}

.product-variations-inline .variations td.value select:focus {
    outline: none;
    border-color: #333;
}

.product-variations-inline .reset_variations {
    display: inline-block;
    margin-top: 8px;
    font-size: 12px;
    color: #999;
    text-decoration: underline;
}

.product-variations-inline .reset_variations:hover {
    color: #333;
}

/* 가변 상품 가격 (선택 후 표시) */
.product-variations-inline .single_variation_wrap .woocommerce-variation-price {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid #e5e5e5;
}

.product-variations-inline .single_variation_wrap .woocommerce-variation-price .price {
    font-size: 18px;
    font-weight: 700;
    color: #111;
}

.product-variations-inline .single_variation_wrap .woocommerce-variation-description {
    margin-top: 8px;
    font-size: 13px;
    color: #666;
}

.product-variations-inline .single_variation_wrap .woocommerce-variation-availability {
    margin-top: 6px;
}

/* 가변 상품 장바구니 버튼 영역 */
.product-variations-inline .single_variation_wrap .woocommerce-variation-add-to-cart {
    margin-top: 15px;
}

.product-variations-inline .single_variation_wrap .woocommerce-variation-add-to-cart .quantity {
    display: none !important;
}

.product-variations-inline .single_variation_wrap .single_add_to_cart_button {
    width: 100%;
    padding: 0 20px;
    height: 52px;
    background: #e85454;
    border: none;
    border-radius: 0;
    color: #fff;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.product-variations-inline .single_variation_wrap .single_add_to_cart_button:hover {
    background: #d44;
}

.product-variations-inline .single_variation_wrap .single_add_to_cart_button.disabled,
.product-variations-inline .single_variation_wrap .single_add_to_cart_button:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* ===== 상품 설명 섹션 ===== */
.product-description-section {
    max-width: 1000px;
    margin: 0 auto;
    padding: 30px 20px;
    border-top: 1px solid #e5e5e5;
    box-sizing: border-box;
}

.product-description-section .section-title {
    font-size: 18px;
    font-weight: 700;
    color: #111;
    margin: 0 0 20px 0;
    line-height: 1.2;
}

.product-description-section .description-content {
    font-size: 15px;
    line-height: 1.7;
    color: #333;
}

.product-description-section .description-content p {
    margin: 0 0 12px 0;
}

.product-description-section .description-content p:last-child {
    margin-bottom: 0;
}

.product-description-section .description-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0;
    box-shadow: none;
}

/* ===== 링크 복사 알림 ===== */
.copy-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: #323232;
    color: white;
    padding: 12px 20px;
    border-radius: 4px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    z-index: 10000;
    animation: slideIn 0.3s ease;
}

@keyframes slideIn {
    from {
        transform: translateX(100%);
        opacity: 0;
    }
    to {
        transform: translateX(0);
        opacity: 1;
    }
}

/* ===== 반응형: 1024px 이하 — 1단 스택 ===== */
@media (max-width: 1024px) {
    .product-header-wrapper {
        flex-direction: column;
        gap: 25px;
        padding: 20px 15px 30px;
    }

    .product-left-section {
        width: 100%;
    }

    .product-right-section {
        width: 100%;
    }

    .product-sidebar-inner .product-title {
        font-size: 18px;
    }
}

/* ===== 반응형: 768px 이하 ===== */
@media (max-width: 768px) {
    .product-header-wrapper {
        padding: 15px 15px 25px;
    }

    .product-sidebar-inner .product-title {
        font-size: 17px;
        margin-bottom: 6px;
    }

    .product-sale-price,
    .product-current-price {
        font-size: 22px;
    }

    .btn-buy-now,
    .product-variations-inline .single_variation_wrap .single_add_to_cart_button {
        height: 48px;
        font-size: 15px;
    }

    .product-icons .icon-btn {
        width: 42px;
        height: 42px;
    }

    .product-gallery-thumbs .gallery-thumb {
        width: 60px;
        height: 60px;
    }

    .product-description-section {
        padding: 20px 15px;
    }

    .product-description-section .section-title {
        font-size: 16px;
    }
}
