:root {
    --brand-green: #8BC34A;
    --brand-green-dark: #2E7D32;
    --brand-green-darker: #1B5E20;
    --brand-cream: #FAFFF0;
    --brand-cream-alt: #F1F7E5;
    --brand-border: #D8E9BE;
    --tg-theme-bg-color: #FAFFF0;
    --tg-theme-text-color: #1B5E20;
    --tg-theme-hint-color: #7A9A5C;
    --tg-theme-button-color: #8BC34A;
    --tg-theme-button-text-color: #ffffff;
    --tg-theme-secondary-bg-color: #F1F7E5;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background-color: var(--tg-theme-bg-color);
    color: var(--tg-theme-text-color);
    padding-bottom: 90px;
    min-height: 100vh;
}

/* Brand */
.brand-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 12px;
    padding: 4px 0;
}

.brand-center {
    flex: 1;
    text-align: center;
}

.icon-btn {
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
}

.icon-circle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #ffffff;
    border: 1.5px solid var(--brand-border);
    color: var(--brand-green-dark);
    box-shadow: 0 2px 5px rgba(46,125,50,0.1);
}

.icon-circle svg {
    width: 20px;
    height: 20px;
}

.brand-logo {
    font-size: 24px;
    font-weight: 900;
    letter-spacing: 4px;
    color: var(--brand-green);
    font-family: 'Georgia', serif;
}

.brand-tagline {
    font-size: 10px;
    letter-spacing: 3px;
    color: var(--brand-green-dark);
    font-weight: 600;
    margin-top: 2px;
}

/* Toast */
.toast {
    position: fixed;
    top: 14px;
    left: 14px;
    right: 14px;
    z-index: 900;
    background: #ffffff;
    border-radius: 12px;
    box-shadow: 0 6px 20px rgba(0,0,0,0.18);
    padding: 14px 16px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 14px;
    color: var(--brand-green-darker);
    animation: toastIn 0.25s ease;
}

.toast-ic {
    width: 22px;
    height: 22px;
    color: var(--brand-green);
    flex-shrink: 0;
}

@keyframes toastIn {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Sheet modal */
.modal-sheet {
    border-radius: 20px 20px 0 0;
    max-height: 70vh;
}

.sheet-header {
    padding: 14px 16px 6px;
}

.sheet-back {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    border: none;
    font-size: 15px;
    color: var(--brand-green-dark);
    cursor: pointer;
    padding: 6px 0;
    font-weight: 600;
}

.sheet-back svg {
    width: 18px;
    height: 18px;
}

.sheet-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--brand-green-darker);
    margin-bottom: 18px;
}

.phone-input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: var(--brand-cream-alt);
    border: 2px solid var(--brand-border);
    border-radius: 12px;
    transition: border-color 0.2s;
}

.phone-input-wrap.error {
    border-color: #e74c3c;
}

.phone-flag {
    font-size: 18px;
}

.phone-prefix {
    font-size: 16px;
    font-weight: 700;
    color: var(--brand-green-darker);
}

.phone-input-wrap input {
    flex: 1;
    border: none;
    background: transparent;
    outline: none;
    font-size: 16px;
    color: var(--brand-green-darker);
}

.input-error {
    color: #e74c3c;
    font-size: 13px;
    margin-top: 8px;
    margin-left: 4px;
}

.terms-text {
    font-size: 13px;
    color: var(--tg-theme-hint-color);
    margin: 16px 0 18px;
    line-height: 1.5;
}

.link {
    color: var(--brand-green);
    text-decoration: underline;
}

/* Chat */
.chat-full {
    padding: 0;
}

.chat-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1.5px solid var(--brand-border);
    background: var(--brand-cream);
}

.chat-title {
    flex: 1;
    text-align: center;
    padding-right: 30px;
}

.chat-title-main {
    font-size: 16px;
    font-weight: 700;
    color: var(--brand-green-darker);
}

.chat-title-sub {
    font-size: 12px;
    color: var(--brand-green);
    margin-top: 2px;
}

.chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 18px 14px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    background: var(--brand-cream);
}

