:root {
    --primary: #3b82f6;
    --bg: #f8fafc;
    --text: #0f172a;
    --font: 'Inter', sans-serif;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: var(--font); background: var(--bg); color: var(--text); -webkit-font-smoothing: antialiased; }
.hidden { display: none !important; }

/* Announcement */
.announcement { background: var(--primary); color: #fff; text-align: center; padding: 8px 16px; font-size: 12px; font-weight: 700; }
.announcement::before { content: '✨ '; }

/* Header */
header { background: var(--bg); border-bottom: 1px solid rgba(0,0,0,.05); position: sticky; top: 0; z-index: 100; box-shadow: 0 1px 3px rgba(0,0,0,.04); }
.header-content { max-width: 1200px; margin: 0 auto; padding: 12px 16px; display: flex; justify-content: space-between; align-items: center; }
.header-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
.store-logo img { height: 36px; width: auto; object-fit: contain; border-radius: 6px; }
.header-content h1 { font-size: 1.1rem; font-weight: 800; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 200px; }
.header-right { display: flex; gap: 16px; align-items: center; }
.cart-icon { position: relative; cursor: pointer; width: 36px; height: 36px; border-radius: 50%; background: rgba(0,0,0,.04); display: flex; align-items: center; justify-content: center; color: var(--primary); transition: transform .2s; }
.cart-icon:active { transform: scale(.9); }
.cart-badge { position: absolute; top: -4px; right: -6px; background: #ef4444; color: #fff; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 10px; min-width: 18px; text-align: center; }

/* Category Nav */
.category-nav { border-bottom: 1px solid rgba(0,0,0,.06); background: rgba(0,0,0,.02); overflow-x: auto; -webkit-overflow-scrolling: touch; }
.category-nav::-webkit-scrollbar { display: none; }
.category-nav-inner { display: flex; gap: 4px; padding: 6px 16px; max-width: 1200px; margin: 0 auto; }
.cat-btn { white-space: nowrap; padding: 6px 14px; border-radius: 20px; border: 1px solid rgba(0,0,0,.08); background: transparent; font-size: 11px; font-weight: 600; color: var(--text); cursor: pointer; display: flex; align-items: center; gap: 4px; transition: all .2s; font-family: var(--font); }
.cat-btn.active, .cat-btn:hover { background: var(--primary); color: #fff; border-color: var(--primary); }

/* Hero */
.hero-section { max-width: 1200px; margin: 0 auto; padding: 16px 16px 0; position: relative; }
.hero-carousel { width: 100%; border-radius: 16px; overflow: hidden; aspect-ratio: 2.2; position: relative; background: rgba(0,0,0,.03); box-shadow: 0 4px 12px rgba(0,0,0,.06); border: 1px solid rgba(0,0,0,.06); }
.hero-carousel img { width: 100%; height: 100%; object-fit: cover; position: absolute; top: 0; left: 0; opacity: 0; transition: opacity .5s ease; }
.hero-carousel img.active { opacity: 1; }
.hero-dots { display: flex; justify-content: center; gap: 6px; padding: 10px 0; }
.hero-dot { width: 8px; height: 8px; border-radius: 50%; background: rgba(0,0,0,.2); cursor: pointer; transition: all .2s; border: none; }
.hero-dot.active { background: var(--primary); transform: scale(1.2); }

/* Main */
main { max-width: 1200px; margin: 0 auto; padding: 16px; min-height: 60vh; }

/* Search */
.search-bar { display: flex; align-items: center; border: 1px solid rgba(0,0,0,.1); border-radius: 10px; overflow: hidden; margin-bottom: 24px; background: #fff; box-shadow: 0 2px 4px rgba(0,0,0,.02); }
.search-bar input { flex: 1; border: none; outline: none; font-size: 14px; padding: 12px 16px; color: var(--text); background: transparent; font-family: var(--font); }
.search-btn { width: 44px; height: 44px; background: var(--primary); color: #fff; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: opacity .2s; }
.search-btn:hover { opacity: .9; }

/* Products Grid */
.products-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
@media (min-width: 640px) { .products-grid { grid-template-columns: repeat(3, 1fr); gap: 16px; } }
@media (min-width: 1024px) { .products-grid { grid-template-columns: repeat(4, 1fr); gap: 20px; } }

/* Product Card */
.product-card { background: rgba(255,255,255,.85); backdrop-filter: blur(8px); border-radius: 14px; overflow: hidden; box-shadow: 0 2px 8px rgba(0,0,0,.04); border: 1px solid rgba(0,0,0,.05); display: flex; flex-direction: column; transition: transform .2s, box-shadow .2s; }
.product-card:hover { transform: translateY(-3px); box-shadow: 0 8px 20px rgba(0,0,0,.08); }
.product-image { width: 100%; aspect-ratio: 1; background: rgba(0,0,0,.03); display: flex; align-items: center; justify-content: center; overflow: hidden; border-bottom: 1px solid rgba(0,0,0,.04); }
.product-image img { width: 100%; height: 100%; object-fit: cover; }
.product-image .material-symbols-outlined { font-size: 48px; color: rgba(0,0,0,.1); }
.product-info { padding: 12px; display: flex; flex-direction: column; flex: 1; }
.product-category { font-size: 10px; text-transform: uppercase; font-weight: 700; letter-spacing: .5px; opacity: .5; margin-bottom: 4px; }
.product-name { font-size: 14px; font-weight: 700; margin-bottom: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.3; }
.product-price { font-size: 18px; font-weight: 900; margin-bottom: 10px; margin-top: auto; }
.product-buttons { display: flex; flex-direction: column; gap: 6px; }

/* Buttons */
.btn-add { background: var(--primary); color: #fff; border: none; border-radius: 8px; padding: 8px 12px; font-weight: 700; font-size: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; transition: opacity .2s; width: 100%; font-family: var(--font); }
.btn-add:hover { opacity: .9; }
.btn-add .material-symbols-outlined { font-size: 16px; }
.btn-whatsapp { background: transparent; color: #16a34a; border: 1px solid #16a34a; border-radius: 8px; padding: 8px 12px; font-weight: 700; font-size: 12px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 6px; transition: all .2s; width: 100%; font-family: var(--font); }
.btn-whatsapp:hover { background: #16a34a; color: #fff; }
.btn-whatsapp svg { width: 14px; height: 14px; fill: currentColor; }

/* Footer */
footer { background: rgba(0,0,0,.03); padding: 40px 16px; text-align: center; border-top: 1px solid rgba(0,0,0,.05); margin-top: 32px; }
.footer-inner { max-width: 600px; margin: 0 auto; }
.footer-logo img { max-height: 48px; width: auto; object-fit: contain; margin-bottom: 12px; }
footer h3 { font-size: 16px; font-weight: 900; margin-bottom: 6px; }
.footer-address, .footer-phone { font-size: 12px; font-weight: 600; opacity: .7; margin-bottom: 4px; }
.footer-about { font-size: 12px; opacity: .6; max-width: 280px; margin: 12px auto; line-height: 1.5; }
.footer-social { display: flex; justify-content: center; gap: 8px; margin: 16px 0; }
.footer-social a { width: 32px; height: 32px; border-radius: 50%; background: rgba(0,0,0,.06); display: flex; align-items: center; justify-content: center; color: var(--text); opacity: .6; transition: opacity .2s, transform .2s; text-decoration: none; }
.footer-social a:hover { opacity: 1; transform: scale(1.1); }
.footer-social a svg { width: 14px; height: 14px; fill: currentColor; }
.footer-copyright { font-size: 10px; opacity: .4; text-transform: uppercase; letter-spacing: 1px; margin-top: 16px; }

/* FABs */
.fab-container { position: fixed; bottom: 20px; right: 20px; z-index: 90; display: flex; flex-direction: column; gap: 10px; }
.fab { width: 48px; height: 48px; border-radius: 50%; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; color: #fff; box-shadow: 0 4px 12px rgba(0,0,0,.2); transition: transform .2s; position: relative; }
.fab:hover { transform: scale(1.05); }
.fab-filter { background: #1e293b; }
.fab-cart { background: var(--primary); }
.fab-badge { position: absolute; top: -4px; right: -4px; background: #ef4444; color: #fff; font-size: 10px; font-weight: 700; padding: 2px 6px; border-radius: 10px; min-width: 18px; text-align: center; }

/* Cart Sidebar */
.cart-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.4); z-index: 200; backdrop-filter: blur(2px); }
.cart-sidebar { position: fixed; top: 0; right: 0; bottom: 0; width: 360px; max-width: 90vw; background: #fff; z-index: 201; display: flex; flex-direction: column; box-shadow: -4px 0 24px rgba(0,0,0,.1); }
.cart-header { padding: 16px 20px; border-bottom: 1px solid rgba(0,0,0,.06); display: flex; justify-content: space-between; align-items: center; }
.cart-header h3 { font-size: 16px; font-weight: 800; }
.cart-close { background: none; border: none; cursor: pointer; color: var(--text); opacity: .6; }
.cart-items { flex: 1; overflow-y: auto; padding: 16px 20px; }
.cart-empty { text-align: center; color: rgba(0,0,0,.3); font-weight: 600; padding: 40px 0; }
.cart-item { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid rgba(0,0,0,.05); }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: 13px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-item-price { font-size: 12px; opacity: .6; }
.cart-item-qty { display: flex; align-items: center; gap: 8px; }
.cart-item-qty button { width: 28px; height: 28px; border-radius: 6px; border: 1px solid rgba(0,0,0,.1); background: transparent; cursor: pointer; font-weight: 700; font-size: 14px; display: flex; align-items: center; justify-content: center; }
.cart-item-qty span { font-weight: 700; min-width: 20px; text-align: center; }
.cart-footer { padding: 16px 20px; border-top: 1px solid rgba(0,0,0,.06); }
.cart-total { display: flex; justify-content: space-between; font-weight: 800; font-size: 18px; margin-bottom: 12px; }
.btn-checkout { width: 100%; padding: 14px; background: #25d366; color: #fff; border: none; border-radius: 10px; font-weight: 700; font-size: 14px; cursor: pointer; display: flex; align-items: center; justify-content: center; gap: 8px; transition: opacity .2s; font-family: var(--font); }
.btn-checkout:hover { opacity: .9; }

/* Loading */
.loading-state { grid-column: 1 / -1; text-align: center; padding: 48px; color: rgba(0,0,0,.3); font-weight: 600; display: flex; flex-direction: column; align-items: center; gap: 12px; }
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 1s linear infinite; }

/* Stock Badge */
.stock-badge { display: inline-block; font-size: 10px; font-weight: 700; padding: 2px 8px; border-radius: 6px; margin-bottom: 6px; }
.stock-in { background: #dcfce7; color: #166534; }
.stock-out { background: #fee2e2; color: #991b1b; }
.product-card.out-of-stock { opacity: .6; }
.product-card.out-of-stock .product-image { filter: grayscale(.5); }

/* Product Detail Modal */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 300; display: flex; align-items: center; justify-content: center; padding: 16px; backdrop-filter: blur(4px); animation: fadeIn .2s; }
.modal-content { background: #fff; border-radius: 16px; max-width: 500px; width: 100%; max-height: 90vh; overflow-y: auto; box-shadow: 0 20px 60px rgba(0,0,0,.2); animation: slideUp .25s ease-out; }
.modal-img { width: 100%; aspect-ratio: 1.2; object-fit: cover; border-radius: 16px 16px 0 0; background: rgba(0,0,0,.03); display: flex; align-items: center; justify-content: center; }
.modal-img img { width: 100%; height: 100%; object-fit: cover; border-radius: 16px 16px 0 0; }
.modal-img .material-symbols-outlined { font-size: 64px; color: rgba(0,0,0,.1); }
.modal-body { padding: 20px; }
.modal-category { font-size: 11px; text-transform: uppercase; font-weight: 700; letter-spacing: .5px; opacity: .5; margin-bottom: 4px; }
.modal-name { font-size: 20px; font-weight: 800; margin-bottom: 8px; line-height: 1.2; }
.modal-desc { font-size: 13px; opacity: .6; line-height: 1.5; margin-bottom: 12px; }
.modal-codes { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.modal-code { font-size: 10px; padding: 3px 8px; background: rgba(0,0,0,.05); border-radius: 6px; font-family: monospace; }
.modal-price { font-size: 28px; font-weight: 900; margin-bottom: 16px; }
.modal-close { position: absolute; top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 50%; background: rgba(0,0,0,.5); color: #fff; border: none; cursor: pointer; display: flex; align-items: center; justify-content: center; z-index: 10; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* Search result count */
.search-info { font-size: 11px; color: rgba(0,0,0,.4); margin-bottom: 12px; font-weight: 600; }

/* AI Chat Widget */
.ai-fab { position: fixed; bottom: 20px; right: 20px; width: 60px; height: 60px; border-radius: 50%; background: var(--primary, #3b82f6); color: white; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 4px 15px rgba(0,0,0,.2); z-index: 100; transition: transform 0.2s; }
.ai-fab:hover { transform: scale(1.05); }
.ai-fab.hidden { display: none; }
.ai-chat-window { position: fixed; bottom: 90px; right: 20px; width: 350px; height: 500px; max-height: calc(100vh - 120px); background: #fff; border-radius: 16px; box-shadow: 0 10px 40px rgba(0,0,0,.2); z-index: 100; display: flex; flex-direction: column; overflow: hidden; animation: slideUp 0.3s ease-out; }
.ai-chat-window.hidden { display: none; }
.ai-chat-header { background: var(--primary, #3b82f6); color: white; padding: 15px; font-weight: bold; display: flex; justify-content: space-between; align-items: center; }
.ai-chat-header button { background: none; border: none; color: white; cursor: pointer; }
.ai-chat-body { flex: 1; overflow-y: auto; padding: 15px; display: flex; flex-direction: column; gap: 10px; background: #f8fafc; }
.ai-msg { max-width: 85%; padding: 10px 15px; border-radius: 12px; font-size: 13px; line-height: 1.4; }
.ai-msg.user { background: var(--primary, #3b82f6); color: white; align-self: flex-end; border-bottom-right-radius: 4px; }
.ai-msg.bot { background: white; border: 1px solid #e2e8f0; color: #1e293b; align-self: flex-start; border-bottom-left-radius: 4px; }
.ai-chat-input { display: flex; padding: 10px; border-top: 1px solid #e2e8f0; background: white; }
.ai-chat-input input { flex: 1; border: 1px solid #cbd5e1; padding: 10px 15px; border-radius: 20px; outline: none; font-family: inherit; font-size: 13px; }
.ai-chat-input button { background: var(--primary, #3b82f6); color: white; border: none; width: 36px; height: 36px; border-radius: 50%; margin-left: 10px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.ai-chat-input button:disabled { opacity: 0.5; cursor: not-allowed; }

@media print {
    .navbar, .hero, .category-nav, .product-buttons, .cart-overlay, .ai-fab, .ai-chat-window, .search-bar, footer { display: none !important; }
    body { background: white !important; }
}
