/* --- Fashion Items (Products) --- */
.products-section {
    padding: 40px 0 80px;
}

/* 1. 针对 Fashion Items 这一块的标题特殊处理 */
.products-section .section-title {
    position: relative;
    margin-bottom: 60px;
    /* 大幅增加标题与下方 Tab 的距离 */
}

/* 2. 添加标题下方的橙色装饰线（完美还原设计稿） */
.products-section .section-title::after {
    content: '';
    display: block;
    width: 50px;
    /* 短线宽度 */
    height: 2px;
    /* 短线高度 */
    background-color: var(--primary-color);
    /* 使用主题橙色 */
    margin: 15px auto 0;
    /* 短线距离文字 15px，且水平居中 */
}

/* 3. 调整 Tabs 的样式，确保它与上方的距离合适 */
.tabs {
    display: flex;
    justify-content: center;
    gap: 30px;
    /* margin-bottom 保持不变，控制下方与商品的距离 */
    margin-bottom: 40px;
    font-weight: 500;
    color: #888;
    /* 如果觉得 margin-bottom: 60px 还不够，可以在这里追加 margin-top */
}

.tabs {
    display: flex;
    justify-content: center;
    gap: 30px;
    margin-bottom: 40px;
    font-weight: 500;
    color: #888;
}

.tabs span {
    cursor: pointer;
    position: relative;
    padding: 8px 0;
    font-size: 15px;
    transition: color 0.3s ease;
}

.tabs span:hover {
    color: #555;
}

.tabs span.active {
    color: #000;
    font-weight: 600;
}

.tabs span.active::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 2px;
    background: var(--primary-color);
}

.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 30px;
}

.product-card {
    transition: var(--transition-base);
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.p-img-box {
    background: linear-gradient(135deg, #f9f9f9 0%, #f5f5f5 100%);
    height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 15px;
    position: relative;
    overflow: hidden;
    border-radius: 8px 8px 0 0;
}

.p-img-box::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 0%, rgba(0, 0, 0, 0.02) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-card:hover .p-img-box::after {
    opacity: 1;
}

.p-img-box img {
    max-width: 90%;
    max-height: 90%;
    width: auto;
    mix-blend-mode: multiply;
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover .p-img-box img {
    transform: scale(1.05);
}

.p-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 10px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding: 0 14px;
    color: var(--text-color);
    transition: color 0.3s ease;
    line-height: 1.5;
}

.product-card:hover .p-title {
    color: var(--primary-color);
}

.p-price {
    font-weight: 700;
    color: var(--primary-color);
    font-size: 17px;
    padding: 0 14px 14px;
    letter-spacing: -0.01em;
}

.p-old-price {
    text-decoration: line-through;
    color: #bbb;
    font-size: 13px;
    margin-left: 10px;
    font-weight: 400;
}

/* Product Footer - Price + Cart Button */
.p-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 12px 12px;
    gap: 8px;
}

.p-footer .p-price {
    white-space: nowrap;
    overflow: hidden;
    flex: 1;
    min-width: 0;
}

/* Cart Button */
.cart-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--primary-color);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.cart-btn i {
    font-size: 14px;
    color: #fff;
}

.cart-btn:hover {
    background: var(--primary-dark);
    transform: scale(1.1);
}

.cart-btn:active {
    transform: scale(0.95);
}

/* Wishlist Button - Top Right Corner */
.wishlist-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 5;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    transition: all 0.3s ease;
}

.wishlist-btn i {
    font-size: 16px;
    color: #999;
    transition: all 0.3s ease;
}

.wishlist-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.wishlist-btn:hover i {
    color: var(--primary-color);
}

.wishlist-btn.active i {
    font-weight: 900;
    color: var(--primary-color);
}

.wishlist-btn:active {
    transform: scale(0.95);
}

