/* 상품리스트 페이지 스타일 */

/* 상품 뱃지 스타일 */
.product-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 10;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 700;
    color: white;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    transform-origin: center;
    letter-spacing: 0.5px;
}

.product-badge.best-seller {
    background: linear-gradient(135deg, #ff6b35 0%, #f7931e 100%);
    border: 1px solid #e55a2b;
    overflow: hidden;
    opacity: 0.8;
}

.product-badge.best-seller::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer-badge 2.5s ease-in-out infinite;
    pointer-events: none;
}

.product-badge.best-combo {
    background: linear-gradient(135deg, #87a8d7 0%, #007bff 100%);
    border: 1px solid #0047ab;
    overflow: hidden;
    opacity: 0.8;
}

.product-badge.best-combo::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(255, 255, 255, 0.3),
        transparent
    );
    animation: shimmer-badge 2.5s ease-in-out infinite;
    pointer-events: none;
}

@keyframes shimmer-badge {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}

/* 재고 상태 스타일 */
.product_price.out-of-stock .price-display {
    text-decoration: line-through;
    color: #dc3545 !important;
}

.product_price.backorder .price-display {
    text-decoration: line-through;
    color: #28a745 !important;
}

.stock-status {
    font-size: 10px;
    font-weight: 600;
    margin-top: 4px;
    text-align: center;
    letter-spacing: 0.5px;
}

.stock-status.out-of-stock {
    color: #dc3545;
}

.stock-status.backorder {
    color: #28a745;
}

/* 상품 이미지 컨테이너 */
.product_image {
    position: relative;
    overflow: hidden;
}

/* 반응형 뱃지 스타일 */
@media (max-width: 768px) {
    .product-badge {
        top: 6px;
        left: 6px;
        padding: 3px 6px;
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .product-badge {
        top: 4px;
        left: 4px;
        padding: 2px 4px;
        font-size: 9px;
        letter-spacing: 0.3px;
    }
    
    .stock-status {
        font-size: 9px;
        margin-top: 2px;
    }
}

/* 검색 아이콘 스타일 */
.search-icon-large {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 20px;
    color: white;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
    transition: all 0.3s ease;
}

.search-icon-large:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.search-icon-large svg {
    width: 32px;
    height: 32px;
    stroke-width: 2.5;
}

/* 모바일 검색 결과 스타일 수정 */
@media (max-width: 768px) {
    /* category-title.mobile-dfcc 스타일 개선 - 가운데 정렬 */
    .category-title.mobile-dfcc {
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: center;
        gap: 10px;
        flex-wrap: nowrap;
        text-align: center;
    }
    
    /* 모바일에서 category-icon-large 크기 조정 */
    .category-title.mobile-dfcc .category-icon-large {
        width: 50px;
        height: 50px;
        flex-shrink: 0;
    }
    
    /* 모바일에서 search-icon-large 크기 조정 */
    .category-title.mobile-dfcc .search-icon-large {
        width: 50px;
        height: 50px;
        border-radius: 12px;
        box-shadow: 0 2px 8px rgba(102, 126, 234, 0.2);
    }
    
    .category-title.mobile-dfcc .search-icon-large svg {
        width: 24px;
        height: 24px;
    }
    
    /* category-title 텍스트 영역 - 가운데 정렬 */
    .category-title-text {
        flex-shrink: 1;
        text-align: center;
        line-height: 1.4;
        white-space: normal;
        word-break: break-word;
    }
    
    /* 검색 결과 페이지에서 category-info-box 스타일 개선 */
    .category-info-box {
        gap: 10px !important;
        padding: 10px !important;
        justify-content: center;
    }
    
    /* category-details 영역 - 가운데 정렬 */
    .category-details {
        flex: 1;
        min-width: 0;
        text-align: center;
        display: flex;
        flex-direction: column;
        align-items: center;
    }
    
    /* category-title이 h4 요소일 때 내부 구조 정리 */
    .category-title.mobile-dfcc {
        margin: 0;
        padding: 0;
        line-height: 1.4;
        width: 100%;
    }
}

@media (max-width: 480px) {
    /* 작은 모바일에서 추가 조정 */
    .category-title.mobile-dfcc .category-icon-large {
        width: 40px;
        height: 40px;
    }
    
    .category-title.mobile-dfcc .search-icon-large {
        width: 40px;
        height: 40px;
        border-radius: 10px;
    }
    
    .category-title.mobile-dfcc .search-icon-large svg {
        width: 20px;
        height: 20px;
    }
    
    .category-title.mobile-dfcc {
        font-size: 1.1rem;
        gap: 8px;
    }
}

/* 새로운 페이지네이션 스타일 */
.pagination-wrapper {
    padding: 1.5rem 0;
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    margin-top: 2rem;
}

.pagination-info {
    text-align: center;
    color: #6b7280;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
}

.pagination a,
.pagination span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 8px;
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.15s ease;
    user-select: none;
}

