/*
	Theme Name: Rehub child theme
	Theme URI: https://wpsoul.com
	Description: A Hybrid magazine/shop/review/news Wordpress Theme
	Author: Sizam
	Author URI: https://wpsoul.com
	Version: 9.4
	Template: rehub-theme
*/

/* =Theme customization starts here
-------------------------------------------------------------- */

/* Custom styling for deal/coupon badge boxes */
.deal_img_wrap.width-100 {
    width: 140px !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.04) !important;
    transition: all 0.3s ease !important;
    border: 1px solid #e2e8f0 !important;
    background-color: #ffffff !important;
}

.deal_img_wrap.width-100:hover {
    transform: translateY(-2px) !important;
    box-shadow: 0 6px 15px rgba(0, 0, 0, 0.08) !important;
    border-color: #cbd5e1 !important;
}

.deal_img_wrap .deal_string {
    border-top: 1px solid #f1f5f9 !important;
    font-size: 11px !important;
    font-weight: 600 !important;
    color: #64748b !important;
    letter-spacing: 0.05em !important;
    background-color: #f8fafc !important;
    border-bottom-left-radius: 7px !important;
    border-bottom-right-radius: 7px !important;
}

.sale_tag_inwoolist {
    display: flex !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    overflow: hidden !important;
    padding: 0 8px !important;
}

.sale_tag_inwoolist .sale_letter {
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    white-space: normal !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    word-break: break-word !important;
    text-align: center !important;
    font-size: 18px !important;
    font-weight: 800 !important;
    line-height: 1.25 !important;
    color: #10b981 !important; /* Modern emerald green color */
}

@media (max-width: 767px) {
    .deal_img_wrap.width-100 {
        width: 115px !important;
    }
    .sale_tag_inwoolist .sale_letter {
        font-size: 15px !important;
    }
}

/* Custom store page header styling */
.woo-tax-name h1 {
    font-size: 56px !important;
    line-height: 1.15 !important;
    font-weight: 800 !important;
    letter-spacing: -0.025em !important;
    color: #111111 !important;
    margin-bottom: 16px !important;
}

@media (max-width: 768px) {
    .woo-tax-name h1 {
        font-size: 30px !important;
    }
}

.woo-tax-name div, 
.woo-tax-name p {
    font-size: clamp(20px, 2.5vw, 28px) !important;
    line-height: 1.5 !important;
    font-weight: 700 !important; /* Bold */
    color: #222222 !important; /* Dark text */
    margin-bottom: 24px !important;
}

/* Custom styles to increase coupon/offer title text size by 10px and description by 2px less */
.rh_listofferitem .rh_listcolumn_text div.font120,
.rh_listofferitem .rh_listcolumn_text .font120 a,
.bigofferblock .product-summary .product_title,
.bigofferblock .product-summary .product_title a,
.rh_listofferitem .rh_listcolumn_text a,
.offer_list_loop .rh_listcolumn_text div:first-child,
.offer_list_loop .rh_listcolumn_text a,
.rh_offer_list h2,
.rh_offer_list h2 a {
    font-size: 26px !important; /* Increased by 10px from ~16px */
    line-height: 1.35 !important;
    font-weight: 700 !important; /* Đảm bảo in đậm */
}

.rh_offer_list .rh_gr_middle_desc {
    font-size: 24px !important; /* Exactly 2px smaller than title */
    line-height: 1.45 !important;
}

/* Responsive adjustment for mobile screen sizes */
@media (max-width: 767px) {
    .rh_listofferitem .rh_listcolumn_text div.font120,
    .rh_listofferitem .rh_listcolumn_text .font120 a,
    .bigofferblock .product-summary .product_title,
    .bigofferblock .product-summary .product_title a,
    .rh_listofferitem .rh_listcolumn_text a,
    .offer_list_loop .rh_listcolumn_text div:first-child,
    .offer_list_loop .rh_listcolumn_text a,
    .rh_offer_list h2,
    .rh_offer_list h2 a {
        font-size: 20px !important;
    }
    .rh_offer_list .rh_gr_middle_desc {
        font-size: 18px !important; /* Exactly 2px smaller than title */
    }
}

