/* =========================================================
   LOSOJA - MAIN STYLES
   css/style.css

   Matches:
   - index.html
   - js/businesses.js
========================================================= */


/* =========================================================
   RESET
========================================================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    background: #f5f7f6;
    color: #17201b;
    font-family:
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}


/* =========================================================
   PAGE
========================================================= */

body {
    min-height: 100vh;
}

.app {
    width: 100%;
    max-width: 480px;
    min-height: 100vh;
    margin: 0 auto;
    background: #ffffff;
    padding-bottom: 75px;
}


/* =========================================================
   HEADER
========================================================= */

header.top {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 13px 16px;

    background: #ffffff;
    border-bottom: 1px solid #e8ece9;

    position: sticky;
    top: 0;
    z-index: 100;
}

.logo {
    font-size: 23px;
    line-height: 1;
    font-weight: 900;
    letter-spacing: -0.5px;
    color: #087a3e;
}

.logo span {
    color: #087a3e;
}


/* =========================================================
   HERO
========================================================= */

.hero {
    background: #087a3e;
    color: #ffffff;
    text-align: center;

    padding: 25px 16px 22px;
}

.hero h1 {
    margin: 0;

    font-size: 23px;
    line-height: 1.2;
    font-weight: 800;
}

.hero p {
    margin: 7px 0 17px;

    font-size: 13px;
    line-height: 1.5;

    opacity: 0.94;
}


/* =========================================================
   SEARCH
========================================================= */

.search {
    width: 100%;
    max-width: 430px;

    display: flex;
    align-items: stretch;

    margin: 0 auto;

    background: #ffffff;

    border-radius: 10px;
    overflow: hidden;

    box-shadow:
        0 4px 14px rgba(0, 0, 0, 0.12);
}

.search input {
    flex: 1;
    min-width: 0;

    padding: 12px 13px;

    border: 0;
    outline: none;

    background: #ffffff;
    color: #17201b;

    font-size: 14px;
}

.search input::placeholder {
    color: #8a938e;
}

.search button {
    border: 0;

    padding: 0 17px;

    background: #111827;
    color: #ffffff;

    font-size: 13px;
    font-weight: 700;

    cursor: pointer;
}

.search button:hover {
    background: #000000;
}


/* =========================================================
   SECTION HEADINGS
========================================================= */

.sec {
    margin: 0;

    padding: 18px 14px 10px;

    font-size: 16px;
    line-height: 1.3;
    font-weight: 800;

    color: #17201b;
}


/* =========================================================
   CATEGORIES
========================================================= */

.cats {
    display: grid;

    grid-template-columns:
        repeat(3, minmax(0, 1fr));

    gap: 10px;

    padding: 0 14px 8px;
}

.cat {
    min-height: 82px;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 7px;

    padding: 12px 7px;

    background: #ffffff;

    border: 1px solid #e2e8e4;
    border-radius: 12px;

    color: #26322c;

    font-size: 12px;
    font-weight: 700;

    text-align: center;

    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.05);

    cursor: pointer;

    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        border-color 0.15s ease;
}

.cat span {
    display: block;

    font-size: 24px;
    line-height: 1;
}

.cat:hover {
    transform: translateY(-2px);

    border-color: #087a3e;

    box-shadow:
        0 4px 12px rgba(8, 122, 62, 0.12);
}


/* =========================================================
   BUSINESS GRID
========================================================= */

#businessGrid {
    display: grid;

    grid-template-columns:
        repeat(2, minmax(0, 1fr));

    gap: 10px;

    padding: 0 14px 8px;
}


/* =========================================================
   BUSINESS CARD
========================================================= */

.business-card {
    min-width: 0;

    background: #ffffff;

    border: 1px solid #e3e8e5;
    border-radius: 12px;

    overflow: hidden;

    box-shadow:
        0 2px 6px rgba(0, 0, 0, 0.05);

    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease;
}

.business-card:hover {
    transform: translateY(-2px);

    box-shadow:
        0 5px 14px rgba(0, 0, 0, 0.09);
}


/* =========================================================
   BUSINESS IMAGE
========================================================= */

.business-card-image {
    width: 100%;
    height: 125px;

    display: block;

    object-fit: cover;

    background: #eef3ef;
}

