/* ========================================
   UNKÉ NARU - GEN Z MODERN STYLE (FIXED SCROLLABLE VERSION)
   Glassmorphism • Gradients • Animations
   ======================================== */

/* === VARIABLES === */
:root {
    /* Modern Color Palette */
    --primary: #6366f1;
    --primary-dark: #4f46e5;
    --primary-light: #818cf8;
    
    --gold: #f59e0b;
    --gold-light: #fbbf24;
    
    --success: #10b981;
    --warning: #f59e0b;
    --error: #ef4444;
    
    --bg-primary: #0f172a;
    --bg-secondary: #1e293b;
    --bg-tertiary: #334155;
    
    --text-primary: #f8fafc;
    --text-secondary: #cbd5e1;
    --text-muted: #64748b;
    
    --glass-bg: rgba(255, 255, 255, 0.05);
    --glass-border: rgba(255, 255, 255, 0.1);
    
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.1);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.15);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.2);
    
    --border-radius: 16px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === RESET & BASE === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    position: relative;
}

/* === ANIMATED BACKGROUND === */
.animated-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.bg-gradient-1, .bg-gradient-2, .bg-gradient-3 {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.3;
    animation: float 20s ease-in-out infinite;
}

.bg-gradient-1 {
    width: 500px;
    height: 500px;
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    top: -200px;
    left: -200px;
    animation-delay: 0s;
}

.bg-gradient-2 {
    width: 400px;
    height: 400px;
    background: linear-gradient(135deg, #f59e0b, #f97316);
    bottom: -150px;
    right: -150px;
    animation-delay: 7s;
}

.bg-gradient-3 {
    width: 300px;
    height: 300px;
    background: linear-gradient(135deg, #10b981, #06b6d4);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: 14s;
}

@keyframes float {
    0%, 100% {
        transform: translate(0, 0) rotate(0deg);
    }
    33% {
        transform: translate(50px, -50px) rotate(120deg);
    }
    66% {
        transform: translate(-50px, 50px) rotate(240deg);
    }
}

/* === GLASS CARD === */
.glass-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
}

/* === TOP BAR === */
.topbar {
    position: sticky;
    top: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 24px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--glass-border);
}

.topbar-left, .topbar-right {
    display: flex;
    align-items: center;
    gap: 16px;
}

.icon-btn-circle {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.icon-btn-circle:hover {
    background: rgba(99, 102, 241, 0.2);
    border-color: var(--primary);
    transform: translateY(-2px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
}

.brand-logo {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--gold), var(--gold-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 800;
    font-size: 14px;
    color: white;
}

.brand-name {
    font-size: 16px;
    font-weight: 700;
    letter-spacing: 0.5px;
}

.brand-subtitle {
    font-size: 12px;
    color: var(--text-secondary);
}

/* === MAIN CONTAINER === */
.main-container {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: 320px 1fr;
    gap: 16px;
    padding: 16px;
    min-height: calc(100vh - 72px);
}

/* === CART PANEL === */
.cart-panel {
    display: flex;
    flex-direction: column;
    max-height: calc(100vh - 104px);
    overflow: hidden;
}

.cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.section-title {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 16px;
    font-weight: 700;
}

.cart-badge {
    min-width: 28px;
    height: 28px;
    padding: 0 8px;
    border-radius: 20px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
    font-weight: 700;
}

/* === MEMBER SECTION === */
.member-section {
    padding: 12px 16px;
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
}

.member-input-group {
    display: flex;
    gap: 8px;
}

.input-modern {
    flex: 1;
    padding: 10px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    color: var(--text-primary);
    font-size: 13px;
    transition: var(--transition);
}

.input-modern:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.input-modern::placeholder {
    color: var(--text-muted);
}

.btn-primary-small {
    padding: 10px 16px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: var(--transition);
}

.btn-primary-small:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(99, 102, 241, 0.4);
}

/* === MEMBER BADGE === */
.member-badge {
    margin-top: 12px;
    padding: 12px;
    background: rgba(16, 185, 129, 0.1);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.member-avatar {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, var(--success), #059669);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.member-name {
    font-size: 14px;
    font-weight: 600;
}

.member-points {
    font-size: 12px;
    color: var(--text-secondary);
}

.error-message {
    margin-top: 8px;
    padding: 8px 12px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    border-radius: 8px;
    color: var(--error);
    font-size: 13px;
}

/* === CART ITEMS === */
.cart-items-container {
    flex: 1;
    overflow-y: auto;
    padding: 12px 16px;
    min-height: 150px;
}

.empty-state {
    height: 100%;
    min-height: 200px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.empty-icon {
    font-size: 64px;
    opacity: 0.3;
    margin-bottom: 16px;
}

.empty-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 4px;
}

.empty-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
}

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

.cart-item {
    padding: 12px;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    transition: var(--transition);
}

.cart-item:hover {
    background: var(--bg-tertiary);
    transform: translateX(-4px);
}

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

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

.cart-item-price {
    font-size: 12px;
    color: var(--text-secondary);
}

.cart-item-total {
    font-size: 14px;
    font-weight: 700;
    color: var(--gold);
}

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

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

.qty-btn {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 600;
    transition: var(--transition);
}

.qty-btn:hover {
    background: var(--primary);
    border-color: var(--primary);
}

.qty-display {
    min-width: 32px;
    text-align: center;
    font-weight: 600;
}

.btn-remove {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--error);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: var(--transition);
}

