/* ATI Hair Gallery - 완전 최적화된 CSS (모든 기능 보존) */

/* ===== 기본 설정 ===== */
.ati-hair-gallery,
.ati-hair-gallery * {
   font-family: 'Noto Sans KR', 'Malgun Gothic', 'Apple SD Gothic Neo', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
   box-sizing: border-box;
}

/* ===== 갤러리 메인 컨테이너 ===== */
.ati-hair-gallery {
   position: relative;
   width: 100%;
   min-height: 100vh;
   background: #fefefe;
   clear: both;
   display: block;
   overflow: hidden;
   margin: 0;
   padding: 0;
   z-index: 1;
}

/* PC: 제한된 폭 사용 + 워드프레스 오버라이드 */
@media (min-width: 769px) {
   .ati-hair-gallery {
       width: 100% !important;
       max-width: 1500px !important;  /* 1300px → 1500px */
       margin: 0 auto !important;
       left: auto !important;
       right: auto !important;
       display: block !important;
       position: relative !important;
       overflow: visible !important;  /* 추가 */
   }
   
   .entry-content .ati-hair-gallery,
   .content .ati-hair-gallery,
   .main .ati-hair-gallery,
   .post-content .ati-hair-gallery,
   article .ati-hair-gallery,
   .container .ati-hair-gallery,
   .wrap .ati-hair-gallery,
   .site-content .ati-hair-gallery {
       width: 100% !important;
       max-width: 1500px !important;  /* 1300px → 1500px */
       margin: 0 auto !important;
       position: relative !important;
       left: auto !important;
       right: auto !important;
       margin-left: auto !important;
       margin-right: auto !important;
   }
}

/* ===== 갤러리 내부 컨텐츠 ===== */
.ati-gallery-content {
   max-width: 1500px;  /* 1400px → 1500px */
   margin: 0 auto;
   padding: 20px;
   position: relative;
   z-index: 2;
}

/* ===== 브랜드 헤더 ===== */
.ati-gallery-header {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    border: 1px solid #e9ecef;
    text-align: center;
}

.ati-brand-header h2 {
    margin: 0 0 10px 0;
    color: #007cba;
    font-size: 24px;
    font-weight: 700;
}

.ati-brand-header p {
    margin: 0 0 20px 0;
    color: #666;
    font-size: 14px;
}

/* ===== 필터 섹션 ===== */
.ati-filters {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
}

.ati-filters input,
.ati-filters select,
.ati-filters button {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.ati-filters input:focus,
.ati-filters select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 2px rgba(0, 124, 186, 0.1);
}

