/* ===== Product Image Slider Wrapper ===== */
.image-wrapper.image-slider-wrapper {
    width: 100%;
    height: 180px;
    background: #fefefe;
    border: 2px solid #aaa;
    border-radius: 8px;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    background-image: linear-gradient(135deg, #fff 0%, #f8f8f8 100%);
    position: relative;
}

/* Images stacked absolutely, hidden by default */
.image-slider-wrapper img {
    position: absolute;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.8s ease-in-out, transform 0.4s ease;
}

/* Show first image initially */
.image-slider-wrapper img:first-child {
    opacity: 1;
    z-index: 1;
}

/* Animate cycling images on hover */
.image-wrapper.image-slider-wrapper:hover img {
    animation-name: sliderFade;
    animation-duration: 8s;
    animation-iteration-count: infinite;
    animation-timing-function: ease-in-out;
    animation-play-state: running;
}

/* Pause animation when not hovered */
.image-wrapper.image-slider-wrapper img {
    animation-play-state: paused;
}

/* Stagger animation delay for cycling */
.image-slider-wrapper img:nth-child(1) { animation-delay: 0s; }
.image-slider-wrapper img:nth-child(2) { animation-delay: 2s; }
.image-slider-wrapper img:nth-child(3) { animation-delay: 4s; }
.image-slider-wrapper img:nth-child(4) { animation-delay: 6s; }

/* Keyframes for fade animation */
@keyframes sliderFade {
    0%, 20%   { opacity: 1; z-index: 2; }
    25%, 95%  { opacity: 0; z-index: 1; }
    100%      { opacity: 1; z-index: 2; }
}

/* Zoom effect on product card hover */
.product-card:hover .image-wrapper.image-slider-wrapper img {
    transform: translate(-50%, -50%) scale(1.07);
}

/* ===== Layout & Page Wrappers ===== */
.page-wrapper {
    display: flex;
    flex-direction: row;
    position: relative;
    padding-top: 20px;
    background-color: #f9f9f9;
}

.main-container {
    flex: 1;
    padding: 20px;
    background-color: #fff;
}

.site-branding img {
    display: block;
    margin: 0 auto 30px;
    max-height: 80px;
}

/* ===== Banner Styling ===== */
.banner-side {
    width: 120px;
    padding: 10px;
}

.banner-side img {
    width: 100%;
    height: auto;
    border-radius: 8px;
}

.banner-top img,
.featured-promo img {
    width: 100%;
    max-height: 200px;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 20px;
}

/* ===== Category Block ===== */
.category-block {
    margin-bottom: 50px;
}

/* Title */
.category-block h2 {
    font-size: 1.5rem;
    margin-bottom: 20px;
    color: #333;
    border-bottom: 2px solid #0d6efd;
    display: inline-block;
    padding-bottom: 5px;
}

/* ===== Products Horizontal Scroll Wrapper ===== */
.products-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    margin-bottom: 1rem;
}

/* Horizontal scrolling products container */
.products {
    display: flex !important;
    flex-wrap: nowrap !important;
    gap: 20px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding-bottom: 10px; /* space for scrollbar */
}

/* Scrollbar styles */
.products::-webkit-scrollbar {
    height: 8px;
}
.products::-webkit-scrollbar-track {
    background: #f1f3f5;
    border-radius: 4px;
}
.products::-webkit-scrollbar-thumb {
    background-color: #0d6efd;
    border-radius: 4px;
}

/* Firefox scrollbar */
.products {
    scrollbar-width: thin;
    scrollbar-color: #0d6efd #f1f3f5;
}

/* Fix product card width for horizontal scrolling */
.product-card {
    flex: 0 0 220px;
    max-width: 220px;
}

/* ===== Scroll Buttons ===== */
.scroll-button {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(13, 110, 253, 0.85);
    border: none;
    color: white;
    font-size: 1.5rem;
    padding: 6px 12px;
    cursor: pointer;
    border-radius: 6px;
    user-select: none;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    transition: background-color 0.3s ease;
}

.scroll-button:hover {
    background-color: rgba(13, 110, 253, 1);
}

.scroll-left {
    left: 4px;
}

.scroll-right {
    right: 4px;
}

/* Hide scroll buttons on small screens */
@media (max-width: 480px) {
    .scroll-button {
        display: none;
    }
}

/* ===== Responsive Adjustments ===== */
@media (max-width: 768px) {
    .banner-side {
        display: none;
    }
    /* On smaller screens, reduce product card width */
    .product-card {
        flex: 0 0 160px;
        max-width: 160px;
    }
    .product-name {
        font-size: 0.9rem;
    }
    .product-price {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .products {
        /* Fall back to grid on very small screens */
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 12px;
        overflow-x: visible;
        padding-bottom: 0;
    }
    .product-card {
        max-width: 100%;
        flex: none;
    }
    .product-description {
        font-size: 0.8rem;
    }
}
