.container-fluid.MainDiv.WhiteDiv.conveyancingMain .contentMainss {
    align-items: start;
}

.conveyancingPage {
    max-width: 100%;
    width: 100%;
    box-sizing: border-box;
    margin-top: -20px;
    max-height: calc(100vh - 100px);
    overflow-y: auto;
    overflow-x: hidden;
    padding-bottom: 30px;
    scrollbar-width: none; 
    -ms-overflow-style: none;
}

.conveyancingPage::-webkit-scrollbar {
    display: none;
}

.conveyancingPage .title-black {
    font-family: 'NaNMetrifyAGigawide-BlckIt';
    font-size: 24px;
    font-style: italic;
    font-weight: 900;
    line-height: normal;
    text-transform: uppercase;
    background: linear-gradient(88deg, #000 3.45%, #000C91 49.95%, #0FD 97.38%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.conveyancingPage .subtitle {
    color: #282826;
    font-family: 'NaNMetrifyAWide-Reg';
    font-size: 15px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
}

.conveyancingPage .search-container {
    width: 100%;
    max-width: 565px;
    height: 42px;
    display: flex;
    gap: 10px;
}

.input-wrapper {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    padding: 0 20px;
    border: 1px solid #282826;
    background: #FFF;
    border-radius: 100px;
}

/* Suggestions Dropdown Styles */
.suggestions-dropdown {
    position: absolute;
    top: calc(100% + 5px);
    left: 0;
    right: 0;
    background: #FFF;
    border: 1px solid #282826;
    border-radius: 10px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    max-height: 320px;
    overflow-y: auto;
    z-index: 1000;
    padding: 8px 0;
}

.suggestions-dropdown::-webkit-scrollbar {
    width: 8px;
}

.suggestions-dropdown::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.suggestions-dropdown::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.suggestions-dropdown::-webkit-scrollbar-thumb:hover {
    background: #555;
}

.suggestion-item {
    padding: 12px 20px;
    cursor: pointer;
    transition: background-color 0.2s;
    font-family: 'NaNMetrifyAWide-Reg';
    font-size: 14px;
    color: #282826;
    border-bottom: 1px solid #f0f0f0;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover,
.suggestion-item.active {
    background-color: #e5fef6;
}

.suggestion-item.selected {
    background-color: #00ffae;
}

.suggestion-type {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    margin-right: 8px;
    text-transform: uppercase;
}

.suggestion-type.firm {
    background-color: #e3f2fd;
    color: #1976d2;
}

.suggestion-type.postcode {
    background-color: #fff3e0;
    color: #f57c00;
}

.suggestion-type.address {
    background-color: #f3e5f5;
    color: #7b1fa2;
}

.suggestion-text {
    font-size: 14px;
}

.suggestion-highlight {
    font-weight: 800;
    color: #000;
}

.no-suggestions {
    padding: 12px 20px;
    text-align: center;
    color: #999;
    font-family: 'NaNMetrifyAWide-Reg';
    font-size: 13px;
    font-style: italic;
}

.search-icon {
    font-size: 16px;
    margin-right: 10px;
    color: #999;
}

.search-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 14px 10px;
    background: transparent;
    color: #282826;
    font-family: 'NaNMetrifyAWide-Reg';
    font-size: 15px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
}

.search-input::placeholder {
    color: #BDBDBD;
}

.clear-btn {
    background-color: transparent;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 10px;
    transition: all 0.3s;
    margin-top: -3px;
}

.search-btn {
    color: #000;
    font-family: 'NaNMetrifyAWide-Reg';
    font-size: 15px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
    background-color: #00ffae;
    border: none;
    border-radius: 100px;
    padding: 10px 20px;
    cursor: pointer;
    transition: background-color 0.3s;
    width: 100%;
    max-width: 153px;
}

.search-btn:hover {
    background: #000C91;
    color: #fff !important;
}

.search-results-count {
    margin-top: 15px;
    margin-bottom: 0;
    color: #282826;
    font-family: 'NaNMetrifyAWide-Reg';
    font-size: 12px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
}

.search-error-message {
    color: #E34B4B;
    margin-top: 15px;
    margin-bottom: 0;
    font-family: 'NaNMetrifyAWide-Reg';
    font-size: 10px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
}

.search-input.error {
    color: #E34B4B;
}

.browse-section {
    margin-top: 20px;
}

.browse-title {
    margin-bottom: 15px;
    color: #282826;
    font-family: 'NaNMetrifyAWide-Reg';
    font-size: 15px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
}

.alphabet-results-count {
    margin-top: 15px;
    margin-bottom: 0;
    color: #282826;
    font-family: 'NaNMetrifyAWide-Reg';
    font-size: 12px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
}

.alphabet-results-count.error {
    color: #E34B4B;
    font-size: 10px;
}

.alphabet-nav-wrapper {
    position: relative;
    margin: 0 -10px;
}

.alphabet-nav {
    display: flex;
    flex-wrap: nowrap;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 10px 10px;
    cursor: grab;
    user-select: none;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; 
    -ms-overflow-style: none; 
}

.alphabet-nav::-webkit-scrollbar {
    display: none;
}

.alphabet-nav.dragging {
    cursor: grabbing;
    scroll-behavior: auto;
}

.alphabet-nav-wrapper::before,
.alphabet-nav-wrapper::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40px;
    pointer-events: none;
    z-index: 2;
    transition: opacity 0.3s;
}