/* Tablet and below (max-width: 992px) */
@media (max-width: 992px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

/* Mobile devices (max-width: 768px) */
@media (max-width: 768px) {

    /* Products Section - Mobile */
    .products-section {
        padding: 40px 0 60px !important;
    }

    .products-section .section-title {
        font-size: 22px !important;
        margin-bottom: 35px !important;
    }

    .tabs {
        gap: 16px !important;
        flex-wrap: wrap !important;
        margin-bottom: 30px !important;
        justify-content: center !important;
    }

    .tabs span {
        font-size: 14px !important;
        padding: 8px 4px !important;
    }

    .product-grid {
        display: grid !important;
        grid-template-columns: 1fr 1fr !important;
        gap: 14px !important;
    }

    .p-img-box {
        height: 180px !important;
        border-radius: 6px 6px 0 0 !important;
    }

    .p-title {
        font-size: 13px !important;
        padding: 0 10px !important;
        margin-bottom: 6px !important;
    }

    .p-price {
        font-size: 14px !important;
        padding: 0 10px 10px !important;
    }

    .p-old-price {
        font-size: 12px !important;
    }
}

/* Category List */
.category-list li {
    margin-bottom: 8px;
}

.category-list a {
    color: #555;
    font-size: 14px;
    transition: var(--transition-base);
    display: block;
    padding: 8px 12px;
    border-radius: 6px;
    position: relative;
}

/* Two-level category styles */
.category-list li.has-children {
    margin-bottom: 4px;
}

.category-list .category-parent {
    cursor: pointer;
}

.category-list .category-parent i {
    transition: transform 0.3s ease;
}

.category-list li.has-children.open>.category-parent i {
    transform: rotate(180deg);
}

/* Sub-category list */
.category-sub-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, padding 0.3s ease;
    padding-left: 16px;
    margin: 0;
    list-style: none;
}

.category-list li.has-children.open>.category-sub-list {
    max-height: 300px;
    padding-top: 4px;
}

.category-sub-list li {
    margin-bottom: 2px;
}

.category-sub-list a {
    font-size: 13px;
    padding: 6px 12px;
    color: #777;
}

.category-sub-list a:hover,
.category-sub-list a.active {
    color: var(--primary-color);
    background: rgba(255, 78, 0, 0.05);
}

.category-list a::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: var(--primary-color);
    transition: height 0.3s ease;
    border-radius: 2px;
}

.category-list a:hover,
.category-list a.active {
    color: var(--primary-color);
    background: rgba(255, 78, 0, 0.05);
    padding-left: 16px;
}

.category-list a:hover::before,
.category-list a.active::before {
    height: 60%;
}

/* Price Range Slider */
.price-range-slider input[type=range] {
    width: 100%;
    cursor: pointer;
    accent-color: var(--primary-color);
}

.widget-check-list {
    margin-left: 1.5rem;
}

/* Checkbox Lists */
.widget-check-list .form-check {
    padding: 6px 0;
    transition: var(--transition-fast);
}

.widget-check-list .form-check:hover {
    padding-left: 8px;
}

.widget-check-list .form-check-input {
    cursor: pointer;
    border-width: 2px;
    transition: var(--transition-fast);
}

.widget-check-list .form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 78, 0, 0.1);
}

.widget-check-list .form-check-label {
    font-size: 14px;
    cursor: pointer;
    transition: color 0.3s;
    user-select: none;
}

.widget-check-list .form-check-input:checked+.form-check-label {
    color: var(--primary-color) !important;
    font-weight: 500;
}

