/* Gilroy Font Face if not imported */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;500;600;700;800&display=swap');

/* ГЛОБАЛЬНЫЕ СТИЛИ И СБРОСЫ */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Outfit', 'Gilroy', Arial, sans-serif;
    background-color: #F8FAFF;
    color: #252729;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

a {
    text-decoration: none;
    color: inherit;
}

/* HTMX ссылки-обертки */
a[hx-boost="true"] {
    display: block;
    text-decoration: none;
    color: inherit;
}

/* --- ШАПКА (navbar) --- */
.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 20px 30px; /* Вернули солидную высоту шапки */
    background-color: #ffffff;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.03);
    max-width: 950px;
    width: 100%;
    margin: 0 auto 30px auto; /* Вернули отступ снизу */
    border-radius: 0 0 20px 20px;
    gap: 25px; /* Сбалансированный горизонтальный отступ */
}

.navbar-logo {
    display: flex;
    align-items: center;
    flex-shrink: 0; /* Предотвращаем сжатие логотипа */
}

.navbar-logo img {
    height: 46px;
    width: auto;
}

.searchf {
    display: flex;
    flex-grow: 1;
    max-width: none; /* Разрешаем поиску занять ВСЁ свободное пространство по центру */
}

#search_text {
    background-color: #E7EDF8;
    width: 100%;
    height: 46px;
    border-radius: 12px;
    border: 1px solid transparent;
    padding: 0 20px;
    font-size: 16px;
    outline: none;
    transition: border 0.3s ease;
}

#search_text:focus {
    border: 1px solid #60A5FA;
}

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

.navbar-right img {
    height: 46px;
    cursor: pointer;
    transition: transform 0.2s ease;
}

.navbar-right img:hover {
    transform: scale(1.05);
}

/* Поиск и индикаторы */
#search_load {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #60A5FA;
    font-weight: 500;
    padding: 10px;
}

.res_search {
    max-width: 950px;
    width: 100%;
    margin: 0 auto 20px auto;
    padding: 0 20px;
}

.block_content {
    max-width: 950px;
    width: 100%;
    margin: 0 auto;
    flex: 1;
}

/* Флеш сообщения */
.flash {
    max-width: 950px;
    width: 100%;
    margin: 0 auto 20px auto;
    padding: 15px 20px;
    border-radius: 12px;
    font-weight: 500;
}

.flash.error {
    background-color: #FED7D7;
    color: #C53030;
    border-left: 5px solid #E53E3E;
}

.flash.success {
    background-color: #C6F6D5;
    color: #276749;
    border-left: 5px solid #38A169;
}

/* --- РЕКЛАМНЫЙ БЛОК --- */
.blockAdvertise {
    background: linear-gradient(135deg, #E7EDF8, #EFF2F7);
    padding: 30px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 950px;
    width: 100%;
    margin: 0 auto 30px auto;
}

.blockAdvertise p {
    font-style: italic;
    font-weight: 500;
    font-size: 28px;
    color: #4A5568;
}

/* --- КАТЕГОРИИ --- */
.mainCategory {
    max-width: 950px;
    width: 100%;
    margin: 0 auto 40px auto;
    padding: 0 20px;
}

.CategoryText h1 {
    font-family: 'Outfit', sans-serif;
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: center;
}

.category {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
}

.category a {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 85px;
    height: 85px;
    background-color: #ffffff;
    border-radius: 18px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    gap: 5px;
}

.category a:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(96, 165, 250, 0.2);
}

.category img {
    width: 35px;
    height: 35px;
}

.cat-name {
    font-size: 11px;
    font-weight: 600;
    color: #718096;
}

/* --- КАРТОЧКИ ТОВАРОВ (GRID) --- */
.containerCards {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 20px;
    max-width: 950px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px 40px 20px;
}

/* BEM КАРТОЧКИ */
.seller-card-link {
    text-decoration: none;
    color: inherit;
    display: block;
    height: 100%;
}

