/* Mobile Responsive Styles for Home Page */

/* Tablet - 768px */
@media screen and (max-width: 768px) {

    /* Header styles */
    header {
        padding: 1rem 1rem !important;
        align-items: flex-start;
    }

    .menu-icon {
        display: block;
        display: flex;
        align-items: center;
        margin: auto 0;
    }

    .flex .justify-end .items-center {
        display: none;
    }

    /* Main content styles */
    main.bg-\[\#F9FAFB\] {
        /* padding: 1rem; */
    }

    /* Section styles */
    main.bg-\[\#F9FAFB\] section {
        /* margin-bottom: 2rem;
        padding: 1rem; */
    }

    /* First section - Hero/Banner */
    main.bg-\[\#F9FAFB\] section:first-child {
        /* padding: 2rem 1rem; */
    }

    /* Second section - Features/Services */
    main.bg-\[\#F9FAFB\] section:nth-child(2) {
        padding: 2rem 1rem;
        background: #F9FAFB;
    }

    .section-child-5 {
        padding: 2rem 1rem;
    }
    
    .section-child-6 {
        padding: 2rem 1rem;
    }

    .content-daily-sevice {
        margin-top: 20px;
    }

    .content-daily-sevice h3 {
        font-size: 40px;
    }

    .content-daily-sevice p {
        font-size: 16px;
    }

    /* Third section - Content/Info */
    main.bg-\[\#F9FAFB\] section:nth-child(3) {
        padding: 2rem 1rem;
        background: #F9FAFB;
    }

    /* Fourth section - Gallery/Images */
    main.bg-\[\#F9FAFB\] section:nth-child(4) {
        padding: 2rem 1rem;
    }

    /* Fifth section - Testimonials/Reviews */
    main.bg-\[\#F9FAFB\] section:nth-child(5) {
        padding: 2rem 1rem;
    }

    /* Sixth section - Contact/CTA */
    main.bg-\[\#F9FAFB\] section:nth-child(6) {
        padding: 2rem 1rem;
    }

    /* Common styles for all sections */
    main.bg-\[\#F9FAFB\] section {
        width: 100%;
        max-width: 100%;
        margin-left: 0;
        margin-right: 0;
    }

    /* Adjust grid layouts to single column */
    main.bg-\[\#F9FAFB\] section .grid {
        grid-template-columns: 1fr !important;
        gap: 1rem;
    }

    /* Adjust flex layouts */
    #searchForm {
        flex-direction: column;
        align-items: flex-start;
    }

    #searchFormMobile {
        flex-direction: column;
        align-items: flex-start;
    }

    #searchFormMobile .text-xl.font-medium.text-\[\#182230\] {
        margin-left: 10px;
        margin-top: 10px;
    }

    .btn-submit-form {
        max-width: 95%;
        margin: auto !important;
        margin-bottom: 20px !important;
        border-radius: 20px;
    }

    .clear-select {
        display: none;
    }

    .search-box__location {
        display: flex;
        flex-wrap: wrap;
        align-items: center;
        /* gap: 4px; */
        flex: 1;
        justify-content: space-around;
        max-width: 100%;
        margin: 10px;
    }

    #locationButton {
        width: 49%;
    }

    #locationButtonMb {
        width: 49%;
    }

    .selectedServiceSubCategory {
        width: 100%;
    }

    .serviceCategoryButton {
        width: 49%;
    }

    .flex.justify-center.gap-x-4.buttom-category {
        /* display: none; */
        
    }

    .buttom-category {
        display: flex;
        background: #F2F4F7;
        margin: 10px;
        border-radius: 10px;
    }

    .buttom-category button {
        background: #FFFFFF;
        width: auto;
        font-size: 18px;
        padding: 5px;
        width: auto !important;
    }

    /* Adjust text sizes */
    main.bg-\[\#F9FAFB\] section h1 {
        font-size: 1.75rem;
    }

    main.bg-\[\#F9FAFB\] section h2 {
        font-size: 1.4rem;
    }

    main.bg-\[\#F9FAFB\] section h3 {
        /* font-size: 1.25rem; */
    }

    main.bg-\[\#F9FAFB\] section p {
        /* font-size: 1.1rem; */
    }

    .banner-icon {
        width: 30px;
    }

    .adress_phone {
        display: block;
        margin-top: 15px;
    }


    .service-article {
        display: inline;
    }

    .article-button {
        display: inline;
    }

    .footer-mobile {
        display: flex;
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 2rem;
        padding: 2rem 1rem;
    }

    .footer-mobile>div:nth-child(2) {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 1rem;
        width: 100%;
        max-width: 300px;

    }

    .footer-mobile>div:nth-child(2)>div {
        text-align: left;
    }

    .text-\[71px\] {
        font-size: 45px;
    }

    .text-\[40px\] {
        font-size: 22px;
    }

    /* Adjust images */
    main.bg-\[\#F9FAFB\] section img {
        max-width: 100%;
        height: auto;
    }
    .search-box__category-button {
        width: auto;
    }

    /* Adjust buttons */
    main.bg-\[\#F9FAFB\] section button,
    main.bg-\[\#F9FAFB\] section .button {
        width: 100%;
        margin: 0.5rem 0;
    }


    .text-\[\#E6872D\] {
        color: #e4750e;
    }

    .search-box__filter {
        transform: translateY(-35.3333%);
    }

    .bg-\[\#1DA563\] {
        background-color: transparent;
    }

    .bg-\[\#1DA563\] img:first-child {
        display: none;
    }

    .bg-\[\#FFFFFF\] {
        /* background-color: #FFF6DD; */
    }

    #map {
        display: none;
    }

    #search {
        display: none;
    }

    .mobile-banner {
        display: flex;
    }

    footer {
        /* display: none; */
    }

    .nav-header a img {
        max-width: 180%;
    }

    .nav-header-list {
        display: none;
    }

    /* Remove padding and margin from search form container */
    .flex.flex-col.border.bg-\[\#FFFFFF\].border-\[\#D0D5DD\].rounded-2xl {
        padding: 0;
        margin: 0;
    }

    /* Style for submit button */
    #searchForm button[type="submit"] {
        margin: 10px;
        width: calc(100% - 20px);
    }

    .footer-mobile>div:last-child {
        align-self: flex-start;
        margin-left: 1rem;
    }

    .footer-mobile>div:last-child .flex.gap-x-3 {
        justify-content: flex-start;
    }

    .footer-mobile>div:last-child .flex.gap-x-3>div {
        text-align: left;
    }

    .bg-\[\#F2F4F7\] Ơ .footer-mobile>div:last-child .flex.gap-x-3>div p {
        margin: 0;
        line-height: 1.5;
    }

    .nearby-lawyer-underline {
        width: 108px;
        height: 6px;
        background-color: #1DA763;
        margin: 16px auto 0;
        border-radius: 100px;
        display: block;
    }

    .nearby-title {
        display: flex;
        justify-content: center;
        color: #333333;
        font-weight: 800;
        font-size: 28px;
        width: 100%;
        margin: auto;
        margin-top: 100px;
    }

    .popup-section-mobile {
        margin-bottom: 0 !important;
        padding-bottom: 0 !important;
        width: 100%;
        display: flex;
        justify-content: center;
    }

    .popup-btn-group {
        display: flex;
        gap: 12px;
        width: 90%;
        justify-content: center;
        margin: 0 0 16px 0;
    }

    .popup-btn {
        flex: 1 1 0;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        border: 2px solid #FF9900;
        border-radius: 12px;
        background: #fff;
        color: #FF9900;
        font-size: 18px;
        font-weight: 500;
        padding: 18px 0 10px 0;
        min-width: 120px;
        min-height: 80px;
        box-sizing: border-box;
        gap: 8px;
    }

    .popup-btn-icon {
        margin-top: 8px;
        color: #FF9900;
        fill: #FF9900;
    }

    .max-w-\[1040px\] {
        padding-block: 0;
    }

    .mobile-menu-popup {
        position: fixed;
        top: 0;
        left: 0;
        width: 100vw;
        height: 100vh;
        background-color: rgba(0, 0, 0, 0.5);
        z-index: 50;
        display: none;
        overflow: hidden;
    }

    .mobile-menu-popup.active {
        display: block;
    }

    .mobile-menu-popup .bg-white {
        width: 100%;
        height: 100%;
        animation: slideIn 0.3s ease-out;
    }

    @keyframes slideIn {
        from {
            transform: translateX(100%);
        }

        to {
            transform: translateX(0);
        }
    }

    .nav-popup {
        margin-top: 30px;
    }

    /* CSS cơ bản để ẩn popup và overlay ban đầu */
    .popup-content {
        display: none;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        /* height: 70%; */
        background-color: rgba(0, 0, 0, 0.5);
        /* Lớp phủ mờ */
        z-index: 1000;
        /* justify-content: center; */
        align-items: center;
        border-top-left-radius: 20px;
        border-top-right-radius: 20px;
    }

    .popup-overlay {
        display: none;
        position: fixed;
        bottom: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        /* Lớp phủ mờ */
        z-index: 20;
        /* justify-content: center; */
        align-items: center;
    }

    .popup-content {
        background-color: white;
        /* padding: 20px; */
        border-radius: 8px;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        max-width: 500px;
        z-index: 1001;
        display: none;
        /* Đảm bảo ẩn ban đầu */
        border-top-left-radius: 20px;
        border-top-right-radius: 20px;
    }

    .popup-content.active {
        display: flex;
        /* Hiển thị khi active */
        flex-direction: column;
        border-top-left-radius: 20px;
        border-top-right-radius: 20px;
    }

    .popup-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 15px;
    }

    .popup-header h3 {
        margin: 0;
    }

    .close-btn {
        background: none;
        border: none;
        font-size: 24px;
        cursor: pointer;
    }

    .popup-body ul {
        list-style: none;
        padding: 0;
    }

    .popup-body li {
        margin-bottom: 10px;
    }

    .popup-body a {
        text-decoration: none;
        color: #333;
        font-size: 16px;
    }

    .popup-body a:hover {
        color: #FF7A3F;
    }


    .nearby-lawyer-popup {
        display: none;
        position: fixed;
        top: 20%;
        /* transform: translate(0%, 75%); */
        background-color: white;
        /* padding: 20px; */
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
        z-index: 1000;
        height: 80%;
        width: 100%;
    }

    .nearby-lawyer-popup-problem {
        border-top-left-radius: 20px;
        border-top-right-radius: 20px;
    }

    .problem-category-container {
        overflow-y: auto;
        height: calc(80vh - 96px - 25px);
        margin-bottom: 50px;
    }

    .popup-header-mb {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15px 20px;
        border-bottom: 1px solid #eee;
        position: sticky;
        top: 0;
        z-index: 10;
        width: 100%;
        margin-bottom: 20px;
        background: #1DA763;
        border-top-left-radius: 20px;
        border-top-right-radius: 20px;
    }

    .popup-title {
        font-size: 1.2em;
        font-weight: bold;
        color: #ffff;
        margin: 0;
    }

    .popup-close-button {
        background: none;
        border: none;
        cursor: pointer;
        padding: 5px;
    }

    .popup-close-button svg {
        width: 20px;
        height: 20px;
    }

    .problem-category-buttons {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 10px 20px 20px;
    }

    .category-button {
        background-color: #f0f0f0;
        color: #475467;
        border: none;
        border-radius: 5px;
        padding: 12px 15px;
        text-align: center;
        text-decoration: none;
        font-size: 1em;
        cursor: pointer;
        transition: background-color 0.3s ease;
        background: none;
        font-weight: 500;
    }

    .category-button:hover {
        background-color: #e0e0e0;
    }

    .problem-category-banner {
        position: relative;
        background-size: cover;
        background-position: center;
        height: 120px;
        width: 90%;
        margin: auto;
        display: flex;
        justify-content: center;
        align-items: center;
        color: white;
        font-size: 1.4em;
        font-weight: bold;
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
        margin-bottom: 15px;
    }

    .problem-category-banner::before {
        content: "";
        /* Bắt buộc cho pseudo-element */
        position: absolute;
        /* Định vị tuyệt đối so với phần tử cha */
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        /* Màu đen với độ trong suốt 50% */
        z-index: 1;
        /* Đảm bảo lớp nền nằm dưới chữ */
    }

    .problem-category-banner span {
        position: relative;
        /* Tạo context xếp chồng cho span */
        z-index: 2;
        /* Đảm bảo chữ nằm trên lớp nền tối */
    }


    .regions-mb {
        margin: 10px 0 0 0;
        padding: 0 20px;
        height: calc(80vh - 76px - 25px);
        overflow-y: auto;
    }

    .regions-mb>div {
        margin-bottom: 24px;
    }

    .regions-mb strong {
        display: block;
        width: 100%;
        margin-bottom: 10px;
        font-weight: bold;
        font-size: 18px;
        color: #2C3E50;
    }

    .regions-mb button {
        display: inline-block;
        margin: 4px 6px 4px 0;
        padding: 6px 12px;
        border: none;
        border-radius: 8px;
        background-color: #f1f3f5;
        font-size: 16px;
        color: #333;
        cursor: pointer;
        white-space: nowrap;
    }

    .regions-mb button:hover {
        background-color: #d0d7de;
    }

    .search-box__mobile.popup {
        display: block;
        position: absolute;
        z-index: 1000;
        bottom: 0;
        height: 70%;
        width: 100%;
    }

    .search-box__mobile.popup {
        display: block;
        position: fixed;
        z-index: 1000;
        bottom: 0;
        left: 0;
        right: 0;
        height: 70%;
        width: 100%;
        background: #FFFFFF;
        border-radius: 16px 16px 0 0;
    }

    .search-box__mobile .flex.flex-col {
        max-height: calc(70vh - 120px);
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: #667085 #F2F4F7;
    }

    .search-box__mobile .flex.flex-col::-webkit-scrollbar {
        width: 6px;
    }

    .search-box__mobile .flex.flex-col::-webkit-scrollbar-track {
        background: #F2F4F7;
        border-radius: 3px;
    }

    .search-box__mobile .flex.flex-col::-webkit-scrollbar-thumb {
        background-color: #667085;
        border-radius: 3px;
    }

    .popup-location-mobile {
       background-color: white;
        /* padding: 20px; */
        border-radius: 8px;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
        max-width: 500px;
        z-index: 1001;
        display: block;
    }

    .prolem-location-popup {
        overflow-y: auto;
        height: calc(80vh - 96px - 25px);
        margin-bottom: 50px;
    }

    .p-\[35px\] {
        padding: 15px;
    }

    /* dropdown 1 mb */
    .dropdown1-mb {
        display: none;
        position: fixed;
        bottom: 0;
        /* top: 0;
        transform: translate(0%, 45%); */
        background-color: white;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
        z-index: 1000;
        height: auto;
        width: 100%;
        border-top-left-radius: 20px;
        border-top-right-radius: 20px;
    }

    .dd1-problem-category-container {
        overflow-y: auto;
        height: calc(75vh - 100px - 50px);
        justify-content: center;
    }

    .dd1-popup-header-mb {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15px 20px;
        border-bottom: 1px solid #eee;
        position: sticky;
        top: 0;
        z-index: 10;
        margin-bottom: 20px;
        background: #1DA763;
        border-top-left-radius: 20px;
        border-top-right-radius: 20px;
    }

    .dd1-popup-title {
        font-size: 1.2em;
        font-weight: bold;
        color: #ffff;
        margin: 0;
    }

    .dd1-popup-close-button {
        background: none;
        border: none;
        cursor: pointer;
        padding: 5px;
    }

    .dd1-popup-close-button svg {
        width: 20px;
        height: 20px;
    }

    .dd1-problem-category-banner {
        position: relative;
        background-size: cover;
        background-position: center;
        height: 80px;
        width: 90%;
        margin: auto;
        display: flex;
        justify-content: center;
        align-items: center;
        color: white;
        font-size: 1.4em;
        font-weight: bold;
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
        margin-bottom: 15px;
    }

    .dd1-problem-category-banner::before {
        content: "";
        /* Bắt buộc cho pseudo-element */
        position: absolute;
        /* Định vị tuyệt đối so với phần tử cha */
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background-color: rgba(0, 0, 0, 0.5);
        /* Màu đen với độ trong suốt 50% */
        z-index: 1;
        /* Đảm bảo lớp nền nằm dưới chữ */
    }

    .dd1-problem-category-banner span {
        position: relative;
        /* Tạo context xếp chồng cho span */
        z-index: 2;
        /* Đảm bảo chữ nằm trên lớp nền tối */
    }

    .dd1-problem-category-buttons {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 10px 20px 20px;
    }

    .dd1-problem-category-container .problem-category-banner {
        height: 80px;
    }

    .dd1-problem-category-container button {
        display: flex;
        padding: 10px 20px 20px;
        width: 90%;
        margin: auto;
        color: #ffff;
        background: #FF9900;
        border: none;
        justify-content: center;
    }

    .dd1-problem-category-banner.selected-banner {
        border: 2px solid #FF9900;
    }

    /* dropdown 2 mb */
    .dropdown2-mb {
        display: none;
        position: fixed;
        bottom: 0;
        /* top: 0; */
        /* transform: translate(0%, 45%); */
        background-color: white;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
        z-index: 1000;
        height: auto;
        width: 100%;
        border-top-left-radius: 20px;
        border-top-right-radius: 20px;
    }

    .dd2-problem-category-container {
        overflow-y: auto;
        height: calc(80vh - 96px - 25px);
        justify-content: center;
        height: 70%;
    }

    .dd2-popup-header-mb {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 15px 20px;
        border-bottom: 1px solid #eee;
        position: sticky;
        top: 0;
        z-index: 10;
        margin-bottom: 20px;
        background: #D0D5DD;
        border-top-left-radius: 20px;
        border-top-right-radius: 20px;
    }

    .dd2-popup-title {
        font-size: 1.2em;
        /* font-weight: bold; */
        font-weight: 600;
        color: #182230;
        margin: 0;
    }

    .dd2-popup-close-button {
        background: none;
        border: none;
        cursor: pointer;
        padding: 5px;
    }

    .dd2-popup-close-button svg {
        width: 20px;
        height: 20px;
    }

    .dd2-problem-category-banner {
        background-size: cover;
        background-position: center;
        height: 80px;
        width: 90%;
        margin: auto;
        display: flex;
        justify-content: center;
        align-items: center;
        color: white;
        font-size: 1.4em;
        font-weight: bold;
        text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
        margin-bottom: 15px;
    }

    .dd2-problem-category-buttons {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        padding: 10px 20px 20px;
    }

    .dd2-problem-category-container .problem-category-banner {
        height: 80px;
    }

    .dd2-problem-category-container button {
        display: flex;
        padding: 10px;
        width: 90%;
        margin: auto;
        border: 1px solid #182230;
        justify-content: center;
        font-size: 12px;
        background: transparent;
        color: #182230;
        font-weight: 500;
    }

    .dd2-problem-category-banner.selected-banner {
        border: 2px solid #A0000C;
    }

    #btn-save-dropdown2 {
        display: flex;
        padding: 10px 20px 20px;
        width: 90%;
        margin: auto;
        color: #ffff;
        background: #FF9900;
        border: none;
        justify-content: center;
        margin-bottom: 15px;
    }

    .dropdown2-mb .problem-category-buttons .category-button.selected-child {
        border: 1px solid #FF9900;
        background: #FF9900;
        color: #ffff;
    }

    .section-search-destop {
        display: none;
    }

    .section-search-mobile {
        display: block;
    }

    /* Style cho các tùy chọn địa điểm khi được chọn */
    .location-option.selected {
        background-color: #FF7A3F;
        /* Màu nền khi được chọn */
        color: #FFFFFF;
        /* Màu chữ khi được chọn */
        border: 1px solid #FF7A3F;
        /* Viền khi được chọn */
        font-weight: 600;
        /* Đậm hơn khi chọn */
    }

    /* Style cho nút xác nhận */
    .btn-confirm-location {
        padding: 12px 24px;
        border: none;
        border-radius: 20px;
        font-size: 18px;
        font-weight: bold;
        cursor: pointer;
        background-color: #FF9900;
        /* Màu nền mặc định khi disabled */
        color: #FFFFFF;
        width: 90%;
        /* Màu chữ mặc định khi disabled */
        transition: background-color 0.3s ease, color 0.3s ease;
        display: none;
    }

    /* Style cho nút xác nhận khi được kích hoạt */
    .btn-confirm-location.enabled {
        background-color: #FF9900;
        /* Màu nền khi enabled */
        color: #FFFFFF;
        /* Màu chữ khi enabled */
    }

    .btn-confirm-location:not([disabled]):hover {
        background-color: #e68a00;
        /* Màu hover khi enabled */
    }


    /* Optional: Style cho trạng thái nút đã chọn */
    .search-box__location .search-box__button--selected {
        border-color: #FF7A3F;
    }

    .disable-scroll {
        overflow: hidden !important;
        position: fixed !important;
        width: 100%;
        top: 0;
    }

    .trouble-section-arrow {
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        transition: transform 0.3s ease;
    }

    .trouble-section-arrow.rotated {
        transform: rotate(180deg);
    }

    .trouble-tags-container {
        max-height: 120px; /* Giới hạn chiều cao cho 2 hàng (mỗi hàng khoảng 60px) */
        overflow: hidden;
        transition: max-height 0.3s ease;
    }

    .trouble-tags-container.expanded {
        max-height: none;
    }

    .text-2xl.font-black.text-\[\#000000\].font-zen-maru-gothic {
        font-size: 1.1rem;
    }
    
}