.alphabet-nav-wrapper::before {
    left: 0;
    background: linear-gradient(to right, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0));
}

.alphabet-nav-wrapper::after {
    right: 0;
    background: linear-gradient(to left, rgba(255, 255, 255, 1), rgba(255, 255, 255, 0));
}

.alphabet-nav-wrapper.at-start::before {
    opacity: 0;
}

.alphabet-nav-wrapper.at-end::after {
    opacity: 0;
}

.alphabet-btn {
    font-family: 'NaNMetrifyAWide-Reg';
    border: none;
    min-width: 30px;
    width: 30px;
    height: 30px;
    flex-shrink: 0;
    background-color: #fafafb;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    flex-direction: column;
    color: rgba(0, 0, 0, 0.60);
    text-align: center;
    font-size: 13px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
    text-transform: uppercase;
    justify-content: center;
    align-items: center;
    padding-top: 4px;
}

.alphabet-btn:hover {
    background-color: #00ffae;
    color: #000000;
}

.alphabet-btn.active {
    background-color: #000000;
    color: #00ffae;
    font-weight: 800;
    font-size: 20px;
    padding-top: 2px;
}

.alphabet-btn.available {
    background-color: #00ffae;
    color: #000000;
    border-color: #00ffae;
}

.alphabet-btn:active {
    transform: scale(0.95);
}

.packagers-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
    margin-top: 24px;
    align-items: flex-start;
    max-width: 100%;
    box-sizing: border-box;
}

.packager-card {
    display: flex;
    box-shadow: none;
    transition: all 0.3s ease;
    position: relative;
    cursor: pointer;
    flex-direction: column;
    flex: 0 0 calc(33.333% - 11px);
    max-width: calc(33.333% - 11px);
    width: 333px;
    height: auto;
    min-height: 42px;
    padding: 10px 20px;
    justify-content: center;
    align-items: stretch;
    gap: 0;
    border-radius: 10px;
    background: #FAFAFB;
    overflow: visible;
    box-sizing: border-box;
}

.packager-card.active {
    z-index: 100;
    border-radius: 10px;
    background: #00ffae;
}

.packager-card.inactive {
    opacity: 0.5;
    background: #e8e8e8;
}

.packager-card.inactive:hover {
    box-shadow: none;
}

.packager-card:hover {
    box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25);
}


.packager-name {
    flex: 1;
    color: #000;
    text-align: left;
    font-family: 'NaNMetrifyAWide-Reg';
    font-size: 15px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
}

.item-header {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    width: 100%;
}

.dropdown-arrow {
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #000000;
    transition: transform 0.3s;
    font-size: 14px;
    line-height: 1;
    flex-shrink: 0;
}

.dropdown-arrow:hover {
    color: #000;
}

.packager-card.active .dropdown-arrow {
    transform: rotate(180deg);
}

.packager-details {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #e5fef6;
    padding: 24px 40px;
    margin-top: 5px;
    border-radius: 10px;
    box-shadow: 0 4px 4px 0 rgba(0, 0, 0, 0.25);
    z-index: 99;
    min-height: 134px;
    height: auto;
    box-sizing: border-box;
    overflow-y: visible;
    /* Width is dynamically calculated by JavaScript based on branch count */
}

.packager-card.active .packager-details {
    display: block;
}

.packager-details .detail-header {
    margin-bottom: 15px;
    color: #000;
    font-family: 'NaNMetrifyAWide-Reg';
    font-size: 12px;
    font-style: normal;
    font-weight: 800;
    line-height: normal;
}

.packager-details .detail-line {
    margin: 4px 0;
    font-family: 'NaNMetrifyAWide-Reg';
    color: #000;
    font-size: 12px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
    word-break: break-word;
}

/* Branch Cards Styling */
.packager-details .branches-container {
    display: grid !important;
    column-gap: 45px;
    row-gap: 25px;
    width: 100%;
    grid-auto-flow: column dense !important;
}

/* Dynamic columns based on branch count */
.packager-details .branches-container.branches-1 {
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-auto-flow: row !important;
}

.packager-details .branches-container.branches-2 {
    display: grid !important;
    grid-template-columns: 1fr 1fr !important;
    grid-auto-flow: row !important;
}

.packager-details .branches-container.branches-3 {
    display: grid !important;
    grid-template-columns: 1fr 1fr 1fr !important;
    grid-auto-flow: row !important;
}

.branch-card {
    background: #FFFFFF;
    border: 1px solid #959595;
    border-radius: 6px;
    padding: 12px;
    box-sizing: border-box;
    display: flex !important;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
}

