/* ========================================
   공동구매 공통 스타일
======================================== */

/* 필터 컨테이너 */
.filter-container {
    display: flex;
    gap: 8px;
    align-items: center;
    padding: 16px;
    background-color: #fff;
    position: sticky;
    top: 8.2rem;
    z-index: 10;
}

.filter-btn {
    padding: 0.6rem 1.2rem;
    border: 1px solid #e0e0e0;
    border-radius: 9.9rem;
    background-color: #fff;
    color: #A1A1A1;
    font-size: 1.2rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    white-space: nowrap;
    height: 3.2rem;
}

.filter-btn:hover {
    border-color: #999;
    background-color: #f9f9f9;
}

.filter-btn.active {
    background-color: #121212;
    color: #fff;
    border-color: #121212;
}

.filter-btn:focus {
    outline: none;
}

/* ========================================
   공구상품 리스트
======================================== */
.group-deal-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.group-deal-list li {
    margin: 0 1.6rem 2.4rem;
    border-radius: 1.6rem;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .1);
    background-color: #fff;
}

.group-deal-list li.hidden {
    display: none;
}

.group-deal-list li a {
    text-decoration: none;
    color: inherit;
    display: block !important;
}

/* ========================================
   이미지 영역
======================================== */
.image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 359 / 208;
    overflow: hidden;
}

.image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 종료된 공구 오버레이 */
.end-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #fff;
    z-index: 1;
}

.end-overlay-text {
    font-size: 2rem;
    font-weight: 700;
    margin-bottom: 0.2rem;
}

.end-overlay-subtext {
    font-size: 2rem;
    font-weight: 700;
}

/* ========================================
   배지 영역
======================================== */
.live-badge-wrap {
    position: absolute;
    top: 12px;
    left: 12px;
    display: flex;
    gap: .4rem;
    z-index: 2;
}

.live-badge {
    background-color: #F62E2E;
    color: #fff;
    padding: 0.3rem 0.8rem;
    font-size: 1.2rem;
    font-weight: 600;
    border-radius: 10rem;
    height: 2.4rem;
    display: flex;
    align-items: center;
    position: static;
    line-height: 150%;
    font-family: 'Montserrat';
}

.countdown-badge {
    background-color: #404040;
    color: #fff;
    padding: 0.3rem 0.8rem;
    border-radius: 10rem;
    font-size: 1rem;
    font-weight: 500;
    height: 2.4rem;
    display: flex;
    align-items: center;
    position: static;
    line-height: 150%;
    font-family: "M PLUS 1p";
}

.countdown-badge strong {
    font-size: 1.2rem;
    font-variant-numeric: tabular-nums;
}

/* ========================================
   스케줄 오버레이
======================================== */
.schedule-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    top: 0;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    text-align: center;
    display: flex;
    flex-direction: column;
    justify-content: center;
    pointer-events: none;
}

.schedule-date {
    font-size: 1.6rem;
    font-weight: 600;
    margin-bottom: .8rem;
}

.schedule-time {
    font-size: 2.8rem;
    font-weight: 700;
}

/* ========================================
   상품 정보
======================================== */

.gd-product-info {
    margin: 1.6rem;
    margin-bottom: 0;
}

.gd-product-title {
    font-size: 14px;
    line-height: 1.4;
    color: #333;
    margin-bottom: 8px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.gd-price-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.gd-original-price {
    font-size: 1.2rem;
    color: #121212;
    font-weight: 700;
}

.gd-price-label {
    font-size: 1.6rem;
    color: #FF41A2;
    margin-bottom: 2px;
    font-weight: 700;
}

/* ========================================
   라벨 그룹
======================================== */
.label-group {
    display: flex;
    gap: 0.4rem;
    font-size: 1rem;
    font-weight: 500;
    margin-bottom: 0.4rem;
}

.join-label {
    padding: 0.2rem 0.6rem;
    border-radius: 0.4rem;
    color: #666;
    background: #F4F4F4;
}

.achieve-label {
    padding: 0.2rem 0.6rem;
    border-radius: 0.4rem;
    color: #FF41A2;
    background: #FFF0F8;
}

/* ========================================
   버튼
======================================== */
.button-wrapper {
    padding: 1.6rem;
    padding-top: 0;
}

.action-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: .8rem 1.6rem;
    border-radius: .8rem;
    font-size: 1.4rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    /* margin-top: 1.6rem; */
    height: 4rem;
    border: none;
    text-decoration: none;
}

.action-button.outline {
    background-color: #fff;
    border: 1px solid #FF41A2;
    color: #FF41A2;
}

.action-button.fill {
    background-color: #fff;
    border: 1px solid #d4d4d4;
    color: #333;
}