/* Shop Toolbar */
.shop-toolbar {
    background: linear-gradient(135deg, #f9f9f9 0%, #f7f7f7 100%);
    padding: 16px 20px;
    border-radius: 8px;
    border: 1px solid #e8e8e8;
    box-shadow: var(--shadow-sm);
    margin-bottom: 24px;
}

.view-mode a {
    color: #ccc;
    transition: var(--transition-base);
    padding: 8px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.view-mode a.active,
.view-mode a:hover {
    color: var(--primary-color) !important;
    background: rgba(255, 78, 0, 0.1);
}


.category-list {
    padding-left: 0px;
}

/* Responsive adjustments for Product List */
@media (max-width: 992px) {
    .sidebar-widget {
        margin-bottom: 30px;
    }

    .shop-toolbar {
        flex-wrap: nowrap !important;
        gap: 8px;
        padding: 10px 12px;
    }

    .toolbar-right {
        flex-shrink: 0;
        gap: 6px;
    }

    .toolbar-right select {
        font-size: 12px !important;
    }
}

/* Mobile Sidebar Enhancements */
@media (max-width: 768px) {



    /* Sidebar becomes collapsible on mobile */
    .product-list-section .col-lg-3 {
        position: relative;
    }

    .sidebar-widget {
        background: #fff;
        border-radius: 8px;
        padding: 16px;
        margin-bottom: 16px;
        box-shadow: var(--shadow-sm);
        border: 1px solid #eee;
    }

    .widget-title {
        font-size: 16px;
        cursor: pointer;
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 0;
        padding-bottom: 0;
    }

    .widget-title::after {
        display: none;
    }

    .widget-title::before {
        content: '\f107';
        font-family: 'Font Awesome 6 Free';
        font-weight: 900;
        font-size: 14px;
        color: #999;
        transition: transform 0.3s ease;
    }

    .sidebar-widget.active .widget-title::before {
        transform: rotate(180deg);
    }

    .sidebar-widget .category-list,
    .sidebar-widget .price-range-slider,
    .sidebar-widget .widget-check-list {
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), padding 0.3s ease;
        padding-top: 0;
    }

    .sidebar-widget.active .category-list,
    .sidebar-widget.active .price-range-slider,
    .sidebar-widget.active .widget-check-list {
        max-height: 500px;
    }

    .shop-toolbar {
        padding: 8px 10px;
        margin-bottom: 12px;
        gap: 8px;
        flex-wrap: nowrap !important;
        justify-content: space-between;
    }

    .toolbar-left {
        width: auto;
        margin-bottom: 0;
    }

    .toolbar-right {
        font-size: 11px !important;
        gap: 6px !important;
        flex-shrink: 0;
    }

    .toolbar-right span {
        font-size: 11px !important;
    }

    .toolbar-right select {
        font-size: 11px !important;
        min-width: 50px !important;
        padding: 4px 20px 4px 6px !important;
    }

    .btn-filter {
        padding: 5px 10px;
        font-size: 11px;
        flex-shrink: 0;
    }
}

/* --- List View / Grid View Toggle Styles --- */

/* Force full width for columns in list view */
#product-container.list-view .col {
    width: 100% !important;
    flex: 0 0 100% !important;
    max-width: 100% !important;
}

/* List View Card Layout */
#product-container.list-view .product-card {
    display: grid;
    grid-template-columns: 250px 1fr;
    grid-template-rows: auto auto;
    gap: 0 30px;
    align-items: center;
    border: 1px solid #eee;
    padding: 20px;
    border-radius: 8px;
    background: #fff;
}

#product-container.list-view .product-card:hover {
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.05);
    transform: translateY(-2px);
}

/* Image Box in List View */
#product-container.list-view .p-img-box {
    grid-row: 1 / span 3;
    /* Span across rows */
    width: 100%;
    height: 220px;
    margin-bottom: 0;
    background: #f9f9f9;
    border-radius: 4px;
}

/* Title in List View */
#product-container.list-view .p-title {
    text-align: left !important;
    font-size: 18px;
    margin-bottom: 10px;
    align-self: end;
    /* Push to bottom of its cell */
}

/* Price in List View */
#product-container.list-view .p-price {
    text-align: left !important;
    font-size: 20px;
    align-self: start;
    /* Push to top of its cell */
}

/* Responsive List View */
@media (max-width: 576px) {
    #product-container.list-view .product-card {
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        text-align: center;
    }

    #product-container.list-view .p-img-box {
        grid-row: auto;
        height: 200px;
        margin-bottom: 15px;
    }

    #product-container.list-view .p-title,
    #product-container.list-view .p-price {
        text-align: center !important;
        align-self: center;
    }
}

/* ========== Product List Page - Hover Overlay Styles ========== */

/* Product Overlay Container */
.product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 10;
    padding: 20px;
}

.product-card:hover .product-overlay {
    opacity: 1;
    visibility: visible;
}

