/* css/제품소개.css */

/* Main Layout */
.main-wrapper {
    max-width: 1400px;
    margin: 0 auto;
    padding: 30px 0;
}

.content-layout {
    display: grid;
    grid-template-columns: 260px 1fr;
    gap: 30px; 
}

/* Mobile Filter Toggle (Hidden by default) */
.filter-toggle-input {
    display: none;
}

.mobile-filter-btn {
    display: none;
}

.mobile-filter-close {
    display: none;
}

.overlay-backdrop {
    display: none;
}

/* Sidebar */
.sidebar {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    height: fit-content;
    position: sticky;
    top: 100px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid #f0f0f0;
}

.filter-section {
    margin-bottom: 32px;
    padding-bottom: 24px;
    border-bottom: 1px solid #f0f0f0;
}

.filter-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.filter-title {
    font-size: 15px;
    font-weight: 700;
    margin-bottom: 16px;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    gap: 6px;
}

.filter-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.filter-option {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: #555;
    cursor: pointer;
    transition: color 0.3s;
    padding: 4px 0;
}

.filter-option:hover {
    color: var(--lq-accent-primary);
}

.filter-option input[type="checkbox"],
.filter-option input[type="radio"] {
    cursor: pointer;
    width: 14px;
    height: 14px;
    accent-color: var(--lq-accent-primary);
}

.filter-option input[type="checkbox"]:checked + span,
.filter-option input[type="radio"]:checked + span {
    color: var(--lq-accent-primary);
    font-weight: 600;
}

/* Price Filter */
.price-input-group {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 8px;
    margin-top: 16px;
}

.price-input,
.price-input-group input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    font-size: 13px;
    outline: none;
    text-align: center;
    transition: border-color 0.3s;
}

.price-input::placeholder {
    color: #ccc;
}

.price-input:focus,
.price-input-group input:focus {
    border-color: var(--lq-accent-primary);
}

.price-input-group > span {
    color: #999;
    font-size: 13px;
}

.btn-apply {
    grid-column: 1 / -1;
    margin-top: 8px;
    padding: 10px;
    background: #faf8f8;
    color: #666;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-apply:hover {
    background: var(--lq-accent-primary);
    color: #fff;
    border-color: var(--lq-accent-primary);
}

/* Product List Area */
.product-list-area {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border: 1px solid #f0f0f0;
}

.list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
}

.result-count {
    font-size: 15px;
    color: #666;
}

.result-count strong {
    color: var(--lq-accent-primary);
    font-weight: 700;
    font-size: 16px;
}

/* Sort Select Box */
.sort-wrapper {
    position: relative;
}

.sort-select {
    padding: 10px 36px 10px 16px;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    background: #fff;
    cursor: pointer;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3e%3cpath d='M1 1L6 6L11 1' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    min-width: 140px;
    transition: border-color 0.3s;
}

.sort-select:focus {
    outline: none;
    border-color: var(--lq-accent-primary);
}

.sort-select option {
    padding: 10px;
}

/* Product List Grid */
.product-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.product-item {
    display: flex;
    flex-direction: column;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.2s;
    padding:10px;
    gap:15px;
}

.product-item:hover {
    border-color: var(--lq-accent-primary);
    box-shadow: 0 0 10px rgba(217, 96, 59, 0.1);
}

/* Product Thumbnail */
.product-thumbnail {
    width: 100%;
    height: 240px;
    border-radius: 0;
    overflow: hidden;
    background: #faf8f8;
    position: relative;
    border-radius:7px;
}

.product-thumbnail img,
.thumbnail-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-thumbnail:hover img {
    transform: scale(1.05);
}

.badge-wrap {
    position: absolute;
    top: 12px;
    left: 12px;
}

.category-badge {
    background: rgba(217, 96, 59, 0.9);
    color: white;
    padding: 4px 10px 5px;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 500;
    z-index: 2;
}

/* 찜 버튼 */
.btn-wishlist {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 36px;
    height: 36px;
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(10px);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-wishlist:hover {
    background: #fff;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.btn-wishlist .heart-icon {
    color: #999;
    transition: all 0.3s;
}

.btn-wishlist:hover .heart-icon {
    color: #df5337;
    stroke: #df5337;
}

/* 찜 버튼 활성화 상태 */
.btn-wishlist.active {
    background: #fff;
}

.btn-wishlist.active .heart-icon {
    fill: #ef4444;
    stroke: #ef4444;
    color: #ef4444;
}

.btn-wishlist.active:hover {
    transform: scale(1.1);
}

/* Product Info */
.product-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap:25px;
}

