@import url("nav.css");
@import url("footer.css");

* {
    margin: 0;
    padding: 0;
}

body {
    background-color: whitesmoke;
    font-family: Arial, Helvetica, sans-serif;
    color: #333;
}

.MAIN-content {
    background-color: whitesmoke;
}

.Products {
    flex: 1;
    max-width: 1920px; 
    display: flex;
    justify-content: top;
    flex-direction: column;
    margin: 0 auto;
}

.products {
    margin: 10px;
    border: 3px solid #3284bc;
    border-radius: 15px;
    padding: 20px;
    box-shadow: inset 0 0 10px rgba(0, 0, 0, 0.5);
}

.products-header {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.Products h2 {
    font-weight: 500;
    font-size: 48px;
    padding-left: 2%;
    color: #3284bc;
}

.pubAd {
    margin-left: auto;
    padding-right: 2%;
    text-align: right;
    font-size: 20px;
    display: flex;
    align-items: center;
    gap: 20px;
}

.pubAd a {
    padding: 10px;
    border-radius: 15px;
    text-decoration: none;
    color: white;
    background-color: #3284bc;
}

.ultility {
    display: flex;
    gap: 20px;
    background: #00000010;
    padding: 10px;
    border: #3498db 2px solid;
    border-radius: 20px;
    max-width: 1920px;
    margin: auto;
    align-items: center;
    justify-content: space-between;
}

.ultility .tools .buttons {
    justify-content: flex-start;
    gap: 10px;
    display: flex;
    align-items: center;
}

.ultility .tools .buttons .filter,
.ultility .tools .buttons .sorter {
    display: flex;
    background-color: white;
    border: #3498db 2px solid;
    border-radius: 10px;
    cursor: pointer;
    padding: 5px;
    align-items: center;
    font-size: 24px;
    gap: 10px;
    color: #333;
}

.ultility .tools .buttons .filter img,
.ultility .tools .buttons .sorter img {
    width: 30px;
    height: 30px;
}

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

.ultility .tools2 .Sort {
    display: flex;
    gap: 10px;
}

.ultility .tools2 .Sort #sort-list {
    margin-right: 5px;
}

.ultility .search-bar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    background-color: white;
    max-height: 40px;
    height: 100%;
    max-width: 500px;
    width: 100%;
    border: #3498db 2px solid;
    border-radius: 15px;
    padding: 3px 10px;
}

.ultility .search-bar input[type="text"] {
    border: none;
    font-size: 26px;
    max-height: 40px;
    outline: none;
}

.ultility .search-bar button.searchBtn {
    background-color: transparent;
    border: none;
    max-height: 35px;
    max-width: 35px;
    width: 100%;
    height: 100%;
    cursor: pointer;
}

.ultility .search-bar button.searchBtn img {
    width: 35px;
    height: 35px;
    color: #3498db;
}

.Sort {
    display: flex;
    flex-wrap: nowrap;
}

.toggleView {
    border: none;
    cursor: pointer;
    background: none;
}

.toggleView img {
    max-width: 40px;
    max-height: 40px;
    width: 100%;
    height: 100%;
}

#products-hr {
    border: none;
    height: 3px;
    background: linear-gradient(90deg, #3284bc 1%, #3498db 20%, #3498db 80%, #3284bc 99%);
    margin: 20px -20px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.5);
}

.product404 {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    width: 100%;
    height: 100%;
    min-height: 300px;
    font-size: xx-large;
    color: red;
}

/* ADVERTS CARD VIEW */
#products-list.grid-mode .product-card:hover {
    transform: translateY(-15px);
}

#products-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    padding: 20px;
    border-radius: 8px;
}

.product-card {
    background-color: #e8f4fc;
    border: 1px solid #3284bc;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 4px 14px rgba(50, 132, 188, 0.18);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.product-card:hover {
    box-shadow: 0 8px 22px rgba(50, 132, 188, 0.28);
}

.product-card .product-image {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-top-left-radius: 8px;
    border-top-right-radius: 8px;
}

.product-card .product-details {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.product-card .product-details {
    padding: 10px 15px;
}


.product-price {
    font-size: 1.5em;
    color: #2E7D32;
    font-weight: bold;
    padding-right: 0;
    padding-left: 12px;
}

.product-card h3 {
    font-size: 1em;
    color: #333;
    margin-top: 10px;
    margin-bottom: 5px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.product-card .location {
    font-size: 0.8em;
    color: #777;
    margin-bottom: 8px;
}

.product-card .price {
    font-size: 0.9em;
    color: #2E7D32;
    font-weight: bold;
    margin-bottom: 10px;
}

.product-card .other-details {
    font-size: 0.75em;
    color: #555;
    margin-bottom: 5px;
}

/* ADVERTS LIST VIEW */
#products-list.list-mode .product-card:hover {
    transform: translateY(-3px);
}

#products-list.list-mode {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding: 20px;
    border-radius: 8px;
}

