/* --- ზოგადი სტილები --- */

*,
::after,
::before {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: Roboto, Helvetica, Arial, sans-serif;
    background-color: #f8f9fa;
    color: #333;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

img {
    max-width: 100%;
    height: auto;
}

/* --- ნავიგაცია --- */

.navbar {
    display: flex;
    align-items: center;
    padding: 16px 0;
    /* ▼▼▼ [ძველი კოდი დაკომენტარებულია წესი #3-ის მიხედვით] ▼▼▼ */
    /* background: linear-gradient(90deg, #009688, #00796b); */
    /* ▼▼▼ [ახალი კოდი - შავი ფონი] ▼▼▼ */
    background: #111;
    /* შეგიძლიათ გამოიყენოთ #000 ან #222 */
    /* ▲▲▲ [ახალი კოდი - შავი ფონი] ▲▲▲ */
    position: sticky;
    top: 0;
    z-index: 1000;
}

.navbar-content-wrapper {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 32px;
}

.nav-left {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-right {
    display: flex;
    align-items: center;
    gap: 15px;
}

.nav-logo {
    color: #fff;
    font-size: 24px;
    font-weight: 700;
    display: flex;
    align-items: center;
    text-decoration: none;
}

.nav-logo img {
    height: 45px;
    margin-right: 10px;
}

.nav-link {
    font-size: 16px;
    color: #e0f2f1;
    background-color: transparent;
    font-weight: 700;
    transition: .2s ease-in-out;
    padding: 8px 18px;
    border-radius: 25px;
    text-decoration: none;
}

.nav-link.active,
.nav-link:hover {
    background-color: rgba(255, 255, 255, .1);
    color: #fff;
}

.login-button {
    padding: 10px 24px;
    background-color: #fff;
    color: #00796b;
    border-radius: 8px;
    font-size: 14px;
    border: none;
    font-weight: 700;
    transition: background-color .3s, transform .2s;
    box-shadow: 0 2px 4px rgba(0, 0, 0, .1);
    text-decoration: none;
}

.login-button:hover {
    background-color: #f1f3f4;
    transform: translateY(-1px);
    color: #00695c;
}

.mobile-menu-toggle {
    display: none;
    background: 0 0;
    border: none;
    cursor: pointer;
    padding: 5px;
}

/* --- Hero სექცია --- */

.hero-section {
    padding: 80px 20px;
    background-color: #fff;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    margin: 30px 0;
    text-align: center;
}

.hero-title {
    font-size: 48px;
    font-weight: 700;
    color: #202124;
    margin-bottom: 30px;
}

.hero-buttons {
    display: flex;
    justify-content: center;
    gap: 15px;
}

/* --- ღილაკები --- */

.btn {
    padding: 12px 32px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 700;
    transition: .3s;
    border: 2px solid transparent;
    cursor: pointer;
    text-decoration: none;
}

.btn-primary {
    background-color: #00897b;
    color: #fff;
}

.btn-primary:hover {
    background-color: #00695c;
    transform: translateY(-2px);
}

.btn-secondary {
    background-color: #fff;
    color: #00897b;
    border-color: #00897b;
}

.btn-secondary:hover {
    background-color: #e0f2f1;
    transform: translateY(-2px);
}

/* --- ჩამოსაშლელი მენიუ (Dropdown) --- */

.dropdown {
    position: relative;
    display: inline-block;
}

.profile-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    background: 0 0;
    border: none;
    cursor: pointer;
    padding: 8px 12px;
    border-radius: 25px;
    transition: background-color .2s ease-in-out;
}

.profile-btn:hover {
    background-color: rgba(255, 255, 255, .1);
}

.profile-btn img {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #00897b;
}

.profile-btn span {
    font-weight: 700;
    font-size: 14px;
    color: #fff;
}

.dropdown-menu {
    position: absolute;
    right: 0;
    top: 55px;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0, 0, 0, .1);
    display: none;
    flex-direction: column;
    min-width: 180px;
    z-index: 999;
    overflow: hidden;
}

.dropdown-menu.show {
    display: flex;
}

.dropdown-menu a {
    padding: 12px 16px;
    text-align: left;
    display: block;
    text-decoration: none;
    color: #333;
    font-weight: 500;
    transition: background-color .2s;
}

.dropdown-menu a:hover {
    background-color: #f1f3f4;
}

.dropdown-header {
    padding: 10px 16px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 13px;
    color: #5f6368;
    font-weight: 700;
}

.logout-link {
    color: #dc3545 !important;
    font-weight: 700;
}

.logout-link:hover {
    background-color: #f8d7da !important;
}

/* --- Footer --- */