.seller-card,
.card-item {
    position: relative;
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
    padding: 16px;
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    cursor: pointer;
    height: 100%;
    width: 100%;
    box-sizing: border-box;
}

.seller-card:hover,
.card-item:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(96, 165, 250, 0.12);
}

.seller-card__image,
.card-item__image {
    margin: -16px -16px 12px -16px;
    border-radius: 16px 16px 0 0;
    overflow: hidden;
    display: block;
    height: 130px;
    background-color: #F7FAFC;
    flex-shrink: 0;
}

.seller-card__img,
.card-item__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
    display: block;
}

.seller-card:hover .seller-card__img,
.card-item:hover .card-item__img {
    transform: scale(1.03);
}

.seller-card__title,
.card-item__title {
    margin-bottom: 8px;
    flex-shrink: 0;
}

.seller-card__title h3,
.card-item__title h3 {
    font-size: 15px;
    font-weight: 600;
    color: #1A202C;
    line-height: 1.4;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.seller-card__count,
.card-item__count {
    background-color: #F7FAFC;
    border-radius: 6px;
    padding: 3px 8px;
    margin-bottom: 10px;
    width: fit-content;
    flex-shrink: 0;
}

.seller-card__count p,
.card-item__count p {
    font-size: 11px;
    font-weight: 500;
    color: #718096;
    margin: 0;
}

.seller-card__price,
.card-item__price {
    margin-bottom: 12px;
    flex-shrink: 0;
}

.seller-card__price p,
.card-item__price p {
    font-size: 20px;
    font-weight: 700;
    color: #60A5FA;
    margin: 0;
}

.seller-card__actions,
.card-item__actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: auto;
    flex-shrink: 0;
}

.seller-card__edit-btn {
    background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 0;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    flex: 1;
    text-align: center;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.2);
}

.seller-card__edit-btn:hover {
    background: linear-gradient(135deg, #D97706 0%, #B45309 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(245, 158, 11, 0.3);
}

.card-item__cart-btn {
    background: none;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6px;
    border-radius: 10px;
    transition: background-color 0.2s ease;
    flex-shrink: 0;
}

.card-item__cart-btn:hover {
    background-color: #F7FAFC;
}

.card-item__cart-icon {
    width: 32px;
    height: 32px;
    display: block;
}

.card-item__buy-btn {
    background-color: #60A5FA;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 0;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    flex: 1;
    text-align: center;
}

.card-item__buy-btn:hover {
    background-color: #3B82F6;
}

.seller-card__sold,
.card-item__sold {
    position: absolute;
    top: 12px;
    left: 12px;
    background: linear-gradient(135deg, #EF4444, #DC2626);
    color: white;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    border-radius: 20px;
    z-index: 10;
    pointer-events: none;
}

/* --- ФУТЕР (FOOTER) --- */
.footer {
    background-color: #252729;
    margin-top: auto;
    padding: 40px 20px;
    width: 100%;
}

.contentFooter {
    display: flex;
    justify-content: space-between;
    flex-wrap: wrap;
    max-width: 950px;
    width: 100%;
    margin: 0 auto;
    gap: 30px;
}

.sellerFooter p, .aboutProject p {
    color: #3ABCFF;
    font-family: "Outfit", sans-serif;
    font-weight: 600;
    font-size: 18px;
    margin-bottom: 15px;
}

.sellerFooter a, .aboutProject a {
    display: block;
    color: #A0AEC0;
    text-decoration: none;
    margin-bottom: 8px;
    font-size: 14px;
    transition: color 0.2s ease;
}

.sellerFooter a:hover, .aboutProject a:hover {
    color: #ffffff;
}

/* --- СТИЛИ ДЛЯ ГЛАВНОЙ СТРАНИЦЫ (index.html) --- */
.index-categories {
    max-width: 950px;
    width: 100%;
    margin: 0 auto 40px auto;
    padding: 0 20px;
}

.index-categories-header {
    text-align: center;
    margin-bottom: 30px;
}

.index-categories-title {
    font-family: 'Outfit', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: #1A202C;
    position: relative;
    display: inline-block;
    padding-bottom: 15px;
    margin: 0;
}

.index-categories-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(135deg, #60A5FA, #3B82F6);
    border-radius: 2px;
}

.index-categories-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 20px;
}

.index-category-item {
    display: flex;
    align-items: center;
    justify-content: center;
}

.index-category-link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background-color: #ffffff;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    text-decoration: none;
}

