/* Store Page Styles */

body {
    color: var(--text-color);
    background-color: #ffffff;
}

.store-container {
    padding: 30px 15px;
}

/* Store Header */
.store-header {
    margin-bottom: 30px;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
}

.store-title {
    color: var(--secondary-light);
    font-weight: 700;
    margin-bottom: 15px;
    position: relative;
    padding-bottom: 10px;
}

.store-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 60px;
    height: 3px;
    background-color: var(--primary-color);
}

.store-controls {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 15px;
}

.results-count {
    color: #666;
    font-size: 0.9rem;
}

.sort-options select {
    border-color: var(--primary-color);
    color: var(--secondary-light);
    font-weight: 500;
    padding: 8px 15px;
    border-radius: 5px;
    cursor: pointer;
}

.sort-options select:focus {
    box-shadow: 0 0 0 0.25rem rgba(205, 140, 42, 0.25);
    border-color: var(--primary-color);
}

/* Filter Toggle Button (Mobile) */
.filter-toggle-btn {
    width: 100%;
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px;
    border-radius: 5px;
    font-weight: 500;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
}

.filter-toggle-btn:hover {
    background-color: var(--secondary-light);
    transform: translateY(-2px);
}

.filter-toggle-btn i {
    font-size: 1.1rem;
}

/* Filters Sidebar */
.filters-sidebar {
    background-color: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: var(--shadow-sm);
    margin-bottom: 30px;
    transition: var(--transition);
}

.filters-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
}

.filters-header h3 {
    color: var(--secondary-light);
    font-weight: 600;
    margin: 0;
}

.close-filters {
    background: none;
    border: none;
    color: var(--secondary-light);
    font-size: 1.2rem;
    cursor: pointer;
    padding: 5px;
}

.filter-section {
    margin-bottom: 25px;
}

.filter-title {
    color: var(--secondary-light);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 15px;
    position: relative;
    padding-left: 15px;
}

.filter-title::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 5px;
    height: 70%;
    background-color: var(--primary-color);
    border-radius: 3px;
}

.filter-options {
    max-height: 200px;
    overflow-y: auto;
    padding-right: 10px;
}

.filter-options::-webkit-scrollbar {
    width: 5px;
}

.filter-options::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.filter-options::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
}

.form-check {
    margin-bottom: 10px;
}

.form-check-input {
    border-color: var(--primary-color);
}

.form-check-input:checked {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.form-check-label {
    color: var(--text-color);
    font-weight: 400;
    cursor: pointer;
}

/* Price Range Inputs */
.price-slider-container {
    padding: 10px 0;
}

.price-inputs {
    display: flex;
    gap: 10px;
}

/* Price Range Inputs (continued) */
.min-price, .max-price {
    flex: 1;
}

.min-price label, .max-price label {
    display: block;
    margin-bottom: 5px;
    color: var(--secondary-light);
    font-weight: 500;
    font-size: 0.9rem;
}

.min-price input, .max-price input {
    width: 100%;
    border: 1px solid var(--border-color);
    border-radius: 5px;
    padding: 8px 10px;
    transition: var(--transition);
}

.min-price input:focus, .max-price input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 0.25rem rgba(205, 140, 42, 0.25);
    outline: none;
}

/* Filter Action Buttons */
.filter-actions {
    display: flex;
    gap: 10px;
    margin-top: 20px;
}

.apply-filters-btn {
    flex: 1;
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 10px;
    border-radius: 5px;
    font-weight: 500;
    transition: var(--transition);
}

.apply-filters-btn:hover {
    background-color: var(--secondary-light);
    transform: translateY(-2px);
}

.reset-filters-btn {
    flex: 1;
    background-color: #f1f1f1;
    color: var(--text-color);
    border: none;
    padding: 10px;
    border-radius: 5px;
    font-weight: 500;
    transition: var(--transition);
}

.reset-filters-btn:hover {
    background-color: #e1e1e1;
}

