/* Products Layout CSS - Shared for Doors and Groceries */

/* Products Display Section */
.products-display-section {
    padding: 40px 0;
}

/* Categories Sidebar */
.categories-sidebar {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 0px 5px;
    position: sticky;
    top: 20px;
}

.sidebar-title {
    font-size: 26px;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* Categories List Styling */
.categories-list .category-item {
    margin-bottom: 8px;
}

.category-button {
    width: 100%;
    background: #fff;
    border: 2px solid #e9ecef;
    border-radius: 8px;
    padding: 15px;
    font-weight: 500;
    color: #555;
    transition: all 0.3s ease;
    cursor: pointer;
    text-align: left;
    box-shadow: 0 2px 5px rgba(0,0,0,0.05);
}

.category-button:hover,
.category-button.active {
    background: #D84A1B;
    color: white;
    border-color: #D84A1B;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(216, 74, 27, 0.3);
}

.category-button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(216, 74, 27, 0.3);
}

.category-info {
    display: flex;
    align-items: center;
    width: 100%;
}

.category-button .category-icon {
    width: 35px;
    height: 35px;
    border-radius: 6px;
    background: #e9ecef;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 12px;
    font-size: 16px;
    color: #666;
    transition: all 0.3s ease;
}

.category-button.active .category-icon,
.category-button:hover .category-icon {
    background: rgba(255,255,255,0.2);
    color: white;
}

.category-details {
    flex: 1;
}

.category-name {
    display: block;
    font-weight: 600;
    font-size: 16px;
    line-height: 1.2;
}

.category-count {
    font-size: 12px;
    opacity: 0.8;
}

.accordion-body {
    display: none; /* Not needed anymore */
}

/* Mobile Responsiveness */
@media (max-width: 991px) {
    .category-button {
        padding: 12px;
        font-size: 14px;
    }
}

/* Products Grid */
.products-grid-container {
    background: #fff;
    border-radius: 10px;
    padding: 30px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    min-height: 500px;
}

.products-header {
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e9ecef;
}

.products-header h4 {
    font-size: 24px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.products-header span {
    color: #666;
    font-size: 14px;
}

/* Product Items */
.door-item, .product-item {
    transition: all 0.3s ease;
    height: 100%;
}

.door-content, .product-content {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    border: 2px solid #e9ecef;
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
    text-align: center;
}

.door-content:hover, .product-content:hover {
    border-color: #D84A1B;
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(216, 74, 27, 0.15);
}

/* Door specific styling */
.door-image {
    position: relative;
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.door-image:hover {
    transform: scale(1.02);
    box-shadow: 0 8px 25px rgba(0,0,0,0.15);
}

.door-image img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    transition: all 0.3s ease;
}

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

.door-info {
    text-align: center;
}

.door-code {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
}

.door-category {
    font-size: 12px;
    color: #666;
    margin: 0;
}

/* Product specific styling */
.product-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, #D84A1B, #ff6b3d);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 15px;
    font-size: 24px;
    color: white;
    box-shadow: 0 4px 15px rgba(216, 74, 27, 0.3);
}

.product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.product-name {
    font-size: 16px;
    font-weight: 600;
    color: #333;
    margin-bottom: 8px;
    line-height: 1.3;
}

.product-category {
    font-size: 12px;
    color: #666;
}

/* Mobile Responsiveness */
@media (max-width: 991px) {
    .categories-sidebar {
        position: static;
        margin-bottom: 30px;
        max-height: none;
    }
    
    .products-grid-container {
        padding: 20px;
    }
    
    .products-header h4 {
        font-size: 20px;
    }
}