.chat-empty {
    margin: auto;
    color: var(--tg-theme-hint-color);
    font-size: 14px;
}

.chat-msg {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.35;
    word-wrap: break-word;
}

.chat-msg.me {
    align-self: flex-end;
    background: var(--brand-green);
    color: #ffffff;
    border-bottom-right-radius: 4px;
}

.chat-msg.them {
    align-self: flex-start;
    background: #ffffff;
    border: 1px solid var(--brand-border);
    color: var(--brand-green-darker);
    border-bottom-left-radius: 4px;
}

.chat-input-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #ffffff;
    border-top: 1.5px solid var(--brand-border);
}

.chat-attach, .chat-send {
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--brand-green-dark);
    flex-shrink: 0;
}

.chat-send {
    background: var(--brand-green);
    color: #ffffff;
}

.chat-attach svg, .chat-send svg {
    width: 20px;
    height: 20px;
}

.chat-input-row input {
    flex: 1;
    border: none;
    background: var(--brand-cream-alt);
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    color: var(--brand-green-darker);
}

/* Drawer */
.drawer-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.4);
    z-index: 600;
    display: flex;
}

.drawer {
    width: 84%;
    max-width: 340px;
    background: var(--brand-cream);
    height: 100%;
    display: flex;
    flex-direction: column;
    animation: slideIn 0.25s ease;
}

@keyframes slideIn {
    from { transform: translateX(-100%); }
    to { transform: translateX(0); }
}

.drawer-header {
    position: relative;
    padding: 18px 20px 20px;
    border-bottom: 1.5px solid var(--brand-border);
    text-align: center;
}

.drawer-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: #ffffff;
    border: 1.5px solid var(--brand-border);
    font-size: 14px;
    cursor: pointer;
    color: var(--brand-green-dark);
}

.drawer-logo {
    padding-top: 8px;
}

.drawer-menu {
    flex: 1;
    padding: 10px 0;
    overflow-y: auto;
}

.drawer-item {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 14px 20px;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--brand-border);
    font-size: 15px;
    color: var(--brand-green-darker);
    cursor: pointer;
    text-align: left;
}

.menu-ic {
    width: 22px;
    height: 22px;
    color: var(--brand-green);
    flex-shrink: 0;
}

.drawer-item:active {
    background: var(--brand-cream-alt);
}

.drawer-lang {
    padding: 14px 20px;
    border-top: 1.5px solid var(--brand-border);
}

.lang-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    background: #ffffff;
    border: 1.5px solid var(--brand-border);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    color: var(--brand-green-dark);
    cursor: pointer;
}

.drawer-footer {
    padding: 14px 20px;
    font-size: 12px;
    color: var(--tg-theme-hint-color);
    text-align: center;
}

/* Top bar */
.top-bar {
    background: var(--brand-cream);
    padding: 12px;
    border-bottom: 2px solid var(--brand-border);
}

.search-row {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
}

.search-input-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    background: var(--tg-theme-secondary-bg-color);
    border-radius: 10px;
    padding: 0 12px;
}

.search-svg {
    width: 18px;
    height: 18px;
    color: var(--brand-green);
    margin-right: 8px;
    flex-shrink: 0;
}

.addr-svg {
    width: 18px;
    height: 18px;
    color: var(--brand-green);
    flex-shrink: 0;
}

.addr-chevron {
    width: 16px;
    height: 16px;
    color: var(--brand-green-dark);
    flex-shrink: 0;
}

.search-input-wrap input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 10px 0;
    font-size: 15px;
    outline: none;
    color: var(--tg-theme-text-color);
}

.search-btn {
    padding: 10px 18px;
    border: none;
    border-radius: 10px;
    background: var(--brand-green);
    color: #ffffff;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(139, 195, 74, 0.35);
}

.address-bar {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    background: #ffffff;
    border: 1.5px solid var(--brand-border);
    border-radius: 10px;
    font-size: 14px;
    color: var(--brand-green-dark);
    cursor: pointer;
    text-align: left;
}

.address-icon { font-size: 16px; }
.address-text { flex: 1; }
.address-arrow { color: var(--tg-theme-hint-color); }

