#searchSuggestions {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: white;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

#searchSuggestions .list-group-item {
    cursor: pointer;
    border: none;
    border-bottom: 1px solid #eee;
}

#searchSuggestions .list-group-item:hover {
    background-color: #f8f9fa;
}

.single-course {
    background: #fff;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0px 2px 10px 0px rgba(35, 94, 231, 0.08);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.single-course:hover {
    box-shadow: 0px 10px 30px 0px rgba(35, 94, 231, 0.2);
    transform: translateY(-5px);
}

/* Product group by category */
.product-group {
    border-bottom: 1px solid #e2e8f0;
    padding-bottom: 1.5rem;
}

.product-group:last-child {
    border-bottom: none;
}

.product-group-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 2px solid #4f46e5;
}

/* Lazy-loaded images: placeholder (skeleton) + fade-in for slow connections */
.img-lazy {
    opacity: 0;
    transition: opacity 0.3s ease;
    background: #e5e7eb;
}

.img-lazy.loaded {
    opacity: 1;
    background: transparent;
}

.perishable-card-image-wrap,
.featured-carousel-img-wrap {
    background: #e5e7eb;
}

/* Product card - image prominent, description expandable */
.product-card-modern .product-card-thumb {
    position: relative;
    overflow: hidden;
    width: 100%;
    aspect-ratio: 1;
    background: #e5e7eb;
}

.product-card-modern .product-card-thumb > a {
    display: block;
    width: 100%;
    height: 100%;
}

.product-card-modern .product-card-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

/* Override Bootstrap img-fluid (height: auto) so image fills the thumb container */
.product-card-modern .product-card-thumb img.product-card-img {
    max-width: none;
    height: 100%;
}

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

.product-card-modern .product-card-img.product-img-lazy:not(.loaded) {
    opacity: 0;
}

.product-card-modern .product-card-img.loaded {
    opacity: 1;
}

.product-card-img-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 2.5rem;
}

.carousel-image-hero.img-lazy {
    opacity: 0;
    transition: opacity 0.35s ease;
}

.carousel-image-hero.img-lazy.loaded {
    opacity: 1;
}

.product-card-badge {
    position: absolute;
    top: 8px;
    right: 8px;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 11px;
    font-weight: 600;
}

.product-card-badge-sale {
    background: #dc2626;
    color: white;
}

.product-card-badge-fresh {
    top: 8px;
    right: auto;
    left: 8px;
    background: #28a745;
    color: white;
}

.product-card-badge-featured {
    top: 8px;
    right: auto;
    left: 8px;
    background: #ffc107;
    color: #000;
}

/* Fixed description height so all cards are same height */
.product-card-desc {
    font-size: 12px;
    color: #64748b;
    margin: 6px 0;
    line-height: 1.4;
    min-height: 2.8em;
    flex-shrink: 0;
}

.product-card-desc-short {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
}

.product-card-desc-toggle {
    font-size: 11px;
    padding: 0;
    margin-left: 4px;
    color: #4f46e5;
    text-decoration: none;
    background: none;
    border: none;
    cursor: pointer;
}

.product-card-desc-toggle:hover {
    text-decoration: underline;
    color: #3730a3;
}

.product-card-desc-full {
    font-size: 12px;
    color: #475569;
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid #f1f5f9;
}

/* Details section: flex so actions stay at bottom for consistent card height */
.product-card-modern .details {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}


.product-card-stock {
    font-size: 11px;
}

.product-card-stock.in-stock { color: #16a34a; }
.product-card-stock.low-stock { color: #ca8a04; }
.product-card-stock.out-stock { color: #dc2626; }

/* Featured products - one horizontal carousel */
.featured-carousel-section {
    padding: 1rem 0;
    border-top: 1px solid #e2e8f0;
}

.featured-carousel-wrapper {
    position: relative;
    padding: 0 2.5rem;
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}

.featured-carousel {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    padding: 0.5rem 0;
}

.featured-carousel::-webkit-scrollbar {
    height: 6px;
}

.featured-carousel::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.featured-carousel-item {
    flex: 0 0 auto;
    width: 160px;
    scroll-snap-align: start;
}

.featured-carousel-card {
    display: block;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    transition: box-shadow 0.2s, transform 0.2s;
    color: #1e293b;
}

.featured-carousel-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    transform: translateY(-2px);
    color: #1e293b;
}

.featured-carousel-img-wrap {
    position: relative;
    aspect-ratio: 1;
    background: #f8fafc;
    overflow: hidden;
}

.featured-carousel-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.featured-carousel-img-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    font-size: 2rem;
}

.featured-carousel-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #f59e0b;
    color: #000;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
}