/* Add to Cart Button */
.product-action-btn {
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 12px 28px;
    font-size: 14px;
    font-weight: 600;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(255, 78, 0, 0.3);
    transform: translateY(10px);
    opacity: 0;
    white-space: nowrap;
}

.product-card:hover .product-action-btn {
    transform: translateY(0);
    opacity: 1;
    transition-delay: 0.1s;
}

.product-action-btn:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(255, 78, 0, 0.4);
}

.product-action-btn:active {
    transform: translateY(0);
}

.product-action-btn i {
    font-size: 14px;
}

/* Quick Actions Container */
.product-quick-actions {
    display: flex;
    gap: 10px;
    transform: translateY(10px);
    opacity: 0;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover .product-quick-actions {
    transform: translateY(0);
    opacity: 1;
    transition-delay: 0.2s;
}

/* Icon Buttons (Quick View & Favorites) */
.product-icon-btn {
    background: #fff;
    color: #333;
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.product-icon-btn:hover {
    background: var(--primary-color);
    color: #fff;
    transform: translateY(-3px) scale(1.1);
    box-shadow: 0 4px 12px rgba(255, 78, 0, 0.3);
}

.product-icon-btn:active {
    transform: translateY(-1px) scale(1.05);
}

.product-icon-btn i {
    font-size: 16px;
}

/* Enhanced Product Card Styling */
.product-card {
    position: relative;
    border: 1px solid transparent;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover {
    border-color: #e8e8e8;
}

/* Improved Image Box */
.p-img-box {
    position: relative;
    overflow: hidden;
}

/* --- Product Zoom Effect --- */
.main-image-wrapper {
    position: relative;
    cursor: crosshair; /* Indicate zoom availability */
}

/* The lens (the selection box) */
.zoom-lens {
    position: absolute;
    border: 1px solid #d4d4d4;
    width: 200px;
    height: 200px;
    background-color: rgba(255, 78, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 10;
    transition: opacity 0.2s;
}

/* The result (the zoomed view) */
.zoom-result {
    position: absolute;
    top: 0;
    left: 105%;
    width: 500px;
    height: 500px;
    border: 1px solid #d4d4d4;
    background-color: #fff;
    background-repeat: no-repeat;
    box-shadow: 0 5px 20px rgba(0,0,0,0.2);
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s;
    display: none;
}

/* Show them when active */
.main-image-wrapper.zooming .zoom-lens,
.main-image-wrapper.zooming .zoom-result {
    opacity: 1;
    visibility: visible;
    display: block;
}

/* Responsive: Hide zoom on smaller screens */
@media (max-width: 992px) {
    .zoom-lens, .zoom-result {
        display: none !important;
    }
    .main-image-wrapper {
        cursor: default;
    }
}

.p-img-box img {
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.product-card:hover .p-img-box img {
    transform: scale(1.08);
}

/* ========== Shop Toolbar Styles ========== */

.shop-toolbar {
    background: #fff;
    padding: 16px 20px;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    border: 1px solid #eee;
}

.shop-toolbar .form-select {
    border: 1px solid #ddd;
    border-radius: 6px;
    padding: 6px 32px 6px 12px;
    font-size: 14px;
    color: #333;
    background-color: #fff;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23333' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 8px center;
    background-size: 16px 12px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.shop-toolbar .form-select:hover {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(255, 78, 0, 0.1);
}

.shop-toolbar .form-select:focus {
    border-color: var(--primary-color);
    outline: none;
    box-shadow: 0 0 0 3px rgba(255, 78, 0, 0.15);
}

/* Ensure option elements are visible */
.shop-toolbar .form-select option {
    color: #333;
    background-color: #fff;
    padding: 8px 12px;
    font-size: 14px;
}

.shop-toolbar .form-select option:hover {
    background-color: #f5f5f5;
}

.shop-toolbar .form-select option:checked {
    background-color: var(--primary-light);
    color: #fff;
}

/* View mode buttons */
.view-mode a {
    transition: all 0.3s ease;
}

.view-mode a:hover {
    transform: scale(1.1);
}

/* Filter button for mobile */
.btn-filter {
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 78, 0, 0.2);
}

.btn-filter:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 78, 0, 0.3);
}

.btn-filter:active {
    transform: translateY(0);
}

/* ========== Responsive Styles for Product Overlay ========== */

@media (max-width: 992px) {
    .product-action-btn {
        padding: 10px 24px;
        font-size: 13px;
    }

    .product-icon-btn {
        width: 40px;
        height: 40px;
    }

    .product-icon-btn i {
        font-size: 15px;
    }
}

@media (max-width: 768px) {

    /* Adjust overlay for smaller screens */
    .product-overlay {
        gap: 10px;
        padding: 15px;
    }

    .product-action-btn {
        padding: 10px 20px;
        font-size: 12px;
    }

    .product-icon-btn {
        width: 38px;
        height: 38px;
    }

    .product-icon-btn i {
        font-size: 14px;
    }

    /* Improve product card spacing on mobile */
    .product-card {
        margin-bottom: 8px;
    }
}

@media (max-width: 576px) {

    /* Stack buttons vertically on very small screens if needed */
    .product-overlay {
        gap: 8px;
        padding: 12px;
    }

    .product-action-btn {
        padding: 9px 18px;
        font-size: 11px;
        gap: 6px;
    }

    .product-quick-actions {
        gap: 8px;
    }

    .product-icon-btn {
        width: 36px;
        height: 36px;
    }

    .product-icon-btn i {
        font-size: 13px;
    }
}

/* ========== Additional Product List Enhancements ========== */

/* Breadcrumb Improvements */
.breadcrumb-area {
    background: linear-gradient(135deg, #f8f9fa 0%, #f5f6f7 100%);
    border-bottom: 1px solid #e8e8e8;
}

.breadcrumb-item a {
    transition: color 0.3s ease;
}

.breadcrumb-item a:hover {
    color: var(--primary-color) !important;
}

/* Sidebar Widget Enhancements */
.widget-title {
    position: relative;
    padding-bottom: 12px;
    margin-bottom: 20px;
    font-size: 18px;
    font-weight: 600;
    color: var(--text-color);
}

.widget-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--primary-color);
    border-radius: 2px;
}

.category-list li a {
    display: block;
    padding: 10px 0;
    color: var(--light-text);
    transition: all 0.3s ease;
    border-bottom: 1px solid #f5f5f5;
}

.category-list li a:hover,
.category-list li a.active {
    color: var(--primary-color);
    padding-left: 10px;
}

/* Price Range Slider Enhancements */
.form-range::-webkit-slider-thumb {
    background: var(--primary-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-range::-webkit-slider-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 0 8px rgba(255, 78, 0, 0.1);
}

.form-range::-moz-range-thumb {
    background: var(--primary-color);
    cursor: pointer;
    transition: all 0.3s ease;
}

.form-range::-moz-range-thumb:hover {
    transform: scale(1.2);
    box-shadow: 0 0 0 8px rgba(255, 78, 0, 0.1);
}

/* Smooth Scrolling */
html {
    scroll-behavior: smooth;
}

/* Loading Animation for Product Cards */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-card {
    animation: fadeInUp 0.6s ease-out;
    animation-fill-mode: both;
}

/* Stagger animation for product cards */
.product-card:nth-child(1) {
    animation-delay: 0.05s;
}

.product-card:nth-child(2) {
    animation-delay: 0.1s;
}

.product-card:nth-child(3) {
    animation-delay: 0.15s;
}

.product-card:nth-child(4) {
    animation-delay: 0.2s;
}

.product-card:nth-child(5) {
    animation-delay: 0.25s;
}

.product-card:nth-child(6) {
    animation-delay: 0.3s;
}

.product-card:nth-child(7) {
    animation-delay: 0.35s;
}

.product-card:nth-child(8) {
    animation-delay: 0.4s;
}

.product-card:nth-child(9) {
    animation-delay: 0.45s;
}

/* ========== Mobile Filter Sidebar Optimization ========== */

/* Mobile Filter Button */
.btn-filter {
    background: var(--primary-color);
    color: #fff;
    border: none;
    padding: 10px 20px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(255, 78, 0, 0.3);
}

.btn-filter:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 78, 0, 0.4);
}

.btn-filter i {
    font-size: 14px;
}

/* --- Product Detail Page --- */

/* Breadcrumb override */
.breadcrumb-item+.breadcrumb-item::before {
    content: "/";
    color: #ccc;
}

.breadcrumb-item.active {
    color: #333;
    font-weight: 500;
}

/* Gallery */
.gallery-thumbs {
    width: 80px;
    flex-shrink: 0;
}

.thumb-item {
    border: 1px solid transparent;
    cursor: pointer;
    transition: all 0.2s;
    opacity: 0.7;
    margin-bottom: 10px;
}

.thumb-item:last-child {
    margin-bottom: 0;
}

.thumb-item:hover,
.thumb-item.active {
    border-color: var(--primary-color);
    opacity: 1;
}

.thumb-item img {
    display: block;
    width: 100%;
}

.thumb-item {
    position: relative;
}

.play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    color: #fff;
    font-size: 16px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    background: rgba(0, 0, 0, 0.3);
    width: 24px;
    height: 24px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #fff;
}