/* Section title */
.section-title {
    font-size: 22px;
    font-weight: 700;
    padding: 18px 14px 12px;
    color: var(--brand-green-darker);
    letter-spacing: 0.3px;
}

/* Categories horizontal scroll */
#categories-section {
    position: sticky;
    top: 0;
    z-index: 150;
    background: var(--brand-cream);
    border-bottom: 1.5px solid var(--brand-border);
    box-shadow: 0 2px 6px rgba(46, 125, 50, 0.06);
}

.categories-scroll {
    display: flex;
    gap: 14px;
    padding: 8px 12px 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.categories-scroll::-webkit-scrollbar { display: none; }

.category-chip {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    flex-shrink: 0;
    min-width: 68px;
    max-width: 78px;
}

.category-chip-image {
    width: 62px;
    height: 62px;
    border-radius: 50%;
    object-fit: cover;
    background: #e0e0e0;
    border: 2.5px solid transparent;
    transition: border-color 0.2s;
}

.category-chip.active .category-chip-image {
    border-color: var(--brand-green);
}

.category-chip-image.no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    background: linear-gradient(135deg, #f5f5f5, #e0e0e0);
    border-radius: 50%;
}

.category-chip-name {
    text-align: center;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.2;
    color: var(--brand-green-dark);
    word-break: break-word;
}

.category-chip.active .category-chip-name {
    color: var(--brand-green);
    font-weight: 700;
}

/* Category section with horizontal products */
.category-block {
    margin-bottom: 20px;
    scroll-margin-top: 110px;
}

.category-block-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--brand-green-darker);
    padding: 10px 14px 8px;
}

.products-hscroll {
    display: flex;
    gap: 12px;
    padding: 0 14px 8px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}

.products-hscroll::-webkit-scrollbar { display: none; }

.product-hcard {
    flex-shrink: 0;
    width: 160px;
    background: #ffffff;
    border: 1.5px solid var(--brand-border);
    border-radius: 14px;
    overflow: hidden;
    box-shadow: 0 2px 6px rgba(46, 125, 50, 0.08);
}

.product-hcard:active { transform: scale(0.98); }

.product-hcard .product-image {
    width: 100%;
    height: 130px;
    object-fit: cover;
    background: #e0e0e0;
}

.product-hcard .product-info {
    padding: 8px 10px 10px;
}

.product-hcard .product-name {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.3;
    color: var(--brand-green-darker);
}

.product-hcard .product-price-row {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 6px;
}

.product-hcard .product-price {
    display: inline-block;
    font-size: 14px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 0;
    padding: 6px 16px;
    border: 1.5px solid #e0e0e0;
    border-radius: 8px;
    background: #ffffff;
    text-align: center;
}

.product-hcard .btn-add-small {
    width: 30px;
    height: 30px;
    border: none;
    border-radius: 50%;
    background: var(--brand-green);
    color: #ffffff;
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s;
}

.product-hcard .btn-add-small:active { transform: scale(0.9); }

/* In-cart product card */
.product-hcard.in-cart .product-info {
    padding-bottom: 6px;
}

.product-hcard .hcard-cart-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 6px 10px 10px;
}

.product-hcard .hcard-qty-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border: 1px solid #ccc;
    background: #ffffff;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    padding: 0;
    transition: background 0.15s, transform 0.15s;
}

.product-hcard .hcard-qty-btn:active {
    background: #f5f5f5;
    transform: scale(0.92);
}

.product-hcard .hcard-qty-val {
    flex: 1;
    text-align: center;
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
}

.product-hcard .quantity-control {
    display: flex;
    align-items: center;
    gap: 6px;
}

.product-hcard .qty-btn {
    width: 28px;
    height: 28px;
    font-size: 15px;
}

.product-hcard .qty-value {
    font-size: 14px;
    min-width: 20px;
}

/* Products view */
.products-header {
    display: none;
}

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

.product-card {
    background: #ffffff;
    border: 1.5px solid var(--brand-border);
    border-radius: 14px;
    overflow: hidden;
    transition: transform 0.2s;
    box-shadow: 0 2px 6px rgba(46, 125, 50, 0.08);
}

