* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Inter', sans-serif;
    -webkit-tap-highlight-color: transparent;
}

:root {
    --bg-color: #f8f9fa;
    --card-bg: #ffffff;
    --text-main: #111111;
    --text-sec: #888888;
    --accents: #000000;
    --border: #eeeeee;
}

body {
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    justify-content: center;
}

#app {
    width: 100%;
    max-width: 600px;
    height: 100vh;
    height: 100dvh;
    display: flex;
    flex-direction: column;
    position: relative;
    background-color: var(--bg-color);
}

.header {
    padding: 24px 20px 10px 20px;
    background-color: var(--bg-color);
    position: sticky;
    top: 0;
    z-index: 10;
}

.header h1 {
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.5px;
}

.seller-tabs {
    display: flex;
    overflow-x: auto;
    gap: 8px;
    margin-top: 16px;
    padding-bottom: 4px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.seller-tabs::-webkit-scrollbar {
    display: none;
}

.seller-tab {
    padding: 8px 16px;
    border-radius: 20px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    color: var(--text-sec);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s ease;
    user-select: none;
}

.seller-tab:active {
    transform: scale(0.96);
}

.seller-tab.active {
    background: var(--accents);
    color: white;
    border-color: var(--accents);
}

.product-list {
    flex: 1;
    overflow-y: auto;
    padding: 10px 16px 120px 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Scrollbar hide for webkit */
.product-list::-webkit-scrollbar {
    display: none;
}
.product-list {
    -ms-overflow-style: none;
    scrollbar-width: none;
}

.product-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid var(--border);
    transition: transform 0.1s;
}

.product-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.product-name {
    font-size: 16px;
    font-weight: 500;
}

.product-price {
    font-size: 14px;
    color: var(--text-sec);
    font-weight: 500;
}

.cart-action {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 40px;
    min-width: 110px;
    border-radius: 20px;
    background: var(--accents);
    color: white;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.cart-action:active {
    transform: scale(0.96);
}

.cart-action.active {
    background: var(--card-bg);
    color: var(--text-main);
    border: 1.5px solid var(--border);
    justify-content: space-between;
    padding: 0 4px;
}

.cart-btn {
    width: 32px;
    height: 32px;
    border-radius: 16px;
    background: var(--bg-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 20px;
    cursor: pointer;
    color: var(--text-main);
}

.cart-btn:active {
    background: var(--border);
}

.cart-count {
    font-size: 15px;
    font-weight: 600;
    width: 28px;
    text-align: center;
}

.search-container {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    background: linear-gradient(to top, var(--bg-color) 70%, transparent);
    z-index: 20;
}

#search-input {
    width: 100%;
    height: 56px;
    border-radius: 28px;
    border: 1px solid var(--border);
    padding: 0 24px;
    font-size: 16px;
    background: var(--card-bg);
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
    outline: none;
    transition: all 0.3s ease;
}

#search-input:focus {
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    border-color: #cccccc;
}

/* Unit selector */
.unit-selector {
    margin-top: 6px;
    display: flex;
    gap: 4px;
}
.unit-btn {
    padding: 4px 8px;
    border-radius: 6px;
    border: 1px solid var(--border);
    background: var(--bg-color);
    font-size: 12px;
    cursor: pointer;
    color: var(--text-sec);
    transition: all 0.2s;
}
.unit-btn.active {
    background: var(--text-main);
    color: white;
    border-color: var(--text-main);
}

/* Sticky Checkout Button */
#checkout-button-container {
    position: absolute;
    bottom: 80px; /* Above the search bar */
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 500px;
    z-index: 15;
    transition: transform 0.3s ease, opacity 0.3s ease;
}

#checkout-button-container.hidden {
    transform: translate(-50%, 40px);
    opacity: 0;
    pointer-events: none;
}

.checkout-btn {
    width: 100%;
    padding: 16px;
    border-radius: 16px;
    background: #000;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 16px rgba(0,0,0,0.15);
    display: flex;
    justify-content: center;
    align-items: center;
}
.checkout-btn:active {
    transform: translateY(2px) scale(0.98);
}

/* Modal */
.modal {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 200;
    display: flex;
    justify-content: center;
    align-items: flex-end;
    transition: opacity 0.3s;
}