.footer {
    padding: 25px;
    background-color: #fff;
    color: #5f6368;
    font-size: 14px;
    margin-top: 60px;
    text-align: center;
    border-top: 1px solid #e0e0e0;
}

/* --- ფორმის ელემენტების ფოკუსი (გამოიყენება ძებნაში) --- */
.search-input:focus,
.support-chat-form-container input[type=text]:focus,
.support-chat-form-container textarea:focus {
    border-color: #00897b;
    box-shadow: 0 0 0 3px rgba(0, 137, 123, .15);
    outline: 0;
}

/* --- ძებნა და ფილტრაცია (მხოლოდ .search-container-ის სტილი) --- */

.search-container {
    max-width: 900px;
    margin: 30px auto;
    padding: 25px;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
    background-color: #fff;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .05);
}

.filter-dropdown {
    display: none;
    position: absolute;
    top: 110%;
    right: 0;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .1);
    z-index: 100;
    min-width: 220px;
    max-height: 300px;
    overflow-y: auto;
    padding: 5px 0;
    background-color: #fff;
}

.filter-dropdown.show {
    display: block;
}

.filter-dropdown a.category-option {
    display: block;
    padding: 10px 16px;
    text-decoration: none;
    color: #333;
    font-weight: 500;
}

/* --- Support Chat --- */

.support-chat-btn {
    position: fixed;
    bottom: 25px;
    right: 25px;
    background-color: #00897b;
    color: #fff;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .2);
    z-index: 998;
    transition: background-color .3s, transform .3s;
}

.support-chat-btn:hover {
    background-color: #00695c;
    transform: scale(1.05);
}

.support-chat-popup {
    display: none;
    position: fixed;
    bottom: 100px;
    right: 25px;
    width: 350px;
    max-width: calc(100% - 40px);
    max-height: 70vh;
    background-color: #fff;
    border-radius: 12px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, .2);
    z-index: 999;
    flex-direction: column;
    overflow-y: auto;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity .3s ease-in-out, transform .3s ease-in-out;
}

.support-chat-popup.show {
    display: flex;
    opacity: 1;
    transform: translateY(0);
}

.support-chat-header {
    padding: 12px 18px;
    background-color: #00897b;
    color: #fff;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.support-chat-header h5 {
    margin: 0;
    font-size: 16px;
    font-weight: 700;
}

.support-chat-close-btn {
    background: 0 0;
    border: none;
    color: #fff;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    opacity: .8;
    transition: opacity .2s;
}

.support-chat-close-btn:hover {
    opacity: 1;
}

.support-chat-form-container {
    padding: 15px;
    display: flex;
    flex-direction: column;
}

.support-chat-form-container label {
    margin-bottom: 3px;
    font-weight: 600;
    font-size: 13px;
    color: #333;
}

.support-chat-form-container input[type=text],
.support-chat-form-container textarea {
    width: 100%;
    padding: 10px;
    font-size: 14px;
    border: 1px solid #dcdcdc;
    border-radius: 8px;
    margin-bottom: 10px;
    transition: border-color .3s, box-shadow .3s;
}

.support-chat-form-container textarea {
    min-height: 100px;
}

.support-chat-form-container .btn {
    background-color: #00897b;
    color: #fff;
    padding: 10px 15px;
    border: none;
    cursor: pointer;
    width: 100%;
    margin-top: 5px;
    font-weight: 700;
    border-radius: 8px;
    transition: background-color .2s;
}

.support-form-response {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 30px 15px;
}

.support-form-response h5 {
    color: #202124;
    font-size: 18px;
}

.support-form-response p {
    color: #5f6368;
    font-size: 14px;
    text-align: center;
    line-height: 1.5;
}

/* --- Responsive Media Queries (მხოლოდ Navbar-ისთვის და ზოგადი) --- */

@media (max-width:992px) {
    .navbar-content-wrapper {
        padding: 0 15px
    }

    .nav-left .nav-link,
    .nav-right {
        display: none
    }

    .mobile-menu-toggle {
        display: block;
        margin-left: auto
    }
}

@media (max-width:768px) {
    .container {
        padding-left: 15px;
        padding-right: 15px
    }

    .hero-section,
    .search-container {
        border-radius: 0;
        border-left: none;
        border-right: none;
        margin: 20px 0;
        padding-left: 15px;
        padding-right: 15px
    }

    .hero-title {
        font-size: 36px
    }
}

@media (max-width:480px) {
    .hero-title {
        font-size: 28px
    }

    .hero-buttons {
        flex-direction: column
    }

    .support-chat-popup {
        width: auto;
        left: 15px;
        right: 15px;
        bottom: 85px;
        max-width: none;
        max-height: 80vh
    }

    .support-chat-btn {
        right: 15px;
        bottom: 15px
    }
}

