.header {
    padding: 14px 12px 8px;
    background: var(--bg);
    position: sticky;
    top: 0;
    z-index: 10;
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    gap: 12px;
}

.header-title {
    min-width: 0;
    flex: 1;
}

.header-title h1 {
    font-size: 26px;
    font-weight: 800;
    letter-spacing: -0.03em;
    line-height: 1.1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-subtitle {
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 3px;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-avatar {
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
    transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.header-avatar:active {
    transform: scale(0.9);
}

.header-avatar svg {
    width: 22px;
    height: 22px;
    color: var(--text-secondary);
}

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

.search-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 11px 14px;
    background: var(--bg-secondary);
    border-radius: 14px;
    height: 42px;
}

.search-icon {
    width: 18px;
    height: 18px;
    color: var(--text-secondary);
    flex-shrink: 0;
}

.search-bar input {
    flex: 1;
    font-size: 15px;
    color: var(--text);
    background: transparent;
    min-width: 0;
    width: 100%;
}

.search-bar input::placeholder {
    color: var(--text-secondary);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    width: 100%;
}

.category-card {
    aspect-ratio: 1 / 1.15;
    border-radius: 22px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
    min-width: 0;
    cursor: pointer;
    will-change: transform;
}

.category-card:active {
    transform: scale(0.96);
}

.category-card-large {
    grid-column: span 2;
    aspect-ratio: 2.15 / 1;
}

.category-card-content {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100%;
    width: 100%;
    position: relative;
}

.category-card-large .category-card-content {
    flex-direction: row;
    align-items: center;
}

.category-card-text {
    display: flex;
    flex-direction: column;
    gap: 3px;
    z-index: 1;
    flex: 1;
    min-width: 0;
}

.category-card-large .category-card-text {
    max-width: 55%;
}

.category-name {
    font-size: 17px;
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.15;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.category-card-large .category-name {
    font-size: 22px;
    -webkit-line-clamp: 1;
    line-clamp: 1;
}

.category-subtitle {
    font-size: 12px;
    font-weight: 500;
    opacity: 0.7;
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.category-card-large .category-subtitle {
    font-size: 13px;
}

.category-icon-wrap {
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    margin-top: auto;
}

.category-card-large .category-icon-wrap {
    margin-top: 0;
    margin-left: auto;
    align-items: center;
}

.category-icon-wrap svg {
    width: 56px;
    height: 56px;
    color: currentColor;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.08));
}

.category-card-large .category-icon-wrap svg {
    width: 72px;
    height: 72px;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
    width: 100%;
}

.product-card {
    background: var(--card);
    border-radius: 18px;
    overflow: hidden;
    transition: transform 0.15s ease;
    display: flex;
    flex-direction: column;
    min-width: 0;
    border: 1px solid var(--border);
}

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

.product-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: var(--bg-secondary);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

.product-image-placeholder {
    width: 40%;
    height: 40%;
    color: var(--text-secondary);
    opacity: 0.3;
}

.product-add-btn {
    position: absolute;
    right: 8px;
    bottom: 8px;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-full);
    background: var(--text);
    color: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.12);
    transition: transform 0.15s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: 2;
    padding: 0;
}

.product-add-btn:active {
    transform: scale(0.85);
}

.product-add-btn svg {
    width: 16px;
    height: 16px;
    stroke-width: 3;
}

.product-add-btn.disabled {
    background: var(--border);
    color: var(--text-secondary);
    box-shadow: none;
    cursor: default;
}

.product-add-btn.disabled:active {
    transform: none;
}

.product-stock {
    position: absolute;
    top: 8px;
    left: 8px;
    max-width: calc(100% - 16px);
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    padding: 4px 9px;
    border-radius: 999px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-stock-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #34c759;
    flex-shrink: 0;
    box-shadow: 0 0 0 2px rgba(52, 199, 89, 0.3);
}

.product-stock-empty {
    background: rgba(30, 30, 30, 0.6);
    color: #ffb4b4;
}

.product-stock-empty .product-stock-dot {
    background: #ff3b30;
    box-shadow: 0 0 0 2px rgba(255, 59, 48, 0.3);
}

.product-detail-stock {
    position: absolute;
    bottom: 8px;
    left: 8px;
    display: flex;
    align-items: center;
    gap: 5px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 11px;
    border-radius: 999px;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 2;
}

.product-info {
    padding: 10px 12px 12px;
    display: flex;
    flex-direction: column;
    gap: 3px;
    flex: 1;
    min-width: 0;
}

.product-price {
    font-size: 17px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.02em;
    line-height: 1.1;
}

.product-name {
    font-size: 13px;
    font-weight: 500;
    color: var(--text-secondary);
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    letter-spacing: -0.01em;
}

.product-stock {
    font-size: 11px;
    color: var(--text-secondary);
    font-weight: 500;
}

.product-stock.out-of-stock {
    color: #FF3B30;
}

