﻿/* =========================================================
   1. ROOT
   ========================================================= */
:root {
    --orange: #ff6a00;
    --orange2: #ff8a00;
    --padX: 12px;
    --skeleton-base: #e9edf3;
    --skeleton-shine: #f8fafc;
}

/* =========================================================
   2. LAYOUT
   ========================================================= */
.page-wrapper {
    max-width: 1160px;
    margin: 0 auto;
    position: relative;
    padding: 5px var(--padX) 0px;
}

.pt-5 {
    padding-top: 5px;
}

footer {
    font-size: 0.9rem;
}

/* =========================================================
   2A. LEFT TOP AD
   ========================================================= */
.k-leftTopAd {
    position: fixed;
    top: 88px;
    left: 6px;
    width: 145px;
    z-index: 40;
}

#leftTopAdsContainer {
    width: 100%;
    overflow: hidden;
    padding: 5px !important;
}

    #leftTopAdsContainer img {
        display: block;
        width: 100%;
        height: auto !important;
        max-height: 560px;
        object-fit: cover;
        border-radius: 8px;
    }

/* =========================================================
   2B. TOP BANNER ADS
   ========================================================= */
#topAdsContainer {
    width: 100%;
}

    #topAdsContainer .carousel,
    #topAdsContainer .carousel-inner,
    #topAdsContainer .carousel-item {
        width: 100%;
        border-radius: 12px;
        overflow: hidden;
    }

    #topAdsContainer .carousel-item {
        position: relative;
        width: 100%;
        min-height: 180px;
        max-height: 260px;
        background: rgba(0, 0, 0, 0.85);
        display: flex;
        align-items: center;
        justify-content: center;
        overflow: hidden;
    }

        #topAdsContainer .carousel-item::before {
            content: "";
            position: absolute;
            inset: 0;
            background-image: var(--top-banner-bg);
            background-size: cover;
            background-position: center;
            filter: blur(14px);
            transform: scale(1.08);
            opacity: 0.45;
            z-index: 1;
        }

        #topAdsContainer .carousel-item img,
        #topAdsContainer .carousel-item picture img {
            position: relative;
            z-index: 2;
            display: block;
            width: 100%;
            height: 100%;
            max-height: 260px;
            object-fit: contain;
            object-position: center;
            background: transparent;
        }

/* =========================================================
   3. TOP / HEADER / BRAND
   ========================================================= */
.top-shell {
    background: #ffffff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.06);
}

.logo-text {
    font-weight: 800;
    letter-spacing: 2px;
}

.logo-pill {
    padding: 4px 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, #2563eb, #22c55e);
    color: #fff;
    font-size: 12px;
}

.brand-wrap {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-badge {
    width: 46px;
    height: 46px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 900;
    font-size: 20px;
    color: #1d4ed8;
    background: linear-gradient(135deg, #eef2ff, #e0e7ff);
    border: 1px solid rgba(29, 78, 216, 0.25);
    box-shadow: 0 8px 18px rgba(29, 78, 216, 0.18);
}

.brand-text {
    display: flex;
    flex-direction: column;
    line-height: 1.05;
}

.brand-title {
    font-size: 22px;
    font-weight: 900;
    letter-spacing: 0.3px;
    color: #0f172a;
}

.brand-sub {
    font-size: 13px;
    color: #6b7280;
    margin: 0;
}

.topbar-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.location-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    font-weight: 700;
    font-size: 13px;
    color: #334155;
    cursor: pointer;
}

/* =========================================================
   4. BUTTONS
   ========================================================= */
.login-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 9px 16px;
    border-radius: 999px;
    border: 1px solid rgba(29, 78, 216, 0.25);
    background: #ffffff;
    color: #1d4ed8;
    font-weight: 800;
    font-size: 14px;
    text-decoration: none;
    transition: 0.18s ease;
    box-shadow: 0 6px 16px rgba(29, 78, 216, 0.12);
}

    .login-btn i {
        font-size: 14px;
    }

    .login-btn:hover {
        background: #1d4ed8;
        color: #ffffff;
        box-shadow: 0 10px 24px rgba(29, 78, 216, 0.25);
        transform: translateY(-1px);
    }

.post-ad-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 9px 16px;
    border-radius: 999px;
    background: linear-gradient(135deg, #22c55e, #16a34a);
    color: #ffffff;
    font-weight: 800;
    font-size: 14px;
    text-decoration: none;
    box-shadow: 0 10px 22px rgba(34, 197, 94, 0.35);
    transition: 0.18s ease;
}