/* Hide the Show next pagination button on store detail pages */
.tax-dealstore .re_ajax_pagination {
    display: none !important;
}

/* --- MOBILE RESPONSIVE OPTIMIZATIONS --- */
* {
    box-sizing: border-box;
}

html,
body {
    max-width: 100%;
    overflow-x: hidden;
}

img,
video,
iframe {
    max-width: 100%;
    height: auto;
}

@media (max-width: 1023px) {
    /* Convert content wrapper to Flexbox column */
    .rh-content-wrap {
        display: flex !important;
        flex-direction: column !important;
        width: 100% !important;
    }
    
    /* 1. Header/Title details go first */
    .rh-mini-sidebar-content-area.tabletblockdisplay.floatright {
        order: 1 !important;
        width: 100% !important;
        float: none !important;
        margin-bottom: 15px !important;
    }
    
    /* 2. Coupon & Deal list goes second (Main Content) */
    .rh-mini-sidebar-content-area.floatright.tabletblockdisplay {
        order: 2 !important;
        width: 100% !important;
        float: none !important;
    }
    
    /* 3. Store logo & details sidebar goes third */
    .rh-mini-sidebar.floatleft.tabletblockdisplay.mb20 {
        order: 3 !important;
        width: 100% !important;
        float: none !important;
        margin-top: 25px !important;
        margin-bottom: 20px !important;
    }
    
    /* 4. Widget sidebar goes fourth */
    .rh-mini-sidebar.tabletblockdisplay.floatleft.clearfix.clearboxleft {
        order: 4 !important;
        width: 100% !important;
        float: none !important;
        margin-top: 20px !important;
    }
    
    /* General width resets for standard containers */
    .container,
    .wrapper,
    .main-content,
    .content-wrapper,
    .dealstore-layout,
    .store-layout,
    .sidebar,
    .coupon-list {
        width: 100% !important;
        max-width: 100% !important;
        float: none !important;
    }
}

@media (max-width: 768px) {
    /* Font size scale */
    h1, .woo-tax-name h1 {
        font-size: 26px !important;
        line-height: 1.25 !important;
    }
    h2 {
        font-size: 22px !important;
        line-height: 1.3 !important;
    }
    h3 {
        font-size: 19px !important;
        line-height: 1.35 !important;
    }
    body, p, li {
        font-size: 15px !important;
        line-height: 1.5 !important;
    }
    
    /* Coupon Titles and descriptions */
    .rh_offer_list h2,
    .rh_offer_list h2 a,
    .woo_list_desc h2,
    .woo_list_desc a {
        font-size: 19px !important;
        line-height: 1.35 !important;
    }
    
    .rh_offer_list .rh_gr_middle_desc {
        font-size: 15px !important;
        line-height: 1.45 !important;
    }
    
    /* Enable word wrapping for titles, badges, and code boxes */
    .coupon-title,
    .deal-title,
    .store-title,
    .rh_offer_list h2 a,
    .woo-tax-name h1,
    .sale_tag_inwoolist .sale_letter,
    .deal_string,
    .coupon_btn,
    p, a, span {
        overflow-wrap: anywhere !important;
        word-break: normal !important;
        white-space: normal !important;
    }
    
    /* Coupon card container padding */
    .rh_offer_list {
        padding: 14px !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        border-radius: 12px !important;
    }
    
    /* Make all CTA buttons inside card loops fill width */
    .btn_offer_block,
    .coupon_btn,
    .re_track_btn,
    .rehub_offer_coupon,
    .rehub_main_btn,
    .wpsm-button,
    .woo-tax-logo a.rehub_main_btn {
        width: 100% !important;
        max-width: 100% !important;
        display: block !important;
        text-align: center !important;
        white-space: normal !important;
        box-sizing: border-box !important;
        padding: 12px 14px !important;
        font-size: 15px !important;
    }
    
    /* Custom alignment for mobile shop logo box buttons */
    .woo-tax-logo a.re_track_btn {
        margin-top: 15px !important;
        display: block !important;
        width: 100% !important;
    }
}

