/* ========================================
   Gifting Section 스타일
   Gifting Section Styles for Sulwhasoo Holiday Festa
   ======================================== */

/* Gifting Section 기본 스타일 */
.gifting {
    background: transparent;
    position: relative;
    margin: 0;
    padding: 0;
}

/* Gifting 컨테이너 */
.gifting-container {
    max-width: 480px; /* 프로젝트 규칙: 480px 고정 너비 */
    margin: 0 auto; /* 중앙 정렬 */
    padding: 0;
}

/* Gifting 콘텐츠 */
.gifting-content {
    width: 100%;
    margin: 0;
    padding: 0;
}

/* Gifting 이미지 컨테이너 */
.gifting-image-container {
    width: 100%;
    margin: 0;
    padding: 0;
    display: block;
}

/* Gifting 메인 이미지 */
.gifting-main-image {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 0;
    box-shadow: none;
    transition: transform var(--transition-medium);
}

/* Gifting 이미지 호버 효과 - GIF 애니메이션과 충돌 방지 */
.gifting-main-image:hover {
    transform: none; /* GIF 애니메이션과 충돌 방지를 위해 호버 효과 제거 */
}

/* Gifting YouTube iframe 오버레이 컨테이너 */
.gifting-youtube-overlay {
    position: absolute;
    top: 26%; /* 이미지 상단에서 26% 위치로 조정 */
    left: 50%;
    transform: translateX(-50%);
    width: auto; /* 너비 자동 계산 */
    height: 42%; /* 68% - 26% = 42% 높이 */
    z-index: 10;
    border-radius: 0; /* 라운드 제거 */
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    aspect-ratio: 4/5; /* 4:5 비율로 변경 */
}

