/* Reset and Base Styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: white;
    color: #1f2937;
    line-height: 1.5;
}

html,
body {
    height: 100%;
    overscroll-behavior-y: none;
}

/* View Management */
.view {
    min-height: 100svh;
}

/* Login View */
.login-container {
    min-height: 100svh;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
}

.login-card {
    width: 100%;
    max-width: 28rem;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    border: 1px solid #f3f4f6;
    margin: auto;
}

.login-header {
    background: linear-gradient(to right, #fb923c, #f97316);
    padding: 2.5rem 2rem;
    text-align: center;
}

.login-header h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
}

.login-header p {
    color: #fed7aa;
}

.login-form-container {
    padding: 2rem;
}

.login-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-group {
    display: flex;
    flex-direction: column;
}

.form-group label {
    display: block;
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.25rem;
}

.form-group input {
    width: 100%;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    border: 1px solid #d1d5db;
    font-size: 1rem;
    transition: all 0.2s;
    text-align: center;
}

.password-wrapper {
    position: relative;
    width: 100%;
}

.password-wrapper input {
    padding-right: 3rem;
}

.password-toggle {
    position: absolute;
    right: 0.75rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.25rem;
    color: #6b7280;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.2s;
}

.password-toggle:hover {
    color: #1f2937;
}

.eye-icon {
    width: 1.25rem;
    height: 1.25rem;
}

.form-group input:focus {
    outline: none;
    border-color: #f97316;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.2);
}

.login-footer {
    margin-top: auto;
    padding-top: 2rem;
    text-align: center;
    font-size: 0.875rem;
    color: #6b7280;
    width: 100%;
}

/* Buttons */
.btn-primary {
    width: 100%;
    max-width: 400px;
    background-color: #f97316;
    color: white;
    font-weight: 500;
    padding: 0.75rem 1rem;
    border-radius: 0.5rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font-size: 1rem;
}

.btn-primary:hover:not(:disabled) {
    background-color: #ea580c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4);
}

.btn-primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(249, 115, 22, 0.3);
}

.btn-primary:focus {
    outline: none;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.4), 0 0 0 4px rgba(249, 115, 22, 0.1);
}

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

.btn-secondary {
    background: white;
    color: #6b7280;
    padding: 0.5rem 0.75rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    font-weight: 500;
    border: 1px solid rgba(107, 114, 128, 0.3);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
    transition: all 0.2s;
}

.btn-secondary:hover {
    background-color: #f9fafb;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-color: rgba(107, 114, 128, 0.5);
}