.product-card:active { transform: scale(0.98); }

.product-image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: #e0e0e0;
}

.product-image.no-image {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    background: linear-gradient(135deg, #f5f5f5, #e0e0e0);
}

.product-info { padding: 10px; }

.product-name {
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 4px;
    line-height: 1.3;
}

.product-price {
    font-size: 15px;
    font-weight: 700;
    color: var(--brand-green-dark);
    margin-bottom: 8px;
}

.product-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.btn-add {
    width: 100%;
    padding: 8px;
    border: none;
    border-radius: 8px;
    background: var(--tg-theme-button-color);
    color: var(--tg-theme-button-text-color);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
}

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

.qty-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: var(--tg-theme-button-color);
    color: var(--tg-theme-button-text-color);
    font-size: 18px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.qty-value {
    font-size: 16px;
    font-weight: 600;
    min-width: 30px;
    text-align: center;
}

/* Address required modal */
#address-required-modal {
    align-items: center;
    justify-content: center;
    padding: 0 16px;
}

.addr-prompt {
    background: #ffffff;
    border-radius: 20px;
    padding: 28px 24px 24px;
    width: 100%;
    max-width: 360px;
    position: relative;
    text-align: center;
    animation: scaleIn 0.25s ease;
}

.addr-prompt-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    font-size: 18px;
    color: #999;
    cursor: pointer;
}

.addr-prompt-pin {
    display: flex;
    justify-content: center;
    margin: 12px 0 16px;
}

.addr-prompt-pin svg {
    width: 120px;
    height: 120px;
    color: #4CAF50;
    filter: drop-shadow(0 10px 14px rgba(76, 175, 80, 0.35));
}

.addr-prompt-title {
    font-size: 17px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 10px;
    line-height: 1.35;
}

.addr-prompt-desc {
    font-size: 13px;
    color: #888;
    line-height: 1.5;
    margin-bottom: 22px;
}

.addr-prompt-btn-primary, .addr-prompt-btn-secondary {
    width: 100%;
    padding: 14px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 10px;
    transition: background 0.15s, transform 0.15s;
}

.addr-prompt-btn-primary {
    border: none;
    background: #4CAF50;
    color: #ffffff;
}

.addr-prompt-btn-primary:active {
    background: #388E3C;
    transform: scale(0.98);
}

.addr-prompt-btn-secondary {
    background: #ffffff;
    color: #4CAF50;
    border: 1px solid #4CAF50;
}

.addr-prompt-btn-secondary:active {
    background: #F1F7E5;
    transform: scale(0.98);
}

/* ============================================
   Checkout page
   ============================================ */
.checkout-page {
    background: #f8f8f8;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

.checkout-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: #ffffff;
    border-bottom: 1px solid #eee;
    flex-shrink: 0;
}

.checkout-header h2 {
    font-size: 17px;
    font-weight: 700;
    color: #1a1a1a;
    flex: 1;
    text-align: center;
}

.checkout-back {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
}

.checkout-back svg {
    width: 22px;
    height: 22px;
}

.checkout-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
}

/* Delivery options */
.delivery-option {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    background: #ffffff;
    border: 1.5px solid transparent;
    border-radius: 12px;
    margin-bottom: 10px;
    cursor: pointer;
    transition: border-color 0.2s;
}

.delivery-option.selected {
    border-color: #4CAF50;
}

.delivery-radio {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #ccc;
    flex-shrink: 0;
    margin-top: 2px;
    position: relative;
    transition: border-color 0.2s;
}

.delivery-option.selected .delivery-radio {
    border-color: #4CAF50;
}

.delivery-option.selected .delivery-radio::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #4CAF50;
}

.delivery-info {
    flex: 1;
}