.product-card.list-item {
    background-color: #e8f4fc;
    border: 1px solid #3284bc;
    border-radius: 10px;
    box-shadow: 0 4px 14px rgba(50, 132, 188, 0.18);
    padding: 10px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
    transition: background-color 0.2s ease-in-out;
    display: flex;
    flex-direction: row;
    gap: 15px;
    flex-wrap: nowrap;
}

.product-card.list-item:hover {
    background-color: #f0f0f0;
}

.product-card.list-item .product-image {
    float: left;
    width: 120px;
    height: 90px;
    object-fit: cover;
    border-radius: 4px;
    flex-shrink: 0;
    flex-grow: 0;
    min-width: 120px;
}

.product-card.list-item .product-details {
    font-size: larger;
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 0;
    min-width: 0;
}

.product-card.list-item h3 {
    flex: 1;
    font-size: 1.1em;
    color: #333;
    margin: 0 0 5px 0;
}

.product-card.list-item .location {
    flex: 1;
    font-size: 0.85em;
    color: #777;
    margin-bottom: 5px;
}

#products-list.list-mode .product-price {
    align-items: flex-end;
    display: flex;
    text-align: right;
    font-size: x-large;
    padding-bottom: 0;
}

#products-list.list-mode .product-price p {
    margin-bottom: 0;
}

.product-card.list-item .other-details {
    font-size: 0.85em;
    color: #555;
    margin-bottom: 0;
}

/* ==================== MODAL OVERLAY & STYLES ==================== */
.modal-overlay {
    display: none;
    /* Varsayılan olarak kapalı */
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.55);
    /* Arka planı karartma */
    backdrop-filter: blur(4px);
    /* Arka planı hafif bulanıklaştırma */
    z-index: 1002;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.25s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-content {
    background-color: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    border: 2px solid #3284bc;
    padding: 24px;
    width: 90%;
    max-height: 90vh;
    overflow-y: auto;
}

/* Sıralama Modalı (Küçük Yatay Dikdörtgen) */
.sort-modal-content {
    max-width: 420px;
}

/* Filtre Modalı (Geniş Çift Sütunlu Kutucuk) */
.filter-modal-content {
    max-width: 850px;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 2px solid #e8f4fc;
    padding-bottom: 12px;
    margin-bottom: 20px;
}

.modal-header h3 {
    color: #3284bc;
    margin: 0;
    font-size: 22px;
}

.close-modal {
    font-size: 28px;
    font-weight: bold;
    color: #777;
    cursor: pointer;
    transition: color 0.2s;
}

.close-modal:hover {
    color: #e74c3c;
}

/* Form içi eleman düzenleri */
.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 15px;
}

.form-group label {
    font-weight: bold;
    font-size: 14px;
    color: #444;
}

.form-row {
    display: flex;
    gap: 10px;
}

.form-row .form-group {
    flex: 1;
}

.modal-select,
.modal-content input[type="text"],
.modal-content input[type="number"] {
    width: 100%;
    padding: 10px 12px;
    border: 1.5px solid #b8d9f0;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    transition: border-color 0.2s;
    box-sizing: border-box;
}

.modal-select:focus,
.modal-content input:focus {
    border-color: #3284bc;
}

/* Çift Kolonlu Grid */
.modal-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 25px;
    margin-bottom: 20px;
}

.grid-column h4 {
    color: #3284bc;
    margin-top: 0;
    margin-bottom: 15px;
    font-size: 16px;
    border-bottom: 1px dashed #b8d9f0;
    padding-bottom: 6px;
}

.disabled-section {
    background-color: #f9f9f9;
    padding: 15px;
    border-radius: 10px;
    border: 1px dashed #ccc;
    min-height: 180px;
}

.warning-text {
    color: #888;
    font-style: italic;
    font-size: 14px;
    text-align: center;
    margin-top: 40px;
}

.modal-btn {
    width: 100%;
    background-color: #3284bc;
    color: white;
    border: none;
    padding: 12px;
    font-size: 16px;
    font-weight: bold;
    border-radius: 10px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.modal-btn:hover {
    background-color: #256896;
}

.modal-footer {
    display: flex;
    align-items: center;
    gap: 15px;
    border-top: 2px solid #e8f4fc;
    padding-top: 15px;
}

.clear-btn {
    text-decoration: none;
    color: #777;
    font-size: 14px;
    white-space: nowrap;
}

.clear-btn:hover {
    color: #e74c3c;
    text-decoration: underline;
}

/* Mobil Uyum */
@media screen and (max-width: 768px) {
    .modal-grid {
        grid-template-columns: 1fr;
    }
}

/* Pagination Stilleri */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    margin: 30px 0 10px 0;
    flex-wrap: wrap;
}

