/* Стили для веб-приложения Boho Auto Parts */

/* Сброс стандартных стилей и установка базовых параметров */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

/* Основной фон приложения в стиле бохо */
body {
    background: linear-gradient(135deg, #2c1810 0%, #8b4513 50%, #d2b48c 100%);
    color: #f5f5dc;
    min-height: 100vh;
    padding-bottom: 80px;
}

/* Контейнер приложения с фиксированной максимальной шириной */
.app-container {
    max-width: 500px;
    margin: 0 auto;
    min-height: 100vh;
    position: relative;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    background: rgba(44, 24, 16, 0.9);
}

/* Стили для шапки приложения */
.header {
    background: linear-gradient(to right, #8b4513, #a0522d);
    padding: 15px 20px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    position: sticky;
    top: 0;
    z-index: 100;
}

.header h1 {
    font-size: 1.5rem;
    font-weight: 600;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
}

/* Стили для основной области контента */
.content {
    padding: 20px;
    min-height: calc(100vh - 140px);
}

/* Стили для страниц */
.page {
    display: none;
}

.page.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

/* Анимация появления страниц */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Стили для приветственной секции */
.welcome-section {
    text-align: center;
    margin-bottom: 30px;
}

.welcome-section h2 {
    font-size: 1.8rem;
    margin-bottom: 10px;
    color: #ffd700;
}

.welcome-section p {
    font-size: 1rem;
    line-height: 1.6;
    opacity: 0.9;
}

/* Сетка с функциями приложения */
.features-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 20px;
}

/* Карточки функций */
.feature-card {
    background: rgba(139, 69, 19, 0.3);
    border-radius: 15px;
    padding: 20px;
    text-align: center;
    backdrop-filter: blur(10px);
    border: 1px solid rgba(210, 180, 140, 0.3);
    transition: transform 0.3s ease;
}

.feature-card:hover {
    transform: translateY(-5px);
    background: rgba(139, 69, 19, 0.5);
}

.feature-card i {
    font-size: 2rem;
    margin-bottom: 10px;
    color: #ffd700;
}

/* Секция поиска запчастей */
.search-section {
    background: rgba(139, 69, 19, 0.3);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
}

.search-section h3 {
    margin-bottom: 15px;
    color: #ffd700;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
}

.form-group input, .form-group select {
    width: 100%;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #d2b48c;
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Стили для кнопок */
.btn {
    background: linear-gradient(to right, #8b4513, #a0522d);
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 10px;
    cursor: pointer;
    font-weight: 600;
    width: 100%;
    transition: all 0.3s ease;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

/* Список запчастей */
.parts-list {
    margin-top: 20px;
}

.part-item {
    background: rgba(139, 69, 19, 0.3);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    backdrop-filter: blur(5px);
}

.part-info h4 {
    color: #ffd700;
    margin-bottom: 5px;
}

.part-price {
    font-weight: bold;
    font-size: 1.2rem;
    color: #90ee90;
}

/* Чат-контейнер */
.chat-container {
    background: rgba(139, 69, 19, 0.3);
    border-radius: 15px;
    padding: 20px;
    height: 400px;
    overflow-y: auto;
    margin-bottom: 15px;
}

.message {
    margin-bottom: 15px;
    max-width: 80%;
}

.user-message {
    background: #8b4513;
    padding: 10px 15px;
    border-radius: 15px;
    margin-left: auto;
}

.support-message {
    background: #a0522d;
    padding: 10px 15px;
    border-radius: 15px;
    margin-right: auto;
}

.input-container {
    display: flex;
    gap: 10px;
}

.input-container input {
    flex: 1;
    padding: 12px;
    border-radius: 10px;
    border: 1px solid #d2b48c;
    background: rgba(255, 255, 255, 0.1);
    color: white;
}

/* Элементы корзины */
.cart-items {
    margin-bottom: 20px;
}

.cart-item {
    background: rgba(139, 69, 19, 0.3);
    border-radius: 10px;
    padding: 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.item-details h4 {
    color: #ffd700;
    margin-bottom: 5px;
}

.quantity-controls {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-btn {
    background: #8b4513;
    border: none;
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    cursor: pointer;
}

.total-section {
    background: rgba(139, 69, 19, 0.5);
    border-radius: 10px;
    padding: 15px;
    text-align: center;
    margin-bottom: 20px;
}

.total-section h3 {
    color: #ffd700;
    margin-bottom: 10px;
}

/* Профиль пользователя */
.profile-header {
    text-align: center;
    margin-bottom: 30px;
}

.avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: linear-gradient(45deg, #8b4513, #d2b48c);
    margin: 0 auto 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
}

.profile-info {
    background: rgba(139, 69, 19, 0.3);
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
}

.info-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(210, 180, 140, 0.3);
}

.info-item:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.info-label {
    font-weight: 600;
    color: #d2b48c;
    margin-bottom: 5px;
}

/* Нижнее навигационное меню */
.bottom-menu {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 500px;
    background: linear-gradient(to top, #8b4513, #a0522d);
    display: flex;
    justify-content: space-around;
    padding: 12px 0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.3);
    z-index: 1000;
}

.menu-item {
    text-align: center;
    color: #f5f5dc;
    text-decoration: none;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    padding: 5px 10px;
    border-radius: 10px;
}

.menu-item.active {
    background: rgba(255, 215, 0, 0.3);
}

.menu-item i {
    display: block;
    font-size: 1.5rem;
    margin-bottom: 5px;
}

.menu-item:hover {
    transform: translateY(-3px);
    color: #ffd700;
}

/* Адаптивные стили для мобильных устройств */
@media (max-width: 480px) {
    .features-grid {
        grid-template-columns: 1fr;
    }

    .header h1 {
        font-size: 1.3rem;
    }
}

/* Стили для всплывающего окна установки приложения */
.install-banner {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: linear-gradient(135deg, #8b4513, #a0522d);
    padding: 15px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
    z-index: 2000;
    transform: translateY(-100%);
    transition: transform 0.3s ease;
}

.install-banner.show {
    transform: translateY(0);
}

.install-banner-content {
    max-width: 500px;
    margin: 0 auto;
    position: relative;
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.close-banner {
    position: absolute;
    top: 5px;
    right: 10px;
    font-size: 24px;
    cursor: pointer;
    color: #f5f5dc;
    font-weight: bold;
}

.install-banner-content p {
    flex: 1;
    margin: 0;
    font-size: 0.9rem;
    min-width: 200px;
}

.install-btn {
    background: linear-gradient(to right, #ffd700, #ffed4e);
    color: #8b4513;
    border: none;
    padding: 8px 15px;
    border-radius: 20px;
    cursor: pointer;
    font-weight: 600;
    font-size: 0.9rem;
    white-space: nowrap;
}

.install-btn:hover {
    transform: scale(1.05);
}

/* Адаптивные стили для мобильных устройств */
@media (max-width: 480px) {
    .install-banner-content {
        flex-direction: column;
        text-align: center;
    }

    .close-banner {
        top: 10px;
        right: 15px;
    }
}

/* Сетка категорий */
.categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
    margin: 20px 0;
}

/* Карточки категорий */
.category-card {
    background: rgba(139, 69, 19, 0.3);
    border-radius: 10px;
    padding: 15px 5px;
    text-align: center;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(210, 180, 140, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
    aspect-ratio: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.category-card:hover {
    transform: translateY(-3px);
    background: rgba(139, 69, 19, 0.5);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.category-card i {
    font-size: 1.5rem;
    margin-bottom: 8px;
    color: #ffd700;
}

.category-card h3 {
    font-size: 0.8rem;
    font-weight: 500;
    margin: 0;
    color: #f5f5dc;
}

/* Сетка производителей */
.manufacturers-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 20px;
}

/* Карточки производителей */
.manufacturer-card {
    background: rgba(139, 69, 19, 0.3);
    border-radius: 10px;
    padding: 15px 5px;
    text-align: center;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(210, 180, 140, 0.3);
    transition: all 0.3s ease;
    cursor: pointer;
}

.manufacturer-card:hover {
    transform: translateY(-3px);
    background: rgba(139, 69, 19, 0.5);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.3);
}

.manufacturer-logo {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(45deg, #8b4513, #d2b48c);
    margin: 0 auto 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    font-size: 1.2rem;
    color: #f5f5dc;
}

.manufacturer-card span {
    font-size: 0.8rem;
    font-weight: 500;
    color: #f5f5dc;
}

/* Адаптивность для категорий */
@media (max-width: 480px) {
    .categories-grid {
        gap: 8px;
    }

    .category-card {
        padding: 10px 5px;
    }

    .category-card i {
        font-size: 1.2rem;
    }

    .category-card h3 {
        font-size: 0.7rem;
    }

    .manufacturers-grid {
        gap: 10px;
    }

    .manufacturer-logo {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .manufacturer-card span {
        font-size: 0.7rem;
    }
}

/* Стили для страниц категорий */
.category-tab-page {
    display: none;
}

.category-tab-page.active {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

/* Адаптивность для страниц категорий */
@media (max-width: 480px) {
    .category-tab-page h2 {
        font-size: 1.3rem;
    }
}

/* Стиль фона кнопок второго слоя */
.fa-pin {
    width: 50px;
    height: 50px;
    background-image: url("/img/pin1.svg");
    background-size: contain;
    background-repeat: no-repeat;

}

/* Контейнер формы поиска - обеспечивает отступы как на остальной странице */
.search-form-container {
    padding: 0 20px 20px;
    width: 100%;
}

/* Стили для формы поиска */
.parts-search-form {
    width: 100%;
}

/* Контейнер для поля ввода и кнопки поиска */
.search-input-container {
    position: relative;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid #d2b48c;
    transition: all 0.3s ease;
}

.search-input-container:hover {
    box-shadow: 0 0 10px rgba(210, 180, 140, 0.3);
}

.search-input-container:focus-within {
    box-shadow: 0 0 10px rgba(210, 180, 140, 0.5);
}

/* Поле ввода поиска */
.search-input {
    flex: 1;
    padding: 15px 20px;
    padding-right: 60px;
    border: none;
    background: transparent;
    color: white;
    font-size: 1rem;
    outline: none;
}

.search-input::placeholder {
    color: rgba(245, 245, 220, 0.7);
}

/* Кнопка поиска */
.search-button {
    position: absolute;
    right: 10px;
    background: #8b4513;
    border: none;
    color: white;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.search-button:hover {
    background: #a0522d;
    transform: scale(1.05);
}

/* Адаптивность для формы поиска */
@media (max-width: 480px) {
    .search-form-container {
        padding: 0 15px 15px;
    }

    .search-input {
        padding: 12px 15px;
        padding-right: 50px;
        font-size: 0.9rem;
    }

    .search-button {
        width: 35px;
        height: 35px;
    }
}