.cat-toggle-btn {
    display: none;
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    background: #ffffff;
    color: #111827;
    box-shadow: 0 6px 14px rgba(15, 23, 42, 0.12);
}

/* =========================================================
   5. SEARCH SUGGESTIONS
   ========================================================= */
.search-suggest-box {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    display: none;
    background: #fff;
    border: 1px solid rgba(17, 24, 39, 0.12);
    border-radius: 14px;
    box-shadow: 0 18px 40px rgba(17, 24, 39, 0.14);
    overflow: hidden;
    max-height: 380px;
    overflow-y: auto;
    opacity: 0;
    transition: opacity .18s ease, transform .18s ease;
    z-index: 1200;
}

    .search-suggest-box.is-open {
        opacity: 1;
        transform: translateY(0);
    }

.s-item,
.s-store {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    cursor: pointer;
    transition: background .18s ease;
}

    .s-item:hover,
    .s-store:hover {
        background: rgba(255, 106, 0, 0.06);
    }

    .s-item i {
        color: #ff6a00;
        font-size: 13px;
        width: 16px;
        text-align: center;
        flex-shrink: 0;
    }

.s-text {
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
}

.s-title {
    font-size: 14px;
    font-weight: 400;
    color: #111827;
}

.s-in {
    font-size: 12px;
    color: #6b7280;
}

.s-sub {
    font-size: 13px;
    color: #374151;
}

.s-store .logo {
    width: 46px;
    height: 46px;
    border-radius: 12px;
    object-fit: cover;
    border: 1px solid #e5e7eb;
    background: #fff;
    flex-shrink: 0;
}

.s-store .meta {
    min-width: 0;
}

.s-store .name {
    font-size: 14px;
    font-weight: 600;
    color: #111827;
    line-height: 1.25;
}

.s-store .sub {
    font-size: 12px;
    color: #6b7280;
    margin-top: 2px;
}

.s-noresult,
.s-loading {
    padding: 12px 14px;
}

    .s-noresult .t1,
    .s-loading .t1 {
        font-size: 14px;
        font-weight: 600;
        color: #111827;
    }

    .s-noresult .t2,
    .s-loading .t2 {
        font-size: 12px;
        color: #6b7280;
        margin-top: 2px;
    }

/* =========================================================
   5A. SEARCH / SUGGESTION SKELETON
   ========================================================= */
.s-skeleton,
.search-skeleton,
.skeleton-row,
.skeleton-card,
.skeleton-line,
.skeleton-thumb,
.skeleton-icon,
.skeleton-chip {
    position: relative;
    overflow: hidden;
    background: var(--skeleton-base);
}

    .s-skeleton::after,
    .search-skeleton::after,
    .skeleton-row::after,
    .skeleton-card::after,
    .skeleton-line::after,
    .skeleton-thumb::after,
    .skeleton-icon::after,
    .skeleton-chip::after {
        content: "";
        position: absolute;
        top: 0;
        left: -150%;
        width: 150%;
        height: 100%;
        background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,.75) 50%, transparent 100%);
        animation: skeletonShimmer 1.2s infinite;
    }

.search-suggest-skeleton {
    padding: 10px 12px;
    background: #fff;
}

    .search-suggest-skeleton .skeleton-row {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 10px 2px;
        background: transparent;
    }

    .search-suggest-skeleton .skeleton-icon {
        width: 16px;
        height: 16px;
        border-radius: 50%;
        flex: 0 0 16px;
    }

    .search-suggest-skeleton .skeleton-thumb {
        width: 46px;
        height: 46px;
        border-radius: 12px;
        flex: 0 0 46px;
    }

    .search-suggest-skeleton .skeleton-content {
        flex: 1;
        min-width: 0;
    }

    .search-suggest-skeleton .skeleton-line {
        height: 12px;
        border-radius: 999px;
        margin-bottom: 8px;
    }

        .search-suggest-skeleton .skeleton-line:last-child {
            margin-bottom: 0;
        }

    .search-suggest-skeleton .w-85 {
        width: 85%;
    }

    .search-suggest-skeleton .w-70 {
        width: 70%;
    }

    .search-suggest-skeleton .w-55 {
        width: 55%;
    }

    .search-suggest-skeleton .w-40 {
        width: 40%;
    }