@media (max-width: 767px) {
    /* Header container padding */
    .header_wrap {
        padding: 10px 0 !important;
    }
    /* Ensure search box and icons are aligned */
    .responsive_nav_wrap.rh_mobile_menu {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
    }
    .dl-menuwrapper {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
    }
    /* Alignment tweaks for hamburger menu and search icon */
    #dl-trigger {
        margin: 0 !important;
        padding: 5px !important;
    }
    #mobile-menu-icons {
        margin: 0 !important;
    }
    /* Center logo on mobile header if visible */
    .logo_image img,
    .logo_image_insticky img {
        display: block !important;
        margin: 0 auto !important;
        max-height: 50px !important;
        width: auto !important;
    }
}

@media (max-width: 576px) {
    /* Force multi-column grids to display in 1 column */
    .col_wrap_two .col_item,
    .col_wrap_three .col_item,
    .col_wrap_fourth .col_item,
    .col_wrap_fifth .col_item,
    .col_wrap_six .col_item,
    .eq_grid .col_item {
        width: 100% !important;
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        margin-bottom: 20px !important;
        float: none !important;
        clear: both !important;
        box-sizing: border-box !important;
    }
    
    /* Break grid layout inside coupon list cards on small screens */
    .rh_grid_image_3_col {
        display: block !important;
        width: 100% !important;
    }
    
    /* Center the logo / badge area */
    .rh_gr_img_first {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        float: none !important;
        text-align: center !important;
        margin: 0 auto 15px auto !important;
    }
    
    .deal_img_wrap.width-100 {
        margin: 0 auto !important;
        float: none !important;
    }
    
    /* Center and stack title and descriptions */
    .rh_gr_top_middle {
        display: block !important;
        text-align: center !important;
        width: 100% !important;
        margin-bottom: 12px !important;
    }
    
    .rh_gr_middle_desc {
        display: block !important;
        text-align: center !important;
        width: 100% !important;
        margin-bottom: 15px !important;
        padding: 0 5px !important;
    }
    
    /* Full-width button wrapper */
    .rh_gr_btn_block {
        display: block !important;
        width: 100% !important;
        max-width: 100% !important;
        margin-top: 15px !important;
    }
    
    .rh_gr_btn_block .priced_block {
        display: block !important;
        width: 100% !important;
    }
    
    .rh_gr_btn_block .rh_button_wrapper {
        display: block !important;
        width: 100% !important;
    }
}

@media (max-width: 430px) {
    .rh-container,
    .logo-section,
    .header_wrap {
        padding-left: 14px !important;
        padding-right: 14px !important;
    }
    
    h1, .woo-tax-name h1 {
        font-size: 24px !important;
    }
    h2 {
        font-size: 20px !important;
    }
}

/* Core Web Vitals optimizations: Defer rendering below-the-fold coupons */
.rh_offer_list:nth-child(n+4) {
    content-visibility: auto;
    contain-intrinsic-size: auto 150px;
}

@media (max-width: 767px) {
    .rh_offer_list:nth-child(n+2),
    .dealstore_tax_second_desc,
    .rh-mini-sidebar.tabletblockdisplay.floatleft.clearfix.clearboxleft {
        content-visibility: auto;
        contain-intrinsic-size: auto 320px;
    }

    .rh_offer_list:first-child {
        content-visibility: visible;
    }
}

/* Fix image layouts to prevent CLS */
.woo-tax-logo img,
.deal_img_wrap img {
    max-width: 100% !important;
    object-fit: contain !important;
}