/* 일반 페이지 링크 */
.pagination a {
    color: #4b5563;
    background: #ffffff;
    border: 1px solid #e5e7eb;
}

.pagination a:hover {
    color: #1f2937;
    background: #f9fafb;
    border-color: #d1d5db;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* 현재 페이지 */
.pagination .current {
    color: #ffffff;
    background: #3b82f6;
    border: 1px solid #3b82f6;
    font-weight: 600;
}

/* 비활성 상태 */
.pagination .disabled {
    color: #9ca3af;
    background: #f9fafb;
    border: 1px solid #e5e7eb;
    cursor: not-allowed;
    opacity: 0.6;
}

/* 이전/다음 버튼 제거됨 */

/* 점프 버튼들 */
.pagination .jump-btn {
    color: #6b7280;
    background: transparent;
    border: none;
    font-weight: 600;
}

.pagination .jump-btn:hover {
    color: #3b82f6;
    background: #eff6ff;
}

/* 반응형 디자인 */
@media (max-width: 640px) {
    .pagination-wrapper {
        padding: 1rem 0;
    }
    
    .pagination a,
    .pagination span {
        min-width: 36px;
        height: 36px;
        font-size: 0.8rem;
    }
    
    /* nav-btn 제거됨 */
    
    /* 모바일에서는 일부 페이지 번호 숨김 */
    .pagination .mobile-hidden {
        display: none;
    }
    
    .pagination-info {
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .pagination {
        gap: 0.125rem;
    }
    
    .pagination a,
    .pagination span {
        min-width: 32px;
        height: 32px;
        font-size: 0.75rem;
        padding: 0px;
    }
    
    /* nav-btn 제거됨 */
}

/* 페이지 전환 애니메이션 */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.pagination-wrapper {
    animation: fadeIn 0.3s ease;
}

/* 호버 효과 강화 */
.pagination a:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

/* 포커스 상태 */
.pagination a:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

/* 기존 페이징 스타일 제거 - 새로운 스타일로 대체됨 */

/* 비활성 버튼 스타일 */
.pagination-container span[aria-disabled="true"] .inline-flex,
.pagination-container span[aria-disabled="true"] {
    background-color: transparent !important;
    color: #d1d5db !important;
    cursor: not-allowed !important;
}

/* SVG 아이콘 스타일 */
.pagination-container svg {
    width: 14px !important;
    height: 14px !important;
    fill: currentColor !important;
}

/* 텍스트 스타일 */
.pagination-container .text-sm {
    font-size: 13px !important;
}

/* 결과 정보 스타일 */
.pagination-container .text-gray-700 {
    color: #9ca3af !important;
    font-size: 12px !important;
    margin-bottom: 15px !important;
    text-align: center !important;
    display: block !important;
}

/* 숨길 요소들 */
.pagination-container .sm\\:hidden {
    display: none !important;
}

/* 모바일 스타일 */
@media (max-width: 768px) {
    .pagination-container {
        margin-top: 20px !important;
    }
    
    .pagination-container .inline-flex,
    .pagination-container a,
    .pagination-container span {
        padding: 4px 8px !important;
        font-size: 12px !important;
        min-width: 28px !important;
        height: 28px !important;
    }
    
    .pagination-container svg {
        width: 12px !important;
        height: 12px !important;
    }
}

/* 메인 컨테이너 */
.product-list-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 30px;
    margin: 10px 0 30px;
}
.breadcrumb-container {
    background: #f8f9fa;
    padding: 15px 0;
    border-bottom: 1px solid #e9ecef;
    margin-bottom: 10px;
}
/* 좌측 카테고리 사이드바 */
.category-sidebar {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 20px;
    height: fit-content;
    position: sticky;
    top: 20px;
}

.category-header h3 {
    font-size: 1.4rem;
    font-weight: 500;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid #007bff;
    line-height: 1.7rem;
}

.category-list {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

.category-item {
    border: 1px solid #f0f0f0;
    border-radius: 8px;
    overflow: hidden;
}

.category-main {
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.category-link {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 15px;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    text-decoration: none;
    color: inherit;
}

.category-link:hover {
    background: #fff;
    text-decoration: none;
    color: inherit;
}

.category-link.active {
    background: #e3f2fd;
    color: #007bff;
}

.category-icon {
    width: 24px;
    height: 24px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 4px;
    flex-shrink: 0;
}

.category-name {
    flex: 1;
    font-weight: 500;
    color: #333;
    font-size: 12px;
}

.toggle-btn {
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    flex-shrink: 0;
    margin-right: 8px;
    border-radius: 4px;
    transition: background-color 0.3s ease;
}

.toggle-btn:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

.toggle-arrow {
    font-size: 12px;
    color: #666;
    transition: transform 0.3s ease;
}

/* 2차 메뉴 (서브카테고리) */
.subcategory-list {
    display: none;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
}

.subcategory-list.show,
.subcategory-list[style*="display: block"] {
    display: block !important;
}

/* 초기 상태에서 선택된 카테고리의 서브카테고리는 보이도록 설정 */
.subcategory-list.initial-show {
    display: block !important;
}

.subcategory-item {
    border-bottom: 1px solid #f8f9fa;
}

.subcategory-item:last-child {
    border-bottom: none;
}

.subcategory-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 15px 12px 35px;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    text-decoration: none;
    color: inherit;
    position: relative;
}

.subcategory-link:hover {
    background: #e9ecef;
    text-decoration: none;
    color: inherit;
}

.subcategory-link.active {
    background: #e3f2fd;
    color: #007bff;
}

.subcategory-icon {
    display: none;
}

.subcategory-name {
    flex: 1;
    font-weight: 500;
    color: #333;
    font-size: 11px;
    padding-left: 3rem; /* 2차 메뉴 들여쓰기 */
}

/* 3차 메뉴 (서브서브카테고리) */
.sub-subcategory-list {
    display: none;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    margin-left: 20px;
}

.sub-subcategory-list.show,
.sub-subcategory-list[style*="display: block"] {
    display: block !important;
}

.sub-subcategory-item {
    border-bottom: 1px solid #e9ecef;
}

.sub-subcategory-item:last-child {
    border-bottom: none;
}

.sub-subcategory-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 15px 10px 35px;
    background: none;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
    text-align: left;
    text-decoration: none;
    color: inherit;
    position: relative;
}

.sub-subcategory-link:hover {
    background: #e9ecef;
    text-decoration: none;
    color: inherit;
}

.sub-subcategory-link.active {
    background: #e3f2fd;
    color: #007bff;
}

.sub-subcategory-icon {
    display: none;
}

.sub-subcategory-name {
    flex: 1;
    font-weight: 500;
    color: #333;
    font-size: 10px;
    padding-left: 40px; /* 3차 메뉴 들여쓰기 (2차보다 더 많이) */
}

/* 우측 상품 컨텐츠 */
.product-content {
    min-height: 600px;
}

/* 상품 헤더 */
.product-header {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 5px;
    margin-bottom: 10px;
}

/* 카테고리 정보 박스 */
.category-info-box {
    display: flex;
    align-items: flex-start;
    gap: 20px;
    margin-bottom: 5px;
    padding: 10px;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #dee2e6;
}

/* 뒤로가기 버튼 스타일 */
.back-button {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    background: #f8f9fa;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    text-decoration: none;
    color: #6c757d;
    transition: all 0.3s ease;
}

.back-button:hover {
    background: #e9ecef;
    border-color: #6c757d;
    color: #495057;
    text-decoration: none;
}

.back-icon {
    font-size: 24px;
    font-weight: bold;
}

/* 카테고리 아이콘 영역 조정 */
.category-icon-large {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-icon-large img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    max-width: 60px;
    max-height: 60px;
}

.default-icon {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    background: #f8f9fa;
    border-radius: 8px;
}

.category-details {
    flex: 1;
}

.category-title {
    font-size: 1.3rem;
    color: #3a4076;
    line-height: 34px; 
    font-weight: 700;
}

/* 카테고리 설명 영역 스타일 */
.category-description, .category-details p {
    font-size: 0.9rem;
    color: #666;
    line-height: 1.5;
    margin: 0;
}

/* 에디터 콘텐츠 스타일 (init.css reset 덮어쓰기) */
.category-description h1, .category-description h2, .category-description h3,
.category-description h4, .category-description h5, .category-description h6 {
    color: #1e293b;
    margin: 1.2em 0 0.6em 0;
    font-weight: 600;
    line-height: 1.3;
    font-family: inherit;
}

.category-description h1 { font-size: 1.25rem; }
.category-description h2 { font-size: 1.125rem; }
.category-description h3 { font-size: 1rem; }
.category-description h4 { font-size: 0.95rem; }
.category-description h5 { font-size: 0.9rem; }
.category-description h6 { font-size: 0.85rem; }

.category-description p {
    margin: 0 0 0.8em 0;
}

.category-description ul, .category-description ol {
    margin: 0.8em 0;
    padding-left: 1.2em !important;
    list-style-position: outside;
}

.category-description ul {
    list-style-type: disc !important;
    list-style: disc outside none !important;
}

.category-description ol {
    list-style-type: decimal !important;
    list-style: decimal outside none !important;
}

.category-description ul ul {
    list-style-type: circle;
    margin-top: 0.4em;
    margin-bottom: 0.4em;
}

.category-description ul ul ul {
    list-style-type: square;
}

.category-description li {
    margin: 0.25em 0;
    line-height: 1.5;
    display: list-item !important;
    list-style-position: outside !important;
}

/* 에디터 색상 상속 문제 해결 */
/* color가 설정된 span 내부의 모든 요소가 color를 상속받도록 */
.category-description span[style*="color"] * {
    color: inherit !important;
}

/* background-color만 있는 span도 부모의 color를 상속받도록 */
.category-description span[style*="background-color"]:not([style*="color"]) {
    color: inherit !important;
}

.category-description blockquote {
    border-left: 3px solid #3b82f6;
    padding: 0.8em;
    margin: 1em 0;
    font-style: italic;
    color: #475569;
    background: #f8fafc;
    border-radius: 0 4px 4px 0;
    font-size: 0.85rem;
}

.category-description hr {
    display: block;
    border: none;
    border-top: 2px solid #e2e8f0;
    margin: 1.2em 0;
    height: 0;
}

.category-description table {
    width: 100%;
    border-collapse: separate !important;
    border-spacing: 0 !important;
    margin: 1em 0;
    border-radius: 4px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
    font-size: 0.8rem;
    border: 1px solid #e2e8f0 !important;
}

.category-description th,
.category-description td {
    padding: 6px 8px;
    text-align: left;
    border: 1px solid #e2e8f0 !important;
}

.category-description table[border] {
    border: 1px solid #e2e8f0 !important;
}

.category-description table[border] th,
.category-description table[border] td {
    border: 1px solid #d1d5db !important;
}

.category-description th {
    background: #f8fafc;
    font-weight: 600;
    color: #1e293b;
}

.category-description tr:nth-child(even) {
    background: #f8fafc;
}

.category-description tr:hover {
    background: #f1f5f9;
}

.category-description img {
    max-width: 100%;
    height: auto !important;
    border-radius: 4px;
    margin: 1em 0;
}

.category-description code {
    background: #f1f5f9;
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', monospace;
    font-size: 0.8em;
    color: #dc2626;
}

.category-description pre {
    background: #1e293b;
    color: #e2e8f0;
    padding: 0.8em;
    border-radius: 4px;
    overflow-x: auto;
    margin: 1em 0;
    font-size: 0.75rem;
}

.category-description pre code {
    background: none;
    padding: 0;
    color: inherit;
}

.category-description [style*="font-family"] {
    /* 에디터에서 설정한 font-family를 그대로 적용하도록 주석 처리 */
    /* font-family: inherit !important; */
}

.category-description font[face] {
    font-family: inherit;
}

/* 서브카테고리 박스 */
.subcategories-box {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 10px;
    margin-bottom: 10px;
}

.subcategories-box h4 {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
}

.subcategories-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.subcategory-item-link {
    display: inline-block;
    padding: 8px 16px;
    background: #e3f2fd;
    color: #1976d2;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.subcategory-item-link:hover {
    background: #bbdefb;
    color: #1565c0;
    transform: translateY(-1px);
}
.subcategory-item-link-active {
    display: inline-block;
    padding: 8px 16px;
    background: #e3f2fd;
    color: #1976d2;
    text-decoration: none;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.subcategory-item-link-active:hover {
    background: #bbdefb;
    color: #1565c0;
    transform: translateY(-1px);
}

/* 상품 요약 */
.product-summary {
    text-align: center;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 8px;
    border: 1px solid #e9ecef;
}

.summary-text {
    font-size: 0.9rem;
    color: #666;
    font-weight: 500;
}

/* 상품 필터 */
.product-filters {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 15px 0 10px;
}

.filter-dropdown {
    position: relative;
}

.filter-select {
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    padding: 10px 40px 10px 15px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    background: white;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    outline: none;
    min-width: 200px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23333' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
}

.filter-select:hover {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.1);
}

.filter-select:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.filter-select option {
    padding: 10px;
    font-size: 14px;
}

@media (max-width: 768px) {
    .product-filters {
        padding: 10px 0;
        margin-bottom: 15px;
    }
    
    .filter-select {
        min-width: 180px;
        font-size: 13px;
        padding: 8px 35px 8px 12px;
    }
}

@media (max-width: 480px) {
    .product-filters {
        padding: 8px 0;
        margin-bottom: 10px;
    }
    
    .filter-select {
        min-width: 100%;
        font-size: 12px;
        padding: 8px 30px 8px 10px;
    }
}

/* 상품 그리드 - 메인과 동일한 스타일 */
.product_grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, max-content));
    gap: 10px;
    justify-content: space-around;
    margin-bottom: 10px;
}

