/*!
Theme Name: fleamarket
Theme URI: http://underscores.me/
Author: sergey42osn
Author URI: http://underscores.me/
Description: Description
Version: 1.0.0
Tested up to: 5.4
Requires PHP: 5.6
License: GNU General Public License v2 or later
License URI: LICENSE
Text Domain: fleamarket
Tags: custom-background, custom-logo, custom-menu, featured-images, threaded-comments, translation-ready

This theme, like WordPress, is licensed under the GPL.
Use it to make something cool, have fun, and share what you've learned.

fleamarket is based on Underscores https://underscores.me/, (C) 2012-2020 Automattic, Inc.
Underscores is distributed under the terms of the GNU GPL v2 or later.

Normalizing styles have been helped along thanks to the fine work of
Nicolas Gallagher and Jonathan Neal https://necolas.github.io/normalize.css/
*/

* {
    box-sizing: border-box;
}

html {
    line-height: 1.15;
    -webkit-text-size-adjust: 100%;
}

/* Sections
	 ========================================================================== */

/**
 * Remove the margin in all browsers.
 */
body {
    margin: 0;
}

/**
 * Render the `main` element consistently in IE.
 */
main {
    display: block;
}

/**
 * Correct the font size and margin on `h1` elements within `section` and
 * `article` contexts in Chrome, Firefox, and Safari.
 */
h1 {
    font-size: 2em;
    margin: 0.67em 0;
}

h1,
h2,
h3,
h4,
h5 {
    margin: 0;
}

a {
    color: #1a5fb4;
    text-decoration: none;
}
li{
    list-style: none;
}
ul{
    margin: 0;
    padding: 0;
}
p{
    margin: 0;
}
button {
  background: transparent;
  border: none;
  cursor: pointer;
}
.fl_container {
    display: flex;
    max-width: 1280px;
    width: 100%;
    margin: 0 auto;
}

form {
    position: relative;
}

.ajax:before {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    background-color: #fff;
    opacity: 0.6;
    z-index: 999;
    cursor: wait;
}

.ajax_box {
    display: inline-flex;
    justify-content: center;
    align-items: center;
}

.ajax_error {
    color: red;
}

.ajax_success {
    color: green;
}

.form-row input.validate {
    border: 1px solid red;
}

body.hidden {
    overflow: hidden;
}

input.validate,
select.validate {
    border: 1px solid red;
}

#page {
    min-height: 100vh;
}

.wrapper_site {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    justify-content: space-between;
}

#primary {
    flex: 2;
    padding: 0 0 30px;
}

.header {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    background: white;
    padding: 16px 28px;
    border-radius: 40px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.04);
    margin-bottom: 32px;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 24px;
    font-weight: 700;
    color: #0f3b5e;
    letter-spacing: -0.3px;
}

.logo i {
    color: #2a7de1;
    font-size: 28px;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    flex: 2;
    justify-content: flex-end;
}

.btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: white;
    border: 1px solid #dce0e8;
    padding: 10px 20px;
    border-radius: 60px;
    font-weight: 500;
    font-size: 0.95rem;
    color: #1e293b;
    transition: all 0.2s;
    cursor: pointer;
    text-decoration: none;
    background: white;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.02);
}

.btn i {
    font-size: 1rem;
    color: #4b5b6c;
}

.btn-primary {
    background: #1a5fb4;
    border: 1px solid #1a5fb4;
    color: white;
    box-shadow: 0 4px 10px rgba(26, 95, 180, 0.2);
}

.fl_container_row {
    display: flex;
    width: 100%;
    flex-direction: column;
}

.auth {
    position: relative;
    display: flex;
    align-items: center;
}

/* Гость */
.auth-guest {
    display: flex;
    gap: 8px;
}

/* Авторизованный */
.auth-user {
    position: relative;
}

.auth-user-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    background: none;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    color: #333;
    transition: background 0.2s;
}

.auth-user-toggle:hover {
    background: #f5f5f5;
}

.auth-user-toggle .fa-user-circle {
    font-size: 22px;
    color: #4a90e2;
}

