/*
 Theme Name:   Dorrinew Child
 Theme URI:    https://www.dorri.co.uk/
 Description:  Child theme for the Dorri (dorrinew) theme.
 Author:       Dorri Ltd
 Author URI:   https://www.dorri.co.uk/
 Template:     dorrinew
 Version:      1.0.2
 Text Domain:  dorrinew-child
*/

/* Add custom CSS below */

/*=====================================================================
  1.0.1 - Mobile & tablet
  Loaded after the parent's style.css / responsive.css, so equal
  selectors here win. Breakpoints follow the parent (Bootstrap 5):
  tablet 768-991px, mobile <=767px, small mobile <=575px.
=====================================================================*/

/* Product rating counts, e.g. "(147)", used the browser's serif font. */
.star-reviews {
    font-family: "Poppins", sans-serif;
}

/* Product cards: .card-body had height:100% under the image, which pushed
   "Buy Now" below the card in the home carousels, and as a wrapping row it
   spread spare height between rating/title/price. A column keeps them
   stacked at the top with the button pinned to the bottom. */
.pdct-item .card-body {
    height: auto;
    flex: 1 1 auto;
    flex-direction: column;
    flex-wrap: nowrap;
}

/* Product cards (shop grid, related products, home carousels): rating sits
   under the image, left-aligned, instead of floating over the image. */
.pdct-item .card-body > .star-reviews {
    position: static;
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
    min-height: 16px;
    margin: 14px 0 8px;
    line-height: 1;
    text-align: left;
}
.pdct-item .card-body > .star-reviews .star-rating {
    float: none;
    margin: 0;
    left: auto;
    transform: none;
}
.pdct-item .card-body > .star-reviews .st_cnt {
    position: static;
    font-size: 14px;
    line-height: 1;
}

/* Home carousels: the last visible card ended exactly on the clipped edge
   and lost its right border. */
.product-item.owl-carousel .owl-item > .item {
    padding: 0 1px;
}

/* Home page "From Our Blog": equal-height cards, buttons on one line. */
.from-our-blog .post-item {
    height: 100%;
}
.from-our-blog .post-item .card-body,
.from-our-blog .post-header {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
}
.from-our-blog .post-header .btnstyle {
    margin-top: auto !important;
    padding-top: 24px;
}
.from-our-blog .image-holder img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

/* Home page Turkish Delight ratings: stars and "(count)" side by side
   (the count used to sit inside the star font and overlap the stars). */
.trksd-item .woocommerce.star-reviews.trksd-rating {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    max-width: none;
}
.trksd-item .trksd-rating .star-rating {
    flex: none;
    width: 5.4em;
    margin: 0;
    left: auto;
    transform: none;
}
.trksd-rating-count {
    font-size: 14px;
    line-height: 1;
}

/* Contact page */
.contactus-social {
    display: flex;
    gap: 16px;
    padding: 0;
    margin: 0;
    list-style: none;
}
.contactus-social a {
    color: #3a6f23;
}
.contactus-social a:hover {
    color: #74a331;
}

/* Touch screens have no hover: show the Turkish Delight "Buy Now" buttons. */
@media (hover: none), (max-width: 991px) {
    .trksd-item .btnstyle,
    .trksd-item .card-body .btnstyle {
        display: block;
        bottom: 0;
    }
}