.ati-filters button {
    background: linear-gradient(135deg, #007cba 0%, #005a87 100%);
    color: white;
    cursor: pointer;
    font-weight: 600;
    border: none;
}

.ati-filters button:hover {
    background: linear-gradient(135deg, #005a87 0%, #004066 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3);
}

/* ===== 선택 정보 섹션 ===== */
.ati-selected-info {
    background: linear-gradient(135deg, #e3f2fd 0%, #f0f8ff 100%);
    padding: 25px;
    border-radius: 12px;
    margin-bottom: 25px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.08);
    border: 1px solid #e1e5e9;
}

.ati-version-info {
    background: #e3f2fd;
    padding: 15px;
    border-radius: 8px;
    margin-top: 5px;
    border-left: 4px solid #2196f3;
}

.ati-version-info h4 {
    margin: 0 0 10px 0;
    color: #1976d2;
    font-size: 14px;
    text-align: left;
}

.ati-price-status-line {
    text-align: left;
    margin-top: 10px;
    font-size: 18px;
    font-weight: 600;
    color: #007cba;
}

.ati-price-status-line span {
    margin-right: 20px;
    display: inline-block;
}

.ati-price-guide {
    font-size: 14px;
    color: #666;
    margin-top: 5px;
}

/* ===== 액션 박스 (이메일 + 버튼) ===== */
.ati-action-boxes {
    display: flex;
    gap: 10px;
    justify-content: flex-start;
    flex-wrap: wrap;
}

.ati-email-box {
    display: flex;
    gap: 10px;
}

.ati-email-box input {
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.ati-email-box input:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1);
}

.ati-action-boxes button {
    padding: 12px 24px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    transition: all 0.3s ease;
}

#ati-add-to-cart {
    background: linear-gradient(135deg, #007cba 0%, #005a87 100%);
    color: white;
}

#ati-add-to-cart:hover:not(:disabled) {
    background: linear-gradient(135deg, #005a87 0%, #004066 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0, 124, 186, 0.3);
}

#ati-add-to-cart:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

#ati-clear-selection {
    background: linear-gradient(135deg, #6c757d 0%, #545b62 100%);
    color: white;
}

#ati-clear-selection:hover {
    background: linear-gradient(135deg, #545b62 0%, #495057 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.3);
}

/* ===== 갤러리 그리드 ===== */
.ati-gallery-grid {
    position: relative;
    z-index: 2;
    min-height: 200px;
    margin-bottom: 30px;
    background: #fefefe;
    padding: 30px 20px;
    display: grid;
    gap: 20px;
    justify-content: center;
}

/* PC: 6-7열 그리드 */
@media (min-width: 1200px) {
    .ati-gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        padding: 30px 60px;
        gap: 25px;
    }
}

/* 태블릿: 4-5열 그리드 */
@media (min-width: 769px) and (max-width: 1199px) {
    .ati-gallery-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
        padding: 30px 40px;
        gap: 20px;
    }
}

/* 모바일: 2열 그리드 강제 적용 */
@media (max-width: 768px) {
    .ati-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        padding: 20px 15px;
    }
}

/* 작은 모바일: 여전히 2열 유지 */
@media (max-width: 480px) {
    .ati-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        padding: 15px 10px;
    }
}

/* ===== 이미지 카드 ===== */
.ati-image-card {
    border: 1px solid #ddd;
    border-radius: 12px;
    overflow: hidden;
    background: white;
    transition: all 0.3s ease;
    position: relative;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.ati-image-card:hover {
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
    transform: translateY(-3px);
}

.ati-image-card.selected {
    border-color: #007cba;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.2);
    transform: translateY(-2px);
}

/* ===== 품절 상품 스타일 ===== */
.ati-image-card.sold-out {
    opacity: 0.75;
}

.ati-image-card.sold-out::before {
    content: '품절';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: linear-gradient(135deg, #dc3545 0%, #c82333 100%);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-weight: 700;
    font-size: 14px;
    z-index: 10;
    pointer-events: none;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.4);
}

.ati-image-card.sold-out .ati-image-container {
    filter: grayscale(60%) brightness(0.8);
}

.ati-image-card.sold-out:hover {
    transform: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* ===== 이미지 컨테이너 ===== */
.ati-image-container {
    position: relative;
    width: 100%;
    aspect-ratio: 3/4;
    overflow: hidden;
    cursor: pointer;
}

.ati-image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    image-rendering: high-quality;
}

.ati-image-card:hover .ati-image-container img {
    transform: scale(1.05);
}

/* ===== 이미지 정보 ===== */
.ati-image-info {
    padding: 15px;
    text-align: center;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
}

.ati-image-info h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    flex: 1;
}

.ati-image-info .ati-checkbox-container {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-shrink: 0;
}

.ati-image-info .ati-image-select {
    margin: 0;
    transform: scale(1.3);
    accent-color: #007cba;
    cursor: pointer;
}

.ati-image-info .ati-select-label {
    font-size: 12px;
    color: #007cba;
    white-space: nowrap;
    font-weight: 600;
    cursor: pointer;
    padding: 6px 12px;
    background: #f8f9fa;
    border: 2px solid #007cba;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.ati-image-info .ati-select-label:hover {
    background: #007cba;
    color: white;
}

