/* =============================================
   VƯƠN - Shared CSS
   ============================================= */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body { font-family: 'Segoe UI', Arial, sans-serif; background: #f9fafb; color: #111827; min-height: 100vh; }

a { color: inherit; text-decoration: none; }

img { max-width: 100%; }

/* ── Layout ── */
.container { max-width: 1280px; margin: 0 auto; padding: 0 1rem; }
.page-content { padding: 2rem 1rem; max-width: 1280px; margin: 0 auto; }

/* ── Colors ── */
:root {
  --green-50: #f0fdf4;
  --green-100: #dcfce7;
  --green-200: #bbf7d0;
  --green-400: #4ade80;
  --green-500: #22c55e;
  --green-600: #16a34a;
  --green-700: #15803d;
  --green-800: #166534;
  --blue-600: #2563eb;
  --purple-600: #9333ea;
  --red-500: #ef4444;
  --yellow-400: #facc15;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-900: #111827;
}

/* ── Buttons ── */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; padding: .75rem 1.5rem; border-radius: .5rem; font-size: .9rem; font-weight: 500; cursor: pointer; border: none; transition: all .2s; text-decoration: none; }
.btn-green { background: var(--green-600); color: #fff; }
.btn-green:hover { background: var(--green-700); }
.btn-outline { background: transparent; border: 2px solid var(--green-600); color: var(--green-600); }
.btn-outline:hover { background: var(--green-50); }
.btn-gray { background: #fff; border: 2px solid var(--gray-300); color: var(--gray-700); }
.btn-gray:hover { background: var(--gray-50); }
.btn-full { width: 100%; }
.btn-sm { padding: .4rem .8rem; font-size: .8rem; }

/* ── Forms ── */
.form-group { margin-bottom: 1rem; }
.form-group label { display: block; font-size: .875rem; color: var(--gray-700); margin-bottom: .5rem; }
.input-wrap { position: relative; }
.input-wrap .icon { position: absolute; left: .75rem; top: 50%; transform: translateY(-50%); color: var(--gray-400); width: 1.25rem; }
.form-control { width: 100%; padding: .75rem 1rem; border: 1px solid var(--gray-300); border-radius: .5rem; font-size: .9rem; outline: none; transition: border .2s; background: #fff; }
.form-control.has-icon { padding-left: 2.5rem; }
.form-control:focus { border-color: var(--green-500); box-shadow: 0 0 0 2px rgba(22,163,74,.15); }
textarea.form-control { resize: vertical; min-height: 80px; }

/* ── Cards ── */
.card { background: #fff; border-radius: .75rem; box-shadow: 0 1px 3px rgba(0,0,0,.08); }
.card-pad { padding: 1.5rem; }

/* ── Badge ── */
.badge { display: inline-flex; padding: .25rem .75rem; border-radius: 9999px; font-size: .75rem; font-weight: 600; }
.badge-green { background: var(--green-100); color: var(--green-800); }
.badge-blue { background: #dbeafe; color: #1e40af; }
.badge-yellow { background: #fef3c7; color: #92400e; }
.badge-red { background: #fee2e2; color: #991b1b; }

/* ── Grid ── */
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1rem; }
@media(max-width:768px) { .grid-4 { grid-template-columns: repeat(2,1fr); } .grid-3 { grid-template-columns: repeat(2,1fr); } }
@media(max-width:480px) { .grid-2 { grid-template-columns: 1fr; } }

/* ── Header ── */
#site-header { background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.06); position: sticky; top: 0; z-index: 100; }
#site-header .header-inner { max-width: 1280px; margin: 0 auto; padding: 0 1rem; display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: .5rem; font-size: 1.25rem; font-weight: 700; color: var(--green-600); }
.logo-icon { width: 40px; height: 40px; background: var(--green-600); border-radius: .5rem; display: flex; align-items: center; justify-content: center; color: #fff; font-size: 1.25rem; font-weight: 700; }
.header-nav { display: flex; align-items: center; gap: 1.5rem; }
.header-nav a { color: var(--gray-700); font-size: .9rem; transition: color .2s; }
.header-nav a:hover { color: var(--green-600); }
.header-right { display: flex; align-items: center; gap: .75rem; }
.cart-btn { position: relative; padding: .5rem; border-radius: .5rem; cursor: pointer; display: flex; align-items: center; }
.cart-btn:hover { background: var(--gray-100); }
.cart-badge { position: absolute; top: -2px; right: -2px; background: var(--red-500); color: #fff; font-size: .65rem; border-radius: 50%; width: 18px; height: 18px; display: flex; align-items: center; justify-content: center; }
.header-mobile-menu { display: none; cursor: pointer; padding: .5rem; }
@media(max-width:768px) { .header-nav { display: none; } .header-mobile-menu { display: block; } }

/* ── Mobile Bottom Nav ── */
#mobile-nav { display: none; position: fixed; bottom: 0; left: 0; right: 0; background: #fff; border-top: 1px solid var(--gray-200); z-index: 99; }
@media(max-width:768px) { #mobile-nav { display: flex; justify-content: space-around; align-items: center; height: 60px; } }
.mobile-nav-item { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: .5rem; color: var(--gray-500); font-size: .7rem; text-decoration: none; }
.mobile-nav-item.active, .mobile-nav-item:hover { color: var(--green-600); }
.mobile-nav-item svg { width: 20px; height: 20px; }

/* ── Footer ── */
#site-footer { background: #fff; border-top: 1px solid var(--gray-200); margin-top: 3rem; }
.footer-newsletter { background: var(--green-600); padding: 2rem 1rem; }
.footer-newsletter-inner { max-width: 1280px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem; }
.footer-newsletter h3 { color: #fff; font-size: 1.1rem; font-weight: 700; }
.footer-newsletter p { color: #bbf7d0; font-size: .85rem; }
.footer-subscribe { display: flex; gap: .5rem; }
.footer-subscribe input { padding: .6rem 1rem; border-radius: .5rem; border: none; font-size: .875rem; width: 220px; }
.footer-subscribe button { padding: .6rem 1.2rem; background: #fff; color: var(--green-600); border: none; border-radius: .5rem; font-weight: 600; cursor: pointer; white-space: nowrap; }
.footer-links { background: var(--gray-50); border-bottom: 1px solid var(--gray-200); padding: 2.5rem 1rem; }
.footer-links-inner { max-width: 1280px; margin: 0 auto; display: grid; grid-template-columns: 2fr 1fr 1fr 1fr 1fr; gap: 2rem; }
@media(max-width:900px) { .footer-links-inner { grid-template-columns: repeat(2,1fr); } }
.footer-brand p { font-size: .875rem; color: var(--gray-600); line-height: 1.6; margin: .75rem 0; }
.footer-contact a, .footer-contact div { display: flex; align-items: flex-start; gap: .5rem; font-size: .875rem; color: var(--gray-600); margin-bottom: .5rem; }
.footer-contact a:hover { color: var(--green-600); }
.footer-social { display: flex; gap: .5rem; margin-top: .5rem; }
.footer-social a { width: 36px; height: 36px; border: 1px solid var(--gray-200); border-radius: .5rem; display: flex; align-items: center; justify-content: center; color: var(--gray-500); transition: all .2s; }
.footer-social a:hover { border-color: var(--green-400); color: var(--green-600); }
.footer-col h4 { font-size: .875rem; font-weight: 600; color: var(--gray-900); margin-bottom: 1rem; }
.footer-col ul { list-style: none; }
.footer-col ul li { margin-bottom: .6rem; }
.footer-col ul li a { font-size: .875rem; color: var(--gray-600); transition: color .2s; }
.footer-col ul li a:hover { color: var(--green-600); }
.footer-bottom { background: #fff; padding: 1rem; }
.footer-bottom-inner { max-width: 1280px; margin: 0 auto; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; }
.footer-bottom p { font-size: .75rem; color: var(--gray-500); }
.footer-payments { display: flex; align-items: center; gap: .5rem; font-size: .75rem; color: var(--gray-500); }
.payment-tag { background: var(--gray-100); border: 1px solid var(--gray-200); padding: 2px 8px; border-radius: 4px; font-size: .7rem; font-weight: 600; color: var(--gray-600); }

/* ── Product Card ── */
.product-card { background: #fff; border-radius: .75rem; box-shadow: 0 1px 3px rgba(0,0,0,.08); overflow: hidden; transition: box-shadow .2s; }
.product-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.12); }
.product-card-img { aspect-ratio: 1; overflow: hidden; }
.product-card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s; }
.product-card:hover .product-card-img img { transform: scale(1.08); }
.product-card-body { padding: 1rem; }
.product-card-name { font-weight: 500; color: var(--gray-900); margin-bottom: .25rem; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-card-name:hover { color: var(--green-600); }
.stars { display: flex; align-items: center; gap: .25rem; margin-bottom: .5rem; }
.star-filled { color: #facc15; }
.star-empty { color: var(--gray-300); }
.product-card-footer { display: flex; align-items: center; justify-content: space-between; }
.price { font-size: 1.1rem; font-weight: 700; color: var(--green-600); }
.add-to-cart-btn { padding: .4rem; background: var(--green-50); color: var(--green-600); border: none; border-radius: .5rem; cursor: pointer; display: flex; align-items: center; transition: background .2s; }
.add-to-cart-btn:hover { background: var(--green-100); }

/* ── Alert ── */
.alert { padding: .75rem 1rem; border-radius: .5rem; font-size: .875rem; margin-bottom: 1rem; }
.alert-error { background: #fee2e2; border: 1px solid #fecaca; color: #991b1b; }
.alert-success { background: var(--green-50); border: 1px solid var(--green-200); color: var(--green-800); }
.alert-info { background: #eff6ff; border: 1px solid #bfdbfe; color: #1e40af; }
.alert-warning { background: #fefce8; border: 1px solid #fde68a; color: #92400e; }

/* ── Hero ── */
.hero { background: linear-gradient(to right, var(--green-600), #4ade80); color: #fff; padding: 3rem 1rem; }
.hero-inner { max-width: 1280px; margin: 0 auto; }
.hero h1 { font-size: 2.5rem; font-weight: 700; margin-bottom: 1rem; }
.hero p { font-size: 1.1rem; opacity: .9; margin-bottom: 1.5rem; }
.hero-btns { display: flex; flex-wrap: wrap; gap: 1rem; }
@media(max-width:600px) { .hero h1 { font-size: 1.75rem; } }

/* ── Section ── */
.section { margin-bottom: 3rem; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 1.5rem; }
.section-title h2 { font-size: 1.5rem; font-weight: 700; color: var(--gray-900); }
.section-title a { font-size: .875rem; color: var(--green-600); }
.section-title a:hover { text-decoration: underline; }

/* ── Category Card ── */
.category-card { background: #fff; border-radius: .75rem; box-shadow: 0 1px 3px rgba(0,0,0,.08); padding: 1.5rem; display: flex; flex-direction: column; align-items: center; gap: .75rem; text-align: center; transition: box-shadow .2s; }
.category-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,.12); }
.category-icon { width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center; transition: transform .2s; }
.category-card:hover .category-icon { transform: scale(1.1); }
.category-icon.green { background: #22c55e; }
.category-icon.pink { background: #ec4899; }
.category-icon.purple { background: #a855f7; }
.category-icon.blue { background: #3b82f6; }
.category-icon.orange { background: #f97316; }

/* ── Promo Banner ── */
.promo-banner { background: #fefce8; border-top: 1px solid #fde68a; border-bottom: 1px solid #fde68a; padding: .75rem 1rem; }
.promo-banner-inner { max-width: 1280px; margin: 0 auto; display: flex; align-items: center; gap: .75rem; color: #92400e; font-size: .875rem; }

/* ── AI CTA ── */
.ai-cta { background: linear-gradient(135deg, #2563eb, #9333ea); border-radius: 1rem; padding: 2.5rem 2rem; color: #fff; }
.ai-cta h2 { font-size: 1.75rem; font-weight: 700; margin-bottom: .75rem; }
.ai-cta p { opacity: .9; margin-bottom: 1.5rem; }

/* ── Chat ── */
.chat-header { background: linear-gradient(to right, #2563eb, #9333ea); border-radius: .75rem .75rem 0 0; padding: 1.5rem; color: #fff; display: flex; align-items: center; gap: .75rem; }
.chat-bot-icon { width: 48px; height: 48px; background: #fff; border-radius: 50%; display: flex; align-items: center; justify-content: center; }
.chat-messages { background: #fff; padding: 1.5rem; min-height: 400px; max-height: 500px; overflow-y: auto; display: flex; flex-direction: column; gap: 1rem; }
.chat-bubble-wrap { display: flex; gap: .75rem; }
.chat-bubble-wrap.user { flex-direction: row-reverse; }
.chat-avatar { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.chat-avatar.bot { background: #dbeafe; }
.chat-avatar.user { background: var(--green-100); }
.chat-bubble { max-width: 70%; padding: .75rem 1rem; border-radius: 1rem; font-size: .9rem; white-space: pre-wrap; line-height: 1.5; }
.chat-bubble.bot { background: var(--gray-100); color: var(--gray-900); }
.chat-bubble.user { background: #2563eb; color: #fff; }
.chat-input-row { background: #fff; border-top: 1px solid var(--gray-200); padding: 1rem; display: flex; gap: .5rem; border-radius: 0 0 .75rem .75rem; }
.chat-input { flex: 1; padding: .75rem 1rem; border: 1px solid var(--gray-300); border-radius: .5rem; font-size: .9rem; outline: none; }
.chat-input:focus { border-color: var(--green-500); }

/* ── Admin Sidebar ── */
#admin-sidebar { background: #111827; color: #fff; width: 256px; min-height: 100vh; position: fixed; left: 0; top: 0; z-index: 50; display: flex; flex-direction: column; transition: width .3s; }
#admin-sidebar.collapsed { width: 72px; }
.sidebar-header { padding: 1rem; display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid #374151; }
.sidebar-logo { font-size: 1.1rem; font-weight: 700; color: #4ade80; white-space: nowrap; overflow: hidden; }
#admin-sidebar.collapsed .sidebar-logo { display: none; }
.sidebar-toggle { background: none; border: none; color: #9ca3af; cursor: pointer; padding: .4rem; border-radius: .375rem; }
.sidebar-toggle:hover { background: #374151; color: #fff; }
.sidebar-nav { padding: 1rem; flex: 1; }
.sidebar-nav a { display: flex; align-items: center; gap: .75rem; padding: .75rem 1rem; border-radius: .5rem; color: #d1d5db; font-size: .9rem; margin-bottom: .25rem; transition: all .2s; white-space: nowrap; }
.sidebar-nav a:hover { background: #374151; color: #fff; }
.sidebar-nav a.active { background: var(--green-600); color: #fff; }
#admin-sidebar.collapsed .sidebar-nav a span { display: none; }
.sidebar-bottom { padding: 1rem; border-top: 1px solid #374151; }
.sidebar-bottom a { display: flex; align-items: center; gap: .75rem; padding: .75rem 1rem; border-radius: .5rem; color: #9ca3af; font-size: .9rem; }
.sidebar-bottom a:hover { color: #fff; }
#admin-sidebar.collapsed .sidebar-bottom a span { display: none; }
.admin-content { margin-left: 256px; padding: 2rem; transition: margin .3s; min-height: 100vh; }
.admin-content.collapsed { margin-left: 72px; }
@media(max-width:768px) { #admin-sidebar { transform: translateX(-100%); } .admin-content { margin-left: 0; } }

/* ── Table ── */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; }
thead tr { border-bottom: 2px solid var(--gray-200); }
th { text-align: left; padding: .75rem 1rem; font-size: .875rem; font-weight: 600; color: var(--gray-600); }
td { padding: .75rem 1rem; font-size: .875rem; color: var(--gray-700); border-bottom: 1px solid var(--gray-100); }
tr:hover td { background: var(--gray-50); }

/* ── Stat Card ── */
.stat-card { background: #fff; border-radius: .75rem; box-shadow: 0 1px 3px rgba(0,0,0,.08); padding: 1.5rem; }
.stat-icon { width: 48px; height: 48px; border-radius: .5rem; display: flex; align-items: center; justify-content: center; }
.stat-icon.green { background: #22c55e; }
.stat-icon.blue { background: #3b82f6; }
.stat-icon.purple { background: #a855f7; }
.stat-icon.orange { background: #f97316; }

/* ── Misc ── */
.divider { height: 1px; background: var(--gray-200); margin: 1.5rem 0; }
.divider-text { display: flex; align-items: center; gap: 1rem; color: var(--gray-400); font-size: .875rem; }
.divider-text::before, .divider-text::after { content: ''; flex: 1; height: 1px; background: var(--gray-200); }
.text-green { color: var(--green-600); }
.text-gray { color: var(--gray-500); }
.text-sm { font-size: .875rem; }
.text-xs { font-size: .75rem; }
.text-center { text-align: center; }
.font-bold { font-weight: 700; }
.font-medium { font-weight: 500; }
.mb-1 { margin-bottom: .25rem; }
.mb-2 { margin-bottom: .5rem; }
.mb-4 { margin-bottom: 1rem; }
.mb-6 { margin-bottom: 1.5rem; }
.mb-8 { margin-bottom: 2rem; }
.mt-4 { margin-top: 1rem; }
.mt-6 { margin-top: 1.5rem; }
.flex { display: flex; }
.flex-wrap { flex-wrap: wrap; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-2 { gap: .5rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.hidden { display: none; }

/* ── Auth Pages ── */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1rem; }
.auth-card { background: #fff; border-radius: .75rem; box-shadow: 0 4px 24px rgba(0,0,0,.1); padding: 2rem; width: 100%; max-width: 440px; }
.auth-icon { width: 64px; height: 64px; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 1rem; }
.auth-icon.green { background: var(--green-600); }
.auth-icon.green-light { background: var(--green-100); }

/* ── Order Step ── */
.order-steps { display: flex; align-items: flex-start; gap: 0; margin: 2rem 0; }
.step-item { flex: 1; display: flex; flex-direction: column; align-items: center; position: relative; }
.step-item:not(:last-child)::after { content:''; position:absolute; top:16px; left:50%; width:100%; height:2px; background: var(--gray-200); }
.step-item.done:not(:last-child)::after { background: var(--green-600); }
.step-dot { width: 32px; height: 32px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: .8rem; font-weight: 700; z-index: 1; border: 2px solid var(--gray-300); background: #fff; color: var(--gray-400); }
.step-item.done .step-dot { background: var(--green-600); border-color: var(--green-600); color: #fff; }
.step-label { font-size: .75rem; color: var(--gray-500); margin-top: .5rem; text-align: center; }
.step-item.done .step-label { color: var(--green-600); }
.step-date { font-size: .7rem; color: var(--gray-400); }

/* ── Profile ── */
.profile-avatar { width: 96px; height: 96px; background: var(--green-100); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 2.5rem; color: var(--green-600); margin: 0 auto 1rem; }

/* ── Quick questions ── */
.quick-questions { display: flex; flex-wrap: wrap; gap: .5rem; padding: .75rem 1rem; background: var(--gray-50); border-top: 1px solid var(--gray-200); }
.quick-q-btn { padding: .4rem .9rem; border: 1px solid var(--gray-300); border-radius: 9999px; font-size: .8rem; background: #fff; cursor: pointer; color: var(--gray-700); transition: all .2s; }
.quick-q-btn:hover { border-color: var(--green-500); color: var(--green-600); }

/* Responsive padding for mobile bottom nav */
@media(max-width:768px) { .page-content { padding-bottom: 5rem; } }