/* Products Grid */
.products-grid {
    margin-bottom: 30px;
    /* Override Bootstrap row properties that might interfere with our grid */
    margin-left: 0;
    margin-right: 0;
}

.product-card-wrapper {
    padding: 10px;
    margin-bottom: 20px;
}

.product-card {
    background-color: white;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    height: 100%;
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-md);
}

.product-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.product-image {
    position: relative;
    padding-top: 100%; /* 1:1 Aspect Ratio */
    overflow: hidden;
}

.product-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.product-badge {
    position: absolute;
    top: 10px;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 1;
}

.new-badge {
    left: 10px;
    background-color: var(--secondary-light);
    color: white;
}

.sale-badge {
    right: 10px;
    background-color: var(--primary-color);
    color: white;
}

.product-info {
    padding: 15px;
}

.product-name {
    color: var(--secondary-light);
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 10px;
    line-height: 1.4;
    height: 3em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-price {
    display: flex;
    align-items: center;
    gap: 10px;
}

.current-price {
    color: var(--primary-color);
    font-size: 1.2rem;
    font-weight: 700;
}

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

/* Product Actions */
.product-actions {
    position: absolute;
    right: 15px;
    bottom: 15px;
    display: flex;
    gap: 10px;
    opacity: 0;
    transform: translateY(10px);
    transition: var(--transition);
}

.product-card:hover .product-actions {
    opacity: 1;
    transform: translateY(0);
}

.quick-view-btn, .add-to-cart-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: white;
    color: var(--secondary-light);
    border: 1px solid var(--secondary-light);
    transition: var(--transition);
    padding: 0;
}

.quick-view-btn:hover, .add-to-cart-btn:hover {
    background-color: var(--secondary-light);
    color: white;
}

/* No Products Message */
.no-products {
    text-align: center;
    padding: 50px 20px;
    background-color: var(--background-light);
    border-radius: 10px;
    color: #666;
}

/* Improved Pagination Styles */
.pagination-container {
    margin-top: 40px;
    display: flex;
    justify-content: center;
}

.pagination {
    display: flex;
    list-style: none;
    padding: 0;
    margin: 0;
    flex-wrap: wrap;
    gap: 5px;
    justify-content: center;
}

.page-item .page-link {
    color: var(--secondary-light);
    border: 1px solid var(--border-color);
    padding: 8px 16px;
    border-radius: 5px;
    transition: var(--transition);
    min-width: 40px;
    text-align: center;
}

.page-item .page-link:hover {
    background-color: var(--secondary-light);
    border-color: var(--secondary-light);
}

.page-item.active .page-link {
    background-color: var(--secondary-light);
    border-color: var(--secondary-light);
    color: white;
}

.page-item.disabled .page-link {
    color: #999;
    pointer-events: none;
    background-color: #f8f8f8;
}

/* Mobile Pagination - Compact Design */
@media (max-width: 767.98px) {
    .pagination {
        gap: 3px;
    }

    .page-item .page-link {
        padding: 6px 10px;
        min-width: 35px;
        font-size: 0.9rem;
    }

    /* Hide some page numbers on mobile */
    .page-item:not(.active):not(:first-child):not(:last-child):not(.prev):not(.next) {
        display: none;
    }

    /* Show only active page and immediate siblings */
    .page-item.active + .page-item,
    .page-item.active + .page-item + .page-item,
    .page-item.active - .page-item,
                        .page-item.active - .page-item - .page-item {
                                                             display: block;
                                                         }

    /* Always show ellipsis next to first/last if needed */
    .page-item:nth-child(2):not(.active),
    .page-item:nth-last-child(2):not(.active) {
        display: block;
    }

    /* Style for ellipsis */
    .page-item.disabled .page-link[aria-label="..."] {
        background: none;
        border: none;
        padding: 6px 5px;
    }
}

/* Quick View Modal */
.modal-content {
    border-radius: 10px;
    overflow: hidden;
    border: none;
}

.modal-header {
    background-color: var(--secondary-light);
    color: white;
    border: none;
}

.modal-title {
    font-weight: 600;
}