.btn-remove:hover {
    background: var(--error);
    color: white;
}

/* === CART FOOTER === */
.cart-footer {
    padding: 14px 16px;
    border-top: 1px solid var(--glass-border);
    flex-shrink: 0;
    background: var(--glass-bg);
}

.cart-total {
    margin-bottom: 12px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    padding: 6px 0;
    font-size: 13px;
    color: var(--text-secondary);
}

.total-main {
    padding-top: 10px;
    border-top: 1px solid var(--glass-border);
    font-size: 16px;
    font-weight: 700;
    color: var(--text-primary);
}

.total-main span:last-child {
    color: var(--gold);
}

.btn-checkout {
    width: 100%;
    padding: 13px;
    background: linear-gradient(135deg, var(--success), #059669);
    border: none;
    border-radius: 10px;
    color: white;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: relative;
    overflow: hidden;
    transition: var(--transition);
}

.btn-checkout:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(16, 185, 129, 0.4);
}

.btn-shine {
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
    animation: shine 3s infinite;
}

@keyframes shine {
    to {
        left: 100%;
    }
}

.item-count {
    text-align: center;
    margin-top: 6px;
    font-size: 11px;
    color: var(--text-secondary);
}

/* === PRODUCTS PANEL === */
.products-panel {
    display: flex;
    flex-direction: column;
    min-height: calc(100vh - 104px);
}

.products-header {
    padding: 14px;
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: var(--border-radius);
    margin-bottom: 14px;
    flex-shrink: 0;
}

.search-box {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    margin-bottom: 12px;
    transition: var(--transition);
}

.search-box:focus-within {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.1);
}

.search-box svg {
    color: var(--text-muted);
}

.search-box input {
    flex: 1;
    background: none;
    border: none;
    color: var(--text-primary);
    font-size: 13px;
}

.search-box input:focus {
    outline: none;
}

.filter-chips {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.chip {
    padding: 7px 14px;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 20px;
    color: var(--text-secondary);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    transition: var(--transition);
}

.chip:hover {
    background: var(--bg-tertiary);
}

.chip.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-color: transparent;
}

/* === PRODUCTS GRID === */
.products-grid {
    flex: 1;
    padding: 0 14px 14px;
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
    align-content: start;
}

.products-empty {
    grid-column: 1 / -1;
    min-height: 300px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.products-empty-icon {
    font-size: 80px;
    opacity: 0.2;
    margin-bottom: 20px;
}

.products-empty-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 8px;
}

.products-empty-text {
    font-size: 14px;
    color: var(--text-secondary);
}

.product-card {
    background: var(--glass-bg);
    backdrop-filter: blur(20px);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    position: relative;
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(99, 102, 241, 0.3);
    border-color: var(--primary);
}

.product-card:active {
    transform: translateY(-3px);
}

.product-image {
    width: 100%;
    height: 130px;
    object-fit: cover;
    background: var(--bg-secondary);
}

.product-info {
    padding: 10px;
}