/*------------------------------ Tablet & mobile ------------------------------*/
@media (max-width: 991px) {
    /* 16px stops iOS Safari zooming the page when a field is focused. */
    input[type="text"],
    input[type="search"],
    input[type="email"],
    input[type="tel"],
    input[type="password"],
    input[type="number"],
    select,
    textarea {
        font-size: 16px;
    }

    /* Keep the search row clear of the logo on pages without the Trustpilot bar. */
    .header-bar .ssy-basket {
        margin-top: 8px;
    }

    /* Side menu search */
    .sidebar .search-bar {
        max-width: none;
        margin: 0;
    }

    /* Product grid (shop, categories, search, related) */
    .dorri-product-list .pdct-item .card-body {
        padding: 0 14px 18px;
    }
    .dorri-product-list .prdt-title {
        font-size: 15px;
        line-height: 1.45;
    }
    .dorri-product-list .pdct-price {
        font-size: 17px;
        line-height: 1.4;
        margin-bottom: 14px;
    }

    .turkish-delight-box {
        padding: 40px 24px;
    }
    .trksd-price {
        font-size: 17px;
        margin-bottom: 14px;
    }

    .top-footer {
        padding: 70px 0 40px;
    }

    /*------------------------- Side menu (hamburger) -------------------------*/
    .sidebar {
        width: min(86vw, 340px);
        box-shadow: 0 0 30px rgba(0, 0, 0, .18);
    }
    .sidebar .mobile-container .mobile-bar,
    .sidebar .mobile-container .mobile-nav {
        min-height: 0;
        padding: 0;
        background: #fff;
    }
    .sidebar .mobile-container .mobile-bar,
    .sidebar .mobile-container .mobile-bar * {
        box-sizing: border-box;
    }
    .sidebar .mobile-container .mobile-nav {
        border-top: 1px solid #e6eadf;
    }
    .sidebar .mobile-nav #mega-menu-wrap-primary,
    .sidebar .mobile-nav #mega-menu-wrap-primary #mega-menu-primary {
        background: #fff;
    }

    /* Categories */
    .sidebar .mobile-nav #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item {
        border-bottom: 1px solid #e6eadf;
    }
    .sidebar .mobile-nav #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > a.mega-menu-link {
        float: none;
        width: 100%;
        height: auto;
        min-height: 52px;
        padding: 15px 64px 15px 20px;
        border: 0;
        background: transparent;
        color: #224612;
        font-size: 15px;
        font-weight: 500;
        line-height: 22px;
        text-transform: none;
    }
    .sidebar .mobile-nav #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > a.mega-menu-link .mega-indicator {
        display: none;
    }

    /* Open/close button: a chevron instead of the dark "+" / "-" box */
    .sidebar .mobile-nav #mega-menu-wrap-primary #mega-menu-primary li > a.mobile-expand {
        position: absolute;
        top: 0;
        right: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 56px !important;
        height: 52px !important;
        margin: 0;
        padding: 0 !important;
        border: 0 !important;
        border-left: 1px solid #e6eadf !important;
        background: transparent;
        color: transparent;
        font-size: 0 !important;
        opacity: 1;
    }
    .sidebar .mobile-nav #mega-menu-wrap-primary #mega-menu-primary li > a.mobile-expand::before {
        content: "";
        width: 9px;
        height: 9px;
        margin-top: -4px;
        border-right: 2px solid #3a6f23;
        border-bottom: 2px solid #3a6f23;
        transform: rotate(45deg);
        transition: transform .2s ease, margin .2s ease;
    }
    .sidebar .mobile-nav #mega-menu-wrap-primary #mega-menu-primary li > a.mobile-expand.mobile-clicked::before {
        margin-top: 4px;
        transform: rotate(-135deg);
    }
    .sidebar .mobile-nav #mega-menu-wrap-primary #mega-menu-primary li > a.mobile-expand:hover {
        background: #f3f7ec;
    }

    /* Sub-groups ("Shop By Type" ...) */
    .sidebar .mobile-nav #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > ul.mega-sub-menu {
        padding: 0;
        background: #f6f8f2;
        border-top: 1px solid #e6eadf;
    }
    .sidebar .mobile-nav #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > ul.mega-sub-menu > li.mega-menu-item {
        float: none;
        width: 100%;
        padding: 0;
        border-bottom: 1px solid #e6eadf;
    }
    .sidebar .mobile-nav #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > ul.mega-sub-menu > li.mega-menu-item:last-child {
        border-bottom: 0;
    }
    .sidebar .mobile-nav #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > ul.mega-sub-menu > li.mega-menu-item > a.mega-menu-link {
        float: none;
        width: 100%;
        height: auto;
        min-height: 48px;
        margin: 0;
        padding: 14px 64px 14px 28px;
        border: 0;
        background: transparent;
        color: #3a6f23;
        font-size: 13px;
        font-weight: 600;
        line-height: 20px;
        letter-spacing: .04em;
        text-transform: uppercase;
        opacity: 1;
    }
    .sidebar .mobile-nav #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > ul.mega-sub-menu > li.mega-menu-item > a.mega-menu-link::before,
    .sidebar .mobile-nav #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > ul.mega-sub-menu > li.mega-menu-item > a.mega-menu-link .mega-indicator {
        display: none;
    }
    .sidebar .mobile-nav #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > ul.mega-sub-menu > li.mega-menu-item > a.mobile-expand {
        height: 48px !important;
    }

    /* Links */
    .sidebar .mobile-nav #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > ul.mega-sub-menu > li.mega-menu-item > ul.mega-sub-menu {
        padding: 0 0 8px;
        background: #fff;
    }
    .sidebar .mobile-nav #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > ul.mega-sub-menu > li.mega-menu-item > ul.mega-sub-menu > li.mega-menu-item {
        float: none;
        width: 100%;
        padding: 0;
    }
    .sidebar .mobile-nav #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > ul.mega-sub-menu > li.mega-menu-item > ul.mega-sub-menu > li.mega-menu-item > a.mega-menu-link {
        float: none;
        width: 100%;
        height: auto;
        margin: 0;
        padding: 11px 20px 11px 36px;
        border: 0;
        background: transparent;
        color: #333;
        font-size: 14px;
        font-weight: 400;
        line-height: 20px;
        text-transform: none;
        opacity: 1;
    }
    .sidebar .mobile-nav #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > ul.mega-sub-menu > li.mega-menu-item > ul.mega-sub-menu > li.mega-menu-item > a.mega-menu-link:hover,
    .sidebar .mobile-nav #mega-menu-wrap-primary #mega-menu-primary > li.mega-menu-item > ul.mega-sub-menu > li.mega-menu-item > ul.mega-sub-menu > li.mega-menu-item > a.mega-menu-link:focus {
        background: #f3f7ec;
        color: #224612;
    }

    /* Phone: a rounded call button instead of a full-width green block */
    .sidebar .top-phone {
        float: none;
        clear: both;
        padding: 24px 20px 32px;
        background: transparent;
    }
    .sidebar .top-phone .tp-phone-box {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        padding: 12px 20px;
        border-radius: 40px;
        background: #3a6f23;
    }
    .sidebar .top-phone .tp-phone-numb a {
        color: #fff;
    }
}

