/* =========================================================
   LOCALREACH - SINGLE CONSOLIDATED STYLESHEET
   =========================================================
   Notes:
   - The original .home-search-bar grid layout is preserved.
   - The service autocomplete is positioned directly below
     the service input.
   - Escaped pseudo-selectors such as \:hover have been fixed.
   - Variables are defined before they are used.
   ========================================================= */


/* =========================================================
   DESIGN SYSTEM / VARIABLES
   ========================================================= */

:root {
    /* Brand colours */
    --primary: #0d6efd;
    --primary-dark: #0b5ed7;
    --primary-light: #4f9dff;

    --secondary: #2563eb;

    --success: #22c55e;
    --warning: #f59e0b;
    --danger: #ef4444;
    --info: #06b6d4;

    /* Neutral colours */
    --white: #ffffff;

    --light: #f8fafc;
    --light-2: #f1f5f9;

    --gray: #64748b;
    --gray-light: #94a3b8;

    --dark: #1e293b;
    --dark-2: #0f172a;

    --border: #e2e8f0;

    /* Typography */
    --font-family: 'Inter', sans-serif;

    --font-xs: .75rem;
    --font-sm: .875rem;
    --font-md: 1rem;
    --font-lg: 1.125rem;
    --font-xl: 1.5rem;
    --font-2xl: 2rem;
    --font-3xl: 3rem;

    --fw-light: 300;
    --fw-normal: 400;
    --fw-medium: 500;
    --fw-semibold: 600;
    --fw-bold: 700;

    /* Spacing */
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 20px;
    --space-6: 24px;
    --space-7: 32px;
    --space-8: 40px;
    --space-9: 60px;
    --space-10: 80px;

    /* Border radius */
    --radius-sm: 6px;
    --radius: 10px;
    --radius-md: 14px;
    --radius-lg: 20px;
    --radius-xl: 30px;
    --radius-round: 50px;

    /* Shadows */
    --shadow-sm: 0 2px 6px rgba(0, 0, 0, .05);
    --shadow: 0 8px 20px rgba(0, 0, 0, .08);
    --shadow-lg: 0 20px 50px rgba(0, 0, 0, .12);

    /* Transition */
    --transition: .3s ease;

    /* Container */
    --container: 1320px;

    /* Header */
    --header-height: 75px;
}


/* =========================================================
   RESET
   ========================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-family);
    font-size: var(--font-md);
    background: var(--light);
    color: var(--dark);
    line-height: 1.6;
    overflow-x: hidden;
}

img {
    max-width: 100%;
    display: block;
}

a {
    text-decoration: none;
    color: inherit;
}

ul {
    list-style: none;
}

button {
    border: none;
    cursor: pointer;
    font-family: inherit;
}

input,
textarea,
select {
    font-family: inherit;
    outline: none;
}

section {
    padding: 80px 0;
}

.container {
    width: 95%;
    max-width: var(--container);
    margin: auto;
}


/* =========================================================
   DISPLAY UTILITIES
   ========================================================= */

.d-none {
    display: none !important;
}

.d-block {
    display: block !important;
}

.d-inline {
    display: inline !important;
}

.d-inline-block {
    display: inline-block !important;
}

.d-flex {
    display: flex !important;
}

.d-grid {
    display: grid !important;
}


/* =========================================================
   FLEX UTILITIES
   ========================================================= */

.flex-wrap {
    flex-wrap: wrap;
}

.flex-column {
    flex-direction: column;
}

.justify-start {
    justify-content: flex-start;
}

.justify-center {
    justify-content: center;
}

.justify-between {
    justify-content: space-between;
}

.justify-around {
    justify-content: space-around;
}

.justify-evenly {
    justify-content: space-evenly;
}

.align-start {
    align-items: flex-start;
}

.align-center {
    align-items: center;
}

.align-end {
    align-items: flex-end;
}

.flex-1 {
    flex: 1;
}

.gap-1 { gap: 5px; }
.gap-2 { gap: 10px; }
.gap-3 { gap: 15px; }
.gap-4 { gap: 20px; }
.gap-5 { gap: 30px; }


/* =========================================================
   GRID UTILITIES
   ========================================================= */

.grid-2 {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 25px;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 25px;
}

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 25px;
}