img.business-card-image {
    object-fit: cover;
}


/* =========================================================
   BUSINESS CONTENT
========================================================= */

.business-card-content {
    padding: 10px;
}

.business-card h3 {
    margin: 0 0 5px;

    color: #17201b;

    font-size: 14px;
    line-height: 1.3;
    font-weight: 800;

    overflow: hidden;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.business-card p {
    margin: 4px 0;

    color: #66716b;

    font-size: 11px;
    line-height: 1.35;

    overflow: hidden;

    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}


/* =========================================================
   BUSINESS CATEGORY LABEL
========================================================= */

.business-category {
    display: inline-block;

    margin-top: 7px;

    padding: 4px 7px;

    background: #eef8f2;
    color: #087a3e;

    border-radius: 6px;

    font-size: 10px;
    font-weight: 700;
}


/* =========================================================
   LOADING / ERROR CARD
========================================================= */

.loading-card {
    grid-column: 1 / -1;

    width: 100%;

    padding: 28px 16px;

    background: #ffffff;

    border: 1px solid #e3e8e5;
    border-radius: 12px;

    text-align: center;

    color: #66716b;

    font-size: 13px;
}

.loading-spinner {
    width: 28px;
    height: 28px;

    margin: 0 auto 10px;

    border: 3px solid #dce9e1;
    border-top-color: #087a3e;

    border-radius: 50%;

    animation:
        losoja-spin 0.8s linear infinite;
}

@keyframes losoja-spin {
    to {
        transform: rotate(360deg);
    }
}


/* =========================================================
   ADD BUSINESS
========================================================= */

.add {
    margin: 16px 14px;

    padding: 20px 16px;

    background: #111827;
    color: #ffffff;

    border-radius: 13px;

    text-align: center;
}

.add h3 {
    margin-bottom: 7px;

    font-size: 17px;
    font-weight: 800;
}

.add p {
    margin-bottom: 13px;

    color: #d7dce2;

    font-size: 12px;
    line-height: 1.5;
}

.add a {
    display: inline-block;

    padding: 9px 16px;

    background: #087a3e;
    color: #ffffff;

    border-radius: 8px;

    text-decoration: none;

    font-size: 12px;
    font-weight: 800;
}

.add a:hover {
    background: #055c2e;
}


/* =========================================================
   BOTTOM NAVIGATION
========================================================= */

nav.bottom {
    position: fixed;

    left: 0;
    right: 0;
    bottom: 0;

    width: 100%;
    max-width: 480px;

    margin: 0 auto;

    display: flex;
    align-items: center;
    justify-content: space-around;

    padding: 8px 4px calc(8px + env(safe-area-inset-bottom));

    background: #ffffff;

    border-top: 1px solid #e4e9e6;

    box-shadow:
        0 -3px 12px rgba(0, 0, 0, 0.05);

    z-index: 200;
}

nav.bottom a {
    flex: 1;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;

    gap: 3px;

    min-height: 42px;

    color: #68736d;

    text-decoration: none;

    font-size: 10px;
    font-weight: 700;

    text-align: center;

    cursor: pointer;
}

nav.bottom a.on {
    color: #087a3e;
}


/* =========================================================
   MOBILE
========================================================= */

@media (max-width: 360px) {

    .hero {
        padding-left: 12px;
        padding-right: 12px;
    }

    .hero h1 {
        font-size: 21px;
    }

    .cats {
        gap: 7px;
        padding-left: 10px;
        padding-right: 10px;
    }

    #businessGrid {
        gap: 8px;
        padding-left: 10px;
        padding-right: 10px;
    }

    .sec {
        padding-left: 10px;
        padding-right: 10px;
    }

    .business-card-content {
        padding: 8px;
    }

    .business-card h3 {
        font-size: 13px;
    }

    .business-card p {
        font-size: 10px;
    }

    .business-card-image {
        height: 110px;
    }

}


/* =========================================================
   LARGER SCREENS
========================================================= */

@media (min-width: 481px) {

    body {
        padding: 20px 0;
    }

    .app {
        border-radius: 16px;

        box-shadow:
            0 8px 35px rgba(0, 0, 0, 0.08);
    }

}
