* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    min-height: 100%;
    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;
}

body {
    background: #f5f6f8;
    color: #111827;
}

button,
input,
textarea,
select {
    font: inherit;
}

button {
    border: 0;
    cursor: pointer;
}

.app {
    min-height: 100vh;
    padding-bottom: 85px;
}


/* =========================================================
   HEADER
   ========================================================= */

.header {
    position: sticky;
    top: 0;
    z-index: 20;

    display: flex;
    align-items: center;
    justify-content: space-between;

    padding: 16px;

    background: rgba(255,255,255,.94);
    backdrop-filter: blur(15px);

    border-bottom: 1px solid #e5e7eb;
}

.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-icon {
    width: 42px;
    height: 42px;

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

    border-radius: 13px;

    background: #111827;
    color: white;

    font-size: 21px;
}

.brand-title {
    font-size: 17px;
    font-weight: 800;
}

.brand-subtitle {
    margin-top: 2px;
    font-size: 12px;
    color: #6b7280;
}


/* =========================================================
   CURRENCY
   ========================================================= */

.currency-button {
    display: flex;
    align-items: center;
    gap: 5px;

    padding: 9px 11px;

    background: #f3f4f6;
    border-radius: 12px;

    font-size: 13px;
    font-weight: 700;
}

.currency-menu {
    position: fixed;
    top: 68px;
    right: 12px;

    z-index: 100;

    width: 160px;

    padding: 8px;

    background: white;

    border: 1px solid #e5e7eb;
    border-radius: 15px;

    box-shadow:
        0 15px 40px rgba(0,0,0,.15);
}

.currency-menu button {
    width: 100%;

    padding: 12px;

    text-align: left;

    background: transparent;

    border-radius: 10px;
}

.currency-menu button:hover {
    background: #f3f4f6;
}

.currency-title {
    padding: 9px 10px;

    font-size: 12px;
    font-weight: 700;
    color: #6b7280;
}


/* =========================================================
   PAGES
   ========================================================= */

.page {
    padding: 18px 15px;
}

.hidden {
    display: none !important;
}

.page-title {
    margin-bottom: 18px;

    font-size: 23px;
    font-weight: 800;
}


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

.search-box {
    margin-bottom: 18px;
}

.search-box input {
    width: 100%;

    padding: 14px 16px;

    border: 1px solid #e5e7eb;
    border-radius: 15px;

    outline: none;

    background: white;
}

.search-box input:focus {
    border-color: #9ca3af;
}


/* =========================================================
   SECTIONS
   ========================================================= */

.section-title {
    margin-bottom: 11px;

    font-size: 17px;
    font-weight: 800;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-top: 23px;
}

.refresh-button {
    width: 34px;
    height: 34px;

    border-radius: 10px;

    background: white;

    font-size: 20px;
}


/* =========================================================
   CATEGORIES
   ========================================================= */

.categories {
    display: flex;
    gap: 8px;

    overflow-x: auto;

    padding-bottom: 4px;
}

.categories button {
    flex: 0 0 auto;

    padding: 9px 12px;

    background: white;

    border: 1px solid #e5e7eb;
    border-radius: 12px;

    font-size: 13px;
}


/* =========================================================
   LISTINGS
   ========================================================= */

.listings {
    display: flex;
    flex-direction: column;

    gap: 12px;
}

.listing-card {
    padding: 14px;

    background: white;

    border: 1px solid #e5e7eb;
    border-radius: 17px;

    box-shadow:
        0 3px 12px rgba(0,0,0,.04);
}

.listing-image {
    width: 100%;
    height: 180px;

    object-fit: cover;

    border-radius: 13px;

    margin-bottom: 12px;
}

.listing-title {
    font-size: 16px;
    font-weight: 800;
}

.listing-description {
    margin-top: 6px;

    color: #6b7280;

    font-size: 13px;
    line-height: 1.4;
}

.listing-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;

    margin-top: 14px;
}

.listing-price {
    font-size: 19px;
    font-weight: 900;
}