.delivery-title {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.delivery-desc {
    font-size: 13px;
    color: #999;
    line-height: 1.4;
}

/* Address block */
.checkout-address-block {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
}

.checkout-row {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    cursor: pointer;
    border-bottom: 1px solid #f0f0f0;
}

.checkout-row:last-child {
    border-bottom: none;
}

.checkout-row-icon {
    width: 24px;
    height: 24px;
    color: #4CAF50;
    flex-shrink: 0;
}

.checkout-row-icon svg {
    width: 100%;
    height: 100%;
}

.checkout-row-content {
    flex: 1;
    min-width: 0;
}

.checkout-row-label {
    font-size: 12px;
    color: #999;
    margin-bottom: 3px;
}

.checkout-row-value {
    font-size: 14px;
    color: #1a1a1a;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.checkout-row-arrow {
    width: 18px;
    height: 18px;
    color: #ccc;
    flex-shrink: 0;
    transition: transform 0.2s;
}

.checkout-row-arrow.rotated {
    transform: rotate(90deg);
}

/* Address details (entrance, floor, room) */
.checkout-addr-details {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
}

.addr-detail-input {
    flex: 1;
    min-width: 0;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 13px;
    outline: none;
    background: #fafafa;
}

.addr-detail-input:focus {
    border-color: #4CAF50;
    background: #ffffff;
}

.courier-comment-input {
    width: calc(100% - 32px);
    margin: 0 16px 12px;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 10px;
    font-size: 13px;
    outline: none;
    background: #fafafa;
    font-family: inherit;
    resize: none;
}

.courier-comment-input:focus {
    border-color: #4CAF50;
    background: #ffffff;
}

/* Checkout bottom button */
.checkout-bottom {
    padding: 12px 16px;
    background: #ffffff;
    border-top: 1px solid #eee;
    flex-shrink: 0;
}

/* Addresses bottom sheet */
#addresses-sheet {
    align-items: flex-end;
    z-index: 600;
}

.addresses-sheet-modal {
    width: 100%;
    background: #ffffff;
    border-radius: 20px 20px 0 0;
    padding: 16px 16px 24px;
    max-height: 70vh;
    animation: sheetUp 0.3s ease;
}

.sheet-drag-handle {
    width: 40px;
    height: 5px;
    background: #ddd;
    border-radius: 3px;
    margin: 0 auto 14px;
}

.addresses-sheet-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 16px;
    padding: 0 4px;
}

.address-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 4px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
}

.address-item-radio {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 2px solid #ccc;
    flex-shrink: 0;
    margin-top: 2px;
    position: relative;
}

.address-item.selected .address-item-radio {
    border-color: #4CAF50;
}

.address-item.selected .address-item-radio::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #4CAF50;
}

.address-item-text {
    flex: 1;
    font-size: 14px;
    color: #1a1a1a;
    line-height: 1.4;
}

.address-item-actions {
    width: 28px;
    height: 28px;
    border: none;
    background: transparent;
    color: #999;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.add-address-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 16px 4px;
    background: transparent;
    border: none;
    color: #4CAF50;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}

.add-address-btn svg {
    width: 22px;
    height: 22px;
}

/* Bottom cart bar */
.cart-bottom-bar {
    position: fixed;
    bottom: 12px;
    left: 12px;
    right: 12px;
    padding: 14px 20px;
    background: var(--brand-green);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    cursor: pointer;
    z-index: 200;
    border-radius: 12px;
    box-shadow: 0 4px 14px rgba(139, 195, 74, 0.4);
    transition: background 0.15s, transform 0.15s;
}

.cart-bottom-bar:active {
    background: var(--brand-green-dark);
    transform: scale(0.98);
}

.cart-bar-icon {
    width: 22px;
    height: 22px;
    flex-shrink: 0;
}

.cart-bar-total {
    font-size: 17px;
    font-weight: 700;
}

.cart-bottom-bar.show {
    animation: sheetUp 0.3s ease;
}

/* Product detail bottom sheet */
#product-detail-modal {
    align-items: flex-end;
}

#product-detail-modal .modal {
    max-height: 85vh;
    border-radius: 20px 20px 0 0;
    animation: sheetUp 0.3s ease;
}

.product-detail {
    background: #ffffff;
    display: flex;
    flex-direction: column;
}