.grid-auto {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 25px;
}


/* =========================================================
   WIDTH / HEIGHT UTILITIES
   ========================================================= */

.w-25 { width: 25%; }
.w-50 { width: 50%; }
.w-75 { width: 75%; }
.w-100 { width: 100%; }

.h-100 {
    height: 100%;
}


/* =========================================================
   MARGIN UTILITIES
   ========================================================= */

.m-0 {
    margin: 0;
}

.mt-1 { margin-top: 5px; }
.mt-2 { margin-top: 10px; }
.mt-3 { margin-top: 15px; }
.mt-4 { margin-top: 20px; }
.mt-5 { margin-top: 30px; }
.mt-6 { margin-top: 40px; }

.mb-1 { margin-bottom: 5px; }
.mb-2 { margin-bottom: 10px; }
.mb-3 { margin-bottom: 15px; }
.mb-4 { margin-bottom: 20px; }
.mb-5 { margin-bottom: 30px; }
.mb-6 { margin-bottom: 40px; }

.ml-auto {
    margin-left: auto;
}

.mr-auto {
    margin-right: auto;
}

.mx-auto {
    margin-left: auto;
    margin-right: auto;
}


/* =========================================================
   PADDING UTILITIES
   ========================================================= */

.p-1 { padding: 5px; }
.p-2 { padding: 10px; }
.p-3 { padding: 15px; }
.p-4 { padding: 20px; }
.p-5 { padding: 30px; }
.p-6 { padding: 40px; }

.pt-5 {
    padding-top: 30px;
}

.pb-5 {
    padding-bottom: 30px;
}


/* =========================================================
   TEXT UTILITIES
   ========================================================= */

.text-left {
    text-align: left;
}

.text-center {
    text-align: center;
}

.text-right {
    text-align: right;
}

.text-primary {
    color: var(--primary);
}

.text-success {
    color: var(--success);
}

.text-danger {
    color: var(--danger);
}

.text-warning {
    color: var(--warning);
}

.text-muted {
    color: var(--gray);
}

.text-white {
    color: var(--white);
}


/* =========================================================
   FONT WEIGHT UTILITIES
   ========================================================= */

.fw-light {
    font-weight: 300;
}

.fw-normal {
    font-weight: 400;
}

.fw-medium {
    font-weight: 500;
}

.fw-semibold {
    font-weight: 600;
}

.fw-bold {
    font-weight: 700;
}


/* =========================================================
   BACKGROUND UTILITIES
   ========================================================= */

.bg-white {
    background: #fff;
}

.bg-light {
    background: var(--light);
}

.bg-primary {
    background: var(--primary);
    color: #fff;
}

.bg-success {
    background: var(--success);
    color: #fff;
}

.bg-danger {
    background: var(--danger);
    color: #fff;
}


/* =========================================================
   BORDER / SHADOW / POSITION UTILITIES
   ========================================================= */

.rounded {
    border-radius: var(--radius);
}

.rounded-lg {
    border-radius: 20px;
}

.rounded-circle {
    border-radius: 50%;
}

.shadow-sm {
    box-shadow: var(--shadow-sm);
}

.shadow {
    box-shadow: var(--shadow);
}

.shadow-lg {
    box-shadow: var(--shadow-lg);
}

.position-relative {
    position: relative;
}

.position-absolute {
    position: absolute;
}

.overflow-hidden {
    overflow: hidden;
}

.pointer {
    cursor: pointer;
}

.transition {
    transition: var(--transition);
}


/* =========================================================
   HOVER EFFECTS
   ========================================================= */

.hover-lift {
    transition: var(--transition);
}

.hover-lift:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}

.hover-scale {
    transition: var(--transition);
}

.hover-scale:hover {
    transform: scale(1.05);
}


/* =========================================================
   ANIMATIONS
   ========================================================= */

.fade-in {
    animation: fadeIn .5s ease;
}

.slide-up {
    animation: slideUp .6s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}


/* =========================================================
   BUTTONS
   ========================================================= */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;

    padding: 14px 28px;

    border: none;
    border-radius: var(--radius);

    font-size: 15px;
    font-weight: 600;

    cursor: pointer;

    transition: var(--transition);
    text-decoration: none;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
}