.btn-close {
    filter: brightness(0) invert(1);
}

/* Responsive Styles */
@media (max-width: 991.98px) {
    /* Mobile Filters */
    .filters-sidebar {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 350px;
        height: 100vh;
        z-index: 1050;
        overflow-y: auto;
        box-shadow: 0 0 15px rgba(0, 0, 0, 0.2);
        padding: 20px;
        transition: left 0.3s ease;
    }

    .filters-sidebar.show {
        left: 0;
    }

    .filters-backdrop {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 1040;
        display: none;
    }

    .filters-backdrop.show {
        display: block;
    }

    .store-controls {
        width: 100%;
        justify-content: space-between;
    }
}

@media (max-width: 767.98px) {
    .store-header {
        flex-direction: column;
        align-items: flex-start;
    }

    .store-controls {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
    }

    .sort-options {
        width: 100%;
    }

    .sort-options select {
        width: 100%;
    }

    .product-card-wrapper {
        padding: 5px;
    }

    .product-name {
        font-size: 1rem;
    }

    .current-price {
        font-size: 1.1rem;
    }
}

@media (min-width: 992px) {
    .close-filters {
        display: none;
    }
}


/* Additional styles for mobile filters and active states */

/* Active filter highlight */
.form-check.active-filter {
    border-radius: 5px;
}

.form-check.active-filter .form-check-label {
    font-weight: 500;
    color: var(--secondary-light);
}

/* Mobile filter drawer enhancements */
@media (max-width: 991.98px) {
    .filters-sidebar {
        background-color: white;
        border-radius: 0;
        padding-top: 10px;
    }

    .filters-header {
        position: sticky;
        top: 0;
        background-color: white;
        z-index: 1;
        padding-top: 10px;
        margin-top: -10px;
    }

    .close-filters {
        width: 40px;
        height: 40px;
        display: flex;
        align-items: center;
        justify-content: center;
        border-radius: 50%;
        color: var(--secondary-light);
        transition: var(--transition);
    }

    .close-filters:hover {
        color: var(--secondary-light);
    }

    /* Filter toggle button animation */
    .filter-toggle-btn {
        position: relative;
        overflow: hidden;
    }

    .filter-toggle-btn::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 100%;
        height: 100%;
        background-color: rgba(255, 255, 255, 0.2);
        border-radius: 50%;
        transform: translate(-50%, -50%) scale(0);
        transition: transform 0.5s ease-out;
    }

    .filter-toggle-btn:active::after {
        transform: translate(-50%, -50%) scale(2);
        opacity: 0;
    }
}

/* Toast notifications */
.toast-container {
    z-index: 1060;
}

.toast {
    min-width: 250px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    border: none;
    border-radius: 8px;
    overflow: hidden;
}

.toast.bg-success {
    border-left: 4px solid #28a745;
}

.toast.bg-danger {
    border-left: 4px solid #dc3545;
}

/* Product card hover effects */
.product-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(29, 10, 91, 0) 70%, rgba(29, 10, 91, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    border-radius: 10px;
}

.product-card:hover::after {
    opacity: 1;
}

/* Empty state styling */
.no-products {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
}

.no-products p {
    margin-top: 20px;
    color: #666;
    text-align: center;
    max-width: 400px;
}

.no-products::before {
    content: '🔍';
    font-size: 3rem;
    margin-bottom: 20px;
}

/* For desktop, use CSS Grid instead of Bootstrap's row/col system */
@media (min-width: 768px) {
    .products-grid {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }

    /* Override Bootstrap column classes inside our grid */
    .products-grid > [class*="col-"] {
        width: 100%;
        max-width: 100%;
        padding: 0;
        margin: 0;
    }

    .product-card-wrapper {
        padding: 0;
        margin-bottom: 0;
    }
}

/* For mobile, keep Bootstrap's row/col system */
@media (max-width: 767.98px) {
    .products-grid {
        display: flex;
        flex-wrap: wrap;
    }

    .product-card-wrapper {
        padding: 10px;
        margin-bottom: 10px;
    }
}