.featured-carousel-body {
    padding: 10px 12px;
}

.featured-carousel-title {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.featured-carousel-price {
    font-size: 14px;
    font-weight: 600;
    color: #4f46e5;
}

.featured-carousel-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #e2e8f0;
    background: #fff;
    color: #64748b;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.featured-carousel-nav:hover {
    background: #4f46e5;
    color: #fff;
    border-color: #4f46e5;
}

.featured-carousel-prev { left: 0; }
.featured-carousel-next { right: 0; }

.single-course .thumb {
    position: relative;
    overflow: hidden;
    width: 100%;
}

.single-course .thumb img {
    width: 100%;
    height: 120px;
    object-fit: contain;
    object-position: center;
    transition: transform 0.3s ease;
}

.single-course:hover .thumb img {
    transform: scale(1.05);
}

.single-course .details {
    padding: 10px;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.single-course .details h4 {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 6px;
    color: #222;
    line-height: 1.2;
    min-height: 34px;
    max-height: 34px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
}

.single-course .details h4 a {
    color: #222;
    text-decoration: none;
    transition: color 0.3s ease;
}

.single-course .details h4 a:hover {
    color: #235ee7;
}

.single-course .details p {
    font-size: 11px;
    color: #777;
    margin-bottom: 8px;
    flex: 0 0 auto;
    line-height: 1.3;
    min-height: 42px;
    max-height: 42px;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    text-overflow: ellipsis;
}

.single-course .bottom {
    margin-top: auto;
    flex-shrink: 0;
}

.single-course .price {
    font-size: 14px;
    font-weight: 600;
    color: #235ee7;
}

.single-course .meta {
    font-size: 11px;
    color: #777;
}

/* Ensure equal height cards */
.row {
    display: flex;
    flex-wrap: wrap;
}

.row > [class*='col-'] {
    display: flex;
    flex-direction: column;
}

/* Product cards: size to content, no extra space below stock status */
#products .mb-4 > .row,
#products .product-group .row {
    align-items: flex-start;
}

#products .single-course {
    height: auto;
}

/* Custom width for 5 cards per row on large screens */
@media (min-width: 992px) {
    .row > .single-course {
        flex: 0 0 calc(20% - 20px);
        max-width: calc(20% - 20px);
        margin: 0 10px 25px 10px;
    }

    .row {
        margin-left: -10px;
        margin-right: -10px;
    }
}

/* Product Action Buttons Responsive Layout */
.product-action-buttons {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex-shrink: 0;
}

.action-buttons-row {
    display: flex;
    gap: 4px;
}

.cart-button-row {
    display: none;
}

.cart-button-sm {
    display: none;
}

.cart-button-lg {
    display: inline-block;
}

/* Small screens: Show cart button in separate row */
@media (max-width: 991px) {
    .cart-button-row {
        display: block;
        margin-top: 4px;
    }

    .cart-button-sm {
        display: inline-block;
    }

    .cart-button-lg {
        display: none;
    }
}

/* Stock Status */
.single-course .details > .mt-1:last-child {
    flex-shrink: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .single-course {
        margin-bottom: 30px;
    }
}