.ati-sold-out-label {
    font-size: 12px;
    color: #dc3545;
    font-weight: 700;
    text-transform: uppercase;
}

/* 숨겨진 검색 텍스트 */
.ati-hidden-title {
    display: none !important;
    visibility: hidden !important;
    opacity: 0 !important;
    position: absolute !important;
    left: -9999px !important;
}

/* ===== 선택된 이미지 썸네일 ===== */
.ati-selected-thumbnails {
    background: white;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: 1px solid #e9ecef;
}

.ati-selected-thumbnails h4 {
    margin: 0 0 15px 0;
    font-size: 16px;
    color: #333;
    font-weight: 600;
}

.ati-thumbnails-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(90px, 1fr));
    gap: 12px;
    align-items: start;
}

.ati-thumbnail-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    background: #f8f9fa;
    border-radius: 8px;
    padding: 8px;
    border: 1px solid #e9ecef;
    transition: all 0.3s ease;
    position: relative;
}

.ati-thumbnail-item:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.ati-thumbnail-item img {
    width: 60px;
    height: 80px;
    object-fit: cover;
    border-radius: 6px;
    margin-bottom: 6px;
}

.ati-thumbnail-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    width: 100%;
}

.ati-thumbnail-name {
    font-size: 10px;
    color: #666;
    text-align: center;
    font-weight: 500;
    line-height: 1.2;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ati-thumbnail-versions {
    font-size: 8px;
    color: #007cba;
    font-weight: 600;
    background: #e3f2fd;
    padding: 1px 4px;
    border-radius: 3px;
    text-align: center;
}

.ati-thumbnail-remove {
    position: absolute;
    top: -6px;
    right: -6px;
    background: #dc3545;
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    width: 20px;
    height: 20px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 15;
    box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}

.ati-thumbnail-remove:hover {
    background: #c82333;
    transform: scale(1.15);
    box-shadow: 0 3px 8px rgba(220, 53, 69, 0.5);
}

.ati-thumbnail-remove::before {
    content: '×';
    font-size: 12px;
    line-height: 1;
}

/* ===== 페이지네이션 ===== */
.ati-pagination {
    text-align: center;
    margin: 30px 0;
    position: relative;
    z-index: 2;
}

.ati-pagination-wrapper {
    display: inline-flex;
    gap: 5px;
    align-items: center;
    flex-wrap: wrap;
    justify-content: center;
}

.ati-page-btn {
    display: inline-block;
    padding: 10px 15px;
    margin: 0;
    border: 1px solid #ddd;
    background: white;
    color: #007cba;
    text-decoration: none;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    min-width: 44px;
    text-align: center;
}

.ati-page-btn:hover:not(.disabled):not(.current) {
    background: #007cba;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 124, 186, 0.3);
}

.ati-page-btn.current {
    background: #007cba;
    color: white;
    cursor: default;
    box-shadow: 0 2px 8px rgba(0, 124, 186, 0.3);
}

.ati-page-btn.disabled {
    color: #ccc;
    cursor: not-allowed;
    border-color: #eee;
    background: #f8f9fa;
}

.ati-page-dots {
    padding: 10px 8px;
    color: #666;
    font-weight: 600;
}

/* ===== 이미지 모달 ===== */
.ati-image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.ati-image-modal.show {
    display: flex !important;
}

.ati-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.9);
    backdrop-filter: blur(6px);
    cursor: pointer;
    z-index: 9999;
}

.ati-modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    max-width: 700px;
    max-height: 95vh;
    width: 90vw;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 25px 80px rgba(0,0,0,0.6);
    z-index: 10001;
}

/* ===== 모달 이미지 컨테이너 ===== */
.ati-modal-image-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 50px 80px 20px 80px;
    background: #f8f9fa;
    min-height: 500px;
    max-height: 80vh;
    position: relative;
}

