/* ==================== SPRODUCTS PAGE STYLES ==================== */

/* Header Breadcrumb */
.breadcrumbs_area {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 30px 0;
    margin-top: 0;
    color: white;
}

.breadcrumb_content h3 {
    font-size: 32px;
    font-weight: 700;
    margin-bottom: 10px;
    text-transform: capitalize;
}

.breadcrumb_content ul {
    list-style: none;
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

.breadcrumb_content ul li {
    font-size: 14px;
}

.breadcrumb_content ul li a {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    transition: all 0.3s ease;
}

.breadcrumb_content ul li a:hover {
    color: white;
    text-decoration: underline;
}

/* Shop Area */
.shop_area {
    padding: 40px 0;
    background: #f8f9fa;
    overflow-x: hidden;
}

.shop_content_wrapper {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
    max-width: 100%;
}

/* Sidebar */
.shop_sidebar {
    position: sticky;
    top: 100px;
    height: fit-content;
}

.filter_widget {
    background: white;
    border-radius: 8px;
    padding: 0;
    margin-bottom: 16px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
    overflow: hidden;
}

.filter_widget h3 {
    font-size: 14px;
    font-weight: 600;
    margin: 0;
    color: #1f2937;
    padding: 14px 16px;
    background: #f9fafb;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    transition: all 0.3s ease;
}

.filter_widget h3:hover {
    background: #f3f4f6;
}

.filter_widget h3 .toggle-icon {
    font-size: 12px;
    color: #9ca3af;
    transition: transform 0.3s ease;
}

.filter_widget.open h3 .toggle-icon {
    transform: rotate(180deg);
}

.filter_content {
    padding: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

.filter_widget.open .filter_content {
    max-height: 1000px;
    padding: 16px;
}

/* Price Filter */
.price_filter_wrapper {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.price_inputs {
    display: flex;
    gap: 8px;
}

.price_inputs input {
    flex: 1;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 12px;
    text-align: center;
    transition: all 0.3s ease;
    min-width: 0;
}

.price_inputs input:focus {
    outline: none;
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.1);
}

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

input[type="range"] {
    width: 100%;
    height: 5px;
    border-radius: 3px;
    background: linear-gradient(to right, #667eea 0%, #667eea 50%, #e5e7eb 50%, #e5e7eb 100%);
    outline: none;
    -webkit-appearance: none;
    appearance: none;
}

input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 4px rgba(102, 126, 234, 0.3);
}

input[type="range"]::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: 0 3px 8px rgba(102, 126, 234, 0.4);
}

input[type="range"]::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #667eea;
    cursor: pointer;
    border: none;
    transition: all 0.3s ease;
}

/* Checkbox Filter */
.checkbox_filter {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.checkbox_item {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.checkbox_item input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    accent-color: #667eea;
    flex-shrink: 0;
}

.checkbox_item label {
    cursor: pointer;
    color: #374151;
    font-size: 14px;
    font-weight: 500;
    margin: 0;
    flex: 1;
    line-height: 1.3;
}

.checkbox_item .count {
    font-size: 12px;
    color: #9ca3af;
    margin-left: auto;
    flex-shrink: 0;
}

.checkbox_item input[type="checkbox"]:checked + label {
    color: #667eea;
    font-weight: 600;
}

/* Color Filter */
.color_filter_wrapper {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
}

.color_option {
    position: relative;
    cursor: pointer;
}

.color_option input {
    display: none;
}

.color_label {
    display: block;
    width: 100%;
    aspect-ratio: 1;
    border-radius: 6px;
    border: 2px solid #d1d5db;
    cursor: pointer;
    transition: all 0.3s ease;
}

.color_option input:checked + .color_label {
    border-color: #667eea;
    box-shadow: 0 0 0 2px rgba(102, 126, 234, 0.2);
}

/* Products Grid - Default Desktop */
.products_grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 24px;
    width: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
}

#products-container {
    width: 100%;
    min-width: 0;
    overflow: hidden;
}

.product_card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: fadeInUp 0.6s ease-out;
    height: 100%;
    display: flex;
    flex-direction: column;
    cursor: pointer;
    min-width: 0;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product_card:hover {
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
}