/* Hero carousel - full width, visible on mobile and medium */
.carousel-home-hero {
    position: relative;
    width: 100%;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.carousel-image-wrapper-hero {
    position: relative;
    width: 100%;
    overflow: hidden;
    background-color: #1a5f2a;
    display: flex;
    align-items: center;
    justify-content: center;
}

.carousel-image-hero {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
}

/* Hero carousel heights: mobile, medium, desktop */
.carousel-home-hero .carousel-image-wrapper-hero {
    height: 200px;
}

@media (min-width: 576px) {
    .carousel-home-hero .carousel-image-wrapper-hero {
        height: 280px;
    }
}

@media (min-width: 768px) {
    .carousel-home-hero .carousel-image-wrapper-hero {
        height: 320px;
    }
}

@media (min-width: 992px) {
    .carousel-home-hero .carousel-image-wrapper-hero {
        height: 380px;
    }
}

.carousel-caption-hero {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
}

.carousel-caption-hero .carousel-caption-content {
    background: rgba(0, 0, 0, 0.6);
    border-radius: 0.25rem;
    padding: 0.5rem 0.75rem;
    display: inline-block;
}

.carousel-caption-hero p {
    color: #fff;
    font-size: 0.875rem;
    line-height: 1.3;
    margin: 0;
}

.carousel-home-hero .carousel-control-prev,
.carousel-home-hero .carousel-control-next {
    width: 15%;
    min-width: 40px;
    opacity: 0.8;
}

.carousel-home-hero .carousel-control-prev:hover,
.carousel-home-hero .carousel-control-next:hover {
    opacity: 1;
}

.carousel-home-hero .carousel-indicators {
    margin-bottom: 0.5rem;
}

.carousel-home-hero .carousel-indicators button {
    width: 10px;
    height: 10px;
    border-radius: 50%;
}

@media (max-width: 991px) {
    .carousel-home-hero {
        touch-action: pan-y;
    }
    .carousel-home-hero .carousel-inner {
        touch-action: pan-y;
    }
    .carousel-home-hero .carousel-control-prev,
    .carousel-home-hero .carousel-control-next {
        width: 20%;
        min-width: 44px;
    }
}

/* Hero + Ads row: carousel (col-7) + promo banners (col-5) */
.hero-and-ads-row {
    align-items: stretch;
}

.promo-banners-column {
    height: 100%;
}

@media (min-width: 992px) {
    .hero-and-ads-row .col-lg-7 {
        min-height: 380px;
    }
    .promo-banners-column {
        min-height: 380px;
        justify-content: space-between;
    }
}

/* Advertisement / Promo banners (right column) */
.promo-banner {
    display: block;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    min-height: 100px;
}

.promo-banner:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.promo-banner-inner {
    padding: 1rem 1.25rem;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    color: #fff;
}

.promo-banner-primary .promo-banner-inner {
    background: linear-gradient(135deg, #1a5f2a 0%, #2d8a3e 100%);
}

.promo-banner-secondary .promo-banner-inner {
    background: linear-gradient(135deg, #c97a0a 0%, #e6a02a 100%);
    color: #1a1a1a;
}

.promo-banner-accent .promo-banner-inner {
    background: #fff;
    color: #222;
    border: 1px solid #eee;
}

.promo-banner-accent .promo-banner-title {
    color: #235ee7;
    font-weight: 600;
}

.promo-banner-brand {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    opacity: 0.95;
}

.promo-banner-accent .promo-banner-brand {
    color: #235ee7;
}

.promo-banner-title {
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.3;
    margin: 0;
}

.promo-banner-terms {
    font-size: 0.7rem;
    opacity: 0.85;
    margin-top: 0.25rem;
}

.promo-banner-cta {
    display: inline-block;
    margin-top: 0.5rem;
    padding: 0.35rem 0.75rem;
    background: rgba(255, 255, 255, 0.25);
    border-radius: 0.25rem;
    font-size: 0.8rem;
    font-weight: 600;
    width: fit-content;
    transition: background 0.2s ease;
}

.promo-banner:hover .promo-banner-cta {
    background: rgba(255, 255, 255, 0.4);
}

.promo-banner-secondary .promo-banner-cta {
    background: rgba(0, 0, 0, 0.15);
    color: #1a1a1a;
}

.promo-banner-secondary:hover .promo-banner-cta {
    background: rgba(0, 0, 0, 0.25);
}

.promo-banner-accent .promo-banner-cta {
    background: #235ee7;
    color: #fff;
}

.promo-banner-accent:hover .promo-banner-cta {
    background: #1a4bb8;
}

@media (min-width: 992px) {
    .promo-banner {
        flex: 1;
        min-height: 0;
    }
    .promo-banner-inner {
        padding: 1rem 1.25rem;
    }
}

/* Perishable Products section - horizontal carousel */
.perishable-section {
    background: #fff;
    border-radius: 0.5rem;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.perishable-section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.75rem 1rem;
    background: linear-gradient(135deg, #c41e3a 0%, #dc3545 100%);
    color: #fff;
}

.perishable-section-title {
    font-size: 1.1rem;
    font-weight: 600;
}

.perishable-section-see-all {
    color: #fff;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.perishable-section-see-all:hover {
    color: #fff;
    opacity: 0.9;
}

.perishable-carousel-wrapper {
    overflow-x: hidden;
    overflow-y: visible;
    padding: 1rem 0;
    width: 100%;
    max-width: 100%;
}

.perishable-carousel {
    display: flex;
    gap: 1rem;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding: 0 1rem;
    -webkit-overflow-scrolling: touch;
}

.perishable-carousel::-webkit-scrollbar {
    height: 6px;
}

.perishable-carousel::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.perishable-carousel::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.perishable-card {
    flex: 0 0 180px;
    scroll-snap-align: start;
    text-decoration: none;
    color: inherit;
    background: #fff;
    border-radius: 0.5rem;
    overflow: hidden;
    border: 1px solid #eee;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
    display: flex;
    flex-direction: column;
}

.perishable-card:hover {
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
    transform: translateY(-2px);
    color: inherit;
}

.perishable-card-image-wrap {
    position: relative;
    width: 100%;
    aspect-ratio: 1;
    background: #f8f9fa;
    overflow: hidden;
}

.perishable-card-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

.perishable-card-image-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2rem;
    color: #ccc;
}

.perishable-card-badge {
    position: absolute;
    top: 6px;
    right: 6px;
    background: #f0ad4e;
    color: #fff;
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 6px;
    border-radius: 4px;
}

.perishable-card-body {
    padding: 0.6rem 0.75rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.perishable-card-title {
    font-size: 0.85rem;
    font-weight: 600;
    margin: 0 0 0.35rem 0;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    color: #222;
}

.perishable-card-price {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.perishable-card-price-current {
    font-size: 1rem;
    font-weight: 700;
    color: #235ee7;
}

.perishable-card-price-old {
    font-size: 0.8rem;
    color: #999;
    text-decoration: line-through;
}

.perishable-card-stock {
    font-size: 0.7rem;
    color: #666;
    margin-top: 0.25rem;
}

@media (min-width: 576px) {
    .perishable-card {
        flex: 0 0 200px;
    }
}

@media (min-width: 768px) {
    .perishable-card {
        flex: 0 0 220px;
    }
}

/* Products list 2-8-2 layout: left advert | products | right advert */
.products-three-column-row {
    align-items: flex-start;
}

.products-advert-column {
    position: sticky;
    top: 1rem;
}

.products-advert-placeholder {
    min-height: 200px;
    background: #f8f9fa;
    border: 1px dashed #dee2e6;
    border-radius: 0.375rem;
}

/* Product Categories Section */
.product-categories-section {
    margin-top: 1rem;
}

.categories-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.category-link {
    white-space: nowrap;
    transition: all 0.3s ease;
}

.category-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

/* Three-Column Layout */
@media (min-width: 992px) {
    .col-lg-2 {
        flex: 0 0 16.666667%;
        max-width: 16.666667%;
    }
    .col-lg-7 {
        flex: 0 0 58.333333%;
        max-width: 58.333333%;
    }
    .col-lg-3 {
        flex: 0 0 25%;
        max-width: 25%;
    }
}

/* Carousel Sidebar Styles */
.carousel-home-sidebar {
    position: relative;
    width: 100%;
}

.carousel-image-wrapper-sidebar {
    position: relative;
    width: 100%;
    overflow: hidden;
    background-color: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 0.5rem;
}

.carousel-image-sidebar {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    display: block;
}

/* Responsive heights for sidebar carousel */
.carousel-home-sidebar .carousel-image-wrapper-sidebar {
    height: 400px; /* Default for desktop */
}

/* Mobile and tablet styles for carousel */
@media (max-width: 991px) {
    .carousel-home-sidebar .carousel-image-wrapper-sidebar {
        height: 300px;
    }

    .carousel-sidebar {
        position: relative !important;
        top: 0 !important;
    }

    /* Ensure touch events work on mobile */
    .carousel-home-sidebar {
        touch-action: pan-y;
        -webkit-touch-callout: none;
        -webkit-user-select: none;
        user-select: none;
    }

    .carousel-home-sidebar .carousel-inner {
        touch-action: pan-y;
    }

    /* Make controls more touch-friendly on mobile */
    .carousel-home-sidebar .carousel-control-prev,
    .carousel-home-sidebar .carousel-control-next {
        width: 20%;
        min-width: 40px;
        opacity: 0.8;
    }

    /* Make indicators more touch-friendly */
    .carousel-home-sidebar .carousel-indicators {
        margin-bottom: 0.75rem;
    }

    .carousel-home-sidebar .carousel-indicators button {
        width: 10px;
        height: 10px;
        margin: 0 4px;
    }
}

@media (min-width: 1200px) {
    .carousel-home-sidebar .carousel-image-wrapper-sidebar {
        height: 500px;
    }
}

@media (min-width: 1400px) {
    .carousel-home-sidebar .carousel-image-wrapper-sidebar {
        height: 600px;
    }
}

/* Carousel Sidebar Caption Styles */
.carousel-caption-sidebar {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 0.5rem;
    text-align: center;
    z-index: 10;
}

.carousel-caption-sidebar .carousel-caption-content {
    background: rgba(0, 0, 0, 0.75);
    border-radius: 0.25rem;
    padding: 0.5rem;
    display: inline-block;
    max-width: 95%;
    margin: 0 auto;
}

.carousel-caption-sidebar p {
    color: #fff;
    font-size: 0.75rem;
    line-height: 1.3;
    margin: 0;
}

/* Carousel Sidebar Controls */
.carousel-home-sidebar .carousel-control-prev,
.carousel-home-sidebar .carousel-control-next {
    width: 15%;
    min-width: 30px;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.carousel-home-sidebar .carousel-control-prev:hover,
.carousel-home-sidebar .carousel-control-next:hover {
    opacity: 1;
}

.carousel-home-sidebar .carousel-control-prev-icon,
.carousel-home-sidebar .carousel-control-next-icon {
    width: 1.5rem;
    height: 1.5rem;
}

/* Carousel Sidebar Indicators */
.carousel-home-sidebar .carousel-indicators {
    margin-bottom: 0.5rem;
}

.carousel-home-sidebar .carousel-indicators button {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    margin: 0 3px;
}

/* Sticky Sidebar */
.carousel-sidebar {
    position: sticky;
}

/* High DPI displays */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .carousel-image-sidebar {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* Fix Add to Cart Button Display */
.cart-button-lg {
    overflow: visible !important;
    text-overflow: clip !important;
}

.action-buttons-row {
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem;
}

.action-buttons-row .btn {
    flex: 1;
}

.action-buttons-row .cart-button-lg {
    flex: 1;
    max-width: 100%;
}

/* Product card action buttons container */
.product-action-buttons {
    width: 100%;
}

/* Ensure button text is visible on medium and large screens */
@media (min-width: 768px) {
    .cart-button-lg {
        font-size: 10px !important;
        padding: 4px 4px !important;
    }
}

@media (min-width: 992px) {
    .cart-button-lg {
        min-width: 110px !important;
        font-size: 10px !important;
        padding: 4px 5px !important;
    }
}

@media (min-width: 1200px) {
    .cart-button-lg {
        min-width: 115px !important;
        font-size: 11px !important;
        padding: 4px 6px !important;
    }
}

/* Product card width adjustments */
.single-course {
    padding: 0.5rem;
    overflow: visible;
}

.single-course .details {
    padding: 0.75rem;
    overflow: visible;
}

.single-course .product-action-buttons {
    overflow: visible;
    width: 100%;
}

/* Ensure buttons don't get cut off */
.action-buttons-row {
    overflow: visible;
    width: 100%;
}

.action-buttons-row .btn {
    overflow: visible;
    text-overflow: clip;
}

/* Make action buttons wrap if needed on smaller product cards */
@media (max-width: 1199px) {
    .action-buttons-row {
        flex-wrap: wrap;
    }

    .action-buttons-row .cart-button-lg {
        flex: 1 1 100%;
        margin-top: 0.25rem;
        min-width: 100% !important;
    }
}

/* Prevent horizontal scroll on mobile/small screens */
@media (max-width: 991px) {
    .course-area,
    #products,
    section.course-area .container-fluid {
        overflow-x: hidden;
        max-width: 100%;
        width: 100%;
    }

    .featured-carousel-wrapper {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    /* Allow flex children to shrink and prevent overflow */
    .row > [class*="col-"],
    .products-three-column-row > [class*="col-"],
    .hero-and-ads-row > [class*="col-"] {
        min-width: 0;
    }
}