.product_card {
    max-width: 200px;
    background: white;
    border-radius: 10px;
    overflow: hidden;
    height: auto;
    margin-bottom: 0px;
    position: relative; /* hover 히트박스 확장용 */
    transition: box-shadow 0.2s ease;
    will-change: transform;
    backface-visibility: hidden;
    transform: translateZ(0);
}

/* hover 시 카드 자체는 이동하지 않고 내부 컨텐츠만 살짝 이동 */
.product_image,
.product_info {
    transition: transform 0.2s ease;
    will-change: transform;
}

.product_card:hover {
    box-shadow: 0 10px 20px rgba(0,0,0,0.08);
}

/* 마우스 모서리 떨림 방지: 호버 히트 영역 확장 */
.product_card::before {
    content: '';
    position: absolute;
    top: -12px;
    left: -12px;
    right: -12px;
    bottom: -12px;
    /* 투명 확장 영역 - 시각적 변화 없음, hover 충돌 감소 */
}

/* 카드 전체를 링크가 덮도록 하여 hover 히트박스를 일관되게 유지 */
.product_card > a {
    display: block;
    width: 100%;
    height: 100%;
}

/* 시각 피드백은 그림자 강조로 */

/* 외부 CSS 충돌 방지: 카드 내부 요소 hover 시 변형(translate/scale/rotate) 강제 무효화 */
.product_card a:hover,
.product_card img:hover,
.product_card .product_image:hover,
.product_card .product_image img:hover {
    transform: none !important;
}