.action-button.fill:disabled {
    background: #d4d4d4;
    border: 1px solid #d4d4d4;
    color: #a1a1a1;
    cursor: not-allowed;
    opacity: 1;
}

.action-button.fill img {
    width: 1.6rem;
    height: 1.6rem;
    margin-right: .4rem;
}

/* ========================================
   Empty 상태
======================================== */

.gd-empty-list {
    text-align: center;
    padding: 6rem 2.4rem;
    display: none;
}

.gd-empty-list.show {
    display: block;
}

.gd-empty-list img {
    width: 100%;
    height: 8rem;
    margin-bottom: 1.6rem;
}

.gd-empty-list p {
    font-size: 1.4rem;
    color: #666;
    margin-bottom: 2.4rem;
}

.gd-empty-list a {
    display: inline-block;
    padding: 1.2rem 2.4rem;
    background-color: #121212;
    color: #fff;
    text-decoration: none;
    border-radius: .8rem;
    font-size: 1.4rem;
    font-weight: 600;
}


/* ========================================
   Progress Section
======================================== */
.group-deal-list .progress-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 1.6rem;
    background: #F5F5F5;
}

.group-deal-list .progress-bar-wrapper {
    flex: 1;
    margin-right: 1.2rem;
}

.group-deal-list .progress-bar {
    width: 100%;
    height: 0.8rem;
    background: #fff;
    border-radius: 10rem;
    overflow: hidden;
    position: relative;
}

.group-deal-list .progress-fill {
    height: 100%;
    background: #FF41A2 !important;
    border-radius: 10rem;
    transition: width 0.3s ease;
    position: absolute;
    left: 0;
    top: 0;
    z-index: 10;
}

.group-deal-list .progress-text {
    font-size: 1.2rem;
    color: #666;
    white-space: nowrap;
}

/* ========================================
   메인 라이브 카드 전용 스타일
======================================== */
.main-live-wrapper .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 1.6rem;
    padding-bottom: 1.2rem;
}

.main-live-wrapper .header-title {
    font-size: 1.6rem;
    font-weight: 700;
    color: #121212;
    display: flex;
    align-items: center;
    letter-spacing: 0.05rem;
}

.main-live-wrapper .header-more {
    font-size: 1.2rem;
    font-weight: 700;
    color: #A1A1A1;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
}

.main-live-wrapper .header-more img {
    width: 1.6rem;
    height: 1.6rem;
}

.main-live-wrapper .group-deal-list {
    margin: 0 1.6rem 2.4rem;
}

.main-live-wrapper .group-deal-list li {
    margin: 0;
}

.main-live-wrapper .group-deal-list li a {
    display: flex;
    flex-direction: column;
}

.main-live-wrapper .image-wrapper {
    order: 1;
}

.main-live-wrapper .progress-section {
    order: 2;
}

.main-live-wrapper .product-info {
    order: 3;
}

.main-live-wrapper .button-wrapper {
    order: 4;
}

/* 메인 라이브 카드에서는 버튼 숨김 */
.main-live-wrapper .button-wrapper .action-button {
    display: none;
}

.group-deal-survey {
    padding: 1.4rem 2.4rem;
    position: fixed;
    bottom: calc(7.4rem + env(safe-area-inset-bottom, 0px)); /* safe-area 고려 */
    background-color: #404040;
    border-radius: 10rem;
    left: 50%;
    transform: translateX(-50%);
    width: max-content;

}