.pd-cat-name {
    padding: 14px 16px 0;
    font-size: 18px;
    font-weight: 700;
    color: #4CAF50;
}

.pd-drag-handle {
    width: 40px;
    height: 5px;
    background: #ddd;
    border-radius: 3px;
    margin: 10px auto 0;
}

.pd-image-wrap {
    position: relative;
    width: 100%;
    max-height: 40vh;
    overflow: hidden;
}

.pd-image-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.pd-info {
    padding: 16px;
    overflow-y: auto;
}

.pd-name {
    font-size: 20px;
    font-weight: 700;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.pd-price {
    font-size: 18px;
    font-weight: 700;
    color: #4CAF50;
    margin-bottom: 10px;
}

.pd-desc {
    font-size: 14px;
    color: #666;
    line-height: 1.5;
}

.pd-bottom {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 14px;
    border-top: 1px solid #eee;
    background: #ffffff;
    box-sizing: border-box;
    width: 100%;
}

.pd-qty-control {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    border: 1px solid #ccc;
    border-radius: 12px;
    background: #ffffff;
    flex-shrink: 0;
}

.pd-qty-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border-radius: 50%;
    font-size: 20px;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    box-sizing: border-box;
    transition: background 0.15s, transform 0.15s;
}

.pd-qty-btn:active { transform: scale(0.92); }

.pd-qty-minus {
    background: #f0f0f0;
    color: #333;
    border: none;
}

