/* Home page modern refresh (Meesho-inspired cleanliness) */

/* Carousel */
.carousel.bg-light {
    background: linear-gradient(180deg, #f7f8ff 0%, #f2f5ff 100%) !important;
}

.header-carousel .header-carousel-item {
    min-height: 460px;
}

.header-carousel .carousel-img img {
    max-height: 360px;
    object-fit: contain;
}

.header-carousel .carousel-content h1,
.header-carousel .carousel-content .display-3 {
    font-weight: 700;
    line-height: 1.2;
    color: #1f2a44;
}

.header-carousel .carousel-content h4 {
    color: var(--bs-primary);
    letter-spacing: 1.4px !important;
}

.carousel .carousel-header-banner {
    border-radius: 16px;
    overflow: hidden;
}

.carousel .carousel-banner {
    padding: 1.25rem 1rem 1rem;
}

.carousel .carousel-banner .btn {
    min-width: 172px;
}

.header-carousel .carousel-content .almart-home-hero-cta {
    padding: 0.5rem 1.35rem !important;
    font-size: 0.95rem;
    font-weight: var(--almart-font-weight-semibold);
}

/* Hero right column: keep background photo readable, avoid “white slab” / fake gap */
.almart-home-hero .almart-home-hero-sidebar .carousel-banner {
    background: linear-gradient(
        to top,
        rgba(10, 18, 36, 0.92) 0%,
        rgba(10, 18, 36, 0.58) 40%,
        rgba(10, 18, 36, 0.22) 66%,
        transparent 88%
    ) !important;
    padding: 0.85rem 0.9rem 1rem !important;
    justify-content: flex-end;
    align-items: stretch;
    gap: 0.5rem;
}

.almart-home-hero .almart-home-hero-sidebar .carousel-banner-content,
.almart-home-hero .almart-home-hero-sidebar .almart-hero-sidebar-panel {
    background: transparent !important;
    box-shadow: none !important;
    flex: 0 1 auto !important;
    width: 100%;
    padding: 0.45rem 0.5rem 0.25rem !important;
    border-radius: 0;
}

.almart-home-hero .almart-home-hero-sidebar .carousel-banner .btn {
    flex: 0 0 auto;
    align-self: center;
    margin-top: 0 !important;
    min-width: 0;
}

.almart-home-hero .almart-home-hero-sidebar .carousel-banner-content .text-white,
.almart-home-hero .almart-home-hero-sidebar .carousel-banner-content .almart-hero-sidebar-title {
    color: #fff !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55);
}

.almart-home-hero .almart-home-hero-sidebar .carousel-banner-content .almart-hero-sidebar-title {
    line-height: 1.25;
    margin-bottom: 0.2rem;
}

.almart-home-hero .almart-home-hero-sidebar .carousel-banner-content a:not(.text-white):not(.almart-hero-sidebar-thumb-link) {
    color: var(--bs-primary) !important;
    font-weight: 600;
}

.almart-home-hero .almart-home-hero-sidebar .almart-hero-sidebar-thumb-link {
    line-height: 0;
}

.almart-home-hero .almart-home-hero-sidebar .almart-hero-sidebar-thumb {
    display: inline-block;
    vertical-align: middle;
    max-height: 84px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
}

/* Services row */
.container-fluid.px-0 .row.g-0 > [class*="col-"] .p-4 {
    background: #fff;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.container-fluid.px-0 .row.g-0 > [class*="col-"] .p-4:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 24px rgba(24, 39, 75, 0.08);
}

/* Product offer cards */
.bg-light.py-5 .container .row.g-4 > [class*="col-"] > a.d-flex {
    border: 1px solid #e8ecfb !important;
    border-radius: 16px !important;
    box-shadow: 0 10px 24px rgba(22, 31, 66, 0.05);
}

.bg-light.py-5 .container .row.g-4 > [class*="col-"] > a.d-flex img {
    max-height: 160px;
    width: auto;
    object-fit: contain;
}

/* Product tabs area */
.tab-class .nav-pills .nav-item a {
    border: 1px solid #dbe2fb;
    box-shadow: 0 4px 10px rgba(18, 40, 96, 0.05);
}

.tab-class .nav-pills .nav-item a.active,
.tab-class .nav-pills .nav-item a:hover {
    background: #fff !important;
    border-color: #bfcaf0;
}

.product-item {
    border-radius: 16px !important;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 8px 22px rgba(17, 33, 76, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.product-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 30px rgba(13, 30, 74, 0.12);
}

.product-item-inner {
    border: none !important;
}

.product-item-inner-item {
    background: #f6f8ff;
}

.product-item-inner-item img {
    height: 220px;
    object-fit: contain;
    padding: 14px;
}

/* Quick-view control: corner chip inside image frame (legacy template used full-bleed overlay) */
.product-item-inner-item .product-details {
    position: absolute !important;
    top: auto !important;
    left: auto !important;
    right: 12px !important;
    bottom: 12px !important;
    width: auto !important;
    height: auto !important;
    margin: 0;
    padding: 0;
    display: flex !important;
    align-items: center;
    justify-content: center;
    background: transparent !important;
    border-radius: 0;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--almart-duration-base) var(--almart-easing-standard);
    z-index: 4;
}

.product-item:hover .product-item-inner-item .product-details,
.product-item:focus-within .product-item-inner-item .product-details {
    opacity: 1;
    pointer-events: auto;
}

.product-item .product-details a {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 40px !important;
    height: 40px !important;
    min-width: 40px;
    min-height: 40px;
    border-radius: 50%;
    background: #fff;
    color: var(--bs-primary);
    box-shadow: 0 6px 16px rgba(15, 33, 73, 0.18);
    text-decoration: none;
}

.product-item .product-details a i,
.product .product-item .product-item-inner .product-item-inner-item .product-details a i {
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    color: inherit !important;
    display: inline-block !important;
    line-height: 1;
    box-shadow: none !important;
}

.product .product-item:hover .product-item-inner .product-item-inner-item .product-details a i:hover {
    background: transparent !important;
    color: inherit !important;
}

/* style.css pulled action rows outside the card (negative margin + absolute) — keep hit area inside */
.product .product-item .product-item-add,
.products .products-mini .products-mini-item .products-mini-add {
    position: static !important;
    bottom: auto !important;
    left: auto !important;
    right: auto !important;
    width: 100%;
    opacity: 1 !important;
    margin-bottom: 0 !important;
    z-index: auto;
}

.product .product-item:hover .product-item-add,
.products .products-mini .products-mini-item:hover .products-mini-add {
    margin-bottom: 0 !important;
    background: var(--almart-color-surface, #fff);
}

.product .product-item:hover .product-item-inner {
    border-bottom: inherit !important;
    border-bottom-right-radius: inherit !important;
    border-bottom-left-radius: inherit !important;
}

.product .product-item:hover .product-item-inner img,
.products .products-mini .products-mini-item:hover .products-mini-img img {
    transform: none !important;
}

.products .products-mini .products-mini-item:hover {
    border-bottom-left-radius: 10px !important;
    border-bottom-right-radius: 10px !important;
}

.products .products-mini .products-mini-item .products-mini-img .products-mini-icon {
    opacity: 1 !important;
    pointer-events: auto;
}

.product-item .h4 {
    font-size: 1.03rem;
    min-height: 44px;
}

.product-item-add {
    border: none !important;
    border-top: 1px solid #edf1ff !important;
    background: #fff;
}

/*
 * "Our Products" tab cards: row uses equal-height columns; legacy `inner { height:100% }`
 * + `product-item { overflow:hidden }` clips the in-flow footer when sale price adds a line.
 * Flex column keeps image + text block flexible and pins the action row to the card bottom.
 */
.almart-home-section.product .product-item {
    display: flex;
    flex-direction: column;
    height: 100%;
    min-height: 0;
}

.almart-home-section.product .product-item .product-item-inner {
    flex: 1 1 auto;
    min-height: 0;
    height: auto !important;
    display: flex;
    flex-direction: column;
}

/* Extra row height fills the image frame (soft bg), not a blank gap under the price */
.almart-home-section.product .product-item .product-item-inner-item {
    flex: 1 1 auto;
    min-height: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border-radius: 14px 14px 0 0;
}

/* Title/price sit over the product photo (no solid white strip) */
.almart-home-section.product .product-item .almart-home-tab-card-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    background: linear-gradient(
        to top,
        rgba(255, 255, 255, 0.96) 0%,
        rgba(255, 255, 255, 0.82) 42%,
        rgba(255, 255, 255, 0) 100%
    );
    pointer-events: auto;
}

.almart-home-section.product .product-item .almart-home-tab-card-caption .h4 {
    color: #1a1d21;
    text-shadow: 0 1px 2px rgba(255, 255, 255, 0.9);
}

/* Keep quick-view chip above caption */
.almart-home-section.product .product-item .product-item-inner-item .product-details {
    top: 10px !important;
    right: 10px !important;
    bottom: auto !important;
}

.almart-home-section.product .product-item .product-item-add {
    flex: 0 0 auto;
}

/*
 * Mini cards (Featured items carousel + Bestseller row): equal row height, footer always
 * below image+text (legacy style.css used absolute + negative margin on .products-mini-add).
 */
.productList-carousel .owl-item {
    display: flex;
    align-items: stretch;
}

.productList-carousel .owl-item > .products-mini-item {
    width: 100%;
}

.products-mini-item.almart-mini-card--stretch {
    display: flex;
    flex-direction: column;
    min-height: 0;
    flex: 1 1 auto;
    width: 100%;
}

.products-mini-item.almart-mini-card--stretch > .row.g-0 {
    flex: 1 1 auto;
    min-height: 0;
    align-items: stretch;
}

/* Same idea as tab cards: grow the image column, not empty space under price in col-7 */
.products-mini-item.almart-mini-card--stretch > .row.g-0 > .col-5 {
    display: flex;
    flex-direction: column;
}

.products-mini-item.almart-mini-card--stretch > .row.g-0 > .col-5 .products-mini-img {
    flex: 1 1 auto;
    min-height: 0;
}

.products-mini-item.almart-mini-card--stretch > .row.g-0 > .col-7 {
    display: flex;
    flex-direction: column;
}

.products-mini-item.almart-mini-card--stretch > .row.g-0 > .col-7 .products-mini-content {
    flex: 0 0 auto;
}

.products-mini-item.almart-mini-card--stretch .products-mini-add {
    flex: 0 0 auto;
    margin-top: auto;
    display: flex !important;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.75rem;
}

/* Banners */
.container-fluid.py-5 .bg-primary.rounded.position-relative,
.container-fluid.py-5 .text-center.bg-primary.rounded.position-relative {
    border-radius: 18px !important;
    overflow: hidden;
    box-shadow: 0 14px 34px rgba(18, 29, 68, 0.11);
}

/* Product list / mini cards */
.products-mini-item {
    border: 1px solid #e8ecfb !important;
    border-radius: 14px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 8px 22px rgba(20, 36, 82, 0.07);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.products-mini-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 14px 30px rgba(18, 36, 80, 0.11);
}

.products-mini-img img {
    object-fit: contain;
    background: #f7f8ff;
}

.products-mini-add {
    border-top: 1px solid #edf1ff !important;
}

/* Section titles */
.title-border-radius {
    border-radius: 999px;
    background: rgba(21, 101, 192, 0.08);
}

/* Responsive tuning */
@media (max-width: 1199.98px) {
    .header-carousel .header-carousel-item {
        min-height: 420px;
    }

    .product-item-inner-item img {
        height: 200px;
    }
}

@media (max-width: 991.98px) {
    .header-carousel .header-carousel-item {
        min-height: auto;
    }

    .header-carousel .carousel-img img {
        max-height: 250px;
        margin-bottom: 12px;
    }

    .tab-class .nav-pills {
        display: grid !important;
        grid-template-columns: 1fr 1fr;
        gap: 0.5rem;
        width: 100%;
    }

    .tab-class .nav-pills .nav-item {
        margin: 0 !important;
    }

    .tab-class .nav-pills .nav-item a {
        margin: 0 !important;
        width: 100%;
        justify-content: center;
    }
}

@media (max-width: 575.98px) {
    .tab-class .nav-pills {
        grid-template-columns: 1fr !important;
    }
}

@media (max-width: 767.98px) {
    .carousel .carousel-content {
        text-align: center;
    }

    .header-carousel .carousel-content .btn {
        width: 100%;
    }

    .carousel .carousel-banner .btn {
        min-width: 0;
        width: 100%;
        max-width: 16rem;
        margin-left: auto;
        margin-right: auto;
    }

    .bg-light.py-5 .container .row.g-4 > [class*="col-"] > a.d-flex {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 0.8rem;
    }

    .bg-light.py-5 .container .row.g-4 > [class*="col-"] > a.d-flex img {
        max-height: 120px;
        align-self: center;
    }

    .product-item-inner-item img {
        height: 170px;
        padding: 10px;
    }

    .product-item .h4 {
        min-height: 0;
        font-size: 0.98rem;
    }
}

@media (max-width: 575.98px) {
    .container.py-5,
    .container.products-mini.py-5 {
        padding-top: 2.25rem !important;
        padding-bottom: 2.25rem !important;
    }

    .product-item .almart-home-tab-card-caption,
    .product-item-add.p-4 {
        padding: 0.85rem !important;
    }

    .products-mini-content .h4 {
        font-size: 0.95rem;
    }
}

/* Image skeleton shimmer (used with .sf-img-wrap + footer script) */
.sf-img-wrap {
    position: relative;
    background: linear-gradient(90deg, #eef1fb 0%, #f8f9ff 45%, #eef1fb 90%);
    background-size: 200% 100%;
    animation: sf-shimmer 1.2s ease-in-out infinite;
}

.sf-img-wrap img {
    opacity: 0;
    transition: opacity 0.35s ease;
}

.sf-img-wrap.sf-loaded {
    animation: none;
    background: transparent;
}

.sf-img-wrap.sf-loaded img {
    opacity: 1;
}

@keyframes sf-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}