.phone-helper,
.phone-hint,
.phone-validation-text {
    display: block;
    font-size: 12px;
    line-height: 1.35;
    margin-top: 6px;
    color: #374151;
}

    .phone-helper.text-error,
    .phone-hint.text-error,
    .phone-validation-text.text-error {
        color: #b91c1c;
    }

    .phone-helper.text-muted,
    .phone-hint.text-muted,
    .phone-validation-text.text-muted {
        color: #6b7280;
    }

/* =========================================================
   6. SEARCH AREA
   ========================================================= */
.k-searchbar {
    position: sticky;
    top: 0;
    background: #fff;
    padding: 14px;
    border: 2px solid rgba(255,106,0,.45);
    max-width: 100%;
    z-index: 50;
}

@media (min-width: 993px) {
    .k-searchbar {
        border-radius: 10px;
    }
}

@media (max-width: 992px) {
    .k-searchbar {
        border-radius: 5px 5px 10px 10px;
    }
}

.k-searchrow {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
}

.k-search-inputwrap {
    position: relative;
    width: 100%;
}

.search-input {
    height: 56px;
    border-radius: 10px !important;
    font-size: 15px;
    padding-left: 14px;
    padding-right: 52px;
    border: 1px solid rgba(17, 24, 39, 0.14);
    background: #fff;
    transition: border-color .25s ease, box-shadow .25s ease;
}

    .search-input:focus {
        outline: none;
    }

.k-search-inputwrap:focus-within .search-input {
    border-color: rgba(255, 106, 0, 0.55) !important;
    box-shadow: 0 0 0 4px rgba(255, 106, 0, 0.12) !important;
}

.k-search-inputwrap:focus-within #mainSearchInput {
    border-color: rgba(255, 106, 0, .65);
    box-shadow: 0 0 0 4px rgba(255, 106, 0, .12), 0 10px 24px rgba(255, 106, 0, .15);
    animation: searchInputPop .28s ease-out;
}

.search-icon-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    width: 42px;
    height: 42px;
    border-radius: 50px;
    border: none !important;
    background: linear-gradient(135deg, var(--orange), var(--orange2)) !important;
    color: #fff !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 22px rgba(255, 106, 0, 0.2);
    padding: 0;
    transform: translateY(-50%);
}

    .search-icon-btn:hover {
        filter: brightness(0.98);
    }

.k-search-inputwrap:focus-within #productListSearchIconBtn {
    animation: kIconPop .35s ease-out;
    box-shadow: 0 12px 26px rgba(255, 106, 0, .26);
}

/* =========================================================
   7. AUTOCOMPLETE
   ========================================================= */
.ui-autocomplete {
    z-index: 1200 !important;
    background: #fff;
    border-radius: 6px;
    border: 1px solid rgba(17, 24, 39, 0.12);
    box-shadow: 0 18px 40px rgba(17, 24, 39, 0.18);
    padding: 6px 0;
    max-height: 360px;
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: rgba(17, 24, 39, 0.25) transparent;
}

    .ui-autocomplete::-webkit-scrollbar {
        width: 6px;
    }

    .ui-autocomplete::-webkit-scrollbar-track {
        background: transparent;
    }

    .ui-autocomplete::-webkit-scrollbar-thumb {
        background-color: rgba(17, 24, 39, 0.25);
        border-radius: 8px;
    }

        .ui-autocomplete::-webkit-scrollbar-thumb:hover {
            background-color: rgba(17, 24, 39, 0.4);
        }

.ui-menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ui-menu-item {
    margin: 0;
}

.ui-menu-item-wrapper {
    padding: 10px 12px !important;
    border: 0 !important;
    display: flex;
    align-items: flex-start;
    gap: 0;
    cursor: pointer;
    background: transparent !important;
    color: #3d4d6e;
    line-height: 1.25;
    border-radius: 5px !important;
    font-weight: 400 !important;
    font-size: 14px;
}

    .ui-menu-item-wrapper.ui-state-active {
        background: rgba(255, 106, 0, 0.08) !important;
        color: #111827 !important;
        border: 0 !important;
        margin: 0 !important;
    }

    .ui-menu-item-wrapper b {
        font-weight: 600;
    }

/* =========================================================
   8. OPTION CARDS / PANELS
   ========================================================= */
.option-card {
    cursor: pointer;
    border-radius: 16px;
    padding: 0.5rem 0.25rem;
    transition: all 0.15s ease-in-out;
}

    .option-card:hover {
        background: #e9f3ff;
        transform: translateY(-1px);
    }

