@font-face {
    font-family: 'AppFont';
    src: url('fonts/Mont-HeavyDEMO.otf') format('truetype');
    font-weight: 600;
    font-style: normal;
}

@font-face {
    font-family: 'AppFont';
    src: url('fonts/Mont-ExtraLightDEMO.otf') format('truetype');
    font-weight: 500;
    font-style: normal;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'AppFont', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

body {
    background: #ffffff;
    color: #000000;
    font-family: 'AppFont', -apple-system, BlinkMacSystemFont,
    'Segoe UI', sans-serif;
}

#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.top-header {
    padding: 10px 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: #5e7256;
    border-bottom: 1px solid #5e7256;
}

.logo {
    font-weight: 700;
    font-size: 18px;
    color: #ffffff;
}


.logo img {
    height: 45px;
    display: block;
    object-fit: contain;
}



.search-wrapper {
    position: relative;
}

.search-wrapper input {
    width: 100%;
    padding: 8px 10px;
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.15);
    background: #f5f5f5;
    color: #000000;
}

.search-wrapper input::placeholder {
    color: rgba(0,0,0,0.4);
}

#mainContent {
    flex: 1;
    overflow-y: auto;
    padding: 10px 10px 70px;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.products-list {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
}

.products-list {
    margin-top: 0; /* чтобы управлялось categories-row */
}


.product-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: #f2f2f2;
    border-radius: 12px;
    overflow: hidden;
}

/* Блок с названием + низом */
.product-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    padding: 10px;
}

.product-image-wrapper {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    background: #e1e1e1;
    width: 100%;
    aspect-ratio: 1 / 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-image-controls {
    position: absolute;
    bottom: 6px;
    right: 6px;
    display: flex;
    gap: 4px;
}

.image-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    border-radius: 999px;
    padding: 4px 6px;
    font-size: 12px;
    background: rgba(0,0,0,0.4);
    color: #ffffff;
}

.image-nav-btn-left { left: 6px; }
.image-nav-btn-right { right: 6px; }

/* Название ВСЕГДА сверху */
.product-title {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    line-height: 1.2;
}

/* Низ ВСЕГДА прижат вниз */
.product-bottom {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-price {
    font-weight: 600;
}

.product-add-btn {
    border: none;
    border-radius: 999px;
    padding: 6px 14px;
    font-size: 14px;
    background: #5e7256;
    color: #ffffff;
}

/* === CART === */

/* Измените отступ для основного контента корзины */
#cartItems {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 200px; /* Увеличиваем отступ снизу для фиксированной панели */
    padding-bottom: 10px;
}


.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px;
    border-radius: 10px;
    background: #f2f2f2;
}

.cart-item-info {
    display: flex;
    flex-direction: column;
}

.cart-item-name {
    font-size: 14px;
    color: #000000;
}

.cart-item-price {
    font-size: 13px;
    opacity: 0.8;
    color: #444444;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cart-qty-btn {
    border: none;
    border-radius: 999px;
    padding: 2px 8px;
    font-size: 16px;
    background: #e6e6e6;
    color: #000000;
}

.cart-qty {
    min-width: 20px;
    text-align: center;
}

.cart-remove-btn {
    border: none;
    border-radius: 999px;
    padding: 4px 10px;
    background: #ffdddd;
    color: #cc0000;
    font-size: 12px;
}

.cart-summary {
    padding: 16px;
    background: #fff;
    border-top: 1px solid #eee;
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 180px; /* Фиксируем высоту */
    position: fixed;
    bottom: 56px; /* Над навигацией */
    left: 0;
    right: 0;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
    z-index: 100;
}

.cart-bonus-section {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 12px;
    border-bottom: 1px solid #e0e0e0;
}

.cart-bonus-info {
    font-size: 14px;
    color: #000000;
    font-weight: 500;
}

/* Правая верхняя */
.cart-total {
    text-align: left;
    font-weight: 600;
    font-size: 16px;
    color: #000;
}

.cart-total-section {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.cart-total-section .primary-btn {
    width: 100%;
    padding: 14px;
    font-size: 16px;
    font-weight: 600;
}

.cart-bonus-row {
    margin-top: 6px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    font-size: 13px;
    opacity: 0.9;
    grid-area: bonus;
}

/* Уберите старые стили */
.cart-bonus-row,
.cart-total { grid-area: unset; }

.bonus-switch-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
}

.bonus-switch-label {
    font-size: 13px;
    color: #666;
}

.bonus-switch {
    display: inline-flex;
    align-items: center;
}

.bonus-switch input {
    display: none;
}

.switch-slider {
    width: 40px;
    height: 20px;
    background-color: #ccc;
    border-radius: 20px;
    position: relative;
    cursor: pointer;
    transition: background-color 0.2s;
}

.switch-slider:after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: white;
    top: 2px;
    left: 2px;
    transition: transform 0.2s;
}

.bonus-switch input:checked + .switch-slider {
    background-color: #5e7256;
}

.bonus-switch input:checked + .switch-slider:after {
    transform: translateX(20px);
}



.primary-btn,
.secondary-btn {
    border-radius: 999px;
    padding: 8px 16px;
    border: none;
    font-size: 14px;
}

.primary-btn {
    background: #5e7256;
    color: #ffffff;
}

.secondary-btn {
    background: #eaeaea;
    color: #000000;
}

/* === MODAL === */

.modal {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.25);
    backdrop-filter: blur(4px);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    z-index: 9999;
}

