/* ============================================
   Sell2U - Main Stylesheet
   ============================================ */
@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:wght@300;400;500;600&display=swap');

:root {
    --red: #E8312A;
    --red-dark: #c0241e;
    --red-light: #fef2f2;
    --bg: #F5F4F2;
    --white: #ffffff;
    --dark: #1a1a1a;
    --gray: #6b6b6b;
    --light-gray: #e8e8e4;
    --border: #e0ddd8;
    --green: #22c55e;
    --orange: #f97316;
    --card-shadow: 0 2px 12px rgba(0,0,0,0.07);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: 'DM Sans', sans-serif; background: var(--bg); color: var(--dark); min-height: 100vh; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; }

/* FLASH MESSAGES */
.flash { padding: 14px 20px; border-radius: 10px; margin-bottom: 20px; font-weight: 500; }
.flash.success { background: #dcfce7; color: #16a34a; border: 1px solid #86efac; }
.flash.error { background: #fee2e2; color: #dc2626; border: 1px solid #fca5a5; }
.flash.info { background: #dbeafe; color: #2563eb; border: 1px solid #93c5fd; }

/* HEADER */
.site-header { background: var(--white); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; box-shadow: 0 1px 8px rgba(0,0,0,0.06); }
.header-inner { max-width: 1280px; margin: 0 auto; display: flex; align-items: center; gap: 16px; padding: 12px 24px; }
.logo { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.logo-icon { width: 38px; height: 38px; background: var(--red); border-radius: 10px; display: flex; align-items: center; justify-content: center; }
.logo-icon span { color: white; font-weight: 800; font-size: 16px; font-family: 'Syne', sans-serif; }
.logo-text { font-family: 'Syne', sans-serif; font-size: 20px; font-weight: 800; }
.logo-text span { color: var(--red); }
.catalog-btn { background: var(--red); color: white; border: none; border-radius: 10px; padding: 10px 18px; font-size: 14px; font-weight: 600; cursor: pointer; display: flex; align-items: center; gap: 8px; transition: background 0.2s; white-space: nowrap; font-family: 'DM Sans', sans-serif; }
.catalog-btn:hover { background: var(--red-dark); }
.search-bar { flex: 1; display: flex; align-items: center; background: var(--bg); border: 1.5px solid var(--border); border-radius: 10px; padding: 0 14px; gap: 10px; }
.search-bar:focus-within { border-color: var(--red); }
.search-bar input { flex: 1; border: none; background: transparent; font-size: 14px; font-family: 'DM Sans', sans-serif; padding: 10px 0; outline: none; }
.search-btn { background: none; border: none; cursor: pointer; display: flex; align-items: center; color: var(--gray); }
.header-right { display: flex; align-items: center; gap: 12px; flex-shrink: 0; }
.nav-links { display: flex; gap: 18px; }
.nav-links a { font-size: 14px; font-weight: 500; color: var(--gray); transition: color 0.2s; }
.nav-links a:hover { color: var(--dark); }
.header-btn { display: flex; align-items: center; gap: 8px; background: var(--bg); border: 1.5px solid var(--border); border-radius: 10px; padding: 8px 14px; cursor: pointer; font-size: 13px; font-weight: 600; transition: border-color 0.2s; }
.header-btn:hover { border-color: var(--red); color: var(--red); }
.header-btn .icon { font-size: 16px; }
.user-menu { position: relative; }
.user-menu-dropdown { display: none; position: absolute; top: calc(100% + 8px); right: 0; background: white; border: 1px solid var(--border); border-radius: 12px; box-shadow: var(--card-shadow); min-width: 200px; overflow: hidden; z-index: 50; }
.user-menu:hover .user-menu-dropdown { display: block; }
.user-menu-dropdown a, .user-menu-dropdown button { display: flex; align-items: center; gap: 10px; padding: 11px 16px; font-size: 14px; font-weight: 500; width: 100%; border: none; background: none; cursor: pointer; font-family: 'DM Sans', sans-serif; text-align: left; color: var(--dark); }
.user-menu-dropdown a:hover, .user-menu-dropdown button:hover { background: var(--red-light); color: var(--red); }
.user-menu-dropdown .divider { height: 1px; background: var(--border); }

/* MAIN LAYOUT */
.main-layout { max-width: 1280px; margin: 0 auto; display: grid; grid-template-columns: 240px 1fr; gap: 24px; padding: 24px; }
.full-width { max-width: 1280px; margin: 0 auto; padding: 24px; }

/* SIDEBAR */
.sidebar { display: flex; flex-direction: column; gap: 16px; }
.sidebar-card { background: white; border: 1px solid var(--border); border-radius: 14px; padding: 20px; }
.sidebar-card h3 { font-family: 'Syne', sans-serif; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: var(--gray); margin-bottom: 14px; }
.category-item { display: flex; align-items: center; gap: 10px; padding: 9px 10px; border-radius: 8px; color: var(--dark); transition: all 0.15s; }
.category-item:hover, .category-item.active { background: var(--red-light); color: var(--red); }
.category-item .cat-emoji { font-size: 18px; width: 28px; text-align: center; }
.category-item span { font-size: 14px; font-weight: 500; flex: 1; }
.category-item .count { font-size: 12px; color: var(--gray); background: var(--bg); padding: 2px 7px; border-radius: 20px; }
.category-item.active .count { background: #fecaca; color: var(--red); }
.filter-label { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.price-inputs { display: flex; gap: 8px; margin-bottom: 8px; }
.price-input { flex: 1; border: 1.5px solid var(--border); border-radius: 8px; padding: 8px 10px; font-size: 13px; font-family: 'DM Sans', sans-serif; outline: none; }
.price-input:focus { border-color: var(--red); }
.filter-section { margin-bottom: 14px; }
.filter-check { display: flex; align-items: center; gap: 8px; padding: 5px 0; cursor: pointer; font-size: 13px; }
.filter-check input { accent-color: var(--red); }
input[type=range] { width: 100%; accent-color: var(--red); margin-bottom: 14px; }
.apply-btn, .btn-red { background: var(--red); color: white; border: none; border-radius: 9px; padding: 11px 20px; font-size: 14px; font-weight: 600; cursor: pointer; font-family: 'DM Sans', sans-serif; transition: background 0.2s; width: 100%; }
.apply-btn:hover, .btn-red:hover { background: var(--red-dark); }
.btn-outline { background: white; color: var(--dark); border: 1.5px solid var(--border); border-radius: 9px; padding: 10px 20px; font-size: 14px; font-weight: 600; cursor: pointer; font-family: 'DM Sans', sans-serif; transition: all 0.2s; }
.btn-outline:hover { border-color: var(--red); color: var(--red); }

/* PRODUCT CARDS */
.products-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.product-card { background: white; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; transition: box-shadow 0.2s, transform 0.2s; }
.product-card:hover { box-shadow: 0 6px 24px rgba(0,0,0,0.1); transform: translateY(-2px); }
.product-card-img { height: 90px; display: flex; align-items: center; justify-content: center; position: relative; }
.product-flag { width: 58px; height: 58px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 30px; background: white; box-shadow: 0 2px 8px rgba(0,0,0,0.1); }
.online-dot { position: absolute; top: 10px; right: 10px; width: 8px; height: 8px; border-radius: 50%; background: var(--green); }
.wishlist-toggle { position: absolute; top: 8px; left: 8px; width: 28px; height: 28px; border-radius: 50%; background: white; border: 1.5px solid var(--border); display: flex; align-items: center; justify-content: center; cursor: pointer; font-size: 13px; transition: all 0.15s; }
.wishlist-toggle:hover, .wishlist-toggle.active { background: var(--red-light); border-color: var(--red); }
.product-card-body { padding: 14px; }
.product-name { font-size: 13px; font-weight: 600; margin-bottom: 6px; line-height: 1.4; }
.product-meta { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.product-qty { font-size: 12px; color: var(--gray); }
.star-rating { color: var(--orange); font-size: 12px; }
.product-price { font-size: 17px; font-weight: 700; margin-bottom: 10px; }
.product-price .old { font-size: 12px; color: var(--gray); text-decoration: line-through; margin-left: 6px; font-weight: 400; }
.buy-btn { width: 100%; background: var(--red); color: white; border: none; border-radius: 8px; padding: 9px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: 'DM Sans', sans-serif; transition: background 0.2s; }
.buy-btn:hover { background: var(--red-dark); }

/* STORES GRID */
.stores-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 14px; }
.store-card { background: white; border: 1.5px solid var(--border); border-radius: 14px; padding: 18px 14px; text-align: center; cursor: pointer; transition: all 0.2s; position: relative; }
.store-card:hover { border-color: var(--red); box-shadow: 0 4px 16px rgba(232,49,42,0.1); }
.store-card.verified { border-color: #fbd5d5; }
.verified-badge { position: absolute; top: 10px; right: 10px; width: 22px; height: 22px; background: var(--green); border-radius: 50%; display: flex; align-items: center; justify-content: center; color: white; font-size: 11px; font-weight: 700; }
.store-logo { width: 56px; height: 56px; border-radius: 12px; margin: 0 auto 10px; object-fit: cover; }
.store-logo-placeholder { width: 56px; height: 56px; border-radius: 12px; margin: 0 auto 10px; display: flex; align-items: center; justify-content: center; font-family: 'Syne', sans-serif; font-size: 16px; font-weight: 800; color: white; }
.store-name { font-size: 13px; font-weight: 700; margin-bottom: 5px; }
.store-since { font-size: 11px; color: var(--gray); margin-bottom: 6px; }
.store-stars { color: var(--orange); font-size: 12px; margin-bottom: 8px; }
.store-stats { display: flex; flex-direction: column; gap: 3px; }
.store-stat { font-size: 11px; color: var(--gray); display: flex; align-items: center; justify-content: center; gap: 4px; }

/* SECTION TITLE */
.section-title { font-family: 'Syne', sans-serif; font-size: 20px; font-weight: 700; margin-bottom: 18px; display: flex; align-items: center; gap: 10px; }

/* FORMS */
.form-card { background: white; border: 1px solid var(--border); border-radius: 16px; padding: 32px; }
.form-card h2 { font-family: 'Syne', sans-serif; font-size: 22px; font-weight: 700; margin-bottom: 24px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 16px; }
.form-group { margin-bottom: 16px; }
.form-group label { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; color: var(--dark); }
.form-group label .req { color: var(--red); }
.form-input, .form-select, .form-textarea { width: 100%; border: 1.5px solid var(--border); border-radius: 9px; padding: 11px 14px; font-size: 14px; font-family: 'DM Sans', sans-serif; outline: none; transition: border-color 0.2s; background: white; }
.form-input:focus, .form-select:focus, .form-textarea:focus { border-color: var(--red); }
.form-textarea { resize: vertical; min-height: 100px; }
.form-hint { font-size: 12px; color: var(--gray); margin-top: 4px; }

/* DASHBOARD SIDEBAR */
.dash-layout { max-width: 1280px; margin: 0 auto; display: grid; grid-template-columns: 240px 1fr; gap: 24px; padding: 24px; }
.dash-sidebar { display: flex; flex-direction: column; gap: 12px; }
.dash-card { background: white; border: 1px solid var(--border); border-radius: 14px; overflow: hidden; }
.dash-user-info { padding: 20px; text-align: center; border-bottom: 1px solid var(--border); }
.dash-avatar { width: 64px; height: 64px; border-radius: 50%; background: var(--red); color: white; font-size: 24px; font-weight: 800; font-family: 'Syne', sans-serif; display: flex; align-items: center; justify-content: center; margin: 0 auto 10px; }
.dash-username { font-weight: 700; font-size: 16px; }
.dash-email { font-size: 13px; color: var(--gray); }
.dash-balance-box { padding: 14px 20px; background: var(--red-light); border-bottom: 1px solid var(--border); }
.dash-balance-label { font-size: 12px; color: var(--gray); }
.dash-balance-amount { font-size: 22px; font-weight: 800; font-family: 'Syne', sans-serif; }
.dash-menu-list { padding: 8px; }
.dash-menu-item { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 9px; font-size: 14px; font-weight: 500; color: var(--dark); transition: all 0.15s; }
.dash-menu-item:hover, .dash-menu-item.active { background: var(--red-light); color: var(--red); }
.dash-menu-item .menu-icon { font-size: 17px; width: 22px; text-align: center; }
.dash-menu-item .menu-badge { margin-left: auto; background: var(--red); color: white; width: 20px; height: 20px; border-radius: 50%; font-size: 11px; font-weight: 700; display: flex; align-items: center; justify-content: center; }
.dash-content { background: white; border: 1px solid var(--border); border-radius: 14px; padding: 28px; }
.dash-content h2 { font-family: 'Syne', sans-serif; font-size: 20px; font-weight: 700; margin-bottom: 20px; }

/* TABLE */
.data-table { width: 100%; border-collapse: collapse; }
.data-table th { background: var(--bg); padding: 12px 14px; text-align: left; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--gray); border-bottom: 1px solid var(--border); }
.data-table td { padding: 13px 14px; border-bottom: 1px solid var(--border); font-size: 14px; vertical-align: middle; }
.data-table tr:hover td { background: var(--bg); }
.badge { display: inline-flex; align-items: center; padding: 3px 10px; border-radius: 20px; font-size: 12px; font-weight: 600; }
.badge-green { background: #dcfce7; color: #16a34a; }
.badge-yellow { background: #fef9c3; color: #ca8a04; }
.badge-red { background: #fee2e2; color: #dc2626; }
.badge-blue { background: #dbeafe; color: #2563eb; }

/* ADMIN PANEL */
.admin-layout { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
.admin-sidebar { background: var(--dark); padding: 0; }
.admin-logo { padding: 20px 24px; border-bottom: 1px solid rgba(255,255,255,0.1); }
.admin-logo span { font-family: 'Syne', sans-serif; font-size: 18px; font-weight: 800; color: white; }
.admin-logo span em { color: var(--red); font-style: normal; }
.admin-menu { padding: 16px 12px; }
.admin-menu-section { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.08em; color: rgba(255,255,255,0.3); padding: 8px 12px; margin-top: 16px; }
.admin-menu-item { display: flex; align-items: center; gap: 10px; padding: 11px 14px; border-radius: 9px; font-size: 14px; font-weight: 500; color: rgba(255,255,255,0.7); transition: all 0.15s; margin-bottom: 2px; }
.admin-menu-item:hover, .admin-menu-item.active { background: rgba(232,49,42,0.2); color: white; }
.admin-menu-item .icon { font-size: 17px; width: 22px; text-align: center; }
.admin-menu-item .abadge { margin-left: auto; background: var(--red); color: white; padding: 1px 7px; border-radius: 10px; font-size: 11px; font-weight: 700; }
.admin-main { background: var(--bg); padding: 30px; overflow-y: auto; }
.admin-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.admin-header h1 { font-family: 'Syne', sans-serif; font-size: 24px; font-weight: 700; }
.stats-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.stat-card { background: white; border: 1px solid var(--border); border-radius: 14px; padding: 20px; }
.stat-card .stat-label { font-size: 13px; color: var(--gray); margin-bottom: 8px; }
.stat-card .stat-value { font-family: 'Syne', sans-serif; font-size: 28px; font-weight: 800; }
.stat-card .stat-change { font-size: 12px; color: var(--green); margin-top: 4px; }
.admin-panel { background: white; border: 1px solid var(--border); border-radius: 14px; padding: 24px; margin-bottom: 24px; }
.admin-panel h3 { font-family: 'Syne', sans-serif; font-size: 16px; font-weight: 700; margin-bottom: 18px; display: flex; align-items: center; justify-content: space-between; }

/* PAGINATION */
.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; padding: 24px 0; }
.page-btn { width: 36px; height: 36px; border-radius: 8px; border: 1.5px solid var(--border); background: white; cursor: pointer; font-size: 13px; font-weight: 600; display: flex; align-items: center; justify-content: center; transition: all 0.15s; font-family: 'DM Sans', sans-serif; }
.page-btn:hover { border-color: var(--red); color: var(--red); }
.page-btn.active { background: var(--red); border-color: var(--red); color: white; }

/* AUTH PAGES */
.auth-page { min-height: 100vh; display: flex; align-items: center; justify-content: center; background: var(--bg); padding: 20px; }
.auth-card { background: white; border: 1px solid var(--border); border-radius: 20px; padding: 40px; width: 100%; max-width: 440px; }
.auth-card .logo { justify-content: center; margin-bottom: 28px; }
.auth-tabs { display: flex; border-bottom: 2px solid var(--border); margin-bottom: 28px; }
.auth-tab { flex: 1; text-align: center; padding: 12px; font-size: 15px; font-weight: 600; cursor: pointer; color: var(--gray); border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all 0.2s; }
.auth-tab.active { color: var(--red); border-bottom-color: var(--red); }
.auth-form { display: none; }
.auth-form.active { display: block; }
.auth-divider { text-align: center; font-size: 13px; color: var(--gray); margin: 18px 0; position: relative; }
.auth-divider::before { content: ''; position: absolute; left: 0; top: 50%; width: 40%; height: 1px; background: var(--border); }
.auth-divider::after { content: ''; position: absolute; right: 0; top: 50%; width: 40%; height: 1px; background: var(--border); }

/* RESPONSIVE */
@media (max-width: 1024px) { .products-grid { grid-template-columns: repeat(2, 1fr); } .stores-grid { grid-template-columns: repeat(3, 1fr); } .stats-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 768px) { .main-layout, .dash-layout { grid-template-columns: 1fr; } .sidebar { display: none; } .nav-links { display: none; } .form-row { grid-template-columns: 1fr; } .admin-layout { grid-template-columns: 1fr; } .admin-sidebar { display: none; } }
@media (max-width: 600px) { .products-grid { grid-template-columns: 1fr; } .stores-grid { grid-template-columns: repeat(2, 1fr); } .header-inner { padding: 10px 14px; gap: 10px; } .main-layout, .full-width { padding: 14px; } }