.btn-primary:hover {
    background: var(--primary-dark);
    transform: translateY(-2px);
    box-shadow: var(--shadow);
}

.btn-outline {
    background: transparent;
    color: var(--primary);
    border: 2px solid var(--primary);
}

.btn-outline:hover {
    background: var(--primary);
    color: var(--white);
}

.btn-success {
    background: var(--success);
    color: #fff;
}

.btn-danger {
    background: var(--danger);
    color: #fff;
}

.btn-block {
    width: 100%;
}


/* =========================================================
   HOMEPAGE SEARCH BAR
   =========================================================
   IMPORTANT:
   This preserves your WORKING grid layout.
   ========================================================= */

.home-search-bar {
    position: relative;

    display: grid;

    grid-template-columns: repeat(3, minmax(0, 1fr));
    grid-template-rows: 66px 56px;

    width: 100%;
    max-width: 780px;

    margin-top: 26px;

    /*
     * IMPORTANT:
     * Do NOT use overflow:hidden here.
     * The autocomplete dropdown must be allowed
     * to extend below the first row.
     */
    overflow: visible;

    border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 16px;

    background: #ffffff;

    box-shadow: 0 16px 35px rgba(4, 25, 58, .26);
}


/* =========================================================
   SERVICE SEARCH
   ========================================================= */

.search-service {
    position: relative;

    grid-column: 1 / 4;
    grid-row: 1;

    display: flex;
    align-items: center;
    gap: 13px;

    min-width: 0;

    padding: 0 20px;

    border-bottom: 1px solid #e7edf4;

    overflow: visible !important;
}


/*
 * This class is used by the autocomplete.
 * It must be the positioning parent for the
 * suggestions dropdown.
 */

.search-service.service-autocomplete {
    position: relative !important;
    overflow: visible !important;
}


/* Search icons */

.search-service i,
.search-location > i {
    flex: 0 0 auto;

    color: #1672e8;
    font-size: 1.05rem;
}


/* Service input */

.search-service input {
    width: 100%;
    min-width: 0;

    border: 0;
    outline: 0;

    background: transparent;

    color: #172033;

    font: inherit;
    font-size: 1rem;
}

.search-service input::placeholder {
    color: #7b8798;
}

.search-service input:focus {
    outline: 0;
}


/* =========================================================
   SERVICE AUTOCOMPLETE DROPDOWN
   =========================================================
   This is the main update.
   It places the suggestions directly below
   the service input, like the Snupit screenshot.
   ========================================================= */

.search-service.service-autocomplete .category-suggestions {
    position: absolute !important;

    /*
     * Directly below the 66px service row.
     * Because .search-service is the positioning parent,
     * 100% means the bottom of the service input area.
     */
    top: 100% !important;
    left: 0 !important;
    right: auto !important;

    width: 100% !important;

    display: none !important;

    margin: 0 !important;
    padding: 0 !important;

    background: #ffffff !important;

    border: 1px solid #dfe5ec !important;
    border-top: 0 !important;

    border-radius: 0 0 8px 8px !important;

    box-shadow: 0 8px 16px rgba(15, 31, 55, .16) !important;

    overflow: hidden !important;

    z-index: 99999 !important;
}


/* Show suggestions */

.search-service.service-autocomplete
.category-suggestions.is-visible {
    display: block !important;
}


/* Individual suggestion */

.search-service.service-autocomplete
.category-suggestion {
    display: block !important;

    width: 100% !important;
    min-height: 44px !important;

    box-sizing: border-box !important;

    margin: 0 !important;

    padding: 12px 14px !important;

    border: 0 !important;
    border-bottom: 1px solid #e7ebf0 !important;

    border-radius: 0 !important;

    background: #ffffff !important;

    color: #f8334b !important;

    font: inherit !important;
    font-size: .92rem !important;
    line-height: 1.35 !important;

    text-align: left !important;

    white-space: normal !important;

    cursor: pointer !important;

    transition:
        background-color .15s ease,
        color .15s ease !important;
}


/* Last suggestion */

.search-service.service-autocomplete
.category-suggestion:last-child {
    border-bottom: 0 !important;
}


/* Hover */

.search-service.service-autocomplete
.category-suggestion:hover {
    background: #fff4f5 !important;
    color: #dc1e36 !important;
}