.btn-secondary:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-logout {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: #e5e7eb;
    color: #1f2937;
    padding: 0.5rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.btn-logout:hover {
    background-color: #d1d5db;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.btn-logout:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-payment {
    width: 100%;
    padding: 0.75rem;
    border-radius: 0.5rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-payment:not(:disabled) {
    background-color: #f97316;
    color: white;
}

.btn-payment:not(:disabled):hover {
    background-color: #ea580c;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4);
}

.btn-payment:not(:disabled):active {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(249, 115, 22, 0.3);
}

.btn-payment:disabled {
    background-color: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
}

/* Spinner */
.spinner {
    width: 1.25rem;
    height: 1.25rem;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }
    to {
        transform: rotate(360deg);
    }
}

.spinner .opacity-25 {
    opacity: 0.25;
}

.spinner .opacity-75 {
    opacity: 0.75;
}

/* Error/Success Messages */
.error-message {
    background-color: #fef2f2;
    border-left: 4px solid #ef4444;
    padding: 1rem;
    border-radius: 0 0.5rem 0.5rem 0;
}

.error-message p {
    color: #b91c1c;
    font-size: 0.875rem;
}

.success-message {
    background-color: #f0fdf4;
    border-left: 4px solid #22c55e;
    padding: 1rem;
    border-radius: 0 0.5rem 0.5rem 0;
}

.success-message p {
    color: #15803d;
    font-size: 0.875rem;
}

/* Header Bar */
.header-bar {
    position: sticky;
    top: 0;
    z-index: 30;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    padding: 0.5rem 1rem;
    transition: transform 0.25s ease;
    will-change: transform;
}

.header-bar.header-hidden {
    transform: translateY(-100%);
}

@media (min-width: 768px) {
    .header-bar {
        padding: 1rem 1.5rem;
    }
}

.header-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.header-bar h1 {
    font-size: 1.25rem;
    font-weight: 700;
}

@media (min-width: 768px) {
    .header-bar h1 {
        font-size: 1.5rem;
    }
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

@media (min-width: 768px) {
    .header-actions {
        gap: 1rem;
    }
}

.header-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: #374151;
    text-decoration: none;
    transition: color 0.2s;
}

.header-link:hover {
    color: #111827;
}

.icon {
    width: 1.25rem;
    height: 1.25rem;
}

.header-link-text {
    display: none;
    font-weight: 500;
}

@media (min-width: 640px) {
    .header-link-text {
        display: block;
    }
}

.btn-logout-text {
    display: none;
}

@media (min-width: 640px) {
    .btn-logout-text {
        display: block;
    }
}

/* Home Layout */
.home-layout {
    display: flex;
    flex-direction: column;
}

@media (min-width: 1024px) {
    .home-layout {
        flex-direction: row;
        height: calc(100svh - 73px);
    }
}

/* Category Sidebar */
.category-sidebar {
    position: sticky;
    top: 3.5rem;
    z-index: 20;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    overflow-x: auto;
}

@media (min-width: 1024px) {
    .category-sidebar {
        width: 16rem;
        border-bottom: none;
        border-right: 1px solid #e5e7eb;
        overflow-y: auto;
        overflow-x: visible;
    }
}

.search-bar-desktop {
    display: none;
    padding: 1rem;
}

@media (min-width: 1024px) {
    .search-bar-desktop {
        display: block;
    }
}

.search-bar-desktop input {
    width: 100%;
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
}

.search-bar-desktop input:focus {
    outline: none;
    border-color: #f97316;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.5);
}

.search-bar-mobile {
    padding: 0.75rem;
}

@media (min-width: 1024px) {
    .search-bar-mobile {
        display: none;
    }
}

.search-bar-mobile input {
    width: 100%;
    padding: 0.5rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 0.5rem;
    font-size: 1rem;
}

.search-bar-mobile input:focus {
    outline: none;
    border-color: #f97316;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.5);
}

.category-nav {
    display: flex;
    padding: 0 1rem 0.75rem;
    gap: 0.5rem;
    overflow-x: auto;
}

@media (min-width: 1024px) {
    .category-nav {
        flex-direction: column;
        padding: 0;
        overflow-x: visible;
        gap: 0.25rem;
    }
}

.category-btn {
    white-space: nowrap;
    text-align: left;
    padding: 0.5rem 1rem;
    border-radius: 0.5rem;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 1rem;
}

@media (min-width: 1024px) {
    .category-btn {
        width: 100%;
        white-space: normal;
        padding: 0.75rem;
    }
}

.category-btn:hover {
    background-color: #f9fafb;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

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

.category-btn.active {
    background-color: #f3f4f6;
    font-weight: 500;
}

/* Product Grid */
.product-grid-container {
    flex: 1;
    padding: 0.75rem;
}

@media (min-width: 768px) {
    .product-grid-container {
        padding: 1.5rem;
    }
}

@media (min-width: 1024px) {
    .product-grid-container {
        overflow-y: auto;
        overscroll-behavior-y: contain;
    }
}

.product-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.75rem;
}

@media (min-width: 640px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

@media (min-width: 1280px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

.product-card {
    background: white;
    border-radius: 0.5rem;
    border: 2px solid transparent;
    padding: 0.75rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    transition: all 0.2s;
    cursor: pointer;
}

@media (min-width: 768px) {
    .product-card {
        padding: 1rem;
    }
}

.product-card:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    transform: translateY(-2px);
}

.product-card.active {
    border-color: #f97316;
    box-shadow: 0 0 0 1px rgba(249, 115, 22, 0.2), 0 8px 20px rgba(249, 115, 22, 0.15);
}

.product-card h3 {
    font-weight: 700;
    font-size: 0.875rem;
    margin-bottom: 0.5rem;
    min-height: 2.5rem;
}

.product-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
}

.product-price {
    display: flex;
    align-items: center;
}

.product-price-value {
    font-size: 1.125rem;
    font-weight: 700;
    color: #1f2937;
}

.product-price-unit {
    font-size: 0.875rem;
    color: #6b7280;
    margin-left: 0.25rem;
}

.product-add-btn {
    background-color: #f3f4f6;
    color: #374151;
    padding: 0.5rem 1rem;
    border-radius: 0.25rem;
    border: none;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

@media (min-width: 768px) {
    .product-add-btn {
        padding: 0.5rem 1rem;
    }
}

.product-add-btn:hover {
    background-color: #e5e7eb;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.product-add-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.product-add-btn.active {
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: white;
}

.product-add-btn.active:hover {
    background: linear-gradient(135deg, #ea580c, #c2410c);
}

/* Cart Sidebar (Desktop) */
.cart-sidebar {
    display: none;
    width: 24rem;
    background: white;
    border-left: 1px solid #e5e7eb;
    flex-direction: column;
}

@media (min-width: 1024px) {
    .cart-sidebar {
        display: flex;
    }
}

.cart-header {
    padding: 1rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cart-header h2 {
    font-size: 1.25rem;
    font-weight: 700;
}

.cart-clear-btn {
    font-size: 0.875rem;
    color: #4b5563;
    background: none;
    border: none;
    cursor: pointer;
    transition: color 0.2s;
}

.cart-clear-btn:hover {
    color: #111827;
    transform: scale(1.05);
}

.cart-clear-btn:active {
    transform: scale(0.95);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cart-empty {
    text-align: center;
    color: #6b7280;
    padding: 2rem 0;
}

.cart-item {
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 1rem;
}

.cart-item-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    margin-bottom: 0.5rem;
}

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

.cart-item-name {
    font-weight: 700;
    font-size: 0.875rem;
}

.cart-item-price {
    font-size: 0.875rem;
    color: #4b5563;
}

.cart-item-remove {
    color: #ef4444;
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    transition: color 0.2s;
}

.cart-item-remove:hover {
    color: #dc2626;
    transform: scale(1.1);
}

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

.cart-item-remove svg {
    width: 1.25rem;
    height: 1.25rem;
}

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

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background-color: #f3f4f6;
    border-radius: 0.25rem;
    padding: 0.25rem 0.5rem;
}

.cart-item-quantity-btn {
    color: #4b5563;
    background: none;
    border: none;
    font-weight: 700;
    cursor: pointer;
    font-size: 1rem;
    transition: all 0.2s;
    padding: 0.25rem;
    border-radius: 0.25rem;
}

.cart-item-quantity-btn:hover {
    color: #111827;
    background-color: #f3f4f6;
    transform: scale(1.1);
}

.cart-item-quantity-btn:active {
    transform: scale(0.95);
}

.cart-item-quantity-value {
    font-weight: 500;
    min-width: 1.25rem;
    text-align: center;
}

.cart-item-total {
    font-weight: 700;
    font-size: 1.125rem;
}

.cart-item-total-unit {
    font-size: 0.875rem;
    font-weight: 400;
    color: #4b5563;
}

.cart-footer {
    border-top: 1px solid #e5e7eb;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cart-total {
    font-size: 1.5rem;
    font-weight: 700;
}

.cart-payment-note {
    font-size: 0.875rem;
    color: #4b5563;
}

/* Mobile Cart */
.mobile-cart {
    display: block;
    position: relative;
}

@media (min-width: 1024px) {
    .mobile-cart {
        display: none;
    }
}

/* Tablet optimizations */
@media (min-width: 768px) and (max-width: 1023px) {
    .mobile-cart-fab {
        bottom: 2rem;
        min-width: 240px;
        padding: 1rem 2rem;
    }

    .cart-sheet-content {
        max-height: 90vh;
    }

    .cart-sheet-body {
        padding: 1.5rem 2rem;
    }

    .cart-sheet-footer {
        padding: 2rem;
    }
}

/* Floating Action Button */
.mobile-cart-fab {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 40;
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: white;
    border: none;
    border-radius: 2rem;
    padding: 0.875rem 1.5rem;
    box-shadow: 0 10px 25px -5px rgba(249, 115, 22, 0.4), 0 4px 6px -2px rgba(249, 115, 22, 0.3);
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 200px;
    max-width: 90%;
}

.mobile-cart-fab:active {
    transform: translateX(-50%) scale(0.95);
}

.mobile-cart-fab:disabled {
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%) translateY(100px);
}

.fab-content {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    position: relative;
}

.fab-icon {
    width: 1.5rem;
    height: 1.5rem;
}

.fab-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.125rem;
}

.fab-label {
    font-size: 0.75rem;
    opacity: 0.9;
    font-weight: 500;
}

.fab-price {
    font-size: 1rem;
    font-weight: 700;
}

.cart-badge-fab {
    position: absolute;
    top: -0.5rem;
    right: -0.5rem;
    background-color: #ef4444;
    color: white;
    border-radius: 9999px;
    min-width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0 0.375rem;
    border: 2px solid white;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.cart-badge-fab:empty,
.cart-badge-fab[style*="display: none"] {
    display: none !important;
}

/* Bottom Sheet */
.mobile-cart-sheet {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.mobile-cart-sheet.active {
    pointer-events: all;
    opacity: 1;
}

.cart-sheet-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
}

.cart-sheet-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    border-radius: 1.5rem 1.5rem 0 0;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
}

.mobile-cart-sheet.active .cart-sheet-content {
    transform: translateY(0);
}

.cart-sheet-handle {
    width: 3rem;
    height: 0.375rem;
    background: #d1d5db;
    border-radius: 9999px;
    margin: 0.75rem auto;
    cursor: grab;
    padding-bottom: 5px;
}

.cart-sheet-handle:active {
    cursor: grabbing;
}

.cart-sheet-header {
    padding: 1rem 1.5rem;
    border-bottom: 1px solid #e5e7eb;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.cart-sheet-header h2 {
    font-size: 1.5rem;
    font-weight: 700;
    color: #111827;
}

.cart-close-btn {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f3f4f6;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    color: #4b5563;
}

.cart-close-btn:hover {
    background: #e5e7eb;
    color: #111827;
}

.cart-close-btn svg {
    width: 1.25rem;
    height: 1.25rem;
}

.cart-sheet-body {
    flex: 1;
    overflow-y: auto;
    padding: 1rem 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    -webkit-overflow-scrolling: touch;
}

.cart-sheet-body:empty::before {
    content: 'Корзина пуста';
    display: block;
    text-align: center;
    color: #9ca3af;
    padding: 3rem 0;
    font-size: 1rem;
}

.cart-sheet-footer {
    padding: 1.5rem;
    border-top: 1px solid #e5e7eb;
    background: white;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.cart-sheet-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem;
    background: #f9fafb;
    border-radius: 0.75rem;
}

.total-label {
    font-size: 1.125rem;
    font-weight: 600;
    color: #374151;
}

.total-amount {
    font-size: 1.5rem;
    font-weight: 700;
    color: #f97316;
}

.cart-sheet-actions {
    display: flex;
    gap: 0.75rem;
}

.btn-clear-cart {
    flex: 1;
    padding: 0.875rem 1rem;
    background: white;
    color: #6b7280;
    border: 1px solid #d1d5db;
    border-radius: 0.75rem;
    font-weight: 600;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-clear-cart:hover {
    background: #f9fafb;
    border-color: #9ca3af;
    color: #374151;
}

.btn-payment-mobile {
    flex: 1;
    padding: 0.875rem 1rem;
    background: linear-gradient(135deg, #f97316, #ea580c);
    color: white;
    border: none;
    border-radius: 0.75rem;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

.btn-payment-mobile:hover:not(:disabled) {
    background: linear-gradient(135deg, #ea580c, #c2410c);
    box-shadow: 0 6px 16px rgba(249, 115, 22, 0.4);
    transform: translateY(-1px);
}

.btn-payment-mobile:active:not(:disabled) {
    transform: translateY(0);
}

.btn-payment-mobile:disabled {
    background: #e5e7eb;
    color: #9ca3af;
    cursor: not-allowed;
    box-shadow: none;
}

/* Enhanced Mobile Cart Items */
.mobile-cart-items .cart-item {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 1rem;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    transition: all 0.2s;
}

.mobile-cart-items .cart-item:active {
    transform: scale(0.98);
}

.mobile-cart-items .cart-item-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.mobile-cart-items .cart-item-info {
    flex: 1;
    min-width: 0;
}

.mobile-cart-items .cart-item-name {
    font-weight: 700;
    font-size: 1rem;
    color: #111827;
    margin-bottom: 0.25rem;
    word-break: break-word;
}

.mobile-cart-items .cart-item-price {
    font-size: 0.875rem;
    color: #6b7280;
}

.mobile-cart-items .cart-item-remove {
    width: 2.5rem;
    height: 2.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fef2f2;
    color: #ef4444;
    border: none;
    border-radius: 0.5rem;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.mobile-cart-items .cart-item-remove:hover {
    background: #fee2e2;
    color: #dc2626;
}

.mobile-cart-items .cart-item-remove svg {
    width: 1.25rem;
    height: 1.25rem;
}

.mobile-cart-items .cart-item-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 0.75rem;
    border-top: 1px solid #f3f4f6;
}

.mobile-cart-items .cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 1rem;
    background: #f9fafb;
    border-radius: 0.75rem;
    padding: 0.5rem 0.75rem;
}

.mobile-cart-items .cart-item-quantity-btn {
    width: 2rem;
    height: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    color: #374151;
    border: 1px solid #e5e7eb;
    border-radius: 0.5rem;
    font-weight: 700;
    font-size: 1.125rem;
    cursor: pointer;
    transition: all 0.2s;
}

.mobile-cart-items .cart-item-quantity-btn:hover {
    background: #f3f4f6;
    border-color: #d1d5db;
    color: #111827;
}

.mobile-cart-items .cart-item-quantity-btn:active {
    transform: scale(0.95);
}

.mobile-cart-items .cart-item-quantity-value {
    font-weight: 700;
    font-size: 1rem;
    min-width: 2rem;
    text-align: center;
    color: #111827;
}

.mobile-cart-items .cart-item-total {
    font-weight: 700;
    font-size: 1.25rem;
    color: #111827;
}

.mobile-cart-items .cart-item-total-unit {
    font-size: 0.875rem;
    font-weight: 400;
    color: #6b7280;
    margin-left: 0.25rem;
}

/* Kitchen View */
.kitchen-container {
    max-width: 48rem;
    margin: 0 auto;
    padding: 2rem 1rem;
}

@media (min-width: 768px) {
    .kitchen-container {
        padding: 2rem;
    }
}

.kitchen-tabs {
    position: sticky;
    top: 3.5rem;
    z-index: 25;
    margin-bottom: 1.5rem;
    background: white;
    padding-top: 1rem;
}

.kitchen-tab-group {
    overflow: auto;
    display: flex;
    gap: 0.5rem;
    background: white;
    padding: 0.25rem;
    border: 1px solid rgba(107, 114, 128, 0.5);
    border-radius: 0.375rem;
    font-size: 0.875rem;
}

.kitchen-tab-item {
    flex: 1 1 auto;
    flex-shrink: 0;
    display: flex;
    align-items: center;
}

.kitchen-tab-radio {
    display: none;
}

.kitchen-tab-label {
    width: 100%;
    text-align: center;
    cursor: pointer;
    border-radius: 0.375rem;
    padding: 0.5rem 2rem;
    color: #6b7280;
    transition: all 0.2s;
}

.kitchen-tab-radio:checked + .kitchen-tab-label {
    background-color: #f97316;
    color: white;
}

.kitchen-orders {
    display: grid;
    gap: 1rem;
    max-width: 100%;
    margin: 0 auto;
}

.kitchen-order-card {
    background: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    padding: 1rem;
    border: 1px solid #e5e7eb;
}

.kitchen-order-title {
    font-weight: 600;
}

.kitchen-order-details {
    color: #4b5563;
    margin-bottom: 0.5rem;
}

.kitchen-order-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: #e5e7eb;
    color: #1f2937;
    padding: 0.5rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.kitchen-order-btn:hover {
    background-color: #d1d5db;
}

.kitchen-order-btn:active {
    transform: scale(0.95);
}
.kitchen-order-print-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background-color: #e5e7eb;
    color: #1f2937;
    padding: 0.5rem 1.25rem;
    border-radius: 0.5rem;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.875rem;
}

.kitchen-order-print-btn:hover {
    background-color: #d1d5db;
}

.kitchen-order-print-btn:active {
    transform: scale(0.95);
}

.kitchen-empty {
    text-align: center;
    color: #6b7280;
    padding: 2rem 0;
}

/* User View */
.user-container {
    min-height: calc(100svh - 74px);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 1rem;
}

.user-card {
    width: 100%;
    max-width: 28rem;
    background: white;
    border-radius: 1rem;
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    border: 1px solid #f3f4f6;
    margin: auto;
}

.user-header {
    background: linear-gradient(to right, #fb923c, #f97316);
    padding: 2.5rem 2rem;
    text-align: center;
}

.user-header h1 {
    font-size: 1.875rem;
    font-weight: 700;
    color: white;
    margin-bottom: 0.5rem;
}

.user-header p {
    color: #fed7aa;
}

.user-form-container {
    padding: 2rem;
}

.user-form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.form-section {
    padding-top: 1rem;
    border-top: 1px solid #e5e7eb;
}

.form-section-title {
    font-size: 0.875rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 1rem;
}

.password-error {
    color: #dc2626;
    font-size: 0.75rem;
    margin-top: 0.25rem;
}

.user-footer {
    margin-top: auto;
    padding-top: 2rem;
    text-align: center;
    font-size: 0.875rem;
    color: #6b7280;
    width: 100%;
}

.product-card-details {
    margin-top: 0.5rem;
}

.order-edit-btn {
    background-color: #f3f4f6 !important;
    color: #374151 !important;
}

.order-cancel-btn {
    background-color: #fef2f2 !important;
    color: #ef4444 !important;
    border: 1px solid #fee2e2 !important;
}

.order-cancel-btn:hover {
    background-color: #fee2e2 !important;
    color: #dc2626 !important;
}

.order-print-btn {
    background-color: #e5e7eb !important;
    color: #1f2937  !important;
    border: 1px solid #e5e7eb !important;
}

.order-print-btn:hover {
    background-color: #e5e7eb !important;
    color: #1f2937  !important;
}

.paginator-container {
    margin-top: 1rem;
    display: flex;
    justify-content: center;
}

.paginator {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.paginator-current {
    min-width: 2rem;
    text-align: center;
    font-size: 0.875rem;
    font-weight: 600;
    color: #374151;
}

.paginator-btn {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 0.5rem;
    border: 1px solid #d1d5db;
    background: white;
    color: #374151;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.paginator-btn:hover:not(:disabled) {
    background-color: #f9fafb;
    border-color: rgba(107, 114, 128, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.paginator-btn:active:not(:disabled) {
    transform: translateY(0) scale(0.98);
}

.paginator-btn:disabled {
    opacity: 0.45;
    cursor: not-allowed;
    box-shadow: none;
}

.paginator-icon {
    width: 1.125rem;
    height: 1.125rem;
}

/* Modal */
.modal {
    position: fixed;
    z-index: 50;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.2);
}

.modal-content {
    display: flex;
    flex-direction: column;
    background: white;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    border-radius: 0.75rem;
    padding: 1.5rem 1.25rem;
    width: 92.5%;
    max-width: 37.5rem;
    border: 1px solid #e5e7eb;
}

.payment-modal-content {
    max-width: 500px;
    max-height: 100svh;
    overflow: auto;
}

.order-details-list {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    overflow: visible;
    padding: 0.75rem 1rem 1rem;
}

.order-details-modal-content {
    width: 100vw;
    max-width: 100vw;
    height: 100svh;
    max-height: 100svh;
    border-radius: 0;
    border: none;
    box-shadow: none;
    padding: 0;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}

.order-details-modal-content .modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: #fff;
    margin-bottom: 0;
    padding: 1rem 1rem 0.75rem;
    border-bottom: 1px solid #e5e7eb;
    flex-shrink: 0;
}

.order-details-modal-content .modal-header h2 {
    margin-bottom: 0;
}

.order-details-modal-footer {
    position: sticky;
    bottom: 0;
    z-index: 10;
    background-color: #fff;
    margin-top: 0;
    border-top: 1px solid #e5e7eb;
    padding: 0.75rem 1rem max(0.75rem, env(safe-area-inset-bottom));
    flex-shrink: 0;
}

.order-details-total-row {
    display: flex;
    justify-content: space-between;
    font-weight: 600;
    font-size: 1.125rem;
}

.order-details-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.75rem;
    background: #f9fafb;
    border-radius: 0.5rem;
    border: 1px solid #e5e7eb;
}

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

.order-details-item-name {
    font-weight: 500;
    color: #111827;
}

.order-details-item-meta {
    font-size: 0.75rem;
    color: #6b7280;
}

.order-details-item-price {
    font-weight: 600;
    color: #111827;
}

.modal-content h2 {
    color: #111827;
    font-weight: 600;
    font-size: 1.25rem;
    margin-bottom: 0.5rem;
}

.modal-content p {
    font-size: 0.875rem;
    color: #4b5563;
    margin-top: 0.5rem;
}

.modal-actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-top: 1.25rem;
    width: 100%;
}

.modal-actions .btn-primary,
.modal-actions .btn-secondary {
    width: 100%;
    max-width: 300px;
    height: 2.5rem;
    border-radius: 0.375rem;
    font-weight: 500;
    font-size: 0.875rem;
    border: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-actions .btn-primary:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.4);
}

.modal-actions .btn-primary:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(249, 115, 22, 0.3);
}

.modal-actions .btn-secondary {
    background: white;
    color: #4b5563;
    border: 1px solid #d1d5db;
}

.modal-actions .btn-secondary:hover {
    background-color: #f9fafb;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    border-color: rgba(107, 114, 128, 0.5);
}

.modal-actions .btn-secondary:active {
    transform: translateY(0) scale(0.98);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* Confirm Dialog */
.confirm-dialog-overlay {
    opacity: 0;
    transition: opacity 0.18s ease;
}

.confirm-dialog-overlay.confirm-dialog-visible {
    opacity: 1;
}

.confirm-dialog-overlay.confirm-dialog-visible .confirm-dialog-content {
    transform: scale(1) translateY(0);
}

.confirm-dialog-content {
    max-width: 22rem;
    padding: 1.5rem 1.25rem 1.25rem;
    transform: scale(0.92) translateY(12px);
    transition: transform 0.18s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.confirm-dialog-message {
    font-size: 1rem;
    font-weight: 500;
    color: #1f2937;
    margin: 0 0 0.25rem;
    line-height: 1.5;
    text-align: center;
}

@media (max-width: 480px) {
    .confirm-dialog-content {
        max-width: 92%;
        padding: 1.25rem 1rem 1rem;
    }

    .confirm-dialog-message {
        font-size: 0.9375rem;
    }

    .modal-actions .btn-primary,
    .modal-actions .btn-secondary {
        height: 2.75rem;
        font-size: 0.9375rem;
    }
}

/* Toasts */
.toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    z-index: 60;
    pointer-events: none;
}

.toast {
    min-width: 240px;
    max-width: 320px;
    padding: 0.75rem 1rem;
    border-radius: 0.75rem;
    background: #111827;
    color: #f9fafb;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    pointer-events: auto;
    font-weight: 500;
}

.toast.show {
    opacity: 1;
    transform: translateY(0);
}

.toast-success {
    background: linear-gradient(135deg, #22c55e, #16a34a);
}

.toast-error {
    background: linear-gradient(135deg, #ef4444, #dc2626);
}

/* Global API Loader */
.global-loader {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    z-index: 9999;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}

.global-loader.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.global-loader__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(17, 24, 39, 0.28);
    backdrop-filter: blur(2px);
}

.global-loader__spinner {
    position: relative;
    z-index: 1;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 4px solid rgba(255, 255, 255, 0.35);
    border-top-color: #f97316;
    animation: spin 0.8s linear infinite;
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.25);
}

/* Payment Modal */
.payment-row {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    flex-wrap: wrap;
    margin-top: 1rem;
}

.payment-label {
    font-size: 1rem;
    font-weight: 500;
    color: #374151;
    margin-bottom: 0.25rem;
    min-width: 6.25rem;
}

.payment-value {
    font-size: 1rem;
    font-weight: 500;
    color: #374151;
    padding: 0.5rem;
}

.payment-options {
    font-size: 1rem;
    font-weight: 500;
    color: #374151;
    padding: 0 0.5rem 0.5rem;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
}

.payment-option {
    display: flex;
    gap: 0.5rem;
    align-items: center;
    cursor: pointer;
}

.payment-option-label {
    color: #374151;
    user-select: none;
}

.payment-input {
    flex: 1;
    padding: 0.5rem;
    border-radius: 0.5rem;
    border: 1px solid #d1d5db;
    font-size: 1rem;
    transition: all 0.2s;
}

.payment-input:focus {
    outline: none;
    border-color: #f97316;
    box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.2);
}

.payment-hint {
    font-size: 0.75rem;
    margin-top: 1rem;
    color: #6b7280;
}
