/* =====================================================================
   BarterTime — თანამედროვე ვიზუალური ფენა (modern.css)
   განლაგება არ იცვლება: მხოლოდ ტიპოგრაფია, ფერები, ფორმები, ჩრდილები,
   ხატულები, hover/focus მდგომარეობები და კონტრასტი (accessibility).
   იტვირთება style.css-ის შემდეგ. გვერდების inline სტილებზე გადასაფარად
   ზოგიერთ სელექტორს აქვს `html body` პრეფიქსი.
   ===================================================================== */

:root {
    --bt-primary: #0D9974;
    --bt-primary-600: #0B8564;
    --bt-primary-700: #065F46;
    --bt-primary-50: #ECFDF5;
    --bt-primary-100: #D1FAE5;
    --bt-ink: #111827;
    --bt-text: #1F2937;
    --bt-muted: #4B5563;          /* ≥ 4.5:1 თეთრზე */
    --bt-border: #E5E7EB;
    --bt-surface: #FFFFFF;
    --bt-bg: #F6F8F7;
    --bt-radius-sm: 10px;
    --bt-radius: 14px;
    --bt-radius-lg: 20px;
    --bt-shadow-sm: 0 1px 2px rgba(16, 24, 40, .06);
    --bt-shadow: 0 1px 2px rgba(16, 24, 40, .05), 0 6px 18px rgba(16, 24, 40, .06);
    --bt-shadow-lg: 0 2px 4px rgba(16, 24, 40, .06), 0 14px 32px rgba(16, 24, 40, .12);
    --bt-ease: cubic-bezier(.2, .7, .2, 1);
}

