/* Ceramic Product Filter Styles */

/* Salient 테마 호환성 - 강제 리셋 */
.ceramic-product-filter * {
    box-sizing: border-box;
}

.ceramic-product-filter {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 auto;
    padding: 40px 60px;
    box-sizing: border-box;
    clear: both;
    overflow: visible;
}

/* 필터 및 제품 컨텐츠 래퍼 */
.filter-content-wrapper {
    display: flex !important;
    flex-direction: row !important;
    gap: 40px;
    width: 100%;
    align-items: flex-start !important;
    clear: both;
    max-width: 1920px;
    margin: 0 auto;
}

/* 필터 사이드바 */
.filter-sidebar {
    width: 250px !important;
    min-width: 250px !important;
    max-width: 250px !important;
    flex-shrink: 0 !important;
    flex-grow: 0 !important;
    float: none !important;
}

.filter-group {
    margin-bottom: 25px;
    border-bottom: 1px solid #e5e5e5;
    padding-bottom: 15px;
}

.filter-group:last-child {
    border-bottom: none;
}

.filter-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 15px;
    cursor: pointer;
    user-select: none;
}

.filter-title span {
    font-size: 18px;
    transition: transform 0.3s ease;
}

.filter-title.collapsed span {
    transform: rotate(-90deg);
}

.filter-options {
    display: block;
    overflow: hidden;
    transition: max-height 0.3s ease;
}

.filter-options.collapsed {
    max-height: 0;
}

.filter-option {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.filter-option input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin-right: 10px;
    cursor: pointer;
    accent-color: #333;
}

.filter-option label {
    font-size: 14px;
    color: #666;
    cursor: pointer;
    user-select: none;
}

.filter-option:hover label {
    color: #333;
}

/* 제품 컨테이너 */
.products-container {
    flex: 1 !important;
    min-width: 0 !important;
    width: auto !important;
    max-width: 100% !important;
    float: none !important;
}

.products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
}

.products-count {
    font-size: 14px;
    color: #666;
}

/* 제품 그리드 */
.products-grid {
    display: grid !important;
    grid-template-columns: repeat(4, 1fr) !important; /* 정확히 4칸 */
    gap: 40px;
    margin-bottom: 40px;
    width: 100%;
    list-style: none !important;
    padding: 0 !important;
}

/* 제품 링크 */
.product-item-link {
    text-decoration: none !important;
    color: inherit !important;
    display: block;
}

.product-item {
    background: #fff;
    border-radius: 4px;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
    width: 100%;
    box-sizing: border-box;
    list-style: none !important;
}

.product-item-link:hover .product-item {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
}

.product-image {
    width: 100%;
    padding-top: 66.67%; /* 3:2 비율 (2/3 = 0.6667) */
    position: relative;
    background: #f5f5f5;
    overflow: hidden;
}

.product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-item-link:hover .product-image img {
    transform: scale(1.05);
}

.product-info {
    padding: 20px;
}

.product-title {
    font-size: 16px;
    font-weight: 500;
    color: #333;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 10px;
}

.product-tag {
    font-size: 11px;
    color: #666;
    background: #f5f5f5;
    padding: 4px 8px;
    border-radius: 3px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* 로딩 상태 */
.products-loading {
    display: none;
    text-align: center;
    padding: 40px;
}

.products-loading.active {
    display: block;
}

.loader {
    border: 3px solid #f3f3f3;
    border-top: 3px solid #333;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 제품 없음 */
.no-products {
    text-align: center;
    padding: 60px 20px;
    font-size: 16px;
    color: #999;
}

/* 페이지네이션 */
.products-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 40px;
    flex-wrap: wrap !important;
}

.pagination-button {
    min-width: 40px;
    height: 40px;
    border: 1px solid #e5e5e5;
    background: #fff;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.pagination-button:hover:not(:disabled) {
    background: #333;
    color: #fff;
    border-color: #333;
}

.pagination-button.active {
    background: #333;
    color: #fff;
    border-color: #333;
}

.pagination-button:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

/* 반응형 */
@media (max-width: 1400px) {
    .ceramic-product-filter {
        padding: 30px 50px;
    }
    
    .filter-content-wrapper {
        gap: 35px;
    }
    
    .products-grid {
        gap: 35px;
    }
}

@media (max-width: 1200px) {
    .ceramic-product-filter {
        padding: 30px 40px;
    }
    
    .products-grid {
        grid-template-columns: repeat(3, 1fr) !important; /* 3칸으로 */
        gap: 30px;
    }
}

@media (max-width: 900px) {
    .ceramic-product-filter {
        padding: 25px 30px;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr) !important; /* 2칸으로 */
        gap: 25px;
    }
}