/* transform에 대한 과도한 전환 제거 (미세 흔들림 방지) */
.product_card a,
.product_card img,
.product_card .product_image,
.product_card .product_image img {
    transition-property: box-shadow, border-color, opacity; /* transform 제외 */
}

@media (prefers-reduced-motion: reduce) {
    .product_card {
        transition: none;
    }
    .product_card:hover {
        transform: none;
    }
}

.product_card a {
    color: #000;
    text-decoration: none;
}

.product_image {
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #fff;
    border-radius: 10px;
}

.product_image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product_info {
    padding: 15px 0 0 0;
}

.product_category {
    margin-bottom: 5px;
}

.product_category span {
    display: inline;
    padding: 0 5px;
    background-color: #edeef5;
    border-radius: 3px;
    color: #4f5268;
    font-weight: 500;
    font-size: 12px;
    line-height: 20px;
    margin: 2px;
    border-radius: 5px;
}

.product_text {
    margin-bottom: 5px;
    font-size: 16px;
    line-height: 28px;
    color: #000;
}

.product_price {
    margin-bottom: 0;
}

.product_price strong {
    font-weight: 700;
    line-height: 30px;
    font-size: 18px;
    color: #245ecb;
}

/* 상품이 없을 때 */
.no-products {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-products p {
    font-size: 1.1rem;
    margin: 0;
}

/* 페이징 */
.pagination-container {
    background: #fff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 25px;
    text-align: center;
}

.pagination-links {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
}

.pagination-links .pagination {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    gap: 5px;
}

.pagination-links .page-item {
    margin: 0;
}

.pagination-links .page-link {
    display: block;
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    color: #007bff;
    text-decoration: none;
    transition: all 0.3s ease;
    min-width: 40px;
    text-align: center;
}

.pagination-links .page-link:hover {
    background: #e9ecef;
    border-color: #007bff;
    color: #007bff;
}

.pagination-links .page-item.active .page-link {
    background: #007bff;
    border-color: #007bff;
    color: white;
}

.pagination-links .page-item.disabled .page-link {
    color: #6c757d;
    pointer-events: none;
    background: #f8f9fa;
    border-color: #dee2e6;
}

/* Ajax 로딩 상태 스타일 */
.subcategory-list .loading {
    padding: 15px;
    text-align: center;
    color: #666;
    font-size: 14px;
    background: #f8f9fa;
    border-radius: 6px;
    margin: 5px 0;
}

.subcategory-list .error {
    padding: 15px;
    text-align: center;
    color: #dc3545;
    font-size: 14px;
    background: #f8d7da;
    border: 1px solid #f5c6cb;
    border-radius: 6px;
    margin: 5px 0;
}

/* 반응형 디자인 */
@media (max-width: 1024px) {
    .product-list-container {
        grid-template-columns: 250px 1fr;
        gap: 25px;
    }
    
    .product_grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, max-content));
        gap: 15px;
    }
}