.branch-contact {
    color: #000;
    font-family: 'NaNMetrifyAWide-ExBld';
    font-size: 12px;
    font-style: normal;
    font-weight: 800;
    line-height: normal;
    margin: 0px;
}

.branch-line {
    color: #000;
    font-family: 'NaNMetrifyAWide-Reg';
    font-size: 12px;
    font-style: normal;
    font-weight: 400;
    line-height: normal;
    margin: 2px 0;
    word-break: break-word;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin-top: 30px;
    margin-bottom: 50px;
    padding: 20px 0;
}

.page-btn {
        min-width: 24px;
    height: 24px;
    border: 1px solid #f1f1f1;
    background-color: white;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.2s;
    color: #333;
    font-size: 10px;
    font-family: 'NaNMetrifyAWide-Reg';
    font-style: normal;
    font-weight: 400;
    line-height: normal;
}

.page-btn:hover:not(:disabled) {
    background-color: #f5f5f5;
    border-color: #00D9B5;
}

.page-btn.active {
    background-color: #00FFAE;
    color: #000;
    border-color: #00FFAE;
    font-weight: 800;
}

.page-btn:disabled {
    cursor: not-allowed;
}

.page-dots {
    color: #666;
    padding: 0 5px;
    font-size: 14px;
}

/* Responsive design */
@media (max-width: 1024px) and (min-width: 768px) {
    .packager-card {
        flex: 0 0 calc(50% - 8px);
        max-width: calc(50% - 8px);
    }
    
    /* Override for tablet - keep dynamic but max 2 columns */
    .branches-container.branches-1 {
        display: grid !important;
        grid-template-columns: 1fr !important;
    }
    
    .packager-details .branches-container.branches-2,
    .packager-details .branches-container.branches-3 {
        display: grid !important;
        grid-template-columns: repeat(2, 1fr) !important;
    }
    
    .packagers-grid {
        margin-bottom: 200px;
    }
    
    .pagination {
        display: none !important;
    }
    .conveyancingMain .container.contentMainSecDiv {
        overflow: auto;
        margin-bottom: 50px;
    }
    .conveyancingPage{
        margin-top: 0px;
        padding-bottom: 150px;
    }
}

@media (max-width: 767px) {
    .packager-card {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    /* All branches stacked on mobile */
    .packager-details .branches-container.branches-1,
    .packager-details .branches-container.branches-2,
    .packager-details .branches-container.branches-3 {
        grid-template-columns: 1fr !important;
    }
    
    .packagers-grid {
        margin-bottom: 200px;
    }
    
    .conveyancingMain .container.contentMainSecDiv {
        overflow: auto;
        margin-bottom: 50px;
    }
    .title {
        font-size: 28px;
    }
    
    .conveyancingPage .title-black {
        font-size: 20px;
    }
    
    .conveyancingPage .subtitle {
        color: #000;
        font-size: 12px;
    }
    
    .browse-title {
        font-size: 12px;
    }
    
    .search-btn {
        width: 100%;
        max-width: 77px;
    padding: 5px;
    font-size: 12px;
    }
    
    .alphabet-btn {
        width: 30px;
        height: 30px;
        min-width: 30px;
        font-size: 15px;
    }
    
    /* Hide pagination on mobile */
    .pagination {
        display: none !important;
    }

.input-wrapper {
    width: 60%;
        padding: 0px 15px;
}
.search-input {
    width: 100%;
        padding-left: 0px;
}
.conveyancingPage{
        margin-top: 0px;
        padding-bottom: 150px;
    }
    .packager-details{
        padding:25px;
    }
    p.branch-contact {
    word-break: break-word;
}
}

@media (min-width: 1025px) and (max-width: 1366px) {
    .conveyancingPage{
        max-width: 95%;
    }
    
    /* Touch detection for tablets */
    @supports (hover: none) and (pointer: coarse) {
        .packagers-grid {
            margin-bottom: 150px !important;
        }
        
        .conveyancingPage {
            padding-bottom: 150px !important;
        }
        
        .conveyancingMain .container.contentMainSecDiv {
            overflow: auto !important;
        }
    }
}

@media (min-width: 1367px) and (max-width: 1920px) {
    .conveyancingPage{
        max-width: 95%;
    }
    
    /* For landscape tablets - apply spacing by default and override for desktop hover */
    .packagers-grid {
        margin-bottom: 150px;
    }
    
    .conveyancingPage {
        padding-bottom: 150px;
    }
    
    .conveyancingMain .container.contentMainSecDiv {
        overflow: auto;
    }
    
    /* Remove spacing for desktop with mouse */
    @media (hover: hover) and (pointer: fine) {
        .packagers-grid {
            margin-bottom: 200px;
        }
        
        .conveyancingPage {
            padding-bottom: 200px;
        }
        
        .conveyancingMain .container.contentMainSecDiv {
            overflow: initial;
        }
    }
}

body.onlyConven {
    overflow-y: scroll;
}