.product-name {
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 5px;
    line-height: 1.3;
    min-height: 30px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-price {
    font-size: 14px;
    font-weight: 700;
    color: var(--gold);
    margin-bottom: 3px;
}

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

.product-stock.low {
    color: var(--warning);
}

.product-stock.out {
    color: var(--error);
}

.product-card.out-of-stock {
    opacity: 0.5;
    cursor: not-allowed;
}

.product-card.out-of-stock:hover {
    transform: none;
    box-shadow: none;
}

/* === LOADING === */
.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(8px);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-spinner {
    position: relative;
    width: 80px;
    height: 80px;
    margin-bottom: 20px;
}

.spinner-ring {
    position: absolute;
    inset: 0;
    border: 4px solid transparent;
    border-top-color: var(--primary);
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

.spinner-ring:nth-child(2) {
    border-top-color: var(--gold);
    animation-delay: 0.15s;
}

.spinner-ring:nth-child(3) {
    border-top-color: var(--success);
    animation-delay: 0.3s;
}

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

.loading-text {
    color: var(--text-secondary);
    font-size: 14px;
}

/* === MODAL === */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.9);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    animation: fadeIn 0.3s ease-out;
}

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

.modal-content {
    max-width: 500px;
    width: 90%;
    background: var(--glass-bg);
    backdrop-filter: blur(30px);
    border: 1px solid var(--glass-border);
    border-radius: 24px;
    padding: 40px;
    text-align: center;
    animation: slideUp 0.3s ease-out;
    max-height: 90vh;
    overflow-y: auto;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.success-animation {
    margin-bottom: 24px;
}

.success-circle {
    width: 80px;
    height: 80px;
    margin: 0 auto;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--success), #059669);
    display: flex;
    align-items: center;
    justify-content: center;
    animation: scaleUp 0.5s ease-out;
}

@keyframes scaleUp {
    from {
        transform: scale(0);
    }
    to {
        transform: scale(1);
    }
}

.modal-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 8px;
}

.modal-subtitle {
    font-size: 14px;
    color: var(--text-secondary);
    margin-bottom: 24px;
}

.order-summary {
    margin-bottom: 24px;
    padding: 20px;
    text-align: left;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 10px 0;
    font-size: 14px;
    border-bottom: 1px solid var(--glass-border);
}

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

.summary-value {
    font-weight: 600;
}

.summary-value.highlight {
    color: var(--success);
}

.btn-primary {
    width: 100%;
    padding: 16px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    border: none;
    border-radius: 12px;
    color: white;
    font-size: 15px;
    font-weight: 700;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 28px rgba(99, 102, 241, 0.4);
}

/* === SETTINGS PANEL === */
.settings-panel {
    position: fixed;
    top: 88px;
    left: 24px;
    width: 320px;
    max-height: calc(100vh - 112px);
    overflow-y: auto;
    z-index: 1000;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.settings-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px;
    border-bottom: 1px solid var(--glass-border);
}

.settings-header h3 {
    font-size: 18px;
    font-weight: 700;
}

.icon-btn-close {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.3);
    color: var(--error);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition);
}

.icon-btn-close:hover {
    background: var(--error);
    color: white;
}

.settings-content {
    padding: 20px;
}

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

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.form-group select {
    appearance: none;
    cursor: pointer;
}

/* === UTILITY === */
.hidden {
    display: none !important;
}

/* === SCROLLBAR === */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: var(--glass-border);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--bg-tertiary);
}

/* === RESPONSIVE === */
@media (max-width: 1200px) {
    .main-container {
        grid-template-columns: 300px 1fr;
        gap: 12px;
        padding: 12px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
        gap: 10px;
    }
    
    .product-image {
        height: 110px;
    }
}

@media (max-width: 900px) {
    .main-container {
        grid-template-columns: 280px 1fr;
    }
}

@media (max-width: 768px) {
    .main-container {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .cart-panel {
        max-height: none;
        margin-bottom: 12px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }
}

/* Optimized for 10" tablets (1280x800 landscape) */
@media (min-width: 1024px) and (max-width: 1366px) {
    .main-container {
        grid-template-columns: 310px 1fr;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(135px, 1fr));
    }
}

/* === TABLET POS OPTIMIZATION === */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    body {
        font-size: 14px;
    }
    
    .topbar {
        padding: 12px 16px;
    }
    
    .main-container {
        grid-template-columns: 280px 1fr;
        gap: 12px;
        padding: 12px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(115px, 1fr));
        gap: 10px;
    }
    
    .product-image {
        height: 100px;
    }
    
    .product-name {
        font-size: 11px;
        min-height: 28px;
    }
    
    .product-price {
        font-size: 13px;
    }
}

/* Fix for small tablets */
@media (max-width: 800px) and (orientation: landscape) {
    .main-container {
        grid-template-columns: 260px 1fr;
        gap: 10px;
        padding: 10px;
    }
    
    .cart-panel {
        max-height: calc(100vh - 90px);
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    }
}