.pagination .page-btn {
    padding: 8px 14px;
    border: 2px solid #3284bc;
    border-radius: 8px;
    background-color: white;
    color: #3284bc;
    text-decoration: none;
    font-weight: bold;
    font-size: 16px;
    transition: all 0.2s ease-in-out;
}

.pagination .page-btn:hover {
    background-color: #3284bc;
    color: white;
}

.pagination .page-btn.active {
    background-color: #3284bc;
    color: white;
    cursor: default;
}

/* 990px Altı Font Küçültme */
@media screen and (max-width: 990px) {
    .pubAd {
        font-size: 14px;
        gap: 10px;
    }

    .pubAd a {
        font-size: 13px;
        padding: 6px 10px;
    }
}

@media (max-width:820px) {

    .tools .filter p,
    .tools .sorter p {
        display: none;
    }

    .search-bar {
        max-width: 300px;
    }

    .products-header {
        display: flex;
        flex-wrap: wrap;
    }

    .products-header h2 {
        justify-content: flex-start;
    }

    .products-header .pubAd a {
        text-align: center;
    }
}


@media (min-width:663px) {
    .Sort-mobile {
        display: none;
    }
}

@media (max-width:663px) {
    .Sort-mobile {
        display: flex;
        flex-wrap: nowrap;
        gap: 15px;
    }

    .ultility .tools2 .Sort {
        display: none;
    }

    .products-header .pubAd {
        background-color: #b8d9f0aa;
        border-radius: 15px;
        padding: 5px;
        flex-wrap: wrap;
        justify-content: flex-end;
    }

    .products-header .pubAd span {
        padding-right: 5px;
    }

    .tools .filter,
    .tools .sorter {
        font-size: 16px;
        padding: 3px;
        gap: 5px;
    }

    .tools .filter img,
    .tools .sorter img {
        width: 20px;
        height: 20px;
    }

    .tools .filter p,
    .tools .sorter p {
        display: block;
        font-size: 15px;
    }

    .tools img {
        width: 35px;
    }

    .ultility {
        flex-wrap: wrap;
        gap: 10px;
    }

    .ultility .tools {
        display: flex;
        width: 100%;
        justify-content: space-between;
    }

    .ultility .tools .buttons {
        display: flex;
        justify-content: flex-start;
        gap: 15px;
    }

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

    .ultility .tools2 {
        display: flex;
        align-items: center;
        gap: 10px;
        flex: 1;
        justify-content: flex-end;
    }

    .ultility .search-bar {
        display: flex;
        align-items: center;
        justify-content: space-between;
        background-color: white;
        max-height: 40px;
        height: 100%;
        max-width: 600px;
        width: 100%;
        border: #3498db 2px solid;
        border-radius: 15px;
        padding: 3px 10px;
        flex: 1;
    }

    .ultility .search-bar input[type="text"] {
        border: none;
        font-size: 18px;
        outline: none;
        flex: 1;
        width: 100%;
        min-width: 0;
        background: transparent;
    }

    .ultility .search-bar button.searchBtn {
        background-color: transparent;
        border: none;
        width: 35px;
        height: 35px;
        flex-shrink: 0;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
    }

    #products-list,
    #products-list.list-mode {
        padding: 0px;
        gap: 10px;
    }

    /* --- GRID / KART GÖRÜNÜMÜ --- */
    /* Ekran genişliğine göre yan yana 2 kart sığacak şekilde grid sütunlarını küçültüyoruz */
    #products-list {
        grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    }

    /* Kart İçi Detaylar & Fontlar */
    .product-card .product-image {
        height: 110px;
        /* Görsel yüksekliği azaltıldı */
    }

    .product-card .product-details {
        padding: 8px;
    }

    .product-card h3 {
        font-size: 0.85em;
        margin-top: 2px;
        margin-bottom: 3px;
    }

    .product-card .location {
        font-size: 0.7em;
        margin-bottom: 4px;
    }

    .product-card .other-details {
        font-size: 0.65em;
        margin-bottom: 2px;
    }

    .product-price {
        padding-left: 8px;
        padding-right: 8px;
    }

    .product-price .price {
        font-size: 0.9em;
        margin-bottom: 6px;
    }


    /* --- LIST / LİSTE GÖRÜNÜMÜ --- */
    .product-card.list-item {
        padding: 8px;
        gap: 10px;
    }

    .product-card.list-item .product-image {
        width: 90px;
        height: 70px;
        min-width: 90px;
    }

    .product-card.list-item h3 {
        font-size: 0.9em;
    }

    .product-card.list-item .location,
    .product-card.list-item .other-details {
        font-size: 0.75em;
    }

    #products-list.list-mode .product-price {
        font-size: medium;
    }
}

@media (max-width:400px) {
    .tools img {
        width: 30px;
    }
}