.option-icon-circle {
    width: 32px;
    height: 32px;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 4px;
    background: #eef2ff;
    color: #2563eb;
}

.option-overlay {
    position: relative;
    left: auto;
    transform: none;
    width: 100%;
    max-width: 1160px;
    margin: 0 auto;
    z-index: 1040;
    pointer-events: none;
    top: auto;
}

.option-panel {
    position: absolute;
    left: 0;
    right: 0;
    margin-inline: auto;
    display: none;
    max-width: 600px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.9);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
    padding: 1rem 1.25rem 1.25rem;
    transform: translateY(10px);
    opacity: 0;
    transition: all 0.22s ease-out;
    pointer-events: auto;
    max-height: 55vh;
    overflow-y: auto;
}

    .option-panel.show {
        display: block;
        transform: translateY(5px);
        opacity: 1;
    }

#panel-location,
#panel-upload {
    margin: 0 auto;
}

#panel-searchSettings {
    margin-left: 0.75rem;
    margin-right: auto;
}

#panel-category {
    margin-right: 0.75rem;
    margin-left: auto;
}

/* =========================================================
   9. PROFILE
   ========================================================= */
.profile-toggle-btn {
    border-radius: 999px;
    padding: 0;
    width: 40px;
    height: 40px;
    border: 1px solid #e2e2e2;
    background: #fff;
}

    .profile-toggle-btn img {
        width: 100%;
        height: 100%;
        border-radius: 999px;
        object-fit: cover;
    }

    .profile-toggle-btn i.fa-bars {
        font-size: 18px;
        color: #333;
    }

.profile-panel {
    position: fixed;
    right: 16px;
    top: 60px;
    width: 260px;
    border-radius: 18px;
    background: rgba(255, 255, 255, 0.92);
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.28);
    padding: 0.75rem 0.75rem 0.85rem;
    transform: translateY(-15px);
    opacity: 0;
    pointer-events: none;
    transition: all 0.22s ease-out;
    z-index: 1050;
}

    .profile-panel.show {
        transform: translateY(0);
        opacity: 1;
        pointer-events: auto;
    }

.profile-panel-close {
    display: none;
}

.profile-menu-btn {
    width: 100%;
    text-align: left;
    border-radius: 999px;
    padding-inline: 0.85rem;
    padding-block: 0.45rem;
    margin-bottom: 0.3rem;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

    .profile-menu-btn i {
        width: 18px;
        text-align: center;
    }

/* =========================================================
   10. PRODUCT / ADS
   ========================================================= */
.product-card {
    border-radius: 14px;
    border: 1px solid #e5e7eb;
    background: #fff;
    box-shadow: 0 5px 18px rgba(15, 23, 42, 0.06);
    overflow: hidden;
    transition: transform 0.15s ease-out, box-shadow 0.15s ease-out;
}

    .product-card:hover {
        transform: translateY(-3px);
        box-shadow: 0 10px 26px rgba(15, 23, 42, 0.12);
    }

.product-img-wrap img {
    width: 100%;
    height: 155px;
    object-fit: contain;
    max-height: 207px;
}

.price-tag {
    color: #198754;
    font-weight: 600;
}

.badge-chip {
    border-radius: 999px;
    font-size: 11px;
    padding: 0.15rem 0.6rem;
}

.ads-sticky {
    position: sticky;
    top: 10px;
}

.ad-card {
    border-radius: 14px;
    background: linear-gradient(135deg, #1d4ed8, #22c55e);
    color: #fff;
    padding: 1rem;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.4);
}

    .ad-card small {
        opacity: 0.85;
    }

/* =========================================================
   11. FAVORITE BUTTON
   ========================================================= */
.js-toggle-favorite.is-favorite {
    background-color: #0d6efd;
    color: #fff;
    border: 1px solid #0d6efd;
}

.js-toggle-favorite:not(.is-favorite) {
    background-color: transparent;
    color: #0d6efd;
    border: 1px solid #0d6efd;
}

/* =========================================================
   12. ANIMATIONS
   ========================================================= */
@keyframes searchInputPop {
    0% {
        transform: scaleX(1);
    }

    55% {
        transform: scaleX(1.02);
    }

    100% {
        transform: scaleX(1);
    }
}

@keyframes kIconPop {
    0% {
        transform: translateY(-50%) scale(1);
    }

    40% {
        transform: translateY(-50%) scale(1.12);
    }

    100% {
        transform: translateY(-50%) scale(1);
    }
}

@keyframes skeletonShimmer {
    100% {
        left: 150%;
    }
}

/* =========================================================
   13. RESPONSIVE
   ========================================================= */

/* 1500px and above */
@media (min-width: 1500px) {
    .page-wrapper,
    .option-overlay {
        max-width: 1160px;
    }

    .k-leftTopAd {
        width: 145px;
        left: 6px;
    }

    #leftTopAdsContainer img {
        max-height: 560px;
    }

    #topAdsContainer .carousel-item {
        max-height: 280px;
    }

        #topAdsContainer .carousel-item img,
        #topAdsContainer .carousel-item picture img {
            max-height: 280px;
        }
}