/* ---------- ტიპოგრაფია ---------- */
html body {
    font-family: 'Noto Sans Georgian', 'Roboto', system-ui, -apple-system, 'Segoe UI', Arial, sans-serif;
    color: var(--bt-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}
html body h1, html body h2, html body h3 { letter-spacing: -.01em; color: var(--bt-ink); }

/* ---------- ფოკუსი კლავიატურისთვის (accessibility) ---------- */
html body a:focus-visible,
html body button:focus-visible,
html body input:focus-visible,
html body select:focus-visible,
html body textarea:focus-visible,
html body [tabindex]:focus-visible {
    outline: 3px solid rgba(13, 153, 116, .45);
    outline-offset: 2px;
    border-radius: 8px;
}

/* ---------- ზედა მენიუ ---------- */
html body .navbar {
    background: linear-gradient(100deg, #0FA37C 0%, #0B8564 55%, #07704F 100%);
    box-shadow: 0 1px 0 rgba(255, 255, 255, .08) inset, 0 6px 20px rgba(6, 95, 70, .18);
}

/* ---------- ღილაკები ---------- */
html body .btn {
    border-radius: var(--bt-radius-sm);
    font-weight: 600;
    min-height: 44px;                       /* touch target */
    transition: transform .15s var(--bt-ease), box-shadow .2s var(--bt-ease), background-color .2s;
}
html body .btn-primary {
    background: linear-gradient(180deg, #10A981 0%, var(--bt-primary) 100%);
    border: none;
    color: #fff;
    box-shadow: 0 6px 16px rgba(13, 153, 116, .28);
}
html body .btn-primary:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(13, 153, 116, .32); }
html body .btn-secondary {
    background: #fff;
    border: 1px solid var(--bt-border);
    color: var(--bt-ink);
    box-shadow: var(--bt-shadow-sm);
}
html body .btn-secondary:hover { border-color: #CBD5E1; transform: translateY(-1px); }

/* ---------- ძებნა ---------- */
html body .unified-search-form-desktop,
html body .unified-search-form-mobile {
    border-radius: 999px;
    box-shadow: var(--bt-shadow);
    border: 1px solid var(--bt-border);
    transition: box-shadow .2s var(--bt-ease), border-color .2s;
}
html body .unified-search-form-desktop:focus-within,
html body .unified-search-form-mobile:focus-within {
    border-color: rgba(13, 153, 116, .55);
    box-shadow: 0 0 0 4px rgba(13, 153, 116, .14), var(--bt-shadow);
}
html body .search-btn, html body .filter-btn-mobile {
    min-width: 44px;
    min-height: 44px;
}

/* ---------- Hero ---------- */
html body .hero-section {
    background:
        radial-gradient(1200px 300px at 10% -20%, rgba(16, 169, 129, .10), transparent 60%),
        radial-gradient(800px 260px at 110% 120%, rgba(16, 169, 129, .10), transparent 60%),
        #fff;
    border: 1px solid var(--bt-border);
    border-radius: var(--bt-radius-lg);
    box-shadow: var(--bt-shadow);
}
html body .hero-title { font-weight: 700; color: var(--bt-ink); }

/* ---------- კატეგორიების ხატულები ---------- */
html body .icon-category-item { color: var(--bt-text); gap: 6px; min-height: 44px; }
html body .icon-category-item .icon-wrapper {
    border-radius: 18px;                                    /* squircle */
    background: linear-gradient(160deg, #F0FDF8 0%, #DDF6EC 100%);
    border: 1px solid rgba(13, 153, 116, .14);
    box-shadow: 0 1px 2px rgba(16, 24, 40, .04), 0 4px 10px rgba(13, 153, 116, .08);
    transition: transform .2s var(--bt-ease), box-shadow .2s var(--bt-ease), background .2s;
}
html body .icon-category-item .icon-wrapper i {
    color: var(--bt-primary);
    transition: transform .2s var(--bt-ease), color .2s;
}
html body .icon-category-item:hover .icon-wrapper,
html body .icon-category-item:focus-visible .icon-wrapper {
    background: linear-gradient(160deg, #12B386 0%, var(--bt-primary-600) 100%);
    border-color: transparent;
    transform: translateY(-3px);
    box-shadow: 0 10px 22px rgba(13, 153, 116, .28);
}
html body .icon-category-item:hover .icon-wrapper i,
html body .icon-category-item:focus-visible .icon-wrapper i { color: #fff; transform: scale(1.06); }
html body .icon-category-item span { font-weight: 500; color: var(--bt-text); }
html body .icon-category-item:last-child .icon-wrapper {   /* „ყველა კატეგორია" */
    background: linear-gradient(160deg, #12B386 0%, var(--bt-primary-700) 100%) !important;
    border-color: transparent;
}

/* ---------- სექციის სათაურები და მრიცხველი ---------- */
html body .section-header h2 { font-weight: 700; color: var(--bt-ink); }
html body .count-badge {
    background-color: var(--bt-primary-100);
    color: var(--bt-primary-700);                           /* კონტრასტი ≥ 4.5:1 */
    border: 1px solid rgba(13, 153, 116, .18);
    box-shadow: none;
    font-weight: 600;
}
html body .section-header .view-all-link,
html body .view-all-link {
    color: var(--bt-primary-700);
    font-weight: 600;
    padding: 10px 4px;                                      /* touch target */
}

/* ---------- ბარათები ---------- */
html body .product-card {
    border: 1px solid rgba(17, 24, 39, .06);
    border-radius: var(--bt-radius);
    box-shadow: var(--bt-shadow);
    overflow: hidden;
    transition: transform .25s var(--bt-ease), box-shadow .25s var(--bt-ease);
}
html body .product-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--bt-shadow-lg);
}
html body .product-image-wrapper {
    border-top-left-radius: var(--bt-radius);
    border-top-right-radius: var(--bt-radius);
    background-color: #EEF2F0;
}
html body .product-image-foreground { transition: transform .45s var(--bt-ease); }
html body .product-card:hover .product-image-foreground { transform: scale(1.04); }
html body .product-card-content { border-top: none; }
html body .product-title { font-weight: 600; color: var(--bt-ink); }
html body .status-badge {
    border-radius: 999px;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, .25);
    letter-spacing: .01em;
}

/* სურვილის ვარსკვლავი — FA6 ფონტის სახელით (beta3-ში ორივე სახელი არსებობს) */
html body #wishlist-section .product-card::after {
    font-family: "Font Awesome 6 Free", "Font Awesome 5 Free";
    background: linear-gradient(160deg, #FBBF24, #F59E0B);
    box-shadow: 0 4px 10px rgba(245, 158, 11, .35);
}

/* სლაიდერის ისრები */
html body .slider-arrow-btn {
    width: 44px; height: 44px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .92);
    color: var(--bt-ink);
    border: 1px solid var(--bt-border);
    box-shadow: var(--bt-shadow);
    backdrop-filter: blur(6px);
}
html body .slider-arrow-btn:hover { background: #fff; box-shadow: var(--bt-shadow-lg); }

/* ---------- ჩანართები (Listings / Barter Services) ---------- */
html body .tab-link, html body .main-tab, html body .tabs a { min-height: 44px; }

/* ---------- ჩატის ღილაკი ---------- */
html body .support-chat-btn {
    background: linear-gradient(160deg, #12B386, var(--bt-primary-700));
    box-shadow: 0 10px 24px rgba(6, 95, 70, .35);
    transition: transform .2s var(--bt-ease), box-shadow .2s;
}
html body .support-chat-btn:hover { transform: translateY(-2px) scale(1.03); }

/* ---------- მობილური ქვედა მენიუ ---------- */
html body .mobile-bottom-nav {
    background: rgba(255, 255, 255, .94);
    backdrop-filter: saturate(160%) blur(10px);
    -webkit-backdrop-filter: saturate(160%) blur(10px);
    border-top: 1px solid var(--bt-border);
    box-shadow: 0 -6px 18px rgba(16, 24, 40, .06);
}
html body .mobile-nav-link { min-height: 48px; min-width: 48px; }

/* ---------- footer ---------- */
html body .site-footer a { line-height: 1.9; display: inline-block; padding: 2px 0; }

/* ---------- კონტრასტი: ღია ნაცრისფერი ტექსტები ---------- */
html body .text-muted,
html body .product-location,
html body .product-meta,
html body .item-location { color: var(--bt-muted); }

/* ---------- ანიმაციები: ვინც შემცირებულ მოძრაობას ითხოვს ---------- */
@media (prefers-reduced-motion: reduce) {
    html body *, html body *::before, html body *::after {
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ჩანართები: კონტრასტი */
html body .tab-link { color: var(--bt-muted); }
html body .tab-link.active { color: var(--bt-primary-700); border-bottom-color: var(--bt-primary); }
html body .tab-link:hover { color: var(--bt-ink); }

/* მობილური: Noto Sans Georgian უფრო განიერია — ტექსტი ერთ ხაზზე დარჩეს */
@media (max-width: 600px) {
    html body .tabs-container { overflow-x: auto; scrollbar-width: none; }
    html body .tabs-container::-webkit-scrollbar { display: none; }
    html body .tab-link { white-space: nowrap; padding: 10px 14px; font-size: .95rem; flex: 0 0 auto; }
    html body .section-header { gap: 8px; align-items: center; }
    html body .section-header h2 { font-size: 1.15rem; line-height: 1.3; }
    html body .section-header .view-all-link, html body .view-all-link { white-space: nowrap; font-size: .9rem; }
    html body .count-badge { white-space: nowrap; margin-left: 6px; }
    html body .hero-title { font-size: 1.6rem; line-height: 1.35; }
}

/* ---------- ლოგო: თეთრი, გამჭვირვალე ფონზე (ძველი თეთრი წრე და „ჰალო" მოშორებულია) ---------- */
html body .nav-logo, html body .mobile-logo-link { display: inline-flex; align-items: center; line-height: 0; border-radius: 999px; }
html body .nav-logo img.bt-logo-img { height: 46px; width: 46px; object-fit: contain; margin-right: 12px; }
html body .mobile-logo-link img.bt-logo-img { height: 40px; width: 40px; object-fit: contain; }
html body img.bt-logo-img {
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .18)) drop-shadow(0 4px 10px rgba(0, 0, 0, .10));
    transition: transform .35s var(--bt-ease), filter .35s var(--bt-ease);
}
html body .nav-logo:hover img.bt-logo-img,
html body .mobile-logo-link:hover img.bt-logo-img {
    transform: rotate(-8deg) scale(1.05);
    filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .22)) drop-shadow(0 6px 14px rgba(0, 0, 0, .14));
}

/* „ახალი" ნიშანი */
.bt-new-badge {
    position: absolute; top: 10px; left: 10px; z-index: 6;
    background: linear-gradient(160deg, #12B386, #065F46);
    color: #fff; font-size: 12px; font-weight: 700; letter-spacing: .02em;
    padding: 4px 10px; border-radius: 999px;
    box-shadow: 0 4px 12px rgba(6, 95, 70, .35);
    pointer-events: none;
}

/* „+ დამატება" მცურავი ღილაკი — მხოლოდ მობილურზე */
.bt-fab { display: none; }
@media (max-width: 768px) {
    .bt-fab {
        position: fixed; left: 16px; bottom: calc(84px + env(safe-area-inset-bottom, 0px)); z-index: 1005;
        display: inline-flex; align-items: center; gap: 8px;
        padding: 0 18px; height: 50px; border-radius: 999px;
        background: linear-gradient(160deg, #12B386, #065F46); color: #fff; text-decoration: none;
        font-weight: 700; font-size: 15px;
        box-shadow: 0 10px 24px rgba(6, 95, 70, .35);
        transition: transform .2s var(--bt-ease), box-shadow .2s;
    }
    .bt-fab i { font-size: 16px; }
    .bt-fab:active { transform: scale(.96); }
}