.product_image_wrapper {
    position: relative;
    overflow: hidden;
    background: #f3f4f6;
    width: 100%;
    aspect-ratio: 1 / 1;
    display: block;
}

/* Fallback for older browsers */
@supports not (aspect-ratio: 1 / 1) {
    .product_image_wrapper {
        padding-bottom: 100%;
        height: 0;
    }
}

.product_image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: all 0.5s ease;
}

.product_image.primary_img {
    opacity: 1;
    visibility: visible;
    z-index: 1;
}

.product_image.secondary_img {
    opacity: 0;
    visibility: hidden;
    z-index: 0;
}

.product_card:hover .product_image.primary_img {
    opacity: 0;
    visibility: hidden;
}

.product_card:hover .product_image.secondary_img {
    opacity: 1;
    visibility: visible;
}

.product_badge {
    position: absolute;
    top: 8px;
    right: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-weight: 700;
    animation: slideIn 0.4s ease-out;
    z-index: 2;
    white-space: nowrap;
    max-width: calc(100% - 16px);
    overflow: hidden;
    text-overflow: ellipsis;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Wishlist Heart Button */
.wishlist_heart {
    position: absolute;
    bottom: 8px;
    right: 8px;
    z-index: 10;
}

.heart_btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border: none;
    border-radius: 50%;
    background: white;
    color: #ef4444;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    text-decoration: none;
}

.heart_btn:hover {
    background: #ef4444;
    color: white;
    transform: scale(1.1);
    box-shadow: 0 4px 12px rgba(239, 68, 68, 0.3);
}

.heart_btn.active {
    background: #ef4444;
    color: white;
}

.heart_btn.active:hover {
    background: #dc2626;
}

/* Product Info */
.product_info {
    padding: 12px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.product_category {
    font-size: 10px;
    color: #9ca3af;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 4px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product_title {
    font-size: 13px;
    font-weight: 600;
    color: #1f2937;
    margin-bottom: 6px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.3s ease;
    word-break: break-word;
}

.product_card:hover .product_title {
    color: #667eea;
}

.product_pricing {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: auto;
    flex-wrap: wrap;
}

.product_price_current {
    font-size: 15px;
    font-weight: 700;
    color: #1f2937;
}

.product_price_original {
    font-size: 12px;
    color: #9ca3af;
    text-decoration: line-through;
}

.product_rating {
    font-size: 11px;
    color: #fbbf24;
    margin-top: 4px;
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
}

.product_rating span {
    color: #6b7280;
    font-size: 10px;
}

/* No Products */
.no_products {
    grid-column: 1 / -1;
    text-align: center;
    padding: 60px 20px;
    background: white;
    border-radius: 12px;
}

.no_products img {
    width: 120px;
    opacity: 0.6;
    margin-bottom: 20px;
}

.no_products h2 {
    font-size: 24px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 10px;
}

.no_products p {
    color: #6b7280;
    font-size: 16px;
}

/* ==================== TABLET BREAKPOINT ==================== */
@media (max-width: 1024px) {
    .products_grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 20px;
    }
    
    .shop_content_wrapper {
        gap: 20px;
    }
}

/* ==================== MOBILE BREAKPOINT - FORCE 2 COLUMNS ==================== */
@media screen and (max-width: 768px) {
    .shop_area {
        padding: 20px 0;
    }
    
    .shop_content_wrapper {
        grid-template-columns: 1fr;
        gap: 20px;
    }

    .shop_sidebar {
        position: relative;
        top: 0;
    }

    /* FORCE 2 COLUMNS */
    .products_grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 12px !important;
    }
    
    .product_card {
        border-radius: 10px;
    }
    
    .product_info {
        padding: 10px;
    }
    
    .product_title {
        font-size: 13px;
        line-height: 1.4;
        margin-bottom: 6px;
    }
    
    .product_category {
        font-size: 9px;
        margin-bottom: 3px;
    }
    
    .product_pricing {
        gap: 6px;
    }
    
    .product_price_current {
        font-size: 14px;
    }
    
    .product_price_original {
        font-size: 11px;
    }
    
    .product_rating {
        font-size: 10px;
        margin-top: 4px;
    }
    
    .product_rating span {
        font-size: 9px;
    }
    
    .product_badge {
        font-size: 10px;
        padding: 3px 6px;
        top: 6px;
        right: 6px;
    }
    
    .wishlist_heart {
        bottom: 6px;
        right: 6px;
    }
    
    .heart_btn {
        width: 32px;
        height: 32px;
        font-size: 14px;
    }

    .breadcrumb_content h3 {
        font-size: 24px;
    }
    
    .breadcrumb_content ul {
        gap: 8px;
    }
    
    .breadcrumb_content ul li {
        font-size: 13px;
    }

    .color_filter_wrapper {
        grid-template-columns: repeat(5, 1fr);
        gap: 6px;
    }
    
    .filter_widget {
        margin-bottom: 12px;
    }
    
    .filter_widget h3 {
        padding: 12px 14px;
        font-size: 13px;
    }
    
    .filter_widget.open .filter_content {
        padding: 14px;
    }
    
    .checkbox_item label {
        font-size: 13px;
    }
}