/* --- SPECIAL MOBILE FIXES: MOBILE MENU & HERO BACKGROUND --- */

/* 1. Mobile Menu Toggling & Clickability Fix */
/* Force main header and menu button to be on top and clickable */
#main_header {
    z-index: 99999 !important;
}
.responsive_nav_wrap,
.dl-menuwrapper,
#dl-trigger {
    z-index: 100000 !important;
    pointer-events: auto !important;
    cursor: pointer !important;
}

/* When the trigger is active, slide-in the menu container */
body:has(#dl-trigger.toggle-active) #rhslidingMenu,
body:has(#dl-trigger.toggle-active) #slide-menu-mobile {
    display: block !important;
    visibility: visible !important;
    z-index: 9999999 !important;
}

body:has(#dl-trigger.toggle-active) #slide-menu-mobile ul,
body:has(#dl-trigger.toggle-active) #slide-menu-mobile ul.menu,
body:has(#dl-trigger.toggle-active) #slide-menu-mobile ul.off-canvas {
    transform: translate3d(0, 0, 0) !important;
    opacity: 1 !important;
    visibility: visible !important;
    z-index: 9999999 !important;
}

/* Render backdrop overlay natively when active */
body:has(#dl-trigger.toggle-active)::after {
    content: '' !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: rgba(0, 0, 0, 0.5) !important;
    z-index: 9999998 !important;
    display: block !important;
    animation: fadeIn 0.2s ease !important;
}

/* 2. Hero Section Mobile Layout Overrides */
@media (max-width: 767px) {
    /* Hide the empty right column to prevent vertical stacking split */
    #gspb_col-id-gsbp-e0cadfd3-fdf0 {
        display: none !important;
    }
    
    /* Make the outer row taller to show the background image clearly, centering the card */
    #gspb_row-id-gsbp-8a235a91-fd0c {
        min-height: 480px !important;
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        background-size: cover !important;
        background-position: 70% center !important; /* Align background image to show SEO illustration */
        padding: 40px 16px !important;
    }
    
    /* Reset and center column wrappers */
    #gspb_col-id-gsbp-ee91a4fa-227d {
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        width: 100% !important;
        padding: 0 !important;
    }
    
    #gspb_row-id-gsbp-a525141f-0f64 {
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        width: 100% !important;
        padding: 0 !important;
    }
    
    #gspb_row-id-gsbp-a525141f-0f64 > .gspb_row__content {
        display: flex !important;
        flex-direction: column !important;
        justify-content: center !important;
        align-items: center !important;
        width: 100% !important;
    }
    
    /* Floating Glassmorphic Card container for hero text */
    #gspb_col-id-gsbp-e68edd7f-04ed {
        width: 100% !important;
        max-width: 380px !important;
        background: rgba(255, 255, 255, 0.88) !important;
        backdrop-filter: blur(10px) !important;
        -webkit-backdrop-filter: blur(10px) !important;
        padding: 30px 24px !important;
        border-radius: 20px !important;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08) !important;
        border: 1px solid rgba(255, 255, 255, 0.4) !important;
        text-align: center !important;
        box-sizing: border-box !important;
        float: none !important;
    }
    
    /* Sizing, colors, and centered alignments for headings inside the card */
    #gspb_heading-id-gsbp-42dec864-f726 {
        font-size: 26px !important;
        line-height: 1.25 !important;
        text-align: center !important;
        margin-bottom: 12px !important;
        color: #0f172a !important; /* Ensure clear text contrast */
    }
    
    #gspb_heading-id-gsbp-9bbb4d0b-c80c {
        font-size: 15px !important;
        line-height: 1.45 !important;
        text-align: center !important;
        margin-bottom: 24px !important;
        color: #475569 !important; /* Ensure clear text contrast */
    }
    
    /* Center align the CTA button container */
    #gspb_container-id-gsbp-10737ffb-c11f {
        justify-content: center !important;
    }
}