.index-category-link:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px rgba(96, 165, 250, 0.25);
    background-color: #f8fafc;
}

.index-category-icon {
    width: 45px;
    height: 45px;
    object-fit: contain;
    transition: transform 0.2s ease;
}

.index-category-link:hover .index-category-icon {
    transform: scale(1.05);
}

.index-category-item--all .index-category-link {
    background: linear-gradient(135deg, #60A5FA, #3B82F6);
}

.index-category-item--all .index-category-icon {
    filter: brightness(0) invert(1);
}

.index-category-item--all .index-category-link:hover {
    background: linear-gradient(135deg, #3B82F6, #2563EB);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.4);
}

/* --- СВЕЖИЕ ПРЕДЛОЖЕНИЯ НА ГЛАВНОЙ --- */
.index-popular {
    max-width: 950px;
    width: 100%;
    margin: 40px auto 40px auto;
    padding: 0 20px;
}

.index-popular-header {
    text-align: center;
    margin-bottom: 30px;
}

.index-popular-title {
    font-family: 'Outfit', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: #1A202C;
    position: relative;
    display: inline-block;
    padding-bottom: 15px;
    margin: 0 0 8px 0;
}

.index-popular-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(135deg, #60A5FA, #3B82F6);
    border-radius: 2px;
}

.index-popular-subtitle {
    font-size: 15px;
    color: #718096;
    margin-top: 5px;
    font-weight: 500;
}

.index-no-items {
    text-align: center;
    padding: 40px 20px;
    background-color: #ffffff;
    border-radius: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    color: #718096;
    font-weight: 500;
    grid-column: 1 / -1;
    width: 100%;
}

/* --- СТИЛИ ДЛЯ ПРОФИЛЯ (profile.html) --- */
.profile-container {
    max-width: 950px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
}

.profile-greeting {
    font-size: 32px;
    font-weight: 700;
    color: #1A202C;
    margin-top: 0;
    margin-bottom: 10px;
    text-align: center;
}

.profile-balance {
    font-size: 24px;
    font-weight: 600;
    color: #60A5FA;
    text-align: center;
    margin-bottom: 30px;
    padding: 20px;
    background: linear-gradient(135deg, #F0F7FF 0%, #F8FAFF 100%);
    border-radius: 20px;
    display: block;
    width: fit-content;
    margin-left: auto;
    margin-right: auto;
}

.profile-message {
    max-width: 600px;
    margin: 0 auto 20px auto;
    text-align: center;
}

.profile-actions-wrapper {
    display: flex;
    justify-content: center;
    gap: 15px;
    flex-wrap: wrap;
    margin-bottom: 50px;
}

.profile-btn {
    background: linear-gradient(135deg, #60A5FA 0%, #3B82F6 100%);
    color: white;
    border: none;
    border-radius: 50px;
    padding: 16px 36px;
    font-weight: 700;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.25);
    display: inline-block;
    text-align: center;
}

.profile-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(59, 130, 246, 0.35);
}

.profile-btn--secondary {
    background: linear-gradient(135deg, #A0AEC0 0%, #718096 100%);
    box-shadow: 0 4px 15px rgba(113, 128, 150, 0.25);
}

.profile-btn--secondary:hover {
    box-shadow: 0 8px 25px rgba(113, 128, 150, 0.35);
}

.profile-btn--danger {
    background: linear-gradient(135deg, #EF4444 0%, #DC2626 100%);
    box-shadow: 0 4px 15px rgba(239, 68, 68, 0.25);
}

.profile-btn--danger:hover {
    box-shadow: 0 8px 25px rgba(239, 68, 68, 0.35);
}

.profile-items-section {
    margin-top: 30px;
}

.profile-section-title {
    font-size: 24px;
    font-weight: 700;
    color: #1A202C;
    margin-top: 40px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 3px solid #60A5FA;
    display: inline-block;
}

.profile-items-section .profile-section-title:first-of-type {
    margin-top: 0;
}

.profile-items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

.profile-empty-message {
    text-align: center;
    font-size: 18px;
    font-weight: 500;
    color: #A0AEC0;
    padding: 60px 20px;
    background: #ffffff;
    border-radius: 16px;
    grid-column: 1 / -1;
    margin: 0;
    border: 1px dashed #E2E8F0;
}

/* --- СТИЛИ ДЛЯ СТРАНИЦЫ ТОВАРА (product.html) --- */
.product-detail-wrapper {
    max-width: 950px;
    width: 100%;
    margin: 0 auto 50px auto;
    padding: 0 20px;
}

.product-breadcrumbs {
    margin-bottom: 30px;
}

.product-breadcrumbs a {
    color: #60A5FA;
    font-size: 14px;
    text-decoration: none;
    transition: color 0.2s ease;
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

.product-breadcrumbs a:hover {
    color: #3B82F6;
    text-decoration: underline;
}

.product-card-full {
    display: flex;
    flex-wrap: wrap;
    gap: 50px;
    background: #ffffff;
    padding: 40px;
    border-radius: 24px;
    box-shadow: 0 8px 30px rgba(0, 70, 185, 0.08);
    margin-bottom: 40px;
}

.product-purchase-info {
    flex: 1.2;
    min-width: 280px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.product-title {
    font-size: 32px;
    font-weight: 700;
    color: #1A202C;
    line-height: 1.3;
    margin: 0;
    padding-bottom: 10px;
    border-bottom: 3px solid #60A5FA;
    display: inline-block;
    width: fit-content;
}

.product-price-block {
    background: linear-gradient(135deg, #F0F7FF 0%, #F8FAFF 100%);
    padding: 24px;
    border-radius: 20px;
    margin: 5px 0;
}

.product-price-value {
    font-size: 44px;
    font-weight: 800;
    color: #60A5FA;
    display: block;
}

.product-availability {
    background: #F0FFF4;
    padding: 16px 20px;
    border-radius: 16px;
    border-left: 4px solid #38A169;
}

.product-availability p {
    font-size: 16px;
    color: #2F855A;
    font-weight: 500;
    margin: 0;
}

.product-availability strong {
    color: #38A169;
    font-weight: 700;
    font-size: 18px;
}

.product-buy-btn {
    background-color: #60A5FA;
    color: white;
    border: none;
    border-radius: 16px;
    padding: 18px 28px;
    font-weight: 700;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s ease;
    width: 100%;
    margin-top: 10px;
    text-align: center;
    box-shadow: 0 4px 12px rgba(96, 165, 250, 0.3);
}

.product-buy-btn:hover {
    background-color: #3B82F6;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4);
}

.product-buy-btn:active {
    transform: translateY(0);
}

.product-status {
    padding: 16px 20px;
    border-radius: 16px;
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    width: 100%;
    margin-top: 10px;
}

.product-status-pending {
    background-color: #FFFDF5;
    color: #D69E2E;
    border-left: 4px solid #D69E2E;
}

.product-status-sold {
    background-color: #FFF5F5;
    color: #E53E3E;
    border-left: 4px solid #E53E3E;
}

.product-gallery {
    flex: 0.8;
    min-width: 250px;
    display: flex;
    justify-content: center;
    align-items: center;
    background: #F7FAFC;
    border-radius: 20px;
    padding: 30px;
}

.product-main-img {
    width: 100%;
    max-width: 320px;
    height: auto;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.product-main-img:hover {
    transform: scale(1.02);
}

.product-description-section {
    background: #F8FAFF;
    border-radius: 24px;
    padding: 30px 40px;
    margin-top: 20px;
}

.product-description-title {
    font-size: 20px;
    font-weight: 700;
    color: #1A202C;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 2px solid #E2E8F0;
}

.product-description-text {
    font-size: 16px;
    line-height: 1.7;
    color: #4A5568;
    margin: 0;
}

/* --- СТИЛИ ДЛЯ СПИСКА ТОВАРОВ (item_list.html) --- */
.itemlist-container {
    max-width: 950px;
    width: 100%;
    margin: 0 auto;
    padding: 0 20px;
}

.itemlist-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.itemlist-empty {
    text-align: center;
    font-size: 20px;
    font-weight: 500;
    color: #A0AEC0;
    padding: 50px 20px;
    background: #ffffff;
    border-radius: 16px;
    grid-column: 1 / -1;
    border: 1px dashed #E2E8F0;
}

/* --- СТИЛИ ДЛЯ ФОРМЫ ДОБАВЛЕНИЯ (form_add.html) --- */
.form-add-page {
    max-width: 600px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
}

.form-add-page__title {
    font-size: 24px;
    font-weight: 700;
    color: #1A202C;
    text-align: center;
    margin-bottom: 30px;
    padding: 15px;
    background: linear-gradient(135deg, #F0F7FF 0%, #F8FAFF 100%);
    border-radius: 16px;
}

.form-add-page__form {
    background: #ffffff;
    border-radius: 24px;
    padding: 30px;
    box-shadow: 0 8px 25px rgba(0, 70, 185, 0.06);
}

.form-add-page__image-container {
    text-align: center;
    background: #F7FAFC;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 20px;
    border: 2px dashed #E2E8F0;
}

.form-add-page__file-input {
    background-color: #E7EDF8;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    padding: 12px;
    font-size: 14px;
    cursor: pointer;
    width: 100%;
    max-width: 300px;
}

.form-add-page__file-input:hover {
    border-color: #60A5FA;
}

.form-add-page__supported-formats,
.form-add-page__max-size {
    font-size: 12px;
    color: #A0AEC0;
    margin: 5px 0;
}

.form-add-page__hr {
    border: none;
    height: 1px;
    background: #E2E8F0;
    margin: 25px 0;
}

.form-add-page__label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #4A5568;
    margin-bottom: 18px;
}

.form-add-page__input {
    width: 100%;
    padding: 12px 16px;
    margin-top: 8px;
    font-size: 15px;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    transition: all 0.3s ease;
    outline: none;
    box-sizing: border-box;
    background-color: #F8FAFF;
}

.form-add-page__input:focus {
    border-color: #60A5FA;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
}

.form-add-page__textarea {
    width: 100%;
    padding: 12px 16px;
    margin-top: 8px;
    font-size: 15px;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    transition: all 0.3s ease;
    outline: none;
    font-family: inherit;
    resize: vertical;
    box-sizing: border-box;
    background-color: #F8FAFF;
}

.form-add-page__textarea:focus {
    border-color: #60A5FA;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.1);
}

.form-add-page__submit {
    width: 100%;
    background: linear-gradient(135deg, #60A5FA 0%, #3B82F6 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
    box-shadow: 0 4px 12px rgba(96, 165, 250, 0.25);
}

.form-add-page__submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.35);
}

.form-add-page__submit:active {
    transform: translateY(0);
}

.form-add-message {
    max-width: 600px;
    margin: 0 auto 20px auto;
    text-align: center;
}

/* --- СТИЛИ ДЛЯ ВЫБОРА КАТЕГОРИИ (category_choose_to_add.html) --- */
.choose-category-page {
    max-width: 950px;
    width: 100%;
    margin: 0 auto;
    padding: 20px 20px 40px;
}

.choose-category-page__header {
    text-align: center;
    margin-bottom: 40px;
}

.choose-category-page__title {
    font-size: 28px;
    font-weight: 700;
    color: #1A202C;
    position: relative;
    display: inline-block;
    padding-bottom: 15px;
    margin: 0;
}

.choose-category-page__title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background: linear-gradient(135deg, #60A5FA, #3B82F6);
    border-radius: 2px;
}

.choose-category-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 25px;
    max-width: 100%;
    margin: 0 auto;
}

.choose-category-grid__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
    border-radius: 20px;
    padding: 30px 15px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    cursor: pointer;
    border: 1px solid rgba(226, 232, 240, 0.5);
}

.choose-category-grid__item:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 25px rgba(96, 165, 250, 0.15);
    background: linear-gradient(135deg, #ffffff 0%, #F8FAFF 100%);
    border-color: rgba(96, 165, 250, 0.3);
}

.choose-category-grid__link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    width: 100%;
    gap: 15px;
}

.choose-category-grid__icon {
    width: 70px;
    height: 70px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.choose-category-grid__item:hover .choose-category-grid__icon {
    transform: scale(1.08);
}

.choose-category-grid__name {
    font-size: 16px;
    font-weight: 600;
    color: #4A5568;
    text-align: center;
    transition: color 0.3s ease;
    word-break: break-word;
    display: block;
}

.choose-category-grid__item:hover .choose-category-grid__name {
    color: #60A5FA;
}

.choose-category-grid__empty {
    text-align: center;
    font-size: 18px;
    font-weight: 500;
    color: #A0AEC0;
    padding: 60px 20px;
    background: #ffffff;
    border-radius: 16px;
    grid-column: 1 / -1;
    border: 1px dashed #E2E8F0;
}

/* --- СТИЛИ ДЛЯ ЛОГИНА И РЕГИСТРАЦИИ (login.html, register.html) --- */
.login-page-container {
    max-width: 450px;
    width: 100%;
    margin: 40px auto;
    padding: 0 20px;
}

.login-card {
    background: #ffffff;
    border-radius: 24px;
    padding: 40px 30px;
    box-shadow: 0 8px 30px rgba(0, 70, 185, 0.06);
    border: 1px solid rgba(226, 232, 240, 0.8);
}

.login-card h2 {
    font-size: 28px;
    font-weight: 700;
    color: #1A202C;
    margin-bottom: 24px;
    text-align: center;
    position: relative;
    padding-bottom: 12px;
}

.login-card h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 40px;
    height: 4px;
    background: linear-gradient(135deg, #60A5FA, #3B82F6);
    border-radius: 2px;
}

.login-card label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #4A5568;
    margin-bottom: 8px;
    margin-top: 16px;
}

.login-card input {
    width: 100%;
    padding: 12px 16px;
    font-size: 15px;
    border: 1px solid #E2E8F0;
    border-radius: 12px;
    transition: all 0.3s ease;
    outline: none;
    background-color: #F8FAFF;
}

.login-card input:focus {
    border-color: #60A5FA;
    background-color: #ffffff;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.15);
}

.login-card button {
    width: 100%;
    background: linear-gradient(135deg, #60A5FA 0%, #3B82F6 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 14px 20px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 24px;
    box-shadow: 0 4px 12px rgba(96, 165, 250, 0.25);
}

.login-card button:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(59, 130, 246, 0.35);
}

.login-card button:active {
    transform: translateY(0);
}

.login-link-container {
    text-align: center;
    margin-top: 20px;
}

.login-link-container a {
    color: #3B82F6;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
}

.login-link-container a:hover {
    color: #2563EB;
    text-decoration: underline;
}

/* --- СТИЛИ ДЛЯ ИСТОРИИ ЗАКАЗОВ (orders_history.html, order_detail.html) --- */
.orders-container {
    max-width: 950px;
    width: 100%;
    margin: 0 auto 50px auto;
    padding: 0 20px;
}

.orders-title {
    font-size: 24px;
    font-weight: 700;
    color: #1A202C;
    margin-top: 40px;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 3px solid #60A5FA;
    display: inline-block;
}

.order-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.order-card {
    background: #ffffff;
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(226, 232, 240, 0.8);
    display: flex;
    flex-direction: column;
    gap: 10px;
    position: relative;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.order-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(96, 165, 250, 0.12);
}

.order-card__header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-bottom: 1px solid #E2E8F0;
    padding-bottom: 8px;
}

.order-card__id {
    font-weight: 700;
    color: #4A5568;
    font-size: 14px;
}

.order-card__date {
    color: #A0AEC0;
    font-size: 12px;
}

.order-card__item-name {
    font-size: 16px;
    font-weight: 600;
    color: #1A202C;
    margin-top: 4px;
}

.order-card__price {
    font-size: 18px;
    font-weight: 700;
    color: #60A5FA;
}

.order-card__status-badge {
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    width: fit-content;
}

.order-card__status-badge--paid {
    background-color: #F0FFF4;
    color: #38A169;
    border: 1px solid #C6F6D5;
}

.order-card__status-badge--pending {
    background-color: #FFFDF5;
    color: #D69E2E;
    border: 1px solid #FEFCBF;
}

.order-card__status-badge--canceled {
    background-color: #FFF5F5;
    color: #E53E3E;
    border: 1px solid #FED7D7;
}

.order-card__view-btn {
    background: linear-gradient(135deg, #60A5FA 0%, #3B82F6 100%);
    color: white;
    border: none;
    border-radius: 8px;
    padding: 8px 16px;
    font-weight: 600;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s ease;
    text-align: center;
    margin-top: auto;
    display: block;
    text-decoration: none;
}

.order-card__view-btn:hover {
    background: linear-gradient(135deg, #3B82F6 0%, #2563EB 100%);
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.2);
}

.order-empty-message {
    font-size: 16px;
    color: #A0AEC0;
    font-weight: 500;
    background: #ffffff;
    border-radius: 16px;
    padding: 30px;
    text-align: center;
    grid-column: 1 / -1;
    border: 1px dashed #E2E8F0;
}

/* Стили для деталей заказа */
.order-detail-card {
    background: #ffffff;
    border-radius: 24px;
    padding: 40px;
    box-shadow: 0 8px 30px rgba(0, 70, 185, 0.06);
    border: 1px solid rgba(226, 232, 240, 0.8);
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 600px;
    margin: 40px auto;
}

.order-detail-card__header {
    border-bottom: 2px solid #E2E8F0;
    padding-bottom: 15px;
    margin-bottom: 10px;
}

.order-detail-card__title {
    font-size: 24px;
    font-weight: 700;
    color: #1A202C;
}

.order-detail-card__row {
    display: flex;
    justify-content: space-between;
    font-size: 16px;
    border-bottom: 1px solid #F7FAFC;
    padding-bottom: 8px;
    align-items: center;
}

.order-detail-card__label {
    color: #718096;
    font-weight: 500;
}

.order-detail-card__value {
    color: #1A202C;
    font-weight: 600;
}

.order-detail-card__value--price {
    color: #60A5FA;
    font-size: 18px;
    font-weight: 700;
}

.order-detail-card__secret-section {
    background: linear-gradient(135deg, #F0F7FF 0%, #F8FAFF 100%);
    border-radius: 16px;
    padding: 24px;
    border: 1px solid #E6F0FF;
    margin-top: 10px;
}

.order-detail-card__secret-title {
    font-size: 16px;
    font-weight: 700;
    color: #2B6CB0;
    margin-bottom: 10px;
}

.order-detail-card__secret-data {
    font-family: 'Courier New', Courier, monospace;
    font-size: 15px;
    color: #2D3748;
    background: #ffffff;
    padding: 15px;
    border-radius: 8px;
    border: 1px solid #E2E8F0;
    word-break: break-all;
    white-space: pre-wrap;
}

.order-detail-card__secret-unauth {
    font-size: 14px;
    color: #E53E3E;
    font-weight: 500;
    background: #FFF5F5;
    padding: 12px 16px;
    border-radius: 8px;
    border-left: 4px solid #E53E3E;
}

/* --- АДАПТИВНОСТЬ --- */
@media (max-width: 950px) {
    .navbar,
    .index-categories,
    .profile-container,
    .product-detail-wrapper,
    .itemlist-container,
    .choose-category-page,
    .contentFooter,
    .res_search,
    .flash,
    .blockAdvertise {
        width: 95%;
    }
}

@media (max-width: 768px) {
    /* Шапка ужимается */
    .navbar {
        width: 100% !important;
        max-width: 100% !important;
        padding: 15px 20px;
        flex-wrap: wrap;
        border-radius: 0;
        margin: 0 0 20px 0;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.02);
        border-bottom: 1px solid #E2E8F0;
    }

    .navbar-logo {
        gap: 10px;
        flex: 0 1 auto;
        max-width: 50%;
    }

    .navbar-logo img {
        height: 32px;
        max-width: 100%;
        object-fit: contain;
        display: block;
    }

    .navbar-right {
        display: flex !important;
        flex-direction: row !important;
        flex-wrap: nowrap !important;
        align-items: center;
        justify-content: flex-end;
        gap: 10px;
        flex: 0 1 auto;
        max-width: 45%;
    }

    .navbar-right img {
        height: 32px;
        width: auto;
        display: block;
    }

    .searchf {
        order: 3;
        width: 100%;
        max-width: 100%;
        margin-top: 12px;
        flex: 1 1 100%;
    }

    #search_text {
        height: 40px;
        font-size: 14px;
        padding: 0 15px;
        border-radius: 10px;
    }

    /* Рекламный блок на мобилке */
    .blockAdvertise {
        padding: 20px 15px;
    }

    .blockAdvertise p {
        font-size: 20px;
        text-align: center;
    }

    /* Сетки */
    .containerCards,
    .profile-items-grid,
    .itemlist-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        padding: 0 10px 30px 10px;
    }

    .choose-category-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }

    .choose-category-grid__item {
        padding: 20px 12px;
    }

    .choose-category-grid__icon {
        width: 55px;
        height: 55px;
    }

    .choose-category-grid__name {
        font-size: 14px;
    }

    /* Профиль */
    .profile-greeting {
        font-size: 24px;
    }

    .profile-balance {
        font-size: 20px;
        padding: 15px;
    }

    .profile-btn {
        padding: 14px 32px;
        font-size: 15px;
    }

    .profile-section-title {
        font-size: 20px;
        margin-top: 30px;
    }

    /* Товар */
    .product-card-full {
        padding: 24px;
        gap: 30px;
    }

    .product-title {
        font-size: 24px;
    }

    .product-price-value {
        font-size: 34px;
    }

    .product-availability {
        padding: 12px 16px;
    }

    .product-gallery {
        padding: 20px;
    }

    .product-main-img {
        max-width: 280px;
    }

    .product-description-section {
        padding: 20px 24px;
    }

    /* Формы */
    .form-add-page__form {
        padding: 20px;
    }

    .login-card {
        padding: 30px 20px;
    }

    /* Футер */
    .contentFooter {
        flex-direction: column;
        gap: 20px;
        text-align: center;
    }
}

@media (max-width: 550px) {
    .containerCards,
    .profile-items-grid,
    .itemlist-grid {
        grid-template-columns: 1fr;
    }

    .choose-category-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}