.cart-bar {
    position: fixed;
    bottom: calc(12px + var(--safe-bottom));
    left: 12px;
    right: 12px;
    background: var(--text);
    color: var(--bg);
    padding: 14px 18px;
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
    z-index: 20;
    max-width: calc(100% - 24px);
}

.cart-info {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
    font-size: 14px;
    min-width: 0;
}

.cart-text {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.cart-count {
    background: rgba(255, 255, 255, 0.2);
    padding: 3px 9px;
    border-radius: var(--radius-full);
    font-weight: 700;
    font-size: 12px;
    min-width: 22px;
    text-align: center;
    flex-shrink: 0;
}

.cart-total {
    font-weight: 800;
    font-size: 16px;
    letter-spacing: -0.01em;
    flex-shrink: 0;
    margin-left: 12px;
}

.product-detail {
    padding: 0 12px;
}

.product-detail-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: var(--bg-secondary);
    border-radius: 22px;
    overflow: hidden;
    margin-bottom: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

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

.product-detail-image .product-image-placeholder {
    width: 35%;
    height: 35%;
}

.product-detail-price {
    font-size: 28px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 6px;
    letter-spacing: -0.03em;
    line-height: 1;
}

.product-detail-name {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 14px;
    letter-spacing: -0.01em;
    line-height: 1.25;
    color: var(--text);
}

.product-detail-description {
    font-size: 14px;
    color: var(--text-secondary);
    line-height: 1.5;
    margin-bottom: 20px;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-secondary);
    padding: 6px;
    border-radius: 14px;
    width: fit-content;
    margin-bottom: 20px;
}

.quantity-btn {
    width: 34px;
    height: 34px;
    border-radius: 10px;
    background: var(--card);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.quantity-btn:active {
    transform: scale(0.9);
}

.quantity-btn svg {
    width: 16px;
    height: 16px;
    stroke-width: 2.5;
}

.quantity-value {
    min-width: 32px;
    text-align: center;
    font-size: 16px;
    font-weight: 700;
}

.add-to-cart-btn {
    width: 100%;
    padding: 16px;
    background: var(--text);
    color: var(--bg);
    border-radius: 16px;
    font-size: 16px;
    font-weight: 700;
    transition: transform 0.15s ease;
    letter-spacing: -0.01em;
}

.add-to-cart-btn:active {
    transform: scale(0.98);
}

.cart-item {
    background: var(--card);
    border-radius: 18px;
    padding: 12px;
    margin-bottom: 10px;
    display: flex;
    gap: 12px;
    border: 1px solid var(--border);
}

.cart-item-image {
    width: 72px;
    height: 72px;
    border-radius: 14px;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

.cart-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cart-item-image svg {
    width: 36px;
    height: 36px;
    color: var(--text-secondary);
    opacity: 0.3;
}

.cart-item-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 6px;
}

.cart-item-top {
    display: flex;
    justify-content: space-between;
    gap: 8px;
    align-items: flex-start;
}

.cart-item-name {
    font-size: 14px;
    font-weight: 600;
    color: var(--text);
    line-height: 1.25;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.cart-item-remove {
    width: 26px;
    height: 26px;
    border-radius: var(--radius-full);
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.15s ease;
}

.cart-item-remove:active {
    transform: scale(0.9);
}

.cart-item-remove svg {
    width: 12px;
    height: 12px;
    color: var(--text-secondary);
    stroke-width: 2.5;
}

.cart-item-bottom {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cart-item-qty {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--bg-secondary);
    border-radius: 10px;
    padding: 4px;
}

.cart-item-qty-btn {
    width: 26px;
    height: 26px;
    border-radius: 8px;
    background: var(--card);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.15s ease;
}

.cart-item-qty-btn:active {
    transform: scale(0.9);
}

.cart-item-qty-btn svg {
    width: 13px;
    height: 13px;
    stroke-width: 2.5;
}

.cart-item-qty-value {
    min-width: 20px;
    text-align: center;
    font-size: 14px;
    font-weight: 700;
}

.cart-item-price {
    font-size: 15px;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.01em;
}

.cart-checkout-block {
    margin-top: 20px;
    padding-bottom: calc(20px + var(--safe-bottom));
}

.cart-summary {
    background: var(--card);
    border-radius: 18px;
    padding: 14px 16px;
    margin-bottom: 12px;
    border: 1px solid var(--border);
}

.cart-summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 14px;
    color: var(--text-secondary);
    padding: 4px 0;
}

.cart-summary-total {
    font-size: 17px;
    font-weight: 800;
    color: var(--text);
    border-top: 1px solid var(--border);
    margin-top: 6px;
    padding-top: 10px;
}

.cart-summary-total span:last-child {
    color: var(--text);
}

.checkout-btn {
    width: 100%;
    padding: 16px;
    background: var(--text);
    color: var(--bg);
    border-radius: 16px;
    font-size: 16px;
    font-weight: 700;
    transition: transform 0.15s ease;
    letter-spacing: -0.01em;
}

.checkout-btn:active {
    transform: scale(0.98);
}

.checkout-btn:disabled {
    opacity: 0.4;
}

.cart-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--text-secondary);
}