@media (max-width: 768px) {
    .ceramic-product-filter {
        padding: 20px;
    }
    
    .filter-content-wrapper {
        flex-direction: column !important;
        gap: 30px;
    }
    
    .filter-sidebar {
        width: 100% !important;
        min-width: 100% !important;
        max-width: 100% !important;
    }
    
    .products-container {
        width: 100% !important;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 20px;
    }
    
    .filter-group {
        margin-bottom: 20px;
    }
    
    .filter-title {
        padding: 10px 0;
    }
    
    .products-pagination {
        gap: 6px !important;
        margin-top: 30px !important;
    }
    
    .pagination-button {
        min-width: 32px !important;
        height: 32px !important;
        font-size: 12px !important;
    }
}

@media (max-width: 480px) {
    .ceramic-product-filter {
        padding: 15px;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 15px;
    }
    
    .product-info {
        padding: 12px;
    }
    
    .product-title {
        font-size: 13px;
    }
    
    .product-tag {
        font-size: 10px;
        padding: 3px 6px;
    }
}

/* Ceramic Search Bar Shortcode Styles */
.ceramic-search-form {
    width: 100%;
    max-width: 400px;
    margin: 0 auto 30px auto;
}

.ceramic-search-wrapper {
    display: flex;
    align-items: center;
    position: relative;
    background: #f9f9f9;
    border: 1px solid #e5e5e5;
    border-radius: 30px;
    padding: 2px 5px;
    transition: all 0.3s ease;
    box-sizing: border-box;
}

.ceramic-search-wrapper:focus-within {
    border-color: #333;
    background: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}

.ceramic-search-field {
    flex: 1;
    border: none !important;
    background: transparent !important;
    height: 40px !important;
    padding: 5px 15px 5px 20px !important;
    font-size: 14px !important;
    color: #333 !important;
    outline: none !important;
    box-shadow: none !important;
}

.ceramic-search-field::placeholder {
    color: #999;
}

.ceramic-search-submit {
    background: #333 !important;
    border: none !important;
    color: #fff !important;
    width: 36px !important;
    height: 36px !important;
    border-radius: 50% !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    padding: 0 !important;
}

.ceramic-search-submit:hover {
    background: #000 !important;
    transform: scale(1.05);
}

.ceramic-search-submit svg {
    width: 16px;
    height: 16px;
    stroke: #fff;
}

/* Sidebar Search Styles */
.sidebar-search-group {
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 1px solid #e5e5e5;
}

.sidebar-search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
    box-sizing: border-box;
}

.sidebar-search-wrapper input {
    width: 100% !important;
    height: 40px !important;
    padding: 10px 35px 10px 15px !important;
    border: 1px solid #e5e5e5 !important;
    border-radius: 4px !important;
    font-size: 13px !important;
    outline: none !important;
    background: #f9f9f9 !important;
    transition: all 0.3s ease !important;
    color: #333 !important;
    box-shadow: none !important;
}

.sidebar-search-wrapper input:focus {
    border-color: #333 !important;
    background: #fff !important;
}

.sidebar-search-wrapper input:focus::placeholder {
    color: transparent !important;
}

.sidebar-search-icon {
    position: absolute;
    right: 12px;
    width: 16px;
    height: 16px;
    stroke: #666;
    fill: none;
    pointer-events: none;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 마우스 클릭(focus) 시 또는 검색어가 입력되어 있을 때 돋보기 아이콘 숨기기 */
.sidebar-search-wrapper input:focus ~ .sidebar-search-icon,
.sidebar-search-wrapper input:not(:placeholder-shown) ~ .sidebar-search-icon {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

.sidebar-search-clear {
    position: absolute;
    right: 12px;
    width: 16px;
    height: 16px;
    background: #ccc;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    cursor: pointer;
    line-height: 1;
    transition: background 0.2s ease;
    z-index: 2; /* clear button sits above the hidden icon */
}

.sidebar-search-clear:hover {
    background: #666;
}

