/* ==========================================================================
   Kushtia Mobile Parts — site overrides
   This file is the LAST stylesheet loaded (after style.css and responsive.css),
   so rules here win without needing !important. Put brand/layout fixes here.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Top category cards — uniform height
   The container carries both .topcategory (display:grid) and .owl-carousel.
   Once Owl initialises, the grid fights the carousel, so the grid is switched
   off here and equal height is done with flex on the Owl stage instead.
   -------------------------------------------------------------------------- */
/* .owl-loaded is added by Owl only after it initialises successfully, so if the
   carousel JS ever fails the original grid layout survives as a fallback. */
.topcategory.owl-loaded {
    display: block;
}
/* grid fallback (no JS / Owl failed): equal height comes from the grid itself */
.topcategory:not(.owl-loaded) .cat_item {
    height: 100%;
}
.cat_slider.owl-carousel .owl-stage {
    display: flex;
    align-items: stretch;
}
.cat_slider.owl-carousel .owl-item {
    display: flex;
    height: auto;
    float: none;
}
.cat_slider.owl-carousel .owl-item > div {
    display: flex;
    width: 100%;
}

.cat_slider .cat_item {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    border: 1px solid #e3e3e3;
    border-radius: 10px;
    padding: 10px;
    background: #fff;
    transition: border-color .2s ease, box-shadow .2s ease;
}
.cat_slider .cat_item:hover {
    border-color: #d81e20;
    box-shadow: 0 4px 14px rgba(216, 30, 32, .12);
}

/* fixed image band — identical on every card */
.cat_slider .cat_img {
    flex: 0 0 auto;
    height: 90px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
}
.cat_slider .cat_img a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
}
.cat_slider .cat_img img {
    max-height: 100%;
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}

/* label pinned to the bottom, clamped to two lines */
.cat_slider .cat_name {
    margin-top: auto;
    min-height: 46px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6px 4px 0;
}
.cat_slider .cat_name a {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
    font-size: 13px;
    color: #222;
}
.cat_slider .cat_name a:hover {
    color: #d81e20;
}

/* --------------------------------------------------------------------------
   1b. Product card image — no distortion on resize
   The theme sets width:100% + height:100% with object-fit commented out, so the
   browser falls back to object-fit:fill and STRETCHES the image whenever the
   card is narrower than the fixed box height. Force contain so the whole product
   stays in proportion at every screen width, on a white background.
   -------------------------------------------------------------------------- */
.pro_img {
    background: #fff;
}
.pro_img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* --------------------------------------------------------------------------
   2. WhatsApp order button — product page
   -------------------------------------------------------------------------- */
.whatsapp_now_btn {
    background: #25d366;
    color: #fff;
    font-weight: 600;
    padding: 10px 16px;
    border-radius: 4px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background .15s ease;
}
.whatsapp_now_btn:hover,
.whatsapp_now_btn:focus {
    background: #1da851;
    color: #fff;
}
.whatsapp_now_btn i {
    font-size: 18px;
}

/* --------------------------------------------------------------------------
   3. Mobile header — hamburger | centred logo | cart, then search below
   -------------------------------------------------------------------------- */
@media only screen and (max-width: 767px) {
    .mobile-logo {
        display: grid;
        grid-template-columns: 48px 1fr 48px;
        align-items: center;
        height: 62px;
        padding: 0 12px;
        background: #fff;
    }
    .menu-logo {
        display: flex;
        align-items: center;
        justify-content: center;
        min-width: 0;
    }
    .menu-logo img {
        width: auto;
        height: auto;
        max-height: 46px;
        max-width: 100%;
        object-fit: contain;
        margin-top: 0;
    }
    .menu-bar {
        display: flex;
        align-items: center;
        margin-top: 0;
    }
    .menu-bar i {
        font-size: 24px;
        color: #0d0d0f;
    }
    .menu-bag {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        margin-top: 0;
        margin-right: 0;
    }
    .menu-bag .margin-shopping {
        margin-right: 0;
    }
    .menu-bag .margin-shopping i {
        font-size: 23px;
        color: #0d0d0f;
    }
    .menu-bag .margin-shopping span {
        background-color: #d81e20;
        min-width: 20px;
        height: 20px;
        line-height: 18px;
        text-align: center;
        top: -8px;
        right: -6px;
    }

    /* search: light, rounded, brand-red outline */
    .mobile-search {
        padding: 0 12px 12px;
        background-color: #fff;
    }
    .mobile-search form {
        background-color: #fff;
        border: 1.5px solid #d81e20;
        border-radius: 30px;
        height: 44px;
    }
    .mobile-search form input {
        background: transparent;
        padding-left: 18px;
        font-size: 14px;
        color: #000;
    }
    .mobile-search form button {
        background-color: transparent;
        flex: 0 0 52px;
    }
    .mobile-search form svg {
        color: #d81e20;
        height: 20px;
        width: 20px;
    }

    /* cards stay uniform on phones */
    .cat_slider .cat_img {
        height: 72px;
    }
    .cat_slider .cat_name {
        min-height: 40px;
    }
    .cat_slider .cat_name a {
        font-size: 12px;
    }
}