/* =================================================================
    მთავარი გვერდი: ერთიანი საძიებო პანელი
================================================================= */

/* --- ერთიანი პანელის კონტეინერი --- */
.unified-search-form {
    display: flex;
    align-items: center;
    background-color: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 50px;
    /* სრულიად მომრგვალებული ფორმა */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
    padding: 6px;
    margin-bottom: 30px;
}

/* --- საძიებო ველი --- */
.unified-search-form .search-input-wrapper {
    flex-grow: 1;
    /* იკავებს მაქსიმალურ თავისუფალ ადგილს */
    position: relative;
}

.unified-search-form .search-input {
    border: none;
    outline: none;
    width: 100%;
    height: 48px;
    padding: 0 20px 0 50px;
    background-color: transparent;
    font-size: 16px;
}

.unified-search-form .search-icon {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #aaa;
}

/* --- კატეგორიების ფილტრი --- */
.unified-search-form .filter-wrapper {
    position: relative;
    border-left: 1px solid #e0e0e0;
    /* გამყოფი ხაზი */
    padding-left: 10px;
    margin-left: 10px;
}

.unified-search-form .filter-btn {
    background-color: transparent;
    border: none;
    height: 48px;
    padding: 0 20px;
    font-size: 15px;
    font-weight: 500;
    color: #555;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.unified-search-form .filter-btn .dropdown-arrow {
    transition: transform 0.2s;
}

.unified-search-form .filter-btn.open .dropdown-arrow {
    transform: rotate(180deg);
}

.unified-search-form .filter-dropdown {
    top: 115%;
    /* პოზიციის კორექცია */
    right: auto;
    left: 0;
    width: 250px;
}


/* --- ძებნის ღილაკი --- */
.unified-search-form .search-btn {
    height: 48px;
    width: 48px;
    /* ვაკეთებთ კვადრატულს */
    border-radius: 50%;
    /* ვამრგვალებთ სრულად */
    padding: 0;
    margin-left: 6px;
    flex-shrink: 0;
    /* ხელს უშლის ღილაკის შეკუმშვას */
    background-color: #00897b;
    color: #fff;
    border: none;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background-color .2s;
    white-space: nowrap;
}

.unified-search-form .search-btn:hover {
    background-color: #00695c;
}


/* --- მობილური ადაპტაცია (ერთიანი ძებნის) --- */
@media (max-width: 768px) {
    .unified-search-form {
        flex-direction: column;
        background-color: transparent;
        border: none;
        box-shadow: none;
        padding: 0;
        gap: 12px;
        /* დაშორება ელემენტებს შორის */
    }

    .unified-search-form .search-input-wrapper,
    .unified-search-form .filter-wrapper,
    .unified-search-form .search-btn {
        width: 100%;
    }

    .unified-search-form .search-input {
        background-color: #fff;
        border: 1px solid #e0e0e0;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
        border-radius: 50px;
        /* დამატებულია მომრგვალება */
    }

    .unified-search-form .filter-wrapper {
        margin: 0;
        padding: 0;
        border: none;
    }

    .unified-search-form .filter-btn {
        width: 100%;
        justify-content: space-between;
        background-color: #fff;
        border: 1px solid #e0e0e0;
        border-radius: 50px;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
        height: 52px;
    }

    .unified-search-form .search-btn {
        width: 100%;
        border-radius: 50px;
        height: 52px;
    }
}

/* =================================================================
    კატეგორიების ინტეგრაცია (მხოლოდ Navbar-ში)
================================================================= */

/* --- კატეგორიების ჩამოსაშლელი მენიუ ნავიგაციაში --- */
.navbar .nav-item.dropdown {
    position: relative;
}

.navbar .nav-item .dropdown-menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    background-color: #ffffff;
    min-width: 220px;
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    z-index: 100;
    border-radius: 8px;
    padding: 5px 0;
    margin-top: 10px;
    /* დაშორება ნავიგაციისგან */
}

.navbar .nav-item .dropdown-menu a {
    color: #333;
    padding: 10px 20px;
    display: block;
    text-decoration: none;
    font-weight: 500;
}

.navbar .nav-item .dropdown-menu a:hover {
    background-color: #f1f3f4;
}

/* ვამატებთ ანიმაციას და ვაჩენთ მენიუს hover-ზე */
.navbar .nav-item:hover .dropdown-menu {
    display: block;
}

.navbar .nav-link .fa-chevron-down {
    font-size: 0.8em;
    margin-left: 5px;
    transition: transform 0.2s ease-in-out;
}

.navbar .nav-item:hover .nav-link .fa-chevron-down {
    transform: rotate(180deg);
}