@media (max-width: 768px) {
    .product-list-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .category-sidebar {
        position: static;
        order: 2;
    }
    
    .product-content {
        order: 1;
    }
    
    .product-header {
        padding: 10px;
    }
    
    .category-title {
        font-size: 1.2rem;
    }
    
    .category-info-box {
        flex-direction: row;
        text-align: center;
        padding: 5px;
    }
    
    .product_grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, max-content));
        gap: 15px;
    }
    .category-info-box {
        align-items: center;
    }

    .subcategory-item-link {
        padding: 4px 8px;
        font-size: 0.7rem;
        font-weight: 500;
    }
    .subcategory-item-link-active {
        padding: 4px 8px;
        font-size: 0.7rem;
        font-weight: 500;
    }
    .category-description, .category-details p{font-size: 0.9rem;}
    .category-info-box {gap:5px;}
    .product-summary {padding: 5px;}
    .summary-text { font-size: 0.8rem;}
    .product_text{font-size: 0.8rem; line-height: 0.8rem;}
    .product_price strong{font-size: 0.8rem; line-height: 1rem;}
    .product_info {
        padding: 5px 0 0 0;
    }
    .category-link{padding:10px;}
    .breadcrumb-item a {
        font-size: 0.8rem;
    }
    .breadcrumb-item.active {
        color: #6c757d;
        font-weight: 500;
        font-size: 0.8rem;
    }
}