.pd-qty-minus:active { background: #e0e0e0; }

.pd-qty-plus {
    background: #4CAF50;
    color: #ffffff;
    border: none;
}

.pd-qty-plus:active { background: #388E3C; }

.pd-qty-value {
    min-width: 20px;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}

.pd-add-btn {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 10px 12px;
    border-radius: 12px;
    background: #ffffff;
    color: #1a1a1a;
    border: 1px solid #ccc;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.15s, background 0.15s;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pd-add-btn:active {
    transform: scale(0.97);
    background: #f5f5f5;
}

.pd-cart-ic {
    width: 18px;
    height: 18px;
    color: #4CAF50;
    flex-shrink: 0;
}

.pd-add-btn.go-to-cart {
    background: #ffffff;
    color: #4CAF50;
    border: 1px solid #4CAF50;
}

.pd-add-btn.go-to-cart .pd-cart-ic {
    color: #4CAF50;
}

/* Cart full page */
.cart-page {
    background: #f8f8f8;
    display: flex;
    flex-direction: column;
}

.cart-page-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    background: #ffffff;
    border-bottom: 1px solid #eee;
}

.cart-page-header h2 {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
}

.cart-back-btn, .cart-trash-btn {
    width: 40px;
    height: 40px;
    border: none;
    background: transparent;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #1a1a1a;
    transition: transform 0.15s;
}

.cart-back-btn:active, .cart-trash-btn:active { transform: scale(0.9); }

.cart-back-btn svg, .cart-trash-btn svg {
    width: 24px;
    height: 24px;
}

.cart-trash-btn { color: #999; }
.cart-trash-btn:active { color: #FF5252; }

.cart-page-items {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.cart-page-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    background: #ffffff;
    margin-bottom: 1px;
}

.cart-page-item-img {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    object-fit: cover;
    background: #e0e0e0;
}

.cart-page-item-info {
    flex: 1;
}

.cart-page-item-name {
    font-size: 15px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 4px;
}

.cart-page-item-price {
    font-size: 14px;
    font-weight: 700;
    color: #4CAF50;
}

.cart-page-item-qty {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 8px;
    border: 1px solid #ccc;
    border-radius: 12px;
    background: #ffffff;
}

.cart-page-item-qty .cpq-btn {
    width: 32px;
    height: 32px;
    min-width: 32px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    font-size: 18px;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #333;
    padding: 0;
    transition: background 0.15s, transform 0.15s;
}

.cart-page-item-qty .cpq-btn:active { transform: scale(0.92); }

.cart-page-item-qty .cpq-btn.cpq-plus {
    background: #4CAF50;
    color: #ffffff;
}

.cart-page-item-qty .cpq-btn.cpq-plus:active { background: #388E3C; }

.cart-page-item-qty .cpq-val {
    min-width: 20px;
    text-align: center;
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}

.cart-page-bottom {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 16px;
    background: #ffffff;
    border-top: 1px solid #eee;
}

.cart-page-total {
    flex-shrink: 0;
}

.cart-page-total-amount {
    font-size: 18px;
    font-weight: 700;
    color: #1a1a1a;
}

.cart-page-total-label {
    font-size: 12px;
    color: #999;
}

.cart-continue-btn {
    flex: 1;
    padding: 14px;
    border: none;
    border-radius: 12px;
    background: #4CAF50;
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.15s, transform 0.15s;
}

.cart-continue-btn:active {
    background: #388E3C;
    transform: scale(0.98);
}

.cart-continue-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.cart-continue-btn .min-order-hint {
    display: block;
    font-size: 11px;
    font-weight: 400;
    opacity: 0.8;
    margin-top: 2px;
}

/* Clear cart dialog */
.dialog-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 700;
    display: flex;
    align-items: center;
    justify-content: center;
}

.dialog-box {
    background: #ffffff;
    border-radius: 16px;
    padding: 24px;
    width: 85%;
    max-width: 320px;
    position: relative;
    animation: scaleIn 0.25s ease;
}

.dialog-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: none;
    font-size: 18px;
    color: #999;
    cursor: pointer;
}

.dialog-text {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
    text-align: center;
    margin-bottom: 24px;
    margin-top: 8px;
}

.dialog-actions {
    display: flex;
    gap: 12px;
}

.dialog-btn {
    flex: 1;
    padding: 12px;
    border-radius: 12px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    border: none;
}

.dialog-btn-cancel {
    background: #f2f2f2;
    color: #333;
}

.dialog-btn-delete {
    background: #FF5252;
    color: #ffffff;
}

/* Modal */
.modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 500;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes sheetUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@keyframes slideUp {
    from { transform: translateY(100%); }
    to { transform: translateY(0); }
}

@keyframes scaleIn {
    from { opacity: 0; transform: scale(0.9); }
    to { opacity: 1; transform: scale(1); }
}

.modal {
    background: var(--tg-theme-bg-color);
    border-radius: 16px 16px 0 0;
    width: 100%;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    animation: sheetUp 0.3s ease;
}

.modal-full {
    max-height: 100vh;
    height: 100vh;
    border-radius: 0;
    animation: slideUp 0.3s ease;
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--tg-theme-secondary-bg-color);
}

.modal-header h2 { font-size: 17px; }

.close-btn {
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 50%;
    background: var(--tg-theme-secondary-bg-color);
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-body {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}

/* Map modal */
.map-modal {
    position: relative;
    padding: 0;
}

.map-top {
    position: absolute;
    top: 14px;
    left: 14px;
    right: 14px;
    z-index: 401;
    display: flex;
    gap: 10px;
    align-items: center;
}

.map-close {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: #ffffff;
    font-size: 18px;
    font-weight: 700;
    color: var(--brand-green-dark);
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    flex-shrink: 0;
}

.map-search-wrap {
    flex: 1;
    display: flex;
    align-items: center;
    background: #ffffff;
    border-radius: 24px;
    padding: 0 16px;
    height: 42px;
    box-shadow: 0 3px 10px rgba(0,0,0,0.15);
}

.map-search-wrap .search-icon {
    margin-right: 8px;
    color: var(--tg-theme-hint-color);
}

.map-search-wrap input {
    flex: 1;
    border: none;
    background: transparent;
    font-size: 14px;
    outline: none;
    color: var(--tg-theme-text-color);
}

#map-container {
    flex: 1;
    min-height: 300px;
    width: 100%;
}

.map-controls {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-110%);
    z-index: 401;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
}