@media (max-width: 767px) {
    .products-display-section {
        padding: 20px 0;
    }
    
    .categories-sidebar {
        padding: 20px;
    }
    
    .sidebar-title {
        font-size: 16px;
        margin-bottom: 15px;
    }
    
    .category-button {
        padding: 12px;
        font-size: 14px;
    }
    
    .category-button .category-icon {
        width: 30px;
        height: 30px;
        font-size: 14px;
        margin-right: 10px;
    }
    
    .category-name {
        font-size: 13px;
    }
    
    .category-count {
        font-size: 11px;
    }
    
    .products-grid-container {
        padding: 15px;
    }
    
    .products-header {
        margin-bottom: 20px;
    }
    
    .products-header h4 {
        font-size: 18px;
    }
    
    .door-content, .product-content {
        padding: 15px;
    }
    
    .door-image img {
        height: 120px;
    }
    
    .product-icon {
        width: 50px;
        height: 50px;
        font-size: 20px;
    }
    
    .product-name, .door-code {
        font-size: 14px;
    }
}

@media (max-width: 575px) {
    .door-content, .product-content {
        padding: 12px;
    }
    
    .door-image img {
        height: 100px;
    }
    
    .product-icon {
        width: 45px;
        height: 45px;
        font-size: 18px;
        margin-bottom: 12px;
    }
    
    .product-name, .door-code {
        font-size: 13px;
        margin-bottom: 6px;
    }
}

/* Animation for category switch */
.category-products {
    animation: fadeIn 0.3s ease-in-out;
}

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

/* Global Modal Fixes */
body.modal-open {
    overflow: hidden;
    padding-right: 0 !important;
}

/* Image Modal Styling */
#imageModal {
    z-index: 9999 !important;
}

#imageModal .modal-backdrop {
    z-index: 9998 !important;
}

.modal {
    z-index: 9999 !important;
}

.modal-backdrop {
    z-index: 9998 !important;
    background-color: rgba(0, 0, 0, 0.7) !important;
}

.modal-xl {
    max-width: 90vw;
}

.modal-dialog {
    margin: 1.75rem auto;
    display: flex;
    align-items: center;
    min-height: calc(100% - 3.5rem);
}

.modal-content {
    border: none;
    border-radius: 15px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.3);
    background: white;
    position: relative;
    z-index: 10000;
}

.modal-header {
    border-bottom: 1px solid #e9ecef;
    padding: 20px 25px;
}

.modal-title {
    font-weight: 600;
    color: #333;
    font-size: 1.25rem;
}

.modal-body {
    padding: 25px !important;
}

.image-container {
    display: flex;
    justify-content: center;
    align-items: center;
    min-height: 300px;
}

.image-container img {
    max-height: 75vh !important;
    max-width: 100% !important;
    object-fit: contain;
    border-radius: 10px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
}

.modal-footer {
    border-top: 1px solid #e9ecef;
    padding: 20px 25px;
}

@media (max-width: 768px) {
    .modal-xl {
        max-width: 95vw;
        margin: 10px;
    }
    
    .modal-dialog {
        margin: 0.5rem;
        min-height: calc(100% - 1rem);
    }
    
    .modal-content {
        border-radius: 10px;
    }
    
    .modal-header, .modal-body, .modal-footer {
        padding: 15px !important;
    }
    
    .image-container {
        min-height: 200px;
    }
    
    .image-container img {
        max-height: 60vh !important;
    }
    
    .modal-title {
        font-size: 1.1rem;
    }
}

@media (max-width: 576px) {
    .modal-xl {
        max-width: 98vw;
        margin: 5px;
    }
    
    .modal-dialog {
        margin: 0.25rem;
        min-height: calc(100% - 0.5rem);
    }
    
    .modal-header, .modal-body, .modal-footer {
        padding: 12px !important;
    }
    
    .image-container img {
        max-height: 50vh !important;
    }
    
    .modal-title {
        font-size: 1rem;
    }
}

/* Scrollbar styling for sidebar */
.categories-sidebar::-webkit-scrollbar {
    width: 4px;
}

.categories-sidebar::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 2px;
}

.categories-sidebar::-webkit-scrollbar-thumb {
    background: #D84A1B;
    border-radius: 2px;
}

.categories-sidebar::-webkit-scrollbar-thumb:hover {
    background: #b83818;
}