.modal.hidden {
    opacity: 0;
    pointer-events: none;
}

.modal-content {
    background: var(--card-bg);
    width: 100%;
    max-width: 600px;
    border-radius: 24px 24px 0 0;
    padding: 24px;
    transform: translateY(0);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.modal.hidden .modal-content {
    transform: translateY(100%);
}

.close-btn {
    position: absolute;
    top: 20px;
    right: 24px;
    font-size: 24px;
    cursor: pointer;
    color: var(--text-sec);
    line-height: 1;
}

.modal-content h2 {
    font-size: 20px;
    margin-bottom: 20px;
}

#modal-cart-items {
    max-height: 40vh;
    overflow-y: auto;
    margin-bottom: 16px;
}

.modal-item {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px solid var(--border);
    font-size: 14px;
}

.total-price-modal {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    text-align: right;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    font-size: 14px;
    color: var(--text-sec);
    margin-bottom: 8px;
}

.form-group textarea {
    width: 100%;
    border-radius: 12px;
    border: 1px solid var(--border);
    padding: 12px;
    font-family: inherit;
    font-size: 14px;
    resize: vertical;
    min-height: 80px;
    outline: none;
}

.form-group textarea:focus {
    border-color: #aaa;
}

.submit-btn {
    width: 100%;
    padding: 16px;
    border-radius: 16px;
    background: #000;
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    border: none;
    cursor: pointer;
}
.submit-btn:active {
    background: #333;
}

/* Order History Styles */
.history-link {
    color: var(--text-sec);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: color 0.2s;
}

.history-link:active {
    color: var(--text-main);
}

.empty-state {
    text-align: center;
    color: var(--text-sec);
    padding: 40px 20px;
    font-size: 15px;
}

.order-card {
    background: var(--card-bg);
    border-radius: 20px;
    padding: 20px;
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    border-bottom: 1px dashed var(--border);
    padding-bottom: 12px;
}

.order-seller {
    font-size: 16px;
    font-weight: 600;
}

.order-date {
    font-size: 12px;
    color: var(--text-sec);
    margin-top: 4px;
}

.order-id {
    font-size: 12px;
    font-weight: 500;
    color: var(--text-sec);
    background: var(--bg-color);
    padding: 4px 8px;
    border-radius: 12px;
}

.order-body {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

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

.order-item-name {
    color: var(--text-main);
}

.order-item-price {
    font-weight: 500;
    white-space: nowrap;
    margin-left: 10px;
}

.order-comment {
    background: #fdfdfd;
    padding: 12px;
    border-radius: 12px;
    font-size: 13px;
    color: var(--text-sec);
    border: 1px solid var(--border);
}

.order-comment strong {
    color: var(--text-main);
    font-weight: 500;
}

.order-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 12px;
    border-top: 1px dashed var(--border);
}

.order-total-label {
    font-weight: 500;
    font-size: 15px;
}

.order-total-amount {
    font-weight: 600;
    font-size: 18px;
}

/* Admin Styles */
.admin-body {
    background-color: var(--bg-color);
}
.admin-app {
    padding-bottom: 20px;
}
.admin-section {
    padding: 0 16px;
    margin-top: 10px;
}
.admin-section.hidden {
    display: none;
}
.admin-actions {
    display: flex;
    justify-content: flex-end;
}
.admin-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}
.admin-card {
    background: var(--card-bg);
    border-radius: 12px;
    padding: 16px;
    border: 1px solid var(--border);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.admin-input {
    width: 100%;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid var(--border);
    font-size: 14px;
    margin-bottom: 4px;
    outline: none;
    font-family: inherit;
}
.admin-input:focus {
    border-color: #aaa;
}
.danger-btn {
    background: #ff4d4f;
    color: white;
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
}
.danger-btn:active {
    background: #e63946;
}
.secondary-btn {
    background: var(--border);
    color: var(--text-main);
    border: none;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 13px;
    font-weight: 500;
    margin-right: 4px;
}
.secondary-btn:active {
    background: #ddd;
}
.flex-row {
    display: flex;
    gap: 8px;
    align-items: center;
}