.listing-seller {
    margin-top: 10px;

    color: #6b7280;

    font-size: 12px;
}

.buy-button {
    padding: 10px 14px;

    background: #111827;
    color: white;

    border-radius: 11px;

    font-weight: 700;
}


/* =========================================================
   FORM
   ========================================================= */

.form {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.form input,
.form textarea,
.form select {
    width: 100%;

    padding: 14px;

    border: 1px solid #e5e7eb;
    border-radius: 14px;

    background: white;

    outline: none;
}

.form textarea {
    min-height: 130px;
    resize: vertical;
}

.price-input {
    display: flex;
    align-items: center;

    background: white;

    border: 1px solid #e5e7eb;
    border-radius: 14px;

    overflow: hidden;
}

.price-input input {
    border: 0;
    border-radius: 0;
}

.price-input span {
    padding-right: 14px;

    color: #6b7280;
    font-weight: 700;
}

.primary-button {
    padding: 15px;

    background: #111827;
    color: white;

    border-radius: 14px;

    font-weight: 800;
}


/* =========================================================
   PROFILE
   ========================================================= */

.profile-card {
    padding: 24px;

    text-align: center;

    background: white;

    border-radius: 18px;
}

.profile-photo {
    width: 75px;
    height: 75px;

    object-fit: cover;

    border-radius: 50%;

    background: #e5e7eb;
}

.profile-name {
    margin-top: 10px;

    font-size: 19px;
    font-weight: 800;
}

.profile-username {
    margin-top: 4px;

    color: #6b7280;
}

.settings-card {
    margin-top: 12px;

    padding: 16px;

    background: white;

    border-radius: 16px;
}

.settings-title {
    margin-bottom: 15px;

    font-weight: 800;
}

.setting-row {
    display: flex;
    justify-content: space-between;

    padding: 13px 0;

    border-top: 1px solid #f0f0f0;
}


/* =========================================================
   MODAL
   ========================================================= */

.modal {
    position: fixed;
    inset: 0;

    z-index: 200;

    display: flex;
    align-items: flex-end;

    background: rgba(0,0,0,.45);
}

.modal-card {
    position: relative;

    width: 100%;
    max-height: 90vh;

    overflow-y: auto;

    padding: 22px;

    background: white;

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

.modal-close {
    position: absolute;
    top: 12px;
    right: 14px;

    width: 34px;
    height: 34px;

    background: #f3f4f6;

    border-radius: 50%;

    font-size: 23px;
}

.deal-price {
    margin: 15px 0;

    font-size: 24px;
    font-weight: 900;
}

.deal-info {
    padding: 14px;

    background: #f5f6f8;

    border-radius: 14px;
}

.deal-actions {
    display: flex;
    flex-direction: column;

    gap: 9px;

    margin-top: 15px;
}

.deal-actions button {
    padding: 13px;

    border-radius: 12px;

    font-weight: 700;
}


/* =========================================================
   NAV
   ========================================================= */

.bottom-nav {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;

    z-index: 50;

    display: flex;

    padding: 8px 8px calc(8px + env(safe-area-inset-bottom));

    background: rgba(255,255,255,.96);
    backdrop-filter: blur(15px);

    border-top: 1px solid #e5e7eb;
}

.nav-button {
    flex: 1;

    display: flex;
    flex-direction: column;
    align-items: center;

    gap: 3px;

    padding: 7px;

    background: transparent;

    color: #6b7280;
}

.nav-button span {
    font-size: 20px;
}

.nav-button small {
    font-size: 10px;
}

.nav-button.active {
    color: #111827;
}


/* =========================================================
   OTHER
   ========================================================= */

.loading {
    padding: 30px;

    text-align: center;

    color: #6b7280;
}

.empty {
    padding: 30px;

    text-align: center;

    background: white;

    border-radius: 16px;

    color: #6b7280;
}

.error {
    padding: 15px;

    background: #fee2e2;
    color: #991b1b;

    border-radius: 13px;
}