/*---------------------------------- Tablet ----------------------------------*/
@media (min-width: 768px) and (max-width: 991px) {
    /* Three narrow blog columns: smaller type and a 4-line excerpt. */
    .from-our-blog .dflt-header .btnstyle {
        margin-top: 20px !important;
    }
    .from-our-blog .post-item .card-body {
        padding: 18px 2px 0;
    }
    .from-our-blog .post-title {
        margin-bottom: 10px !important;
        font-size: 17px;
        line-height: 1.35;
    }
    .from-our-blog .post-header p {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 4;
        overflow: hidden;
        margin-bottom: 0;
        font-size: 14px;
        line-height: 1.6;
    }
    .from-our-blog .post-header .btnstyle {
        padding-top: 18px;
    }
    .from-our-blog .post-header .btn_green {
        padding: 8px 16px;
        white-space: nowrap;
    }
}

/*---------------------------------- Mobile ----------------------------------*/
@media (max-width: 767px) {
    /* Footer: "Quick Links" sat directly under the category list. */
    .ftr-clm-cnt {
        margin-bottom: 24px;
    }
    .ftr-clm-cnt h4 {
        margin-bottom: 18px;
    }

    .contact-map iframe {
        height: 320px;
    }

    .turkish-delight-box {
        padding: 30px 12px;
    }
    .trksd-title {
        font-size: 14px;
        line-height: 1.4;
    }
    .trksd-item .card-body {
        padding: 12px 4px;
    }
    .trksd-item .btn_green {
        padding: 8px 18px;
        font-size: 13px;
    }
}

/*------------------------------- Small mobile -------------------------------*/
@media (max-width: 575px) {
    /* Home carousels were centred here; left-align to match the rating. */
    .product-item.owl-carousel .card-body {
        text-align: left;
    }

    /* Two products per row: compact cards so titles and buttons fit. */
    .dorri-product-list .row {
        --bs-gutter-x: 12px;
    }
    .dorri-product-list .pdct-item .card-body {
        padding: 0 10px 14px;
    }
    .dorri-product-list .pdct-item-img {
        padding: 12px 8px 0;
    }
    .dorri-product-list .prdt-title {
        font-size: 14px;
        line-height: 1.4;
    }
    .dorri-product-list .pdct-price {
        font-size: 15px;
        margin-bottom: 12px;
    }
    /* Overrides the parent's "14px 14px !important" button padding. */
    .dorri-product-list .pdct-item .btnstyle .button,
    .dorri-product-list .pdct-item .btnstyle .btn {
        display: block;
        width: 100%;
        padding: 10px 6px !important;
        font-size: 12px !important;
        line-height: 1.3;
        text-align: center;
        white-space: nowrap;
    }
}