/* Gifting YouTube iframe */
.gifting-youtube-overlay iframe {
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 0; /* 라운드 제거 */
    object-fit: cover; /* 레터박스 방지 */
    /* 모바일 최적화 */
    -webkit-transform: translate3d(0, 0, 0);
    transform: translate3d(0, 0, 0);
    will-change: auto;
    backface-visibility: visible;
    /* 터치 최적화 */
    touch-action: manipulation;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Gifting 카운트다운 섹션 (Event 스타일로 교체) */
.gifting-countdown-section {
    background: #000;
    color: #fff;
    text-align: center;
    padding: 2rem 1rem;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
    position: relative;
    z-index: 5;
}

/* Gifting 카운트다운 텍스트 (Event 스타일 적용) */
.gifting-countdown-text {
    font-family: 'Theinhardt', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-size: 1.2rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #fff !important;
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
}

/* Gifting 카운트다운 타이머 컨테이너 */
.gifting-countdown-timer {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

/* Gifting 카운트다운 아이템 */
.gifting-countdown-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 60px;
}

/* Gifting 카운트다운 숫자 */
.gifting-countdown-number {
    font-family: 'Theinhardt', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-size: 2.9rem; /* 2.5rem + 4px = 2.9rem (46.4px) */
    font-weight: 700;
    line-height: 1;
    color: #fff;
    display: block;
    margin-bottom: 0.25rem;
}

/* Gifting 카운트다운 라벨 */
.gifting-countdown-label {
    font-family: 'Theinhardt', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-size: 1.3rem; /* 0.9rem + 4px = 1.3rem (20.8px) */
    font-weight: 500;
    color: #fff;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Gifting 카운트다운 구분자 */
.gifting-countdown-separator {
    font-family: 'Theinhardt', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: #fff;
    margin: 0 0.25rem;
    line-height: 1;
}

/* 모바일 최적화 */
@media (max-width: 768px) {
    .gifting-container {
        padding: 0;
    }
    
    .gifting-content {
        padding: 0;
    }
    
    .gifting-image-container {
        margin: 0;
        padding: 0;
    }
    
    .gifting-main-image {
        width: 100%;
        height: auto;
        margin: 0;
        padding: 0;
    }
    
    /* Gifting YouTube iframe 오버레이 모바일 최적화 */
    .gifting-youtube-overlay {
        top: 24%; /* 모바일에서 약간 위로 조정 (26% → 24%) */
        height: 44%; /* 68% - 24% = 44% 높이 */
        width: auto; /* 너비 자동 계산 */
        aspect-ratio: 4/5; /* 4:5 비율 유지 */
        border-radius: 0; /* 라운드 제거 */
    }
    
    .gifting-countdown-container {
        padding: var(--spacing-xs); /* 480px 내에서 최적화된 패딩 */
        gap: var(--spacing-xs);
    }
    
    .gifting-countdown-number {
        font-size: 1.65rem; /* 1.25rem + 4px = 1.65rem (26.4px) */
    }
    
    .gifting-countdown-label {
        font-size: 0.9rem; /* 0.5rem + 4px = 0.9rem (14.4px) */
    }
    
    .gifting-countdown-separator {
        font-size: 1.25rem; /* 480px 내에서 최적화된 폰트 크기 */
        margin: 0 var(--spacing-xs);
    }
}

/* 태블릿 최적화 */
@media (min-width: 769px) and (max-width: 1024px) {
    .gifting-container {
        padding: 0;
    }
    
    .gifting-content {
        padding: 0;
    }
    
    .gifting-main-image {
        width: 100%;
        height: auto;
        margin: 0;
        padding: 0;
    }
    
    .gifting-countdown-container {
        padding: var(--spacing-sm); /* 480px 내에서 최적화된 패딩 */
        gap: var(--spacing-xs);
    }
    
    .gifting-countdown-number {
        font-size: 1.775rem; /* 1.375rem + 4px = 1.775rem (28.4px) */
    }
    
    .gifting-countdown-label {
        font-size: 1.0625rem; /* 0.5625rem + 4px = 1.0625rem (17px) */
    }
    
    .gifting-countdown-separator {
        font-size: 1.375rem; /* 480px 내에서 최적화된 폰트 크기 */
        margin: 0 var(--spacing-xs);
    }
}

/* 데스크톱 최적화 */
@media (min-width: 1025px) {
    .gifting-container {
        padding: 0;
    }
    
    .gifting-content {
        padding: 0;
    }
    
    .gifting-main-image {
        width: 100%;
        height: auto;
        margin: 0;
        padding: 0;
    }
    
    .gifting-countdown-container {
        padding: var(--spacing-sm); /* 480px 내에서 최적화된 패딩 */
        gap: var(--spacing-xs);
    }
    
    .gifting-countdown-number {
        font-size: 1.9rem; /* 1.5rem + 4px = 1.9rem (30.4px) */
    }
    
    .gifting-countdown-label {
        font-size: 1.125rem; /* 0.625rem + 4px = 1.125rem (18px) */
    }
    
    .gifting-countdown-separator {
        font-size: 1.5rem; /* 480px 내에서 최적화된 폰트 크기 */
        margin: 0 var(--spacing-xs);
    }
}

/* 초소형 화면 최적화 */
@media (max-width: 360px) {
    .gifting-youtube-overlay {
        top: 22%; /* 초소형 화면에서 더 위로 (26% → 22%) */
        height: 46%; /* 68% - 22% = 46% 높이 */
        width: auto; /* 너비 자동 계산 */
        aspect-ratio: 4/5; /* 4:5 비율 유지 */
        border-radius: 0; /* 라운드 제거 */
    }
}

/* 접근성 개선 */
@media (prefers-reduced-motion: reduce) {
    .gifting-main-image {
        transition: none;
    }
    
    .gifting-main-image:hover {
        transform: none;
    }
    
    .gifting-overlay-video {
        animation: none;
    }
    
    .gifting-countdown-number,
    .gifting-countdown-label,
    .gifting-countdown-separator {
        transition: none;
    }
}

/* 키보드 네비게이션 */
.gifting-countdown-container:focus {
    outline: 2px solid var(--sulwhasoo-orange);
    outline-offset: 2px;
}

/* 고대비 모드 지원 */
@media (prefers-contrast: high) {
    .gifting {
        background: var(--sulwhasoo-white);
        border: 1px solid var(--sulwhasoo-dark-brown);
    }
    
    .gifting-main-image {
        border: 1px solid var(--sulwhasoo-dark-brown);
    }
    
    .gifting-countdown-section {
        background: #000000;
        border: 2px solid var(--sulwhasoo-white);
    }
    
    .gifting-countdown-number,
    .gifting-countdown-label,
    .gifting-countdown-separator {
        color: var(--sulwhasoo-white);
        font-weight: 700;
    }
}