.product-category {
    display: inline-block;
    padding: 4px 12px;
    background: var(--lq-accent-primary-light);
    color: var(--lq-accent-primary);
    font-size: 11px;
    font-weight: 600;
    border-radius: 6px;
    width: fit-content;
    margin-bottom: 5px;
}

.product-title {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    line-height: 1.5; 
    min-height: 42px;
    display: box;
    line-clamp: 2;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Pricing */
.product-pricing {
    display: flex;
    flex-direction: column;
    gap: 10px; 
    flex: 1;
}

.price-row {
    display: flex; 
    padding: 12px;
    border-radius: 8px;
    align-items: center;
    justify-content: space-between;
}

.price-row.rental { 
    border: 1px solid #ddd;
}

.price-row.purchase { 
    border: 1px solid #ddd;
}

.price-row.rental.unavailable {
    background: #fbfbfb;
    border: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: center; 
    flex:1;
}

.unavailable-text {
    font-size: 14px;
    color: #999;
    font-weight: 500;
}

.price-label {
    font-size: 14px;
    font-weight: 600;
    color: #555;
}

.price-details {
    display: flex;
    flex-direction: column; 
}

.price-line {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.price-original {
    font-size: 13px;
    color: #999;
    text-decoration: line-through;
}

.price-current-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.price-current {
    font-size: 18px;
    font-weight: 500;
}

.price-row.rental .price-current {
    color: var(--lq-accent-primary);;
}

.price-row.purchase .price-current {
    color: var(--lq-accent-primary);;
}

.price-discount {
    font-size: 12px;
    font-weight: 700;
    color: #df5337;
    background: #FFE8E8;
    padding: 1px 5px 2px;
    border-radius: 4px;
}

.price-row.rental .price-discount {
    color: var(--lq-accent-primary);
    background: rgba(217, 96, 59, 0.18);
}

/* Purchase Only Product Style */
.product-item.purchase-only .product-pricing {
    justify-content: center;
}

.price-row.single {
    margin-bottom: 0;
}

.price-row.purchase.single {
    background: #fff7f5;
    border: 1px solid #FFE0E0;
}

.price-row.purchase.single .price-current {
    font-size: 22px;
    color: #df5337;
}

/* Button More */

.btn-more {
    width: 100%;
    padding: 10px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    background: var(--lq-accent-primary);
    color: #fff;
    cursor: pointer;
    transition: all 0.3s;
    text-align: center;

    text-decoration: none;
    display: inline-block;
}

.btn-more:hover {
    background: var(--lq-accent-primary-dark);
}

.product-actions {
    display: flex;
    flex-direction: column;
    gap: 10px; 
}

.btn-add-cart {
    width: 100%;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    border: 1.5px solid var(--lq-accent-primary);
    background: #fff;
    color: var(--lq-accent-primary);
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-add-cart:hover {
    color: #fff;
    background: var(--lq-accent-primary);
}

/* 품절 버튼 비활성화 스타일 */
.btn-add-cart:disabled {
    border-color: #d1d5db;
    background: #f3f4f6;
    color: #9ca3af;
    cursor: not-allowed;
    box-shadow: none;
}

.btn-add-cart:disabled:hover {
    border-color: #d1d5db;
    background: #f3f4f6;
    color: #9ca3af;
    box-shadow: none;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 40px;
    padding-top: 40px;
    border-top: 1px solid #f0f0f0;
}

.page-btn {
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    cursor: pointer;
    transition: all 0.3s;
}

.page-btn:hover {
    border-color: var(--lq-accent-primary);
    color: var(--lq-accent-primary);
}

.page-btn.active {
    background: var(--lq-accent-primary);
    border-color: var(--lq-accent-primary);
    color: #fff;
    font-weight: 700;
}

/* Responsive */
@media (max-width: 1200px) {
    .product-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 1024px) {
    /* Show Mobile Filter Button */
    .mobile-filter-btn {
        display: flex;
        align-items: center;
        gap: 8px;
        padding: 12px 20px;
        background: #fff;
        border: 1px solid #e8e8e8;
        border-radius: 8px;
        font-size: 14px;
        font-weight: 600;
        color: #333;
        cursor: pointer;
        margin: 0 0px 20px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
        transition: all 0.3s;
    }

    .product-list-area {
        padding:20px;
    }

    .mobile-filter-btn:hover {
        border-color: var(--lq-accent-primary);
        color: var(--lq-accent-primary);
    }

    .mobile-filter-btn svg {
        flex-shrink: 0;
    }

    /* Sidebar Overlay */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        z-index: 9998;
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.3s;
    }

    .overlay-backdrop {
        display: block;
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        cursor: pointer;
    }

    /* 체크박스가 체크되면 오버레이 표시 */
    #filter-toggle:checked ~ .main-wrapper .sidebar-overlay {
        opacity: 1;
        pointer-events: all;
    }

    /* Sidebar Mobile Style */
    .sidebar {
        position: fixed;
        bottom: 0;
        left: 0;
        right: 0;
        top: auto;
        max-height: 80vh;
        border-radius: 24px 24px 0 0;
        transform: translateY(100%);
        transition: transform 0.3s ease-in-out;
        z-index: 9999;
        overflow-y: auto;
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.15);
    }

    /* 체크박스가 체크되면 사이드바 올라오기 */
    #filter-toggle:checked ~ .main-wrapper .sidebar {
        transform: translateY(0);
    }

    /* Mobile Close Button */
    .mobile-filter-close {
        display: flex;
        position: absolute;
        top: 16px;
        right: 16px;
        width: 32px;
        height: 32px;
        align-items: center;
        justify-content: center;
        background: #faf8f8;
        border-radius: 50%;
        cursor: pointer;
        z-index: 10;
        transition: background 0.3s;
    }

    .mobile-filter-close:hover {
        background: #e8e8e8;
    }

    /* Content Layout */
    .content-layout {
        grid-template-columns: 1fr;
    }

    .product-list {
        grid-template-columns: repeat(2, 1fr);
        gap:15px;
    }
}

