/* ===== SHOP PAGE STYLES ===== */

/* Shop Layout */
.shop-container {
    background: #fff;
}

/* Filter Sidebar */
.filter-sidebar {
    background: #f8f9fa;
    padding: 25px;
    border-radius: 12px;
    height: fit-content;
    position: sticky;
    top: 20px;
    box-shadow: 0 2px 15px rgba(0,0,0,0.08);
}

.filter-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

.filter-section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.filter-section h5 {
    color: #2c3e50;
    margin-bottom: 18px;
    font-weight: 700;
    font-size: 1.1rem;
    border-left: 4px solid #f78b5a;
    padding-left: 12px;
}

/* Category List */
.category-list .list-group {
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.category-list .list-group-item {
    border: none;
    border-bottom: 1px solid #e9ecef;
    padding: 12px 16px;
    transition: all 0.3s ease;
    background: white;
    color: #495057;
    font-weight: 500;
}

.category-list .list-group-item:last-child {
    border-bottom: none;
}

.category-list .list-group-item:hover {
    background: #f78b5a;
    color: white;
    transform: translateX(5px);
}

.category-list .list-group-item.active {
    background: #f78b5a;
    border-color: #f78b5a;
    color: white;
    font-weight: 600;
}

.category-list .badge {
    font-size: 0.7rem;
    padding: 4px 8px;
    background: rgba(255,255,255,0.2) !important;
    border: 1px solid rgba(255,255,255,0.3);
}

/* Current Filter Display */
.current-filter {
    background: white;
    padding: 12px;
    border-radius: 6px;
    border-left: 3px solid #f78b5a;
    margin-top: 15px;
}

.current-filter small {
    font-weight: 500;
}

.clear-filter {
    color: #dc3545;
    font-weight: 600;
    text-decoration: none;
}

.clear-filter:hover {
    text-decoration: underline;
    color: #dc3545;
}

/* Search Form */
.filter-form .input-group {
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border-radius: 6px;
}

.filter-form .form-control {
    border: 1px solid #dee2e6;
    border-right: none;
    padding: 10px 15px;
}

.filter-form .form-control:focus {
    border-color: #f78b5a;
    box-shadow: 0 0 0 0.2rem rgba(247, 139, 90, 0.25);
}

.filter-form .btn-outline-primary {
    border: 1px solid #f78b5a;
    color: #f78b5a;
    padding: 10px 15px;
}

.filter-form .btn-outline-primary:hover {
    background: #f78b5a;
    border-color: #f78b5a;
    color: white;
}

/* Product Cards - NO CROPPING */
.product-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: none;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    border-radius: 10px;
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

/* Product Images - NO CROPPING */
.product-card img {
    width: 100%;
    height: 220px;
    object-fit: contain; /* Changed from cover to contain - NO CROPPING */
    object-position: center;
    background: #f8f9fa;
    padding: 15px;
    transition: transform 0.3s ease;
}

.product-card:hover img {
    transform: scale(1.03);
}

.product-card .card-body {
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* Fix Product Card Text Layout */

.product-card .card-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2; /* Standard property */
    box-orient: vertical; /* Standard property */
    margin-bottom: 0.5rem;
}
.product-card .card-text {
    font-size: 0.85rem;
    line-height: 1.4;
    height: 2.8em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2; /* Add this */
    box-orient: vertical; /* Add this */
    margin-bottom: 1rem;
    color: #6c757d;
}

.product-card .card-body .mt-auto {
    margin-top: auto;
}

/* Price styling */
.product-card .fw-bold {
    font-size: 1.1rem;
    color: #f78b5a;
    margin-bottom: 0.5rem;
}

/* Add to cart button */
.product-card .add-to-cart {
    background: #f78b5a;
    border: none;
    padding: 8px 16px;
    font-size: 0.9rem;
    transition: all 0.3s ease;
}

.product-card .add-to-cart:hover {
    background: #e67e22;
    transform: translateY(-2px);
}

/* Sorting Bar */
.sorting-bar {
    background: white;
    padding: 20px;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 25px;
}

/* Price Filter Styles */
.price-filter .form-control {
    font-size: 0.85rem;
    padding: 8px 10px;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    height: auto;
}

.price-filter .form-control:focus {
    border-color: #f78b5a;
    box-shadow: 0 0 0 0.2rem rgba(247, 139, 90, 0.25);
}

.price-filter .btn {
    font-size: 0.85rem;
    padding: 8px 12px;
    background: #f78b5a;
    border: none;
    border-radius: 6px;
    font-weight: 500;
}

.price-filter .btn:hover {
    background: #e67e22;
    transform: translateY(-1px);
}

.price-filter label {
    font-weight: 600;
    margin-bottom: 5px;
    color: #495057;
    font-size: 0.9rem;
}

.price-filter .row {
    margin-bottom: 10px;
}

.price-filter .col-6 {
    padding: 0 5px;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .filter-sidebar {
        position: static;
        margin-bottom: 25px;
        padding: 20px;
    }
    
    .category-list .list-group-item {
        padding: 10px 14px;
    }
    
    .sorting-bar {
        padding: 15px;
    }
    
    .sorting-bar .d-flex {
        flex-direction: column;
        gap: 15px;
        align-items: start !important;
    }
    
    .sort-options {
        width: 100%;
    }
    
    .sort-options .form-select {
        width: 100%;
    }
    
    /* Mobile Images */
    .product-card img {
        height: 180px;
        padding: 10px;
    }
    
    .product-card .card-body {
        padding: 15px;
    }
    
    .product-card .card-title {
        font-size: 0.95rem;
        height: 2.4em;
    }
    
    .product-card .card-text {
        font-size: 0.8rem;
        height: 2.6em;
    }
    
    .product-card .fw-bold {
        font-size: 1rem;
    }
    
    .product-card .add-to-cart {
        padding: 6px 12px;
        font-size: 0.85rem;
    }
    
    /* Mobile Price Filter */
    .price-filter .form-control {
        font-size: 0.8rem;
        padding: 6px 8px;
    }
    
    .price-filter .btn {
        font-size: 0.8rem;
        padding: 6px 10px;
    }
    
    .price-filter label {
        font-size: 0.85rem;
    }
}

@media (max-width: 576px) {
    .product-card img {
        height: 160px;
        padding: 8px;
    }
    
    .product-card .card-body {
        padding: 12px;
    }
}

/* Extra small devices (phones, 360px and down) */
@media (max-width: 360px) {
    .product-card img {
        height: 140px;
    }
}
/* Categories Section Styles */
.category-card {
    transition: all 0.3s ease;
    border: 1px solid #e9ecef !important;
    overflow: hidden;
}

.category-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15) !important;
}