/* Keyboard focus */

.search-service.service-autocomplete
.category-suggestion:focus {
    background: #fff4f5 !important;
    color: #dc1e36 !important;
    outline: 0 !important;
}


/* Active */

.search-service.service-autocomplete
.category-suggestion:active {
    background: #ffe9ec !important;
}


/* =========================================================
   LOCATION SEARCH
   ========================================================= */

.search-location {
    position: relative;

    display: flex;
    align-items: center;
    gap: 12px;

    min-width: 0;

    padding: 0 18px;
}

.search-service + .search-location {
    grid-column: 1;
    grid-row: 2;

    border-right: 1px solid #e7edf4;
}

.city-location {
    grid-column: 2;
    grid-row: 2;

    border-right: 1px solid #e7edf4;
}

.search-location select {
    width: 100%;
    min-width: 0;

    border: 0;
    outline: 0;

    appearance: none;

    background: transparent;

    color: #3b4758;

    font: inherit;
    font-size: .92rem;

    cursor: pointer;
}

.search-location select:focus {
    outline: 0;
}

.search-location select:disabled {
    color: #94a3b8;
    cursor: not-allowed;
}


/* Dropdown arrow */

.search-location::after {
    position: absolute;

    right: 16px;

    content: "⌄";

    color: #64748b;

    pointer-events: none;
}


/* =========================================================
   SEARCH BUTTON
   ========================================================= */

.search-submit {
    grid-column: 3;
    grid-row: 2;

    border: 0;

    background: #fb344b;
    color: #ffffff;

    font: inherit;
    font-size: 1rem;
    font-weight: 700;

    cursor: pointer;

    transition: background .2s ease;
}

.search-submit:hover {
    background: #df2038;
}

.search-submit:focus {
    outline: 0;
}

.search-submit:active {
    transform: translateY(1px);
}


/* =========================================================
   GENERIC SEARCH BOX
   ========================================================= */

.search-box {
    display: flex;

    background: #fff;

    border-radius: 60px;

    padding: 8px;

    box-shadow: var(--shadow);
}

.search-box input,
.search-box select {
    border: none;
    padding: 15px;

    flex: 1;

    background: none;
}

.search-box button {
    border-radius: 50px;
}


/* =========================================================
   CARDS
   ========================================================= */

.card {
    background: #fff;

    border-radius: 16px;

    padding: 25px;

    box-shadow: var(--shadow-sm);

    transition: .3s;
}

.card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
}


/* =========================================================
   BUSINESS CARD
   ========================================================= */

.business-card {
    background: #fff;

    border-radius: 18px;

    overflow: hidden;

    box-shadow: var(--shadow-sm);

    transition: .3s;
}

.business-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.business-cover {
    height: 170px;

    background: #ddd;

    overflow: hidden;
}

.business-cover img {
    width: 100%;
    height: 100%;

    object-fit: cover;
}

.business-content {
    padding: 20px;
}

.business-logo {
    width: 70px;
    height: 70px;

    border-radius: 50%;

    margin-top: -55px;

    border: 5px solid #fff;

    background: #fff;

    overflow: hidden;
}

.business-logo img {
    width: 100%;
    height: 100%;

    object-fit: cover;
}

.business-name {
    font-size: 22px;
    font-weight: 700;

    margin-top: 15px;
}

.business-location {
    color: var(--gray);

    margin: 8px 0;
}

.business-rating {
    color: #fbbf24;

    margin-bottom: 15px;
}

.business-actions {
    display: flex;

    gap: 10px;

    margin-top: 20px;
}


/* =========================================================
   CATEGORY CARD
   ========================================================= */

.category-card {
    background: #fff;

    text-align: center;

    padding: 30px;

    border-radius: 16px;

    box-shadow: var(--shadow-sm);

    transition: .3s;
}

.category-card:hover {
    background: var(--primary);
    color: #fff;

    transform: translateY(-8px);
}

.category-card i {
    font-size: 42px;

    margin-bottom: 15px;
}


/* =========================================================
   FORMS
   ========================================================= */

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;

    margin-bottom: 8px;

    font-weight: 600;
}

.form-control {
    width: 100%;

    padding: 14px 16px;

    border: 1px solid var(--border);
    border-radius: 12px;

    background: #fff;

    transition: .3s;
}