.map-ctrl-btn {
    width: 44px;
    height: 44px;
    border: none;
    background: #ffffff;
    font-size: 22px;
    font-weight: 700;
    color: var(--brand-green-dark);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-ctrl-btn + .map-ctrl-btn {
    border-top: 1px solid var(--brand-border);
}

.map-locate-btn {
    position: absolute;
    right: 14px;
    bottom: 160px;
    z-index: 401;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: none;
    background: #ffffff;
    color: var(--brand-green);
    cursor: pointer;
    box-shadow: 0 3px 10px rgba(0,0,0,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
}

.map-locate-btn svg {
    width: 22px;
    height: 22px;
}

.map-footer {
    padding: 14px;
    background: #ffffff;
    border-top: 1px solid var(--brand-border);
    z-index: 400;
}

.map-selected-label {
    font-size: 14px;
    color: var(--brand-green-dark);
    margin-bottom: 10px;
    min-height: 20px;
    font-weight: 500;
    line-height: 1.3;
}

.yandex-pin {
    width: 32px;
    height: 40px;
    transform: translate(-16px, -40px);
    pointer-events: auto;
    filter: drop-shadow(0 3px 6px rgba(0,0,0,0.3));
}

.yandex-pin svg {
    width: 100%;
    height: 100%;
}

/* Hide Yandex Maps branding and routing */
.ymaps-2-1-79-copyrights-pane,
.ymaps-2-1-79-copyright,
[class*="copyright"],
[class*="copyrights-pane"],
[class*="ground-pane"] + [class*="copyrights"],
[class*="logo"],
[class*="route-panel"],
[class*="gotoymaps"],
[class*="router"],
.ymaps-2-1-79-gotoymaps,
.ymaps-2-1-79-map-copyrights-promo {
    display: none !important;
}

/* Cart items */
.cart-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 0;
    border-bottom: 1px solid var(--tg-theme-secondary-bg-color);
}

.cart-item-info { flex: 1; }

.cart-item-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 4px;
}

.cart-item-price {
    color: var(--tg-theme-hint-color);
    font-size: 13px;
}

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

.cart-item-controls .qty-btn {
    width: 28px;
    height: 28px;
    font-size: 16px;
}

.cart-item-subtotal {
    font-weight: 700;
    font-size: 14px;
    min-width: 80px;
    text-align: right;
}

/* Cart summary */
.cart-summary {
    padding: 16px;
    border-top: 1px solid var(--tg-theme-secondary-bg-color);
}

.cart-total-row {
    display: flex;
    justify-content: space-between;
    font-size: 18px;
    margin-bottom: 12px;
}

.warning {
    color: #e74c3c;
    font-size: 13px;
    margin-bottom: 8px;
    text-align: center;
}

/* Buttons */
.btn-primary {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--brand-green), var(--brand-green-dark));
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(139, 195, 74, 0.35);
}

.btn-primary:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-secondary {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--tg-theme-button-color);
    border-radius: 8px;
    background: transparent;
    color: var(--tg-theme-button-color);
    font-size: 14px;
    cursor: pointer;
    margin-top: 8px;
}

/* Form */
.form-group { margin-bottom: 16px; }

.form-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 14px;
}

.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid var(--tg-theme-secondary-bg-color);
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    background: var(--tg-theme-bg-color);
    color: var(--tg-theme-text-color);
}

.selected-address {
    padding: 12px;
    background: var(--tg-theme-secondary-bg-color);
    border-radius: 8px;
    font-size: 14px;
    min-height: 20px;
}

/* Order summary */
.order-summary {
    background: var(--tg-theme-secondary-bg-color);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 16px;
}

.order-summary-item {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 14px;
}

.order-summary-total {
    display: flex;
    justify-content: space-between;
    padding-top: 8px;
    margin-top: 8px;
    border-top: 1px solid var(--tg-theme-hint-color);
    font-weight: 700;
    font-size: 16px;
}

.btn-order { margin-top: 8px; }

/* Success */
.modal-success {
    text-align: center;
    padding: 40px 20px;
    border-radius: 16px;
    margin: auto 16px;
}

.success-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.modal-success h2 { margin-bottom: 8px; }

.modal-success p {
    color: var(--tg-theme-hint-color);
    margin-bottom: 24px;
}

/* Loading */
.loading, .empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 40px;
    color: var(--tg-theme-hint-color);
}