.auth-user-name {
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Выпадающее меню */
.auth-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    min-width: 200px;
    margin: 0;
    padding: 6px 0;
    list-style: none;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: all 0.2s ease;
    z-index: 100;
}

.auth-user.open .auth-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.auth-dropdown li a {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    color: #333;
    text-decoration: none;
    font-size: 14px;
    transition: background 0.15s;
}

.auth-dropdown li a:hover {
    background: #f5f5f5;
}

.auth-dropdown li a i {
    width: 16px;
    text-align: center;
    color: #888;
}

.auth-dropdown li:last-child {
    border-top: 1px solid #f0f0f0;
    margin-top: 4px;
    padding-top: 4px;
}

.search-section {
    background: white;
    padding: 20px 28px;
    border-radius: 40px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.03);
    margin-bottom: 32px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 14px;
}

.search-wrapper {
    flex: 2;
    min-width: 200px;
    display: flex;
    align-items: center;
    background: #f0f3f8;
    border-radius: 60px;
    padding: 0 18px;
}

.search-wrapper i {
    color: #6b7a8f;
    font-size: 1rem;
}

.search-wrapper input {
    border: none;
    background: transparent;
    padding: 14px 12px;
    width: 100%;
    font-size: 0.95rem;
    outline: none;
}

.filter-group {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 180px;
}

.filter-group select {
    background: #f0f3f8;
    border: none;
    padding: 12px 18px;
    border-radius: 60px;
    font-size: 0.9rem;
    color: #1e293b;
    outline: none;
    cursor: pointer;
    appearance: none;
    background-image: url(data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b7a8f' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E);
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 40px;
    min-width: 130px;
}

.btn-search {
    background: #1a5fb4;
    border: none;
    padding: 12px 32px;
    border-radius: 60px;
    color: white;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: 0.2s;
    box-shadow: 0 4px 10px rgba(26, 95, 180, 0.25);
    border: 1px solid #1a5fb4;
}

.categories {
    display: flex;
    flex-wrap: wrap;
    gap: 12px 18px;
    margin-bottom: 28px;
    padding: 0 8px;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 8px;
    background: white;
    padding: 8px 20px 8px 16px;
    border-radius: 60px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #1e293b;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.02);
    border: 1px solid #e9ecf2;
    transition: all 0.15s;
    cursor: default;
}

.category-item i {
    color: #2a7de1;
    font-size: 1rem;
    width: 20px;
    text-align: center;
}
.entry-content {
  margin: 30px 0 0;
}

.footer {
    margin-top: 20px;
    padding: 18px 8px 6px;
    font-size: 0.85rem;
    color: #7087a3;
    border-top: 1px solid #e4eaf2;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 12px;
    flex-direction: column;
}

.footer_top {
    display: flex;
    width: 100%;
    justify-content: space-between;
    align-items: center;
}

.footer_bottom {
    display: flex;
    width: 100%;
    justify-content: flex-end;
}

.footer a {
    color: #2a5f8e;
    text-decoration: none;
    margin: 0 8px;
}

.modal {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    z-index: -1;
    opacity: 0;
    overflow-y: auto;
}

.modal.active {
    display: flex;
    opacity: 1;
    z-index: 999;
    overflow-y: auto;
    background-color: #000000a8;
}

a.modal_overlay {
    position: absolute;
    display: flex;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    z-index: 9;
    // background-color: #000;
    opacity: 0.6;
}

.modal_wrap {
    position: absolute;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
}

.modal_con {
    position: relative;
    flex-direction: column;
    align-items: center;
    display: flex;
    z-index: 9;
    background-color: #fff;
    padding: 20px;
    margin: 50px 0;
    max-width: 800px;
    width: 100%;
}

#quickAdForm,
.AdForm {
    width: 100%;
}

.modal_close_ad_quick {
    position: absolute;
    top: 10px;
    right: 10px;
    cursor: pointer;
}

form#quickAdForm .form-grid,
.AdForm .form-grid{
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form_row label{
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#quickAdForm .form_row input,
#quickAdForm .form_row select,
.AdForm  .form_row input,
.AdForm .form_row select{
    padding: 10px 15px;
    width: 100%;
}

#fullFields {
    margin: 20px 0 0;
}

.form_row_field_box {
    position: relative;
}

#benefits {
    margin: 20px 0 0;
}

label.checkbox.checkbox_privacy {
    margin: 12px 0 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-actions {
    display: flex;
    margin: 28px 0 0;
}

span.field_required {
    color: red;
}

textarea#ad-desc {
    padding: 10px 15px;
}

.form_row_field_box {
    position: relative;
    display: flex;
    width: 100%;
}

.form_row.cat {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

#quickAdForm_ad_city_result {
    position: absolute;
    display: none;
    opacity: 0;
    z-index: -1;
    background-color: #fff;
    top: 100%;
}

#quickAdForm_ad_city_result.active {
    display: flex;
    flex-direction: column;
    opacity: 1;
    z-index: 99;
    width: 100%;
    border: 1px solid;
}