/* 1300px - 1499px */
@media (min-width: 1300px) and (max-width: 1499.98px) {
    .page-wrapper,
    .option-overlay {
        max-width: 1080px;
    }

    .k-leftTopAd {
        width: 118px;
        left: 5px;
    }

    #leftTopAdsContainer img {
        max-height: 500px;
    }

    #topAdsContainer .carousel-item {
        max-height: 240px;
    }

        #topAdsContainer .carousel-item img,
        #topAdsContainer .carousel-item picture img {
            max-height: 240px;
        }
}

/* 992px - 1299px */
@media (min-width: 992px) and (max-width: 1299.98px) {
    .page-wrapper,
    .option-overlay {
        max-width: 860px;
    }

    .k-leftTopAd {
        width: 82px;
        left: 4px;
        top: 88px;
    }

    #leftTopAdsContainer {
        padding: 3px !important;
    }

        #leftTopAdsContainer img {
            max-height: 360px;
        }

    #topAdsContainer .carousel-item {
        min-height: 160px;
        max-height: 220px;
    }

        #topAdsContainer .carousel-item img,
        #topAdsContainer .carousel-item picture img {
            max-height: 220px;
        }
}

/* below 992px */
@media (max-width: 991.98px) {
    .k-leftTopAd {
        display: none !important;
    }

    .page-wrapper,
    .option-overlay {
        max-width: 100%;
        padding-left: 8px;
        padding-right: 8px;
    }

    #topAdsContainer .carousel-item {
        min-height: 130px;
        max-height: 180px;
        border-radius: 10px;
    }

        #topAdsContainer .carousel-item img,
        #topAdsContainer .carousel-item picture img {
            max-height: 180px;
        }

    .profile-panel {
        position: fixed;
        top: 0;
        left: 0;
        right: auto;
        width: 100%;
        height: 100%;
        max-width: 100%;
        border-radius: 0;
        transform: translateX(-100%);
        opacity: 1;
        pointer-events: none;
        background: rgba(15, 23, 42, 0.06);
        display: flex;
        justify-content: flex-start;
        align-items: stretch;
    }

    .profile-panel-inner {
        background: rgba(255, 255, 255, 0.98);
        width: 280px;
        max-width: 80%;
        box-shadow: 6px 0 20px rgba(15, 23, 42, 0.25);
        padding: 1rem 1rem 1.25rem;
    }

    .profile-panel.show {
        transform: translateX(0);
        pointer-events: auto;
    }

    .profile-panel-close {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        width: 32px;
        height: 32px;
        border-radius: 999px;
        border: none;
        background: #f3f4f6;
        margin-left: auto;
    }
}

/* below 500px */
@media (max-width: 499.98px) {
    .k-leftTopAd,
    #topAdsContainer {
        display: none !important;
    }

    .page-wrapper,
    .option-overlay {
        padding-left: 6px;
        padding-right: 6px;
    }
}

@media (max-width: 767.98px) {
    .option-panel {
        max-width: 100%;
        margin: 0.25rem 0.75rem;
        border-radius: 0.75rem;
    }

    #panel-searchSettings,
    #panel-location,
    #panel-upload,
    #panel-category {
        margin-left: 0.75rem;
        margin-right: 0.75rem;
    }
}

@media (max-width: 576px) {
    .product-section,
    .product-section .row {
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

        .product-section .col-12,
        .product-section .col-sm-6 {
            padding-left: 0 !important;
            padding-right: 0 !important;
        }
}

@media (max-width: 575.98px) {
    .brand-sub {
        display: none;
    }

    .login-btn span {
        display: none;
    }
}