.cart-empty-icon {
    width: 72px;
    height: 72px;
    border-radius: var(--radius-full);
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 16px;
}

.cart-empty-icon svg {
    width: 32px;
    height: 32px;
    color: var(--text-secondary);
}

.cart-empty-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 4px;
}

.cart-empty-sub {
    font-size: 13px;
    margin-bottom: 20px;
}

.checkout-form {
    padding-bottom: calc(20px + var(--safe-bottom));
}

.checkout-block {
    margin-bottom: 20px;
}

.checkout-block-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    padding: 0 6px 8px;
}

.checkout-field {
    background: var(--card);
    border-radius: 14px;
    padding: 4px 16px;
    margin-bottom: 8px;
    border: 1px solid var(--border);
}

.checkout-field input {
    width: 100%;
    padding: 14px 0;
    font-size: 16px;
    color: var(--text);
    background: transparent;
}

.checkout-field input::placeholder {
    color: var(--text-secondary);
}

.checkout-field:focus-within {
    border-color: var(--accent);
}

.payment-options {
    display: grid;
    gap: 8px;
}

.payment-option {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 14px 16px;
    background: var(--card);
    border-radius: 14px;
    border: 2px solid transparent;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
}

.payment-option.selected {
    border-color: var(--accent);
    background: var(--card-hover);
}

.payment-option-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.payment-option-icon svg {
    width: 20px;
    height: 20px;
    color: var(--text);
}

.payment-option-text {
    flex: 1;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}

.payment-option-badge {
    font-size: 11px;
    font-weight: 600;
    color: var(--text-secondary);
    background: var(--bg-secondary);
    padding: 3px 8px;
    border-radius: var(--radius-full);
}

.checkout-order-summary {
    background: var(--card);
    border-radius: 18px;
    padding: 14px 16px;
    margin: 16px 0 12px;
    border: 1px solid var(--border);
}

.checkout-order-row {
    display: flex;
    justify-content: space-between;
    font-size: 14px;
    color: var(--text-secondary);
    padding: 4px 0;
}

.checkout-order-total {
    display: flex;
    justify-content: space-between;
    font-size: 17px;
    font-weight: 800;
    color: var(--text);
    border-top: 1px solid var(--border);
    margin-top: 6px;
    padding-top: 10px;
}

.success-content {
    text-align: center;
    padding: 80px 20px;
}

.success-icon {
    width: 80px;
    height: 80px;
    border-radius: var(--radius-full);
    background: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 20px;
}

.success-icon svg {
    width: 40px;
    height: 40px;
    color: var(--accent-text);
    stroke-width: 2.5;
}

.success-content h2 {
    font-size: 22px;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 8px;
}

.success-content p {
    font-size: 15px;
    color: var(--text-secondary);
    margin-bottom: 30px;
    line-height: 1.5;
}

.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--text-secondary);
    font-size: 14px;
    grid-column: 1 / -1;
}

@media (min-width: 420px) {
    .categories-grid,
    .products-grid {
        gap: 12px;
    }

.section {
        padding: 0 16px;
    }

    .header {
        padding: 16px 16px 10px;
    }

    .cart-bar {
        left: 16px;
        right: 16px;
        max-width: calc(100% - 32px);
    }

    .product-detail {
        padding: 0 16px;
    }

    .category-name {
        font-size: 18px;
    }

    .category-card-large .category-name {
        font-size: 24px;
    }
}

.order-card {
    background: var(--card);
    border-radius: 18px;
    padding: 12px;
    margin-bottom: 10px;
    border: 1px solid var(--border);
}

.order-card-top {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}

.order-card-id {
    font-weight: 600;
    font-size: 15px;
}

.order-status {
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-radius: 999px;
    white-space: nowrap;
}

.status-pending {
    color: #f5a623;
    background: rgba(245, 166, 35, 0.12);
}

.status-confirmed {
    color: #34c759;
    background: rgba(52, 199, 89, 0.12);
}

.status-declined {
    color: #ff3b30;
    background: rgba(255, 59, 48, 0.12);
}

.order-card-body {
    display: flex;
    gap: 12px;
}

.order-card-img {
    width: 64px;
    height: 64px;
    border-radius: 12px;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    overflow: hidden;
}

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

.order-card-img svg {
    width: 32px;
    height: 32px;
    color: var(--text-secondary);
    opacity: 0.3;
}

.order-card-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.order-card-name {
    font-weight: 600;
    font-size: 15px;
    line-height: 1.3;
}

.order-card-meta {
    font-size: 13px;
    color: var(--text-secondary);
}

.order-card-date {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-secondary);
}

@media (min-width: 600px) {
    #app {
        max-width: 600px;
        margin: 0 auto;
    }

    .categories-grid,
    .products-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .category-card-large {
        grid-column: span 3;
        aspect-ratio: 3 / 1;
    }

    .cart-bar {
        max-width: 568px;
        left: 50%;
        transform: translateX(-50%);
    }
}