@media (max-width: 480px) {
    .breadcrumb-item a {
        font-size: 0.7rem;
    }
    .subcategories-list{ gap: 4px;}
    .breadcrumb-item.active {
        color: #6c757d;
        font-weight: 500;
        font-size: 0.7rem;
    }    
    .subcategory-item-link {
        padding: 4px 8px;
        font-size: 0.5rem;
        font-weight: 500;
    }    
    .subcategory-item-link-active {
        padding: 4px 8px;
        font-size: 0.5rem;
        font-weight: 500;
    }    
    .product_grid .product_card {
        max-width: 170px;
    }
    .product_grid {
        grid-template-columns: repeat(auto-fill, minmax(148px, max-content));
        gap: 5px;
    }
    
    .category-info-box {
        padding: 5px;
    }
    
    .product-header {
        padding: 10px;
    }
    
    .subcategories-box {
        padding: 10px;
    }
    .breadcrumb-container {
        padding: 10px 0;
        margin-bottom: 5px;
    }
    .product_card{margin-bottom: 0.5rem;}
}


.breadcrumb-nav {
    max-width: 100%;
    margin: 0 auto;
    padding: 0 20px;
}

.breadcrumb {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    font-size: 14px;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-item:not(:last-child)::after {
    content: '>';
    margin: 0 10px;
    color: #6c757d;
    font-weight: 600;
}

.breadcrumb-item a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb-item a:hover {
    color: #0056b3;
    text-decoration: underline;
}

.breadcrumb-item.active {
    color: #6c757d;
    font-weight: 600;
}
@media (max-width: 350px) {
    .product_grid {
        grid-template-columns: repeat(auto-fill, minmax(135px, max-content));
        gap: 5px;
    }
}

/* 상품 설명 스타일 */
.product_description_box {
    margin-top: 8px;
    font-size: 12px;
    line-height: 1.4;
    color: #666;
}

.product_description_short {
    display: block;
}

.product_description_full {
    display: block;
}

.product_description_full.hidden {
    display: none;
}

/* 상품 태그 스타일 */
.product_tags_box {
    margin-top: 8px;
}

.product_tags_short,
.product_tags_full {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: center;
}

.product_tags_full.hidden {
    display: none;
}

.product_tag {
    display: inline-block;
    padding: 2px 8px;
    background: #E6F3FF;
    color: #1E40AF;
    border-radius: 12px;
    font-size: 10px;
    font-weight: 500;
    line-height: 1.3;
    text-align: center;
    white-space: nowrap;
    border: 1px solid #B3D9FF;
}

.product_tag_more {
    display: inline-block;
    padding: 2px 6px;
    background: #FFB6C1;
    color: #8B1538;
    border-radius: 12px;
    font-size: 9px;
    font-weight: 600;
    line-height: 1.3;
    text-align: center;
    white-space: nowrap;
}

/* View More/View Less 버튼 스타일 (checkout과 동일) */
.view-more-btn {
    text-align: center;
    cursor: pointer;
    padding: 8px 0;
    border-top: 1px solid #e9ecef;
}

.view-more-text {
    color: #007bff;
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.3s ease;
}

.view-more-text:hover {
    color: #0056b3;
    text-decoration: underline;
}

.hidden {
    display: none !important;
}