/* Shop Index Page Styles - Extracted from inline styles for better performance */

.hero-banner {
    min-height: 120px;
    max-height: 180px;
    background: #eee;
    position: relative;
}
.hero-img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    filter: brightness(0.7);
}
.hero-overlay {
    left: 0;
    top: 0;
    height: 100%;
    background: linear-gradient(90deg, rgba(0,0,0,0.45) 40%, rgba(0,0,0,0.08) 100%);
    padding: 0.75rem 1.1rem 0.75rem 1.1rem !important;
    justify-content: flex-end !important;
}
.hero-overlay h2 {
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
    font-weight: 700;
}
.hero-overlay p {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}
.hero-overlay .btn {
    font-size: 0.85rem;
    padding: 0.25rem 0.9rem;
    border-radius: 1.2rem;
    font-weight: 600;
}
.category-bar { 
    gap: 0.5rem; 
    border: 1px solid #eee; 
    position: relative;
    z-index: 100;
    overflow-x: auto;
    overflow-y: visible;
    scrollbar-width: thin;
    scrollbar-color: #dee2e6 transparent;
}
.category-bar::-webkit-scrollbar {
    height: 6px;
}
.category-bar::-webkit-scrollbar-track {
    background: transparent;
}
.category-bar::-webkit-scrollbar-thumb {
    background-color: #dee2e6;
    border-radius: 3px;
}
.category-bar::-webkit-scrollbar-thumb:hover {
    background-color: #adb5bd;
}
@media (min-width: 768px) {
    .category-bar {
        justify-content: center;
    }
}
.category-link { 
    display: inline-block; 
    padding: 0.5rem 1.2rem; 
    background: #f8fafc; 
    border-radius: 2rem; 
    color: #222; 
    font-weight: 500; 
    text-decoration: none; 
    border: 1px solid #eee; 
    transition: background 0.15s, color 0.15s, border 0.15s; 
    white-space: nowrap; 
}
.category-link.active, .category-link:hover { 
    background: linear-gradient(135deg, #FF6600 0%, #000000 100%); 
    color: #fff; 
    border: 1px solid #FF6600; 
}
.flash-sale-section { 
    background: linear-gradient(90deg, #dc2626 0%, #ef4444 100%); 
    position: relative; 
}
.flash-sale-section h4 { color: #fff; }
.flash-sale-section .badge { font-size: 1rem; }
.product-card { 
    transition: box-shadow 0.15s; 
    cursor: pointer; 
    border-radius: 1rem; 
    overflow: hidden; 
    width: 100%; 
    display: flex; 
    flex-direction: column; 
}
.product-card:hover { 
    box-shadow: 0 8px 32px rgba(255, 102, 0, 0.15); 
}
.card-img-top.shop-product-img {
    object-fit: cover;
    height: 200px;
    width: 100%;
    border-radius: 1rem 1rem 0 0;
    background: #f8f9fa;
    padding: 0;
    transition: opacity 0.3s ease;
}

/* Lazy loading styles */
.card-img-top.shop-product-img[loading="lazy"] {
    background-color: #f0f0f0;
    background-image: linear-gradient(90deg, #f0f0f0 0%, #e0e0e0 50%, #f0f0f0 100%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

.card-img-top.shop-product-img.loaded {
    background-color: #f8f9fa;
    background-image: none;
    animation: none;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}
.product-card form { margin-top: auto; }
.product-card .btn-success { 
    font-size: 0.85rem; 
    padding: 0.3rem 0.75rem; 
    border-radius: 0.5rem; 
    font-weight: 500; 
    background: linear-gradient(135deg, #FF6600 0%, #E55A00 100%); 
    border: none; 
    transition: background 0.15s;
}
.product-card .btn-success:hover { 
    background: linear-gradient(135deg, #E55A00 0%, #CC4D00 100%); 
}
.card-title { 
    font-size: 0.9rem; 
    line-height: 1.2; 
    display: -webkit-box; 
    -webkit-line-clamp: 2; 
    -webkit-box-orient: vertical; 
    overflow: hidden; 
    text-overflow: ellipsis; 
    text-align: center; 
}
.product-price {
    color: #dc2626;
    font-size: 1.15rem;
    font-weight: bold;
    margin-bottom: 0.5rem;
    letter-spacing: 0.5px;
}
.price-amount {
    font-size: 1.25em;
    font-weight: 700;
}
.old-price {
    color: #888;
    font-size: 1rem;
    text-decoration: line-through;
    margin-left: 0.3rem;
}
.product-card .p-2.pt-0 {
    margin-top: auto;
    padding-top: 0.5rem !important;
}
.product-card .product-price {
    margin-bottom: 0.75rem;
}

/* Loading and Error States */
.loading-state, .error-state, .empty-state {
    padding: 2rem;
    text-align: center;
}
.loading-state .spinner-border {
    width: 3rem;
    height: 3rem;
    animation: spin 1s linear infinite;
}
.error-state i, .empty-state i {
    color: #6c757d;
    margin-bottom: 1rem;
}
.error-state h4 {
    color: #dc3545;
}

/* Smooth transitions for category changes */
#products-grid {
    transition: opacity 0.2s ease;
}
#products-grid.loading {
    opacity: 0.6;
    pointer-events: none;
    user-select: none;
}

/* Category brands dropdown styles */
.category-item-wrapper {
    position: static;
    z-index: 10001;
}
.category-brands-dropdown {
    position: fixed;
    z-index: 99999 !important;
    min-width: 200px;
    max-width: 300px;
    pointer-events: auto;
    visibility: hidden;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}
.category-brands-dropdown.show {
    visibility: visible !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
}
.dropdown-bridge {
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    height: 0.5rem;
    z-index: 99998;
    pointer-events: auto;
    background: transparent;
}
.row {
    overflow: visible;
}
#category-navigation-row,
.category-navigation-row {
    overflow: visible !important;
}

/* Filters Sidebar Styles */
.filters-sidebar {
    position: sticky;
    top: 20px;
    max-height: calc(100vh - 40px);
    overflow-y: auto;
}
.filter-section {
    border-bottom: 1px solid #eee;
    padding-bottom: 1rem;
}
.filter-section:last-child {
    border-bottom: none;
}
.brands-filter {
    scrollbar-width: thin;
    scrollbar-color: #ccc transparent;
    max-height: 300px;
    overflow-y: auto;
}
.brands-filter::-webkit-scrollbar {
    width: 6px;
}
.brands-filter::-webkit-scrollbar-track {
    background: transparent;
}
.brands-filter::-webkit-scrollbar-thumb {
    background-color: #ccc;
    border-radius: 3px;
}
.brands-filter::-webkit-scrollbar-thumb:hover {
    background-color: #999;
}
@media (max-width: 991.98px) {
    .filters-sidebar {
        position: relative;
        top: 0;
        max-height: none;
    }
    #filtersCollapse {
        margin-top: 1rem;
    }
}

/* Product grid adjustments for 5 columns */
@media (min-width: 1400px) {
    .row-cols-xl-5 > * {
        flex: 0 0 auto;
        width: 20%;
    }
}

/* Pagination Styles */
.pagination {
    justify-content: center;
    margin-bottom: 0;
}
.pagination .page-link {
    color: #FF6600;
    border-color: #dee2e6;
    padding: 0.5rem 0.75rem;
    transition: all 0.2s ease;
}
.pagination .page-link:hover {
    color: #fff;
    background: linear-gradient(135deg, #FF6600 0%, #000000 100%);
    border-color: #FF6600;
}
.pagination .page-item.active .page-link {
    background: linear-gradient(135deg, #FF6600 0%, #000000 100%);
    border-color: #FF6600;
    color: #fff;
    font-weight: 600;
}
.pagination .page-item.disabled .page-link {
    color: #6c757d;
    pointer-events: none;
    background-color: #f8f9fa;
    border-color: #dee2e6;
    opacity: 0.5;
}

/* Previous/Next Navigation Buttons */
.btn-pagination-nav {
    min-width: 130px;
    padding: 0.6rem 1.5rem;
    font-weight: 600;
    border-radius: 0.5rem;
    transition: all 0.2s ease;
    border: 2px solid;
}
.btn-pagination-nav.btn-primary {
    background: linear-gradient(135deg, #FF6600 0%, #000000 100%);
    border-color: #FF6600;
    color: #fff;
}
.btn-pagination-nav.btn-primary:hover {
    background: linear-gradient(135deg, #E55A00 0%, #1a1a1a 100%);
    border-color: #E55A00;
    color: #fff;
}
.btn-pagination-nav.btn-outline-secondary {
    border-color: #dee2e6;
    color: #6c757d;
    background-color: #f8f9fa;
}
.btn-pagination-nav.btn-outline-secondary:hover {
    background-color: #e9ecef;
    border-color: #adb5bd;
    color: #6c757d;
}
.btn-pagination-nav:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none !important;
}
.btn-pagination-nav i {
    font-size: 1.1rem;
    vertical-align: middle;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.dropdown-content {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    overflow: hidden;
    border: 1px solid #e5e7eb;
    position: relative;
    z-index: 99999;
}
.brands-list {
    max-height: 300px;
    overflow-y: auto;
    padding: 0.5rem 0;
}
.brands-list .brand-item {
    padding: 0.75rem 1rem;
    color: #333;
    text-decoration: none;
    display: block;
    transition: background-color 0.15s, color 0.15s;
    border-bottom: 1px solid #f3f4f6;
    position: relative;
    z-index: 99999;
}
.brands-list .brand-item:first-child {
    border-top: none;
}
.brands-list .brand-item:last-child {
    border-bottom: none;
}
.brands-list .brand-item:hover {
    background-color: #f9fafb;
    color: #FF6600;
}
.brands-list .no-brands {
    padding: 1rem;
    text-align: center;
    color: #6b7280;
    font-size: 0.85rem;
}

@media (max-width: 768px) {
    .category-brands-dropdown {
        display: none !important;
    }
}

.offcanvas-filter .form-select,
.offcanvas-filter .form-control {
    border-radius: 0.5rem;
    border: 1px solid #dee2e6;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.offcanvas-filter .form-select:focus,
.offcanvas-filter .form-control:focus {
    border-color: #0d6efd;
    box-shadow: 0 0 0 0.2rem rgba(13, 110, 253, 0.25);
}

body {
    scroll-behavior: smooth;
}

@media (max-width: 767.98px) { 
    .card-img-top.shop-product-img { height: 110px; } 
    .card-title { font-size: 0.82rem; } 
    .product-card .btn-success { 
        font-size: 0.8rem; 
        padding: 0.18rem 0.5rem; 
        background: linear-gradient(135deg, #FF6600 0%, #E55A00 100%); 
        border: none; 
    } 
    .product-price { font-size: 1rem; }
    .price-amount { font-size: 1.1em; }
}
@media (min-width: 768px) and (max-width: 991.98px) { 
    .card-img-top.shop-product-img { height: 120px; } 
}

.custom-carousel-wrapper {
    width: 100%;
    overflow-x: auto;
    position: relative;
}
.custom-carousel-wrapper::-webkit-scrollbar {
    height: 8px;
}
.custom-carousel-wrapper::-webkit-scrollbar-thumb {
    background: #eee;
    border-radius: 4px;
}
.custom-carousel-track {
    transition: none;
    will-change: auto;
    display: flex;
    flex-wrap: nowrap;
    gap: 0;
    scroll-behavior: smooth;
}
.custom-carousel-item {
    padding: 0 4px;
    width: 100vw;
    max-width: 100vw;
    box-sizing: border-box;
}
@media (min-width: 768px) {
    .custom-carousel-item {
        width: calc(33.3333vw - 8px);
        max-width: calc(33.3333vw - 8px);
    }
}
@media (min-width: 992px) {
    .custom-carousel-item {
        width: calc(25vw - 8px);
        max-width: calc(25vw - 8px);
    }
}
@media (max-width: 575.98px) {
    .hero-banner {
        min-height: 140px;
        max-height: 180px;
    }
    .hero-img {
        height: 140px;
        width: 92vw;
        max-width: 92vw;
        margin: 0 auto;
        border-radius: 0.7rem;
    }
    .custom-carousel-item {
        width: 92vw;
        max-width: 92vw;
        padding: 0 2px;
        margin: 0 auto;
    }
    .hero-overlay {
        padding: 0.7rem 0.7rem 0.7rem 0.7rem !important;
    }
    .hero-overlay h2 {
        font-size: 1.08rem;
    }
    .hero-overlay p {
        font-size: 0.92rem;
    }
    .hero-overlay .btn {
        font-size: 0.8rem;
        padding: 0.18rem 0.7rem;
    }
}

