@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&display=swap");

:root {
    --primary: #1677ff;
    --primary-dark: #0864df;
    --green: #18a957;
    --page: #f1f4f8;
    --white: #ffffff;
    --text: #17253a;
    --muted: #66768a;
    --light: #8d99a8;
    --border: #dfe6ee;
    --shadow: 0 14px 45px rgba(31, 56, 87, 0.09);
}

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

body {
    min-height: 100vh;
    background: var(--page);
    color: var(--text);
    font-family: "Plus Jakarta Sans", sans-serif;
}

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

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

button,
label {
    -webkit-tap-highlight-color: transparent;
}

.profile-header {
    height: 70px;
    position: sticky;
    top: 0;
    z-index: 100;
    background: var(--white);
    border-bottom: 1px solid var(--border);
}

.profile-header-inner {
    width: 100%;
    max-width: 1240px;
    height: 100%;
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.profile-logo {
    display: flex;
    align-items: center;
}

.profile-logo img {
    width: 175px;
    height: 48px;
    object-fit: contain;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.header-link,
.logout-link {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
}

.header-link {
    color: var(--muted);
}

.header-link:hover {
    color: var(--primary);
    background: #edf5ff;
}

.logout-link {
    color: #d33d3d;
    background: #fff0f0;
}

.profile-page,
.public-profile-page {
    width: 100%;
    max-width: 1120px;
    margin: 0 auto;
    padding: 30px 20px 60px;
}

.profile-edit-card,
.public-profile-card,
.profile-about-card,
.profile-section-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 20px;
    box-shadow: var(--shadow);
}

.profile-edit-card {
    overflow: hidden;
}

.edit-cover,
.public-cover {
    height: 270px;
    position: relative;
    background-position: center;
    background-size: cover;
}

.default-cover {
    background:
        radial-gradient(circle at 20% 15%, rgba(24,169,87,.55), transparent 32%),
        radial-gradient(circle at 85% 80%, rgba(255,159,28,.4), transparent 30%),
        linear-gradient(135deg, #12355d, #1677ff);
}

.cover-upload-button {
    position: absolute;
    right: 22px;
    bottom: 20px;
    padding: 11px 15px;
    cursor: pointer;
    border-radius: 10px;
    color: var(--text);
    background: rgba(255,255,255,.94);
    box-shadow: 0 8px 24px rgba(0,0,0,.16);
    font-size: 11px;
    font-weight: 800;
}

.edit-profile-top {
    padding: 0 35px 28px;
    display: flex;
    align-items: flex-end;
    gap: 25px;
    border-bottom: 1px solid var(--border);
}

.avatar-editor {
    flex: 0 0 auto;
    margin-top: -58px;
    position: relative;
}

.edit-avatar,
.public-profile-avatar {
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--white);
    background: linear-gradient(135deg, #1677ff, #18a957);
    border: 6px solid var(--white);
    box-shadow: 0 10px 30px rgba(25, 55, 90, .16);
    font-weight: 800;
}

.edit-avatar {
    width: 125px;
    height: 125px;
    font-size: 42px;
}

.edit-avatar img,
.public-profile-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.avatar-upload-button {
    display: block;
    width: max-content;
    margin: 10px auto 0;
    padding: 8px 11px;
    cursor: pointer;
    border-radius: 8px;
    color: var(--primary);
    background: #edf5ff;
    font-size: 10px;
    font-weight: 800;
}

.edit-title {
    padding-bottom: 8px;
}

.edit-title > span {
    display: block;
    color: var(--primary);
    font-size: 10px;
    font-weight: 800;
    letter-spacing: 1.1px;
    text-transform: uppercase;
    margin-bottom: 7px;
}

.edit-title h1 {
    font-size: 28px;
    letter-spacing: -1px;
    margin-bottom: 8px;
}

.edit-title p {
    max-width: 570px;
    color: var(--muted);
    font-size: 13px;
    line-height: 1.7;
}

.profile-alert {
    margin: 25px 35px 0;
    padding: 13px 15px;
    border-radius: 11px;
    font-size: 12px;
    line-height: 1.6;
}

.profile-alert-error {
    color: #bd2828;
    background: #fff0f0;
    border: 1px solid #ffd5d5;
}

.profile-alert-success {
    color: #08783b;
    background: #eafbf2;
    border: 1px solid #c7f0d9;
}

.profile-form {
    padding: 5px 35px 35px;
}

.form-section {
    padding: 30px 0;
    border-bottom: 1px solid var(--border);
}

.section-heading {
    margin-bottom: 22px;
}

.section-heading h2 {
    font-size: 17px;
    margin-bottom: 5px;
}

.section-heading p {
    color: var(--muted);
    font-size: 12px;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 18px;
}

.form-group {
    position: relative;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 12px;
    font-weight: 800;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 11px;
    outline: none;
    color: var(--text);
    background: #fbfcfe;
    font-size: 13px;
    transition: .2s ease;
}

.form-group input,
.form-group select {
    height: 50px;
    padding: 0 14px;
}

.form-group textarea {
    min-height: 150px;
    padding: 14px;
    resize: vertical;
    line-height: 1.7;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(22,119,255,.09);
}

.form-group input:disabled {
    color: var(--light);
    background: #f1f4f7;
}

.form-group small {
    display: block;
    color: var(--light);
    font-size: 9px;
    line-height: 1.5;
    margin-top: 7px;
}

.full-width {
    width: 100%;
    margin-bottom: 18px;
}

.form-span-2 {
    grid-column: 1 / -1;
}

.character-count {
    position: absolute;
    right: 12px;
    bottom: 9px;
    padding: 3px 6px;
    border-radius: 6px;
    color: var(--light);
    background: rgba(255,255,255,.9);
    font-size: 9px;
}

.upload-note {
    margin-top: 22px;
    padding: 13px 15px;
    border-radius: 10px;
    color: var(--muted);
    background: #f5f8fb;
    font-size: 10px;
    line-height: 1.7;
}

.form-actions {
    margin-top: 25px;
    display: flex;
    justify-content: flex-end;
    gap: 10px;
}

.cancel-button,
.save-button,
.primary-profile-button {
    min-height: 44px;
    padding: 0 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 800;
}

.cancel-button {
    color: var(--muted);
    background: #edf1f5;
}

.save-button,
.primary-profile-button {
    border: none;
    color: var(--white);
    background: var(--primary);
    cursor: pointer;
}

.save-button:hover,
.primary-profile-button:hover {
    background: var(--primary-dark);
}

/* Public profile */

.public-profile-card {
    overflow: hidden;
}

.public-profile-main {
    min-height: 145px;
    padding: 0 30px 25px;
    display: flex;
    align-items: flex-end;
    gap: 22px;
}

.public-profile-avatar {
    width: 150px;
    height: 150px;
    flex: 0 0 150px;
    margin-top: -65px;
    font-size: 48px;
}

.public-identity {
    flex: 1;
    padding-bottom: 7px;
}

.public-identity h1 {
    font-size: 28px;
    letter-spacing: -1px;
    margin-bottom: 6px;
}

.public-business-name {
    color: var(--muted);
    font-size: 14px;
    margin-bottom: 12px;
}

.profile-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.profile-badges span {
    padding: 7px 10px;
    border-radius: 20px;
    color: var(--primary);
    background: #edf5ff;
    font-size: 10px;
    font-weight: 700;
}

.public-profile-action {
    padding-bottom: 10px;
}

.profile-content-layout {
    margin-top: 20px;
    display: grid;
    grid-template-columns: 350px minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

.profile-about-card,
.profile-section-card {
    padding: 24px;
}

.profile-about-card h2,
.profile-section-heading h2 {
    font-size: 16px;
    margin-bottom: 14px;
}

.profile-bio,
.empty-profile-text {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.8;
}

.profile-details {
    margin-top: 20px;
    display: flex;
    flex-direction: column;
    gap: 13px;
}

.profile-details div {
    padding-top: 13px;
    border-top: 1px solid var(--border);
}

.profile-details span {
    display: block;
    color: var(--light);
    font-size: 9px;
    text-transform: uppercase;
    letter-spacing: .7px;
    margin-bottom: 5px;
}

.profile-details strong,
.profile-details a {
    color: var(--text);
    font-size: 11px;
    word-break: break-word;
}

.profile-details a {
    color: var(--primary);
    font-weight: 700;
}

.profile-section-heading {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.profile-section-heading h2 {
    margin-bottom: 0;
}

.profile-section-heading span {
    color: var(--light);
    font-size: 9px;
}

.empty-activity {
    min-height: 340px;
    padding: 45px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.empty-activity-icon {
    width: 75px;
    height: 75px;
    margin-bottom: 17px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 23px;
    color: var(--white);
    background: linear-gradient(135deg, #1677ff, #18a957);
    font-size: 30px;
    font-weight: 800;
}

.empty-activity h3 {
    font-size: 17px;
    margin-bottom: 8px;
}

.empty-activity p {
    max-width: 410px;
    color: var(--muted);
    font-size: 11px;
    line-height: 1.7;
}

.empty-activity a {
    margin-top: 18px;
    color: var(--primary);
    font-size: 11px;
    font-weight: 800;
}

@media (max-width: 800px) {
    .edit-cover,
    .public-cover {
        height: 215px;
    }

    .form-grid,
    .profile-content-layout {
        grid-template-columns: 1fr;
    }

    .public-profile-main {
        align-items: center;
        flex-wrap: wrap;
    }

    .public-profile-action {
        width: 100%;
    }

    .primary-profile-button {
        width: 100%;
    }
}

@media (max-width: 600px) {
    .profile-header {
        height: 62px;
    }

    .profile-header-inner {
        padding: 0 12px;
    }

    .profile-logo img {
        width: 120px;
        height: 40px;
    }

    .header-link {
        display: none;
    }

    .profile-page,
    .public-profile-page {
        padding: 12px 8px 35px;
    }

    .profile-edit-card,
    .public-profile-card,
    .profile-about-card,
    .profile-section-card {
        border-radius: 14px;
    }

    .edit-cover,
    .public-cover {
        height: 180px;
    }

    .edit-profile-top {
        padding: 0 18px 22px;
        display: block;
    }

    .avatar-editor {
        width: max-content;
        margin-top: -45px;
        margin-bottom: 18px;
    }

    .edit-avatar {
        width: 100px;
        height: 100px;
    }

    .profile-alert {
        margin: 20px 18px 0;
    }

    .profile-form {
        padding: 0 18px 25px;
    }

    .form-actions {
        display: grid;
        grid-template-columns: 1fr 1fr;
    }

    .public-profile-main {
        padding: 0 18px 22px;
        display: block;
    }

    .public-profile-avatar {
        width: 115px;
        height: 115px;
        margin-top: -50px;
        margin-bottom: 15px;
    }

    .public-identity h1 {
        font-size: 23px;
    }

    .public-profile-action {
        margin-top: 18px;
    }
}

/* 2026 profile upload/layer/position update */
.edit-cover,.public-cover{z-index:1;background-position:var(--cover-x,50%) var(--cover-y,50%);background-size:var(--cover-size,cover);background-repeat:no-repeat;background-color:#172f50}
.edit-profile-top,.public-profile-main{position:relative;z-index:5;background:#fff}
.avatar-editor,.public-profile-avatar{position:relative;z-index:9}
.avatar-editor{margin-top:-66px}
.public-profile-avatar{margin-top:-76px}
.cover-control-grid{display:grid;grid-template-columns:1fr 1fr 1fr;gap:18px;align-items:end}
.range-control label{display:flex;justify-content:space-between;margin-bottom:11px;font-size:11px;font-weight:800}.range-control label span{color:var(--primary)}.range-control input{width:100%;accent-color:var(--primary)}
.profile-product-grid{padding-top:18px;display:grid;grid-template-columns:repeat(3,1fr);gap:14px}.profile-product-card{overflow:hidden;border:1px solid var(--border);border-radius:13px;background:#fff}.profile-product-image{height:180px;display:block;overflow:hidden;position:relative;background:#e9eef4}.profile-product-image img{width:100%;height:100%;object-fit:cover;transition:transform .3s}.profile-product-card:hover img{transform:scale(1.04)}.profile-product-placeholder{width:100%;height:100%;display:flex;align-items:center;justify-content:center;color:#fff;background:linear-gradient(135deg,#1677ff,#18a957);font-size:34px;font-weight:800}.condition-badge,.profile-sold-badge{position:absolute;top:9px;padding:6px 8px;border-radius:7px;color:#fff;font-size:8px;font-weight:800}.condition-badge{left:9px;background:rgba(14,50,92,.88)}.profile-sold-badge{right:9px;background:rgba(211,61,61,.94)}.profile-product-body{padding:13px}.profile-product-body h3{min-height:37px;font-size:11px;line-height:1.5}.profile-product-price{margin-top:8px;color:var(--primary);font-size:14px;font-weight:800}.profile-product-price del{margin-left:7px;color:var(--light);font-size:9px;font-weight:500}
@media(max-width:850px){.cover-control-grid{grid-template-columns:1fr}.profile-product-grid{grid-template-columns:repeat(2,1fr)}}
@media(max-width:600px){.avatar-editor{margin-top:-52px}.public-profile-avatar{margin-top:-60px}.profile-product-grid{grid-template-columns:1fr}.profile-product-image{height:260px}}

/* Cart and shop ordering update */
.profile-page-alert { margin: 0 0 16px; }
.cart-header-link { gap: 5px; }
.cart-header-link span { min-width: 20px; height: 20px; padding: 0 5px; display: inline-flex; align-items: center; justify-content: center; border-radius: 10px; color: #fff; background: var(--primary); font-size: 8px; }
.shop-delivery-card { margin-top: 20px; padding: 15px; border-radius: 11px; background: #f4f7fa; }
.shop-delivery-card h3 { font-size: 12px; margin-bottom: 10px; }
.shop-delivery-card > div { padding: 8px 0; display: flex; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--border); }
.shop-delivery-card > div span { color: var(--light); font-size: 8px; }
.shop-delivery-card > div strong { font-size: 8px; text-align: right; }
.shop-delivery-card p { margin-top: 10px; color: var(--muted); font-size: 7px; line-height: 1.6; }
.profile-stock-row { margin: 8px 0 11px; display: flex; justify-content: space-between; gap: 8px; color: var(--light); font-size: 7px; }
.profile-cart-form { display: grid; grid-template-columns: 62px minmax(0,1fr); gap: 7px; align-items: end; }
.profile-cart-form label { display: flex; flex-direction: column; gap: 5px; color: var(--muted); font-size: 7px; font-weight: 700; }
.profile-cart-form input { width: 100%; height: 34px; padding: 0 7px; border: 1px solid var(--border); border-radius: 7px; outline: none; }
.profile-cart-form button, .profile-add-cart, .profile-manage-product { min-height: 34px; display: flex; align-items: center; justify-content: center; border: none; border-radius: 7px; color: #fff; background: var(--primary); font-size: 8px; font-weight: 800; }
.profile-manage-product { color: var(--primary); background: #edf5ff; }
.profile-add-cart.muted { color: var(--muted); background: #edf1f5; }
@media (max-width: 600px) { .profile-cart-form { grid-template-columns: 70px minmax(0,1fr); } }
@media (max-width: 600px) {
    .header-actions .cart-header-link { display: inline-flex !important; }
}


/* Followers, ratings and verified reviews */
.public-profile-action{display:flex;flex-wrap:wrap;justify-content:flex-end;gap:8px}
.public-profile-action form{display:flex}
.secondary-profile-button,.follow-profile-button{min-height:44px;padding:0 16px;display:inline-flex;align-items:center;justify-content:center;border:1px solid #cfe0f7;border-radius:10px;color:var(--primary);background:#edf5ff;font-size:11px;font-weight:800}
.follow-profile-button{cursor:pointer}
.follow-profile-button.following{color:#08783b;background:#e9f9f0;border-color:#c8efda}
.rating-badge{color:#8a5900!important;background:#fff3dd!important}
.profile-community-stats{margin-top:13px;display:flex;flex-wrap:wrap;gap:15px}
.profile-community-stats a{display:flex;align-items:baseline;gap:5px}
.profile-community-stats strong{font-size:14px}
.profile-community-stats span{color:var(--muted);font-size:9px}

.profile-product-rating{min-height:24px;margin-top:8px;display:flex;align-items:center;gap:5px}
.ms-stars{color:#f2a900;font-size:11px;letter-spacing:.5px}
.ms-rating-label{color:var(--light);font-size:8px}

.profile-review-section{margin-top:18px}
.profile-review-empty{min-height:260px}
.profile-review-list{padding-top:17px;display:flex;flex-direction:column;gap:12px}
.profile-review-card{padding:14px;display:grid;grid-template-columns:42px minmax(0,1fr);gap:11px;border:1px solid var(--border);border-radius:12px;background:#fbfcfe}
.profile-review-avatar{width:42px;height:42px;overflow:hidden;display:flex;align-items:center;justify-content:center;border-radius:50%;color:#fff;background:linear-gradient(135deg,#1677ff,#18a957);font-size:12px;font-weight:800}
.profile-review-avatar img{width:100%;height:100%;object-fit:cover}
.profile-review-head{display:flex;align-items:center;justify-content:space-between;gap:10px}
.profile-review-head strong{font-size:10px}
.profile-review-head span{color:#f2a900;font-size:11px;letter-spacing:1px}
.profile-review-product{display:inline-flex;margin-top:4px;color:var(--primary);font-size:8px;font-weight:800}
.profile-review-card p{margin-top:7px;color:var(--muted);font-size:9px;line-height:1.7}
.profile-review-card small{display:block;margin-top:7px;color:var(--light);font-size:7px}

@media(max-width:850px){.public-profile-action{justify-content:flex-start}.profile-community-stats{gap:10px}}
@media(max-width:600px){.public-profile-action{display:grid;grid-template-columns:1fr 1fr}.public-profile-action>a,.public-profile-action form,.public-profile-action button{width:100%}.profile-community-stats{display:grid;grid-template-columns:repeat(3,1fr);gap:6px}.profile-community-stats a{padding:8px 5px;display:flex;flex-direction:column;align-items:center;border-radius:8px;background:#f4f7fa}.profile-review-card{grid-template-columns:35px minmax(0,1fr);padding:11px}.profile-review-avatar{width:35px;height:35px}}

/* Business address, WhatsApp and working cart feedback */
.whatsapp-profile-button {
    min-height: 44px;
    padding: 0 17px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: #fff;
    background: #20b866;
    font-size: 11px;
    font-weight: 800;
}

.whatsapp-profile-button:hover {
    background: #159f55;
}

.public-profile-action {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 8px;
}

.profile-details strong {
    line-height: 1.65;
}

.profile-form .form-group textarea {
    min-height: 100px;
}

.profile-cart-form button:disabled {
    cursor: wait;
    opacity: .65;
}

.profile-cart-toast {
    min-width: 290px;
    max-width: calc(100vw - 24px);
    min-height: 55px;
    padding: 10px 11px 10px 15px;
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 1500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    border-radius: 12px;
    color: #08783b;
    background: #e9f9f0;
    border: 1px solid #bfe9d1;
    box-shadow: 0 18px 48px rgba(20, 60, 40, .18);
    font-size: 10px;
    font-weight: 700;
}

.profile-cart-toast.error {
    color: #b32929;
    background: #fff0f0;
    border-color: #ffd0d0;
}

.profile-cart-toast a {
    flex: 0 0 auto;
    padding: 9px 11px;
    border-radius: 8px;
    color: #fff;
    background: #1677ff;
    font-size: 9px;
    font-weight: 800;
}

@media (max-width: 600px) {
    .public-profile-action {
        justify-content: stretch;
    }

    .public-profile-action > a,
    .public-profile-action > form,
    .public-profile-action form button {
        width: 100%;
    }

    .profile-cart-toast {
        right: 10px;
        bottom: 82px;
        left: 10px;
        min-width: 0;
    }
}

.public-profile-avatar{overflow:visible!important;position:relative}.public-profile-avatar>img{border-radius:50%;overflow:hidden}.public-achievement-stars{position:absolute;right:-10px;bottom:2px;display:flex;gap:2px;padding:5px 7px;border:3px solid #fff;border-radius:20px;background:#1677ff;box-shadow:0 7px 18px rgba(22,119,255,.3)}.public-achievement-stars i{color:#ffd84d;font-size:11px;font-style:normal;line-height:1}