.category-card .card-img-top {
    width: 100%;
    height: auto;
    object-fit: contain;
    object-position: center;
    background-color: #f8f9fa;
    padding: 15px;
    transition: transform 0.3s ease;
}

.category-card:hover .card-img-top {
    transform: scale(1.05);
}

/* Mobile First - Remove fixed heights completely */
@media (max-width: 576px) {
    .category-card .card-img-top {
        height: auto !important; /* Let height be natural */
        min-height: 100px; /* Minimum height for very small images */
        max-height: 150px; /* Maximum height to prevent huge images */
        padding: 8px;
    }
    
    .category-card .card-body {
        padding: 0.75rem !important;
    }
    
    .category-card .card-title {
        font-size: 0.8rem !important;
    }
}

/* Tablet */
@media (min-width: 577px) and (max-width: 768px) {
    .category-card .card-img-top {
        height: auto;
        max-height: 160px;
    }
}

/* Desktop */
@media (min-width: 769px) and (max-width: 992px) {
    .category-card .card-img-top {
        height: auto;
        max-height: 180px;
    }
}

/* Large Desktop */
@media (min-width: 993px) {
    .category-card .card-img-top {
        height: auto;
        max-height: 200px;
    }
}

/* Fix for card body text overflow */
.category-card .card-body {
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.category-card .card-title {
    line-height: 1.2;
}

/* Stagger animation for cards */
.category-card:nth-child(1) { animation-delay: 0.1s; }
.category-card:nth-child(2) { animation-delay: 0.2s; }
.category-card:nth-child(3) { animation-delay: 0.3s; }
.category-card:nth-child(4) { animation-delay: 0.4s; }
.category-card:nth-child(5) { animation-delay: 0.5s; }
.category-card:nth-child(6) { animation-delay: 0.6s; }