.ad_city.loading:before {
    content: "";
    position: absolute;
    display: block;
    width: 30px;
    height: 30px;
    top: 50%;
    right: 3px;
    background: url(includes/front/img/icons/Loading11.gif) center / contain no-repeat;
    transform: translateY(-50%);
}

#quickAdForm .modal-actions,
.AdForm  .modal-actions{
    position: relative;
}

#quickAdForm .modal-actions .ajax_box,
.AdForm .modal-actions .ajax_box {
    position: absolute;
    top: -18px;
    right: 0;
}

#ad-consent {
    appearance: none;
    -webkit-appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 3px;
    cursor: pointer;
    position: relative;
    border: 1px solid;
}

#ad-consent.validate {
    border: 1px solid red;
}

#ad-consent:checked {
    background: #1a5fb4;
}

#ad-consent:checked::after {
    content: "✓";
    color: #fff;
    position: absolute;
    top: -2px;
    left: 3px;
    font-size: 16px;
}


.photo-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
}

.photo-item {
    position: relative;
    width: 120px;
    height: 120px;
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.photo-item .remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.photo-item .remove-btn:hover {
    background: rgba(220, 0, 0, 0.85);
}

.photo-item .file-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 4px 6px;
    font-size: 10px;
    color: #fff;
    background: rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}




.photo-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 12px;
}

.photo-item {
    position: relative;
    width: 120px;
    height: 120px;
    border: 2px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    background: #f5f5f5;
    transition: border-color 0.2s, box-shadow 0.2s;
}

/* Главное фото выделяется рамкой */
.photo-item.is-main {
    border-color: #ff9800;
    box-shadow: 0 0 0 3px rgba(255, 152, 0, 0.25);
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Бейдж "Главное" */
.photo-item .main-badge {
    position: absolute;
    top: 4px;
    left: 4px;
    padding: 2px 8px;
    font-size: 10px;
    font-weight: 600;
    color: #fff;
    background: #ff9800;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

/* Кнопка удаления */
.photo-item .remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.photo-item .remove-btn:hover {
    background: rgba(220, 0, 0, 0.85);
}

/* Кнопка "сделать главным" */
.photo-item .star-btn {
    position: absolute;
    bottom: 4px;
    right: 4px;
    width: 28px;
    height: 28px;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.15s;
}

.photo-item .star-btn:hover {
    background: rgba(255, 152, 0, 0.9);
    transform: scale(1.1);
}

.photo-item.is-main .star-btn {
    background: #ff9800;
    cursor: default;
}

.photo-item .file-name {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 36px;
    padding: 4px 6px;
    font-size: 10px;
    color: #fff;
    background: rgba(0, 0, 0, 0.5);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.hint {
    margin: 6px 0 0;
    font-size: 12px;
    color: #888;
}
.form_rows {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.form_row {
    display: flex;
    flex-direction: column;
    gap: 5px;
}

/* Мобильная адаптация */
@media (max-width: 768px) {

    .auth-guest .btn span,
    .auth-user-name {
        display: none;
    }

    .auth-guest .btn {
        padding: 8px 10px;
    }
}