/* ==================== SMALL MOBILE BREAKPOINT ==================== */
@media screen and (max-width: 480px) {
    .breadcrumbs_area {
        padding: 20px 0;
    }
    
    .breadcrumb_content h3 {
        font-size: 20px;
    }
    
    /* ENSURE 2 COLUMNS */
    .products_grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 10px !important;
    }

    .product_info {
        padding: 8px;
    }

    .product_title {
        font-size: 12px;
        line-height: 1.3;
        margin-bottom: 4px;
    }
    
    .product_category {
        font-size: 8px;
        letter-spacing: 0.2px;
        margin-bottom: 2px;
    }
    
    .product_pricing {
        gap: 4px;
    }

    .product_price_current {
        font-size: 13px;
    }
    
    .product_price_original {
        font-size: 10px;
    }
    
    .product_rating {
        font-size: 9px;
        margin-top: 2px;
        gap: 2px;
    }
    
    .product_rating span {
        font-size: 8px;
    }
    
    .heart_btn {
        width: 28px;
        height: 28px;
        font-size: 12px;
    }
    
    .product_badge {
        font-size: 9px;
        padding: 2px 5px;
        top: 4px;
        right: 4px;
    }
    
    .wishlist_heart {
        bottom: 4px;
        right: 4px;
    }
    
    .color_filter_wrapper {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .checkbox_item {
        gap: 8px;
    }
    
    .checkbox_item input[type="checkbox"] {
        width: 18px;
        height: 18px;
    }
    
    .checkbox_item label {
        font-size: 12px;
    }
    
    .no_products {
        padding: 40px 16px;
    }
    
    .no_products img {
        width: 80px;
    }
    
    .no_products h2 {
        font-size: 20px;
    }
    
    .no_products p {
        font-size: 14px;
    }
}

/* ==================== EXTRA SMALL MOBILE ==================== */
@media screen and (max-width: 360px) {
    .products_grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
    }
    
    .product_info {
        padding: 6px;
    }
    
    .product_title {
        font-size: 11px;
        line-height: 1.2;
    }
    
    .product_price_current {
        font-size: 12px;
    }
}

/* Touch device optimizations */
@media (hover: none) {
    .product_card:hover {
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    }
    
    .heart_btn:hover {
        transform: none;
    }
    
    .heart_btn:active {
        transform: scale(0.95);
    }
}

/* Product Thumb Hover Effect */
.product_thumb {
    position: relative;
    overflow: hidden;
}

.product_thumb a {
    position: relative;
    display: block;
}

.product_thumb a img {
    width: 100%;
    height: auto;
    transition: all 0.5s ease;
}

.single_product .product_thumb a.primary_img {
    opacity: 1;
    visibility: visible;
    z-index: 1;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.single_product .product_thumb a.primary_img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.single_product .product_thumb a.secondary_img {
    opacity: 0;
    visibility: hidden;
    z-index: 0;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.single_product .product_thumb a.secondary_img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.single_product:hover .product_thumb a.primary_img {
    opacity: 0;
    visibility: hidden;
}

.single_product:hover .product_thumb a.secondary_img {
    opacity: 1;
    visibility: visible;
}