.form-control:focus {
    border-color: var(--primary);

    box-shadow: 0 0 0 4px rgba(13, 110, 253, .15);
}

textarea.form-control {
    resize: vertical;

    min-height: 120px;
}


/* =========================================================
   BADGES
   ========================================================= */

.badge {
    display: inline-block;

    padding: 6px 12px;

    border-radius: 30px;

    font-size: 12px;
    font-weight: 600;
}

.badge-success {
    background: #dcfce7;
    color: #166534;
}

.badge-primary {
    background: #dbeafe;
    color: #1d4ed8;
}

.badge-warning {
    background: #fef3c7;
    color: #92400e;
}

.badge-danger {
    background: #fee2e2;
    color: #991b1b;
}


/* =========================================================
   ALERTS
   ========================================================= */

.alert {
    padding: 18px;

    border-radius: 12px;

    margin-bottom: 20px;
}

.alert-success {
    background: #dcfce7;
    color: #166534;
}

.alert-danger {
    background: #fee2e2;
    color: #991b1b;
}

.alert-warning {
    background: #fef3c7;
    color: #92400e;
}


/* =========================================================
   PAGINATION
   ========================================================= */

.pagination {
    display: flex;

    justify-content: center;

    gap: 8px;

    margin-top: 40px;
}

.pagination a {
    width: 42px;
    height: 42px;

    display: flex;

    align-items: center;
    justify-content: center;

    border-radius: 10px;

    background: #fff;

    box-shadow: var(--shadow-sm);
}

.pagination a.active {
    background: var(--primary);
    color: #fff;
}


/* =========================================================
   STAR RATING
   ========================================================= */

.stars {
    color: #fbbf24;
}


/* =========================================================
   SECTION TITLE
   ========================================================= */

.section-title {
    text-align: center;

    margin-bottom: 50px;
}

.section-title h2 {
    font-size: 38px;

    margin-bottom: 10px;
}

.section-title p {
    color: var(--gray);
}


/* =========================================================
   MOBILE SEARCH
   ========================================================= */

@media (max-width: 620px) {

    .home-search-bar {
        grid-template-columns: 1fr;

        grid-template-rows:
            62px
            54px
            54px
            58px;

        overflow: visible;
    }

    .search-service {
        grid-column: 1;
        grid-row: 1;

        overflow: visible !important;
    }

    .search-service.service-autocomplete {
        overflow: visible !important;
    }

    .search-service + .search-location {
        grid-column: 1;
        grid-row: 2;

        border-right: 0;

        border-bottom: 1px solid #e7edf4;
    }

    .city-location {
        grid-column: 1;
        grid-row: 3;

        border-right: 0;

        border-bottom: 1px solid #e7edf4;
    }

    .search-submit {
        grid-column: 1;
        grid-row: 4;

        border-radius: 0 0 16px 16px;
    }

    /*
     * Keep autocomplete attached to the service input
     * on mobile as well.
     */

    .search-service.service-autocomplete
    .category-suggestions {
        top: 100% !important;
        left: 0 !important;
        width: 100% !important;
    }
}


/* =========================================================
   SMALL MOBILE
   ========================================================= */

@media (max-width: 480px) {

    .container {
        width: 92%;
    }

    section {
        padding: 60px 0;
    }

    .home-search-bar {
        max-width: 100%;
    }

    .search-service {
        padding: 0 15px;
        gap: 10px;
    }

    .search-location {
        padding: 0 15px;
    }

    .section-title {
        margin-bottom: 35px;
    }

    .section-title h2 {
        font-size: 30px;
    }

    .grid-2,
    .grid-3,
    .grid-4 {
        grid-template-columns: 1fr;
    }
}


/* =========================================================
   AUTOCOMPLETE SAFETY OVERRIDES
   =========================================================
   These prevent common parent-container rules from
   clipping the dropdown.
   ========================================================= */

.hero-search,
.quote-search-wrap,
.home-search-bar,
.search-service,
.search-service.service-autocomplete {
    overflow: visible !important;
}

.search-service.service-autocomplete {
    z-index: 1000;
}

.search-service.service-autocomplete .category-suggestions {
    z-index: 99999 !important;
}