.gallery-main {
    border: 1px solid #eee;
    min-height: 400px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff;
}

.main-image-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.gallery-main img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

/* Product Info */
.product-title {
    line-height: 1.4;
    color: #333;
}

.product-price-box .h1 {
    color: var(--primary-color);
}

.spec-btn {
    border: 1px solid #ddd;
    color: #666;
    min-width: 40px;
    border-radius: 0;
    position: relative;
    overflow: hidden;
}

.spec-btn:hover,
.spec-btn.active {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background: #fff;
}

.spec-btn.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 0 10px 10px;
    border-color: transparent transparent var(--primary-color) transparent;
}

.quantity-spinner {
    border: 1px solid #ddd;
    width: fit-content;
}

.quantity-spinner button {
    background: #f8f8f8;
    border: none;
    height: 36px;
    width: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

.quantity-spinner button:hover {
    background: #eee;
}

/* Tabs */
.tab-trigger {
    cursor: pointer;
    font-size: 18px;
    font-weight: 500;
    color: #999;
    border-bottom: 2px solid transparent;
    transition: all 0.3s;
    position: relative;
}

.tab-trigger:hover {
    color: #666;
}

.tab-trigger.active {
    color: #000;
    border-bottom-color: var(--primary-color);
}

.tab-pane-custom {
    display: none;
    animation: fadeIn 0.4s ease;
}

.tab-pane-custom.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Related Products Swiper Navigation */
.related-nav {
    width: 40px;
    height: 40px;
    cursor: pointer;
    transition: all 0.3s;
    opacity: 0.3;
}

.related-nav:hover {
    opacity: 1;
    color: var(--primary-color) !important;
}

/* Table Styles for Attributes */
.table th {
    font-weight: 600;
    color: #333;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .product-gallery {
        flex-direction: column-reverse;
    }

    .gallery-thumbs {
        flex-direction: row !important;
        width: 100%;
        overflow-x: auto;
    }

    .thumb-item {
        width: 60px;
        margin-right: 10px;
        margin-bottom: 0;
    }

    .gallery-main {
        min-height: 300px;
    }
}