.modal.hidden { display: none; }
.hidden { display: none !important; }

.modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    background: #ffffff;
    border-radius: 0;
    padding: 20px;
    overflow-y: auto;
    box-sizing: border-box;
    color: #000000;
}

.modal-content {
    padding-bottom: 80px; /* Для нижней кнопки */
}

.modal-content h2 { margin-bottom: 10px; }

.modal-content label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-bottom: 10px;
    font-size: 14px;
    color: #000000;
}

.modal-content input,
.modal-content textarea {
    border-radius: 10px;
    border: 1px solid rgba(0,0,0,0.15);
    padding: 8px;
    background: #f5f5f5;
    color: #000000;
}

.modal-actions {
    display: flex;
    justify-content: space-between;
    margin-top: 10px;
}

.address-block h3 { margin: 10px 0 6px; }

/* === PROFILE === */

.profile-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    color: #000000;
}

.avatar {
    width: 52px;
    height: 52px;
    border-radius: 999px;
    background: #e6e6e6;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 26px;
    overflow: hidden;
}

.avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.profile-name {
    font-weight: 600;
    font-size: 16px;
    color: #000000;
}

.profile-username {
    font-size: 13px;
    opacity: 0.7;
    color: #444444;
}

.profile-bonuses {
    font-size: 13px;
    margin-top: 4px;
    opacity: 0.85;
}


.profile-buttons {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}

.profile-tab-btn {
    flex: 1;
    border-radius: 999px;
    border: none;
    padding: 6px 4px;
    font-size: 13px;
    background: #e5e5e5;
    color: #000000;
}

.profile-tab-btn.active {
    background: #5e7256;
    color: #ffffff;
}

.profile-content {
    font-size: 14px;
    color: #000000;
}

.address-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f2f2f2;
    padding: 10px 12px;
    border-radius: 10px;
    margin-bottom: 8px;
}

.address-text {
    font-size: 14px;
    color: #000000;
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.address-delete-btn {
    padding: 4px 10px;
    font-size: 13px;
    background: #ffdddd;
    border: none;
    border-radius: 6px;
    color: #cc0000;
    margin-left: 12px;
}



/* === ORDERS === */

.order-item {
    padding: 8px;
    border-radius: 10px;
    background: #f2f2f2;
    margin-bottom: 6px;
}

.order-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 4px;
    color: #000000;
}

.order-id { font-size: 13px; }
.order-status { font-size: 13px; opacity: 0.8; }
.order-total { font-size: 14px; font-weight: 600; }
.order-date { font-size: 12px; opacity: 0.7; }

/* === INFO === */

.info-content {
    font-size: 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    color: #000000;
}

/* === BOTTOM NAVIGATION === */

.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 56px;
    background: #5e7256;
    display: flex;
    border-top: 1px solid rgba(0,0,0,0.12);
}

.nav-btn {
    flex: 1;
    border: none;
    background: transparent;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    font-size: 11px;
    gap: 2px;
}

.nav-btn.active {
    color: #ffffff;
    background: rgba(0,0,0,0.06);
}

.nav-btn {
    border-radius: 12px;
    margin: 6px 6px;
}
.bottom-nav { padding: 0 6px; }


.product-qty-controls {
    display: flex;
    align-items: center;
    gap: 6px;
}

.product-qty-btn {
    border: none;
    border-radius: 999px;
    padding: 4px 8px;
    background: #e6e6e6;
    color: #000000;
    font-size: 14px;
}

.product-qty-value {
    min-width: 20px;
    text-align: center;
    font-size: 14px;
    color: #000000;
}

.modal-close-btn {
    position: absolute;
    top: 12px;
    right: 14px;
    border: none;
    background: transparent;
    color: #000000;
    font-size: 24px;
}

.nav-icon {
    width: 22px;
    height: 22px;
}

.categories-bar {
    display: flex;
    gap: 8px;
    padding: 0 10px ;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    margin-top: 6px;     /* отступ от шапки */
    margin-bottom: 12px;  /* отступ до товаров */
}
.categories-bar::-webkit-scrollbar { display: none; }

.category-chip {
    flex: 0 0 auto;
    border: 1px solid #5e7256;
    background: transparent;
    color: #000;
    border-radius: 999px;
    padding: 6px 10px;
    font-size: 13px;
    white-space: nowrap;
}

.category-chip.active {
    background: #5e7256;
    color: #fff;
}

.address-add-form {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 12px;
}

.address-add-label {
    font-size: 14px;
    font-weight: 600;
}

.text {
    text-indent: 2em;
    text-align: justify;
}

.input-error {
    outline: 1px solid #e74c3c;
    outline-offset: 1px;
}

.profile-address-input {
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.12);   /* <-- добавили видимую границу */
    padding: 10px;
    background: rgba(0, 0, 0, 0.03);         /* <-- лёгкий серый фон под белую тему */
    color: #111;
    font-size: 14px;
}

.profile-address-input::placeholder {
    color: rgba(0, 0, 0, 0.45);
}

.profile-address-input:focus {
    outline: 2px solid rgba(87, 112, 79, 0.35);  /* акцент 57704F */
    outline-offset: 1px;
    border-color: rgba(87, 112, 79, 0.55);
}

/* Чтобы подпись "Адрес" выглядела как в модалке */
.address-add-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin-top: 10px;
    font-size: 14px;
}

/* Чтобы кнопка всегда была под строкой */
.address-add-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