.group-deal-survey-btn {
    font-weight: 500;
    font-size: 1.5rem;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 0.4rem;

}

    /*공구 상품 요청*/
	.group-deal-preview {
		padding: 2.4rem 0 2.4rem 0;
		background: #f5f5f5;
	}

	.preview-header {
		display: flex;
		justify-content: space-between;
		align-items: center;
		margin-bottom: 1.2rem;
		padding: 0 1.6rem
	}

	.preview-title {
		font-size: 1.3rem;
		font-weight: 600;
		line-height: 1.6rem;
		color: #121212;
	}

	.preview-more {
		display: flex;
		align-items: center;
		gap: 4px;
		font-size: 1.2rem;
		font-weight: 500;
		line-height: 1.6rem;
		color: #a1a1a1;
	}

	.preview-list-wrapper {
		overflow: hidden;
	}

	.preview-swiper {
		overflow: visible;
	}

	.preview-swiper .swiper-slide {
		width: auto;
	}

	/* 카드 스타일 - 가로형 */
	.gd-request-preview-item {
		display: flex;
		align-items: flex-start;
		gap: 0.8rem;
		width: 24rem;
		padding: 0.8rem;
		background: #fff;
		border-radius: 1.2rem;
	}

	.preview-item-image {
		position: relative;
		width: 6rem;
		height: 8rem;
		border-radius: .8rem;
		overflow: hidden;
		background: #f5f5f5;
		flex-shrink: 0;
		border: 1px solid #d4d4d4;
	}

	.preview-item-image img {
		width: 100%;
		height: 100%;
		object-fit: cover;
	}

	.preview-item-image .no-image {
		width: 100%;
		height: 100%;
		display: flex;
		align-items: center;
		justify-content: center;
		background: #f5f5f5;
		color: #ccc;
		font-size: 10px;
	}

	.preview-item-badge {
		padding: .2rem .4rem;
		font-size: 0.8rem;
		font-weight: 500;
	}
	
	.preview-item-badge.reviewing {
		background: #404040;
		color: #fff;
		width: fit-content;
	}

	.preview-item-badge.on-sale {
		background: #1E68FF;
		color: #fff;
		width: fit-content;
	}

	.preview-item-info {
		display: flex;
		flex-direction: column;
		width: 73%;
		height: 100%;
		gap: 0.4rem;
	}

	.preview-item-brand {
		font-size: 1.2rem;
		font-weight: 500;
		color: #737373;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.preview-item-name {
		font-size: 1.2rem;
		color: #121212;
		font-weight: 500;
		line-height: 1.6rem;
		white-space: nowrap;         /* 한 줄로 표시 */
		overflow: hidden;            /* 넘치는 부분 숨김 */
		text-overflow: ellipsis;
	}

	.preview-item-wish {
		display: flex;
		align-items: center;
		gap: .4rem;
		font-size: 1.2rem;
		font-weight: 500;
		color: #a1a1a1;
	}

	.preview-item-wish img {
		width: 1.2rem;
		height: 1.2rem;
	}

    .survey-guide-text {
        background: #F5F5F5;
        padding: 1.6rem;
        font-size:1.2rem;
        color: #737373;
        font-weight: 500;
        line-height: 1.6rem;
    }

    .survey-list-wrapper {
        display: flex;
        flex-direction: column;
        gap: .8rem;
        margin-bottom: 12rem;
        padding: 0 1.6rem;
    }

    .survey-list-item .preview-item-image {
        width: 10.8rem;
        height: 14.4rem;
        object-fit: cover;
    }

    .survey-list-item .gd-request-preview-item {
        width: auto;
        background: #F5F5F5;
        align-items: stretch;
        padding: 1.6rem;
        gap: 1.2rem;
    }

    .survey-list-item .preview-item-info {
        width: 100%;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
        height: auto;
    }

    .preview-item-text-group {
        display: flex;
        flex-direction: column;
        gap: 0.4rem;
    }

    .survey-list-item .preview-item-name {
        white-space: pre-wrap;

    }

    .survey-list-item .preview-item-date {
        font-size: 1.2rem;
        color: #a1a1a1;
        font-weight: 500;
        line-height: 1.4rem;
    }

    .survey-list-wish {
        display: flex;
        align-items: center;
        justify-content: space-between;
        background-color: #fff;
        border-radius: 10rem;
        height: 4rem;
        padding: 1rem 1.6rem;
        color: #a1a1a1;
        font-size: 1.3rem;
        font-weight: 500;
        line-height: 1.6rem;
        box-sizing: border-box;

    }

    .survey-list-wish  .left-section span {
        font-weight: 500;
    }

    @media (min-width: 550px) {
        .survey-list-wish {
            width: 100%;
        }
    }

    .survey-list-wish.on {
        color: #fff;
        background-color: #FF41A2;
    }

    .survey-list-wish .right-section {
        display: flex;
        align-items: center;
    }

    .survey-list-wish .right-section span {
        font-weight: 500;
    }

    .survey-list-wish img {
        width: 1.6rem;
        height: 1.6rem;
        margin-right: 0.4rem;
    }

    .survey-list-container .filter-bar {
        padding: .8rem 1.6rem;
    }

        .survey-write-popup {
        width: 100%;
    }

    .survey-write-popup .survey-guide {
        padding: 1.6rem;
        background: #F5F5F5;
        font-size: 1.2rem;
        font-weight: 500;
        line-height: 1.6;
        color: #737373;
    }

    .survey-write-popup .survey-text {
        padding: 2.4rem 1.6rem;
    }

    .survey-write-popup .survey-text b {
        color: #000000;
        font-size: 1.4rem;
        font-weight: 700;
    }

    .survey-write-popup .survey-text p {
        margin-top: 1.6rem;
        margin-bottom: .8rem;
        font-size: 1.2rem;
        font-weight: 400;
        color: #000000;
        position: relative;
        /* 추가 */
        display: inline-block;
        /* 추가 */
        width: 100%;
        /* 추가 */
    }

    .survey-write-popup .survey-text textarea {
        width: 100%;
        background: #fff;
        border: 1px solid #dcdcdc;
        height: 6vh;
        font-size: 1.3rem;
        padding: 1.4rem 1.2rem;
        box-sizing: border-box;
        resize: none;
        border-radius: 0.8rem;
        color: #000000;
    }

    .survey-write-popup .image-preview {
        display: flex;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .survey-write-popup .image-preview li {
        width: calc(15% + 5rem);
        padding-top: calc(15% + 5rem);
        position: relative;
        display: inline-block;
        overflow: hidden;
        margin-right: 0;
        border-radius: .75rem;
    }

    .survey-write-popup .image-preview {
        display: flex;
        flex-wrap: wrap;
        gap: 1rem;
    }

    .survey-write-popup .image-preview li {
        width: calc(15% + 5rem);
        padding-top: calc(15% + 5rem);
        position: relative;
        display: inline-block;
        overflow: hidden;
        margin-right: 0;
        border-radius: .75rem;
    }

    .gd-request-preview-image {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        border-radius: .75rem;
    }

    .deleteImg {
        position: absolute;
        top: 8px;
        right: 8px;
        width: 24px;
        height: 24px;
        cursor: pointer;
        z-index: 2;
    }

    .survey-write-popup #files {
        display: none;
    }

    .survey-write-popup .file-upload label {
        color: #b0b0b0;
        font-size: calc(.7vh + 8px);
        cursor: pointer;
    }

    @media (max-width: 500rem) {
        .deleteImg {
            width: 1.3rem;
            height: 1.3rem;
        }
    }

    .survey-write-popup .check-icon {
        display: inline-block;
        position: absolute;
        top: 0;
        margin-left: 2px;
        width: 4px;
        height: 4px;
        background-color: red;
        border-radius: 100%;
    }

    .survey-write-popup .survey-text .survey-remarks {
        color: #F62E2E;
        font-size: 1.1rem;
        font-weight: 400;
    }

    .survey-write-popup .button-wrap {
        width: 100%;
        background: #fff;
        position: fixed;
        bottom: 0;
        z-index: 11;
        box-sizing: border-box;
        display: flex;
        align-items: center;
        padding: .8rem 1.6rem;
        padding-bottom: calc(env(safe-area-inset-bottom, 34px) + .8rem);
        box-shadow: 0 .4rem 1.6rem 0 rgba(0, 0, 0, .16);
        max-width: 750px;
    }

    /* iframe 전체 높이 조절을 위한 body 설정 */
    body {
        /* --vh 변수가 없으면 1vh로 작동 */
        min-height: calc(var(--vh, 1vh) * 100);
        overflow-x: hidden;
}

    /* fallback for older browsers */
    @supports not (padding: env(safe-area-inset-bottom)) {
        .survey-write-popup .button-wrap {
            padding-bottom: calc(3.4rem + .8rem); /* iOS용 고정값 */
        }
    }

    .survey-write-popup .button-wrap button:last-child {
        background: #dcdcdc;
        color: #fff;
        margin-left: 0;
        border: #dcdcdc;
        width: 100%;
        height: 4.8rem;
        font-size: 1.5rem;
        font-weight: 600;
        border-radius: 8px;
    }

    .survey-write-popup .button-wrap .writeSurvey.on {
        background: #000000;
        color: #fff;
        margin-left: 0;
        border: #000000;
        width: 100%;
    }

    #survey-confirm-popup {
        position: fixed;
        top: 0;
        /* width: 100%; */
        width: 100vw;
        /* height: 100%; */
        height: 100dvh;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1000;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    #survey-confirm-popup .survey-confirm-content {
        background: #fff;
        border-radius: 12px;
        padding: 2.5rem 2rem;
        width: 85%;
        max-width: 320px;
        text-align: center;
        box-sizing: border-box;
    }

    #survey-confirm-popup .survey-confirm-text {
        font-size: 1.3rem;
        font-weight: 400;
        line-height: 1.6;
        color: #000;
        margin-bottom: 2rem;
        text-align: start;
    }

    #survey-confirm-popup #survey-confirm-ok {
        width: 100%;
        padding: 1.2rem;
        background: #000;
        color: #fff;
        border: none;
        border-radius: 8px;
        font-size: 1.4rem;
        font-weight: 600;
        cursor: pointer;
    }
    .survey-close-btn {
        position: absolute;
        top: 10px;
        right: 10px;
        z-index: 10000;
        width: 32px;
        height: 32px;
        cursor: pointer;
        background: none;
        border: none;
        padding: 0;
    }
    .dim-overlay {
        position: absolute;
        top: 0; left: 0; right: 0; bottom: 0;
        background: rgba(0,0,0,0.3); /* 약간 어두운 회색 투명도 */
        border-radius: .75rem;
        z-index: 1;
        pointer-events: none; /* 클릭 이벤트는 아래로 통과 */
    }

    .preview-swiper .swiper-slide:first-child {
        margin-left: 16px;
    }