/* --- Product Detail Page New Styles (Append) --- */

/* Breadcrumb Truncation */
.text-truncate {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Product Info */
.product-info {
    padding-left: 20px;
}

.product-title {
    font-size: 24px;
    font-weight: 600;
    line-height: 1.4;
    color: #333;
}

.price-wrapper {
    display: flex;
    align-items: baseline;
    gap: 15px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.current-price {
    font-size: 28px;
    font-weight: 700;
    color: #333;
}

.original-price {
    font-size: 16px;
    color: #999;
    text-decoration: line-through;
}

.product-meta {
    font-size: 14px;
    color: #666;
}

.meta-row {
    margin-bottom: 8px;
    display: flex;
}

.meta-label {
    width: 80px;
    color: #999;
}

.meta-value {
    font-weight: 500;
    color: #333;
}

/* Options */
.option-label {
    display: block;
    margin-bottom: 8px;
    font-size: 14px;
    color: #666;
}

.option-values {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.option-btn {
    border: 1px solid #ddd;
    padding: 6px 15px;
    cursor: pointer;
    background: #fff;
    transition: all 0.2s;
    min-width: 40px;
    text-align: center;
    font-size: 14px;
    color: #555;
    position: relative;
    overflow: hidden;
}

.option-btn:hover {
    border-color: #aaa;
}

.option-btn.selected {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.option-btn.selected::after {
    content: '';
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 0;
    border-style: solid;
    border-width: 0 0 12px 12px;
    border-color: transparent transparent var(--primary-color) transparent;
}

.option-btn.disabled {
    border-color: #eee;
    color: #ccc;
    cursor: not-allowed;
    background: #fdfdfd;
}

/* Quantity */
.quantity-selector {
    display: flex;
    border: 1px solid #ddd;
    height: 44px;
}

.qty-btn {
    width: 40px;
    background: #f9f9f9;
    border: none;
    cursor: pointer;
    font-size: 12px;
    transition: background 0.2s;
}

.qty-btn:hover {
    background: #eee;
}

.qty-input {
    width: 50px;
    border: none;
    text-align: center;
    font-weight: 600;
    -moz-appearance: textfield;
}

.qty-input::-webkit-outer-spin-button,
.qty-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Actions */
.btn-add-cart,
.btn-buy-now {
    height: 44px;
    padding: 0 30px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 14px;
    border-radius: 0;
    transition: all 0.3s;
}

.btn-add-cart {
    background: #fff;
    border: 1px solid #333;
    color: #333;
}

.btn-add-cart:hover {
    background: #333;
    color: #fff;
}

.btn-buy-now {
    background: #333;
    border: 1px solid #333;
    color: #fff;
}

.btn-buy-now:hover {
    background: #000;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
}

.add-to-fav-link {
    font-size: 13px;
    color: #999;
    transition: color 0.2s;
}

.add-to-fav-link:hover {
    color: var(--primary-color);
}

/* Tabs */
.tabs-header {
    display: flex;
    gap: 40px;
    justify-content: center;
}

.tab-btn {
    border: none;
    background: none;
    padding: 15px 0;
    font-size: 16px;
    font-weight: 600;
    color: #999;
    border-bottom: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn.active {
    color: var(--primary-color);
    border-bottom-color: var(--primary-color);
}

.tab-pane {
    display: none;
    padding-top: 30px;
    animation: fadeIn 0.5s ease;
}

.tab-pane.active {
    display: block;
}

/* Related Products Swiper */
.related-swiper {
    padding: 20px 5px 50px !important;
}

.related-swiper .product-card {
    border: 1px solid #eee;
}

.related-swiper .swiper-pagination-bullet-active {
    background: var(--primary-color);
}

.related-swiper .swiper-button-next,
.related-swiper .swiper-button-prev {
    color: #333;
    width: 40px;
    height: 40px;
    background: #fff;
    border-radius: 50%;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.related-swiper .swiper-button-next::after,
.related-swiper .swiper-button-prev::after {
    font-size: 16px;
    font-weight: bold;
}

/* Responsive */
@media (max-width: 991px) {
    .product-info {
        padding-left: 0;
        margin-top: 30px;
    }

    .product-gallery {
        flex-direction: column-reverse;
    }

    .gallery-thumbs {
        flex-direction: row !important;
        width: 100%;
        overflow-x: auto;
    }

    .thumb-item {
        width: 80px;
        height: 80px;
        flex-shrink: 0;
    }

    .main-image-wrapper {
        width: 100%;
    }
}

/* --- Mobile Filter Sidebar Styles --- */
@media (max-width: 991.98px) {
    .filter-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 1040;
        opacity: 0;
        visibility: hidden;
        transition: all 0.3s ease;
    }

    .filter-overlay.active {
        opacity: 1;
        visibility: visible;
    }

    .sidebar-container {
        position: fixed;
        top: 0;
        left: 0;
        width: 280px;
        height: 100%;
        background: #fff;
        z-index: 1050;
        padding: 20px;
        transform: translateX(-100%);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        overflow-y: auto;
        box-shadow: 4px 0 15px rgba(0, 0, 0, 0.1);
    }

    .sidebar-container.active {
        transform: translateX(0);
    }

    .btn-close-filter {
        position: absolute;
        top: 15px;
        right: 15px;
        width: 32px;
        height: 32px;
        border: 1px solid #eee;
        background: #fff;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        color: #666;
        transition: all 0.3s ease;
        z-index: 1060;
        padding: 0;
    }

    .btn-close-filter:hover {
        background: var(--primary-color);
        color: #fff;
        border-color: var(--primary-color);
        transform: rotate(90deg);
    }

    .sidebar-title {
        font-size: 18px;
        font-weight: 600;
        margin-bottom: 25px !important;
        padding-bottom: 15px;
        border-bottom: 1px solid #eee;
        display: block !important;
        color: #333;
    }
}

/* --- Quick Shop Modal Styles --- */
.quick-shop-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    visibility: hidden;
    opacity: 0;
    transition: all 0.3s ease;
}

.quick-shop-modal.active {
    visibility: visible;
    opacity: 1;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(2px);
}

.modal-content {
    background: #fff;
    width: 800px;
    max-width: 90%;
    max-height: 90vh;
    border-radius: 8px;
    position: relative;
    z-index: 2001;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    transform: translateY(20px);
    transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.quick-shop-modal.active .modal-content {
    transform: translateY(0);
}

.modal-close {
    position: absolute;
    top: 15px;
    right: 15px;
    background: none;
    border: none;
    font-size: 24px;
    color: #999;
    cursor: pointer;
    z-index: 2002;
    transition: color 0.3s;
}

.modal-close:hover {
    color: var(--primary-color);
}

.modal-body {
    padding: 30px;
}

.quick-shop-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 30px;
}

.qs-image-col img {
    width: 100%;
    height: auto;
    border-radius: 4px;
    object-fit: cover;
}

.qs-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
}

.qs-price-wrapper {
    margin-bottom: 20px;
}

.qs-price {
    font-size: 22px;
    font-weight: 700;
    color: var(--primary-color);
    margin-right: 10px;
}

.qs-old-price {
    font-size: 14px;
    color: #999;
    text-decoration: line-through;
}

/* Mobile Responsiveness for Modal */
@media (max-width: 768px) {
    .modal-content {
        max-width: 95%;
        max-height: 80vh;
        margin: 0 auto;
    }

    .quick-shop-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .modal-body {
        padding: 20px;
    }

    .qs-image-col {
        text-align: center;
    }

    .qs-image-col img,
    .qs-gallery-col {
        max-height: 250px;
        width: 100%;
        overflow: hidden;
    }

    .qs-gallery {
        height: 250px !important;
    }

    .qs-title {
        font-size: 18px;
    }

    .qs-price {
        font-size: 20px;
    }
}

/* --- Added QS Features (Stock, Gallery, Link) --- */
.qs-stock-status {
    font-size: 14px;
    font-weight: 500;
}

.stock-badge.in-stock {
    color: #2ecc71;
}

.stock-badge.low-stock {
    color: #e74c3c;
}

.view-detail-link {
    color: #666;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s;
    display: inline-flex;
    align-items: center;
}

.view-detail-link:hover {
    color: var(--primary-color);
}

/* Modal Swiper Gallery */
.qs-gallery {
    width: 100%;
    height: 100%;
    border-radius: 4px;
    overflow: hidden;
}

.qs-gallery .swiper-slide {
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f9f9f9;
}

.qs-gallery .swiper-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Video placeholder in slide */
.qs-video-slide {
    position: relative;
    width: 100%;
    height: 100%;
    background: #000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.play-icon {
    font-size: 40px;
    color: #fff;
    opacity: 0.8;
}

.qs-gallery .swiper-button-next,
.qs-gallery .swiper-button-prev {
    color: #fff;
    width: 30px;
    height: 30px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
}

.qs-gallery .swiper-button-next:after,
.qs-gallery .swiper-button-prev:after {
    font-size: 12px;
}