.ati-modal-image-container img {
    width: auto;
    height: auto;
    max-width: calc(100% - 100px);
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 8px 30px rgba(0,0,0,0.15);
    aspect-ratio: 3/4;
    background: white;
    min-width: 360px;
    min-height: 480px;
    image-rendering: high-quality;
}

/* ===== 모달 버튼들 ===== */
.ati-modal-close {
    position: absolute;
    top: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 30px;
    background: rgba(220, 53, 69, 0.95);
    border: none;
    border-radius: 15px;
    color: white;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    z-index: 10003;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.4);
}

.ati-modal-close:hover {
    background: rgba(220, 53, 69, 1);
    transform: translateX(-50%) scale(1.05);
}

.ati-modal-close::before {
    content: '닫기';
}

.ati-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 100px;
    background: rgba(0, 0, 0, 0.8);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 16px;
    font-weight: 900;
    cursor: pointer;
    z-index: 10002;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.ati-modal-nav:hover:not(:disabled) {
    background: rgba(0, 124, 186, 0.9);
    transform: translateY(-50%) scale(1.05);
}

.ati-modal-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    background: rgba(0, 0, 0, 0.3);
}

.ati-modal-prev {
    left: 25px;
}

.ati-modal-prev::before {
    content: '‹';
    font-size: 24px;
}

.ati-modal-next {
    right: 25px;
}

.ati-modal-next::before {
    content: '›';
    font-size: 24px;
}

/* ===== 모달 정보 섹션 ===== */
.ati-modal-info {
    padding: 20px 25px;
    border-top: 1px solid #eee;
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    flex-shrink: 0;
    z-index: 10001;
}

.ati-modal-title-and-select {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 15px;
}

.ati-modal-info h3 {
    margin: 0;
    font-size: 16px;
    color: #333;
    font-weight: 600;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.ati-modal-select {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-shrink: 0;
}

.ati-modal-select input {
    transform: scale(1.4);
    accent-color: #007cba;
    margin: 0;
    cursor: pointer;
}

.ati-modal-select input:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.ati-modal-select label {
    font-size: 14px;
    color: #007cba;
    font-weight: 600;
    cursor: pointer;
    margin: 0;
    white-space: nowrap;
}

/* ===== 알림 시스템 ===== */
.ati-notification {
    position: fixed;
    top: 20px;
    right: 20px;
    background: white;
    border-radius: 8px;
    padding: 15px 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.15);
    z-index: 10003;
    max-width: 400px;
    border-left: 4px solid;
    display: flex;
    align-items: center;
    gap: 10px;
    animation: notificationSlideIn 0.3s ease;
}

@keyframes notificationSlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.ati-notification-success {
    border-left-color: #28a745;
    background: linear-gradient(135deg, #d4edda 0%, #ffffff 100%);
}

.ati-notification-error {
    border-left-color: #dc3545;
    background: linear-gradient(135deg, #f8d7da 0%, #ffffff 100%);
}

.ati-notification-warning {
    border-left-color: #ffc107;
    background: linear-gradient(135deg, #fff3cd 0%, #ffffff 100%);
}

.ati-notification-info {
    border-left-color: #17a2b8;
    background: linear-gradient(135deg, #d1ecf1 0%, #ffffff 100%);
}

.ati-notification-close {
    background: none;
    border: none;
    font-size: 18px;
    cursor: pointer;
    color: #666;
    margin-left: auto;
    flex-shrink: 0;
    transition: color 0.3s ease;
}

.ati-notification-close:hover {
    color: #333;
    transform: scale(1.1);
}

/* ===== 구매 이력 경고 ===== */
.ati-purchase-warning {
    background: linear-gradient(135deg, #fff3cd 0%, #ffffff 100%);
    border: 2px solid #ffc107;
    border-radius: 10px;
    padding: 20px;
    margin-top: 20px;
    box-shadow: 0 4px 15px rgba(255, 193, 7, 0.2);
}

.ati-warning-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.ati-warning-icon {
    font-size: 24px;
    color: #856404;
}

.ati-warning-content {
    margin-bottom: 15px;
    color: #856404;
    line-height: 1.5;
}

.ati-warning-content code {
    background: rgba(133, 100, 4, 0.1);
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 12px;
}

.ati-warning-actions {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
}

.ati-remove-duplicates-btn {
    background: #ffc107;
    color: #212529;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-weight: 600;
    font-size: 13px;
    transition: all 0.3s ease;
}

.ati-remove-duplicates-btn:hover {
    background: #e0a800;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(255, 193, 7, 0.3);
}

.ati-image-card.duplicate-purchased {
    border-color: #ffc107;
    background: linear-gradient(135deg, #fff3cd 0%, #ffffff 100%);
}

/* ===== 상태 메시지들 ===== */
.ati-loading,
.ati-no-results,
.ati-error {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px 20px;
    border-radius: 8px;
    color: #6c757d;
}

.ati-loading {
    background: #f8f9fa;
}

.ati-loading::after {
    content: '';
    display: inline-block;
    width: 20px;
    height: 20px;
    margin-left: 10px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #007cba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.ati-no-results {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 2px dashed #dee2e6;
}

.ati-no-results::before {
    content: '🔍';
    display: block;
    font-size: 48px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.ati-error {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

.ati-error::before {
    content: '⚠️';
    display: block;
    font-size: 32px;
    margin-bottom: 10px;
}

/* ===== 체크아웃 페이지 이미지 표시 ===== */
.ati-checkout-images {
    background: linear-gradient(135deg, #f8f9fa 0%, #ffffff 100%);
    border: 1px solid #e9ecef;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    margin: 20px 0;
    padding: 15px;
}

.ati-checkout-images h4 {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
    margin: 0 0 15px 0;
    color: #007cba;
    font-size: 14px;
}

.ati-checkout-images img {
    border: 1px solid #dee2e6;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* ===== 장바구니 페이지 이미지 표시 ===== */
.ati-cart-thumbnails {
    margin-top: 10px;
}

.ati-cart-thumbnails img {
    border: 1px solid #e9ecef;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

/* ===== 모바일 최적화 ===== */
@media (max-width: 768px) {
    /* 갤러리 컨테이너 */
    .ati-gallery-content {
        padding: 15px;
    }
    
    /* 헤더 */
    .ati-gallery-header {
        margin: 15px 0;
        padding: 15px;
    }
    
    .ati-brand-header h2 {
        font-size: 20px;
    }
    
    .ati-brand-header p {
        font-size: 13px;
    }
    
    /* 필터 */
    .ati-filters {
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
    }
    
    .ati-filters input,
    .ati-filters select,
    .ati-filters button {
        width: 100%;
        margin-bottom: 5px;
        padding: 8px 10px;
        font-size: 13px;
    }
    
    /* 선택 정보 */
    .ati-selected-info {
        margin: 15px 0;
        padding: 15px;
    }
    
    .ati-price-status-line {
        font-size: 14px;
        margin-bottom: 15px;
    }
    
    .ati-price-status-line span {
        display: block;
        margin: 5px 0;
        text-align: center;
    }
    
    .ati-price-guide {
        font-size: 11px !important;
        line-height: 1.4;
        margin-top: 8px;
    }
    
    /* 액션 박스 */
    .ati-action-boxes {
        flex-direction: column;
        gap: 12px;
    }
    
    .ati-email-box {
        flex-direction: column;
        width: 100%;
        gap: 8px;
    }
    
    .ati-email-box input {
        width: 100%;
        box-sizing: border-box;
    }
    
    .ati-action-boxes button {
        width: 100%;
        padding: 12px;
        font-size: 14px;
    }
    
    /* 이미지 정보 */
    .ati-image-info {
        padding: 10px;
        flex-direction: column;
        gap: 8px;
    }
    
    .ati-image-info h4 {
        font-size: 12px;
        text-align: center;
    }
    
    .ati-image-info .ati-checkbox-container {
        justify-content: center;
    }
    
    /* 썸네일 */
    .ati-thumbnails-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
        gap: 10px;
    }
    
    .ati-thumbnail-item img {
        width: 60px;
        height: 80px;
    }
    
    .ati-thumbnail-name {
        font-size: 10px;
        max-width: 80px;
    }
    
    .ati-thumbnail-remove {
        width: 20px;
        height: 20px;
        font-size: 12px;
    }
    
    /* 페이지네이션 */
    .ati-pagination {
        padding: 0 10px;
    }
    
    .ati-pagination-wrapper {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .ati-page-btn {
        min-width: 40px;
        padding: 8px 12px;
    }
    
    /* 모달 */
    .ati-modal-content {
        max-width: 95vw;
        max-height: 95vh;
        margin: 10px;
        width: calc(100vw - 20px);
    }
    
    .ati-modal-image-container {
        padding: 45px 20px 15px 20px;
        min-height: 400px;
        max-height: 70vh;
    }
    
    .ati-modal-image-container img {
        max-width: calc(100% - 40px);
        width: calc(100vw - 100px);
        height: calc((100vw - 100px) * 4 / 3);
        max-height: calc(70vh - 60px);
        min-width: 240px;
        min-height: 320px;
    }
    
    .ati-modal-nav {
        width: 35px;
        height: 80px;
        font-size: 14px;
    }
    
    .ati-modal-nav::before {
        font-size: 20px !important;
    }
    
    .ati-modal-prev {
        left: 20px;
    }
    
    .ati-modal-next {
        right: 20px;
    }
    
    .ati-modal-close {
        top: 8px;
        width: 60px;
        height: 28px;
        font-size: 11px;
        border-radius: 14px;
    }
    
    .ati-modal-close::before {
        content: '닫기';
    }
    
    .ati-modal-info {
        padding: 15px 20px;
    }
    
    .ati-modal-info h3 {
        font-size: 14px;
    }
    
    /* 알림 */
    .ati-notification {
        top: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
    }
    
    /* 구매 경고 */
    .ati-purchase-warning {
        margin: 15px 0;
        padding: 15px;
    }
    
    .ati-warning-actions {
        justify-content: center;
    }
    
    .ati-remove-duplicates-btn {
        width: 100%;
        padding: 12px;
    }
    
    /* 체크아웃 이미지 */
    .ati-checkout-images {
        margin: 15px 0;
        padding: 15px;
    }
    
    .ati-checkout-images h4 {
        font-size: 14px;
    }
    
    .ati-checkout-images img {
        width: 50px;
        height: 66px;
    }
    
    /* 상태 메시지 */
    .ati-no-results {
        padding: 40px 15px;
    }
    
    .ati-no-results::before {
        font-size: 36px;
        margin-bottom: 10px;
    }
    
    .ati-no-results p {
        font-size: 14px;
    }
}

/* ===== 작은 모바일 (480px 이하) ===== */
@media (max-width: 480px) {
    .ati-gallery-content {
        padding: 10px;
    }
    
    .ati-gallery-header {
        padding: 15px 10px;
    }
    
    .ati-brand-header h2 {
        font-size: 18px;
    }
    
    .ati-brand-header p {
        font-size: 12px;
    }
    
    .ati-selected-info {
        margin: 10px 0;
        padding: 12px;
    }
    
    .ati-image-info h4 {
        font-size: 12px;
    }
    
    .ati-thumbnails-grid {
        grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
        gap: 8px;
    }
    
    .ati-thumbnail-item img {
        width: 50px;
        height: 66px;
    }
    
    .ati-thumbnail-name {
        font-size: 9px;
        max-width: 60px;
    }
    
    .ati-modal-content {
        max-width: 98vw;
        margin: 5px;
        width: calc(100vw - 10px);
    }
    
    .ati-modal-image-container {
        padding: 40px 15px 10px 15px;
        min-height: 350px;
        max-height: 65vh;
    }
    
    .ati-modal-image-container img {
        width: calc(100vw - 80px);
        height: calc((100vw - 80px) * 4 / 3);
        max-width: calc(100vw - 80px);
        max-height: calc(65vh - 50px);
        min-width: 200px;
        min-height: 267px;
    }
    
    .ati-modal-prev {
        left: 5px;
        width: 30px;
        height: 60px;
    }
    
    .ati-modal-next {
        right: 5px;
        width: 30px;
        height: 60px;
    }
    
    .ati-pagination {
        padding: 0 5px;
    }
}

/* ===== 접근성 및 사용성 개선 ===== */
.ati-hair-gallery button:focus,
.ati-hair-gallery input:focus,
.ati-hair-gallery select:focus {
    outline: 2px solid #007cba !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1) !important;
}

.ati-image-card:focus {
    outline: 2px solid #007cba !important;
    outline-offset: 2px !important;
    box-shadow: 0 0 0 3px rgba(0, 124, 186, 0.1) !important;
}

/* 모달 열렸을 때 body 스크롤 방지 */
body.modal-open {
    overflow: hidden;
}

/* 터치 디바이스 최적화 */
.ati-modal-content {
    touch-action: pan-y pinch-zoom !important;
}

.ati-modal-image-container {
    touch-action: manipulation !important;
    user-select: none !important;
    -webkit-user-select: none !important;
}

@media (hover: none) and (pointer: coarse) {
    .ati-modal-image-container img {
        user-select: none;
        -webkit-user-select: none;
        -webkit-touch-callout: none;
        -webkit-user-drag: none;
    }
}

/* 애니메이션 감소 옵션 */
@media (prefers-reduced-motion: reduce) {
    .ati-image-card,
    .ati-filters button,
    .ati-action-boxes button,
    .ati-page-btn,
    .ati-modal-nav,
    .ati-modal-close,
    .ati-notification,
    .ati-purchase-warning,
    .ati-thumbnail-item {
        transition: none;
        animation: none;
    }
    
    .ati-loading::after {
        animation: none;
    }
    
    .ati-thumbnail-remove:hover,
    .ati-modal-nav:hover,
    .ati-modal-close:hover {
        transform: none;
    }
}

/* 🔒 보안 강화 CSS - 레이아웃 영향 제거 버전 */
.ati-hair-gallery img:not(.admin-mode),
.ati-checkout-images img:not(.admin-mode) {
    -webkit-user-select: none !important;
    -moz-user-select: none !important;
    -ms-user-select: none !important;
    user-select: none !important;
    -webkit-user-drag: none !important;
    -moz-user-drag: none !important;
    user-drag: none !important;
    -webkit-touch-callout: none !important;
    /* pointer-events 제거 - 클릭은 상위 컨테이너에서 처리 */
}

/* 보안 알림 스타일 */
.ati-security-alert {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    background: linear-gradient(135deg, #dc3545, #c82333) !important;
    color: white !important;
    padding: 15px 20px !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 20px rgba(220, 53, 69, 0.3) !important;
    z-index: 10000 !important;
    font-weight: 600 !important;
    max-width: 300px !important;
    word-wrap: break-word !important;
    animation: securitySlideIn 0.3s ease !important;
}

@keyframes securitySlideIn {
    from {
        opacity: 0;
        transform: translateX(100%);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 개발자 도구 감지 시 블러 효과 */
.ati-security-blur {
    filter: blur(20px) grayscale(100%) !important;
    opacity: 0.3 !important;
    transition: all 0.5s ease !important;
    pointer-events: none !important;
}

/* 관리자 모드 표시는 유지 */
.admin-mode::before {
    content: '👤 관리자 모드';
    position: absolute;
    top: 5px;
    left: 5px;
    background: rgba(40, 167, 69, 0.9);
    color: white;
    padding: 2px 6px;
    border-radius: 3px;
    font-size: 10px;
    font-weight: 600;
    z-index: 10;
}