@media (max-width: 768px) {
    .main-wrapper {
        padding: 20px 0;
    }

    .mobile-filter-btn {
        margin: 0 0 15px;
    }

    .product-list-area {
        padding: 20px;
    }

    .list-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }

    .sort-wrapper {
        width: 100%;
    }

    .sort-select {
        width: 100%;
    }

    .product-list {
        grid-template-columns: 1fr;
        gap: 16px;
    }

    .product-thumbnail {
        height: 200px;
    }

    .sidebar {
        max-height: 85vh;
        padding: 32px 24px 24px;
    }

    .btn-wishlist {
        width: 32px;
        height: 32px;
    }

    .btn-wishlist .heart-icon {
        width: 18px;
        height: 18px;
    }
}

@media (max-width: 480px) {

    .mobile-filter-btn {
        justify-content: center;
    }

    .product-list-area {
        padding: 16px;
    }

    .product-info { 
    }

    .product-title {
        font-size: 13px;
        min-height: 39px;
    }

    .price-row {
        padding: 10px;
    }

    .price-current {
        font-size: 16px;
    }

    .price-discount {
        font-size: 12px;
    }

    .sidebar {
        padding: 28px 20px 20px;
    }

    .btn-wishlist {
        width: 30px;
        height: 30px;
        top: 10px;
        right: 10px;
    }

    .btn-wishlist .heart-icon {
        width: 16px;
        height: 16px;
    }

    .category-badge {
        top: 10px;
        left: 10px;
        font-size: 11px;
        padding: 5px 10px;
    }
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    grid-column: 1 / -1;
}

.loading-spinner .spinner {
    width: 40px;
    height: 40px;
    border: 3px solid #f0f0f0;
    border-top-color: var(--lq-accent-primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.loading-spinner p {
    margin-top: 16px;
    color: #888;
    font-size: 14px;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Thumbnail Placeholder */
.thumbnail-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    min-height: 200px;
    background: #faf8f8;
    color: #ccc;
}

.thumbnail-placeholder svg {
    width: 48px;
    height: 48px;
}

/* 무한 스크롤 센티넬 및 로딩 */
.scroll-sentinel {
    padding: 20px;
    text-align: center;
    grid-column: 1 / -1;
}

.scroll-loading {
    display: flex;
    justify-content: center;
    padding: 20px;
}

.scroll-loading .spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e1e6f0;
    border-top-color: var(--lq-accent-primary);
    border-radius: 50%;
    animation: products-spin 0.8s linear infinite;
}

@keyframes products-spin {
    to { transform: rotate(360deg); }
}

.scroll-end-message {
    text-align: center;
    padding: 20px;
    color: #999;
    font-size: 14px;
    grid-column: 1 / -1;
}
