/* AURA E-Commerce */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --white: #ffffff;
    --off-white: #f8f7f5;
    --light-gray: #f2f2f0;
    --border: #e8e8e6;
    --muted: #999;
    --secondary: #666;
    --primary: #1a1a1a;
    --gold: #d4af37;
    --danger: #c0392b;
    --success: #27ae60;
    --shadow-sm: 0 1px 4px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08);
    --shadow-lg: 0 8px 32px rgba(0,0,0,0.12);
    --r: 8px;
    --rl: 14px;
}

html { scroll-behavior: smooth; }
body { font-family: 'DM Sans', sans-serif; background: var(--off-white); color: var(--primary); line-height: 1.6; }

/* ── NAVBAR ── */
.navbar { background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 100; }
.nav-inner {
    max-width: 1400px; margin: 0 auto;
    padding: 0 14px;
    height: 50px;
    display: flex; align-items: center; gap: 10px;
}
.nav-brand {
    font-family: 'Cormorant Garamond', serif;
    font-size: 22px; font-weight: 400;
    color: var(--primary); text-decoration: none;
    letter-spacing: 5px; flex-shrink: 0;
    line-height: 1;
}
.nav-brand span { color: var(--gold); }

/* Search */
.search-bar {
    flex: 1; min-width: 0;
    display: flex; align-items: center; gap: 7px;
    background: var(--off-white); border: 1px solid var(--border);
    border-radius: 40px; padding: 0 12px;
    transition: border-color .2s;
}
.search-bar:focus-within { border-color: var(--primary); background: #fff; }
.search-bar svg { color: var(--muted); flex-shrink: 0; }
.search-bar input { border: none; background: transparent; outline: none; font-size: 13px; font-family: 'DM Sans', sans-serif; width: 100%; padding: 8px 0; color: var(--primary); }

/* Nav right side */
.nav-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

/* Lang switcher */
.lang-switcher { display: inline-flex; align-items: center; background: var(--off-white); border: 1px solid var(--border); border-radius: 20px; padding: 2px; flex-shrink: 0; }
.lang-btn { padding: 2px 7px; border-radius: 12px; font-size: 10px; font-weight: 700; text-decoration: none !important; color: var(--muted); transition: all .15s; white-space: nowrap; line-height: 1.5; display: inline-block; }
.lang-btn.active { background: var(--primary); color: #fff !important; }
.lang-btn:visited { color: var(--muted); }

/* Chat icon */
.nav-icon-btn { position: relative; display: flex; align-items: center; color: var(--secondary); text-decoration: none; }
.unread-badge { background: var(--danger); color: #fff; border-radius: 50%; width: 15px; height: 15px; font-size: 9px; display: flex; align-items: center; justify-content: center; position: absolute; top: -4px; right: -4px; }

/* Avatar */
.nav-avatar-wrap { display: flex; align-items: center; text-decoration: none; flex-shrink: 0; }
.nav-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border); }
.nav-avatar-initials { width: 30px; height: 30px; border-radius: 50%; background: #e0e0e0; display: flex; align-items: center; justify-content: center; font-size: 12px; font-weight: 700; color: #555; border: 2px solid var(--border); }

/* ── CONTAINER ── */
.container { max-width: 1400px; margin: 0 auto; padding: 0 14px; }

/* ── SECTION HEADER ── */
.section-header { display: flex; align-items: center; justify-content: space-between; margin: 18px 0 12px; }
.section-title { font-family: 'Cormorant Garamond', serif; font-size: 22px; font-weight: 400; }

/* ── PRODUCT GRID: 5 desktop, 3 mobile ── */
.products-grid {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 10px;
    padding-bottom: 90px;
}
@media(max-width: 900px) {
    .products-grid { grid-template-columns: repeat(4, 1fr) !important; gap: 8px; }
}
@media(max-width: 600px) {
    .products-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 6px; }
    .product-card-body { padding: 6px; }
    .product-name { font-size: 10px; }
    .product-price { font-size: 11px; }
}

/* ── PRODUCT CARD ── */
.product-card { background: #fff; border: 1px solid var(--border); border-radius: var(--rl); overflow: hidden; transition: transform .2s, box-shadow .2s; text-decoration: none; color: inherit; display: block; }
.product-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); border-color: #d0d0d0; }
.product-card-img { aspect-ratio: 1/1; overflow: hidden; background: var(--light-gray); display: block; width: 100%; }
.product-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .3s; }
.product-card:hover .product-card-img img { transform: scale(1.04); }
.product-card-body { padding: 8px; }
.product-card-seller { display: flex; align-items: center; gap: 4px; margin-bottom: 4px; }
.seller-avatar { width: 16px; height: 16px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.seller-name { font-size: 10px; color: var(--muted); text-decoration: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; min-width: 0; }
.trusted-badge { background: var(--gold); color: #fff; font-size: 7px; padding: 1px 4px; border-radius: 6px; font-weight: 700; flex-shrink: 0; }
.product-name { font-size: 11px; font-weight: 500; margin-bottom: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; line-height: 1.3; }
.product-price { font-size: 12px; font-weight: 700; }
.product-meta { display: flex; align-items: center; gap: 6px; font-size: 10px; color: var(--muted); margin-top: 3px; }
.stars-display { color: var(--gold); font-size: 10px; }

/* ── FAB ── */
.fab { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: var(--primary); color: #fff; border: none; border-radius: 50px; padding: 12px 22px; font-size: 13px; font-weight: 500; cursor: pointer; display: flex; align-items: center; gap: 8px; box-shadow: 0 6px 20px rgba(0,0,0,0.22); transition: all .25s; z-index: 90; font-family: 'DM Sans', sans-serif; text-decoration: none; white-space: nowrap; }
.fab:hover { background: #333; transform: translateX(-50%) translateY(-2px); }

/* ── MODAL ── */
.modal-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.45); display: flex; align-items: flex-end; justify-content: center; z-index: 200; opacity: 0; pointer-events: none; transition: opacity .25s; }
.modal-overlay.active { opacity: 1; pointer-events: all; }
.modal { background: #fff; border-radius: var(--rl) var(--rl) 0 0; width: 100%; max-width: 540px; max-height: 90vh; overflow-y: auto; padding: 24px 20px; transform: translateY(30px); transition: transform .25s; }
.modal-overlay.active .modal { transform: translateY(0); }
.modal-title { font-family: 'Cormorant Garamond', serif; font-size: 22px; margin-bottom: 18px; }
.modal-close { float: right; background: none; border: none; font-size: 24px; cursor: pointer; color: var(--muted); line-height: 1; padding: 0; }

/* ── FORMS ── */
.form-group { margin-bottom: 14px; }
.form-group label { display: block; font-size: 10px; text-transform: uppercase; letter-spacing: 1.5px; color: #888; margin-bottom: 6px; }
.form-group input, .form-group textarea, .form-group select { width: 100%; padding: 10px 13px; border: 1px solid var(--border); border-radius: var(--r); font-size: 14px; font-family: 'DM Sans', sans-serif; background: var(--off-white); transition: border-color .2s; color: var(--primary); }
.form-group input:focus, .form-group textarea:focus { outline: none; border-color: var(--primary); background: #fff; }
.form-group textarea { resize: vertical; min-height: 80px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* ── BUTTONS ── */
.btn { padding: 10px 18px; border-radius: var(--r); font-size: 13px; font-weight: 500; cursor: pointer; border: none; transition: all .2s; font-family: 'DM Sans', sans-serif; text-decoration: none; display: inline-flex; align-items: center; gap: 7px; }
.btn-dark { background: var(--primary); color: #fff; }
.btn-dark:hover { background: #333; }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--primary); }
.btn-outline:hover { border-color: var(--primary); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 7px 13px; font-size: 12px; }
.btn-block { width: 100%; justify-content: center; }

/* ── PRODUCT DETAIL ── */
.pd-wrap { display: grid; grid-template-columns: 1fr 1fr; gap: 36px; padding: 28px 0; align-items: start; }
.pd-main-img { width: 100%; aspect-ratio: 1/1; border-radius: var(--rl); overflow: hidden; background: #f0f0f0; }
.pd-main-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pd-thumbs { display: flex; gap: 7px; margin-top: 9px; flex-wrap: wrap; }
.pd-thumbs img { width: 54px; height: 54px; border-radius: var(--r); object-fit: cover; cursor: pointer; border: 2px solid transparent; transition: border-color .2s; background: #f0f0f0; }
.pd-thumbs img.active, .pd-thumbs img:hover { border-color: var(--primary); }
.pd-info { display: flex; flex-direction: column; gap: 13px; }
.pd-title { font-family: 'Cormorant Garamond', serif; font-size: 26px; font-weight: 400; line-height: 1.2; }
.pd-price { font-size: 24px; font-weight: 700; }
.pd-seller { display: flex; align-items: center; gap: 8px; text-decoration: none; color: inherit; }
.pd-seller img, .pd-seller-av { width: 28px; height: 28px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.pd-seller-av { background: #e0e0e0; display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: #666; }
.pd-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.pd-actions .btn { flex: 1; justify-content: center; min-width: 0; }
.like-btn { display: flex; align-items: center; justify-content: center; gap: 5px; padding: 10px 14px; border: 1px solid var(--border); border-radius: var(--r); background: none; cursor: pointer; font-size: 13px; transition: all .2s; font-family: 'DM Sans', sans-serif; flex-shrink: 0; }
.like-btn.liked { border-color: #e74c3c; color: #e74c3c; }

/* Stars */
.star-select { display: flex; gap: 2px; flex-direction: row-reverse; justify-content: flex-end; }
.star-select input { display: none; }
.star-select label { font-size: 24px; color: #ddd; cursor: pointer; transition: color .15s; }
.star-select input:checked ~ label, .star-select label:hover, .star-select label:hover ~ label { color: var(--gold); }

/* Comments */
.comment-item { display: flex; gap: 9px; margin-bottom: 16px; }
.comment-avatar { width: 30px; height: 30px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.comment-content { flex: 1; }
.comment-meta { font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.comment-meta strong { color: var(--primary); }
.comment-text { font-size: 13px; line-height: 1.6; }
.comment-reply-btn { font-size: 11px; color: var(--muted); background: none; border: none; cursor: pointer; margin-top: 3px; padding: 0; }
.comment-reply-btn:hover { color: var(--primary); }
.replies { margin-left: 39px; border-left: 2px solid var(--border); padding-left: 12px; }

/* Profile */
.profile-header { background: #fff; border: 1px solid var(--border); border-radius: var(--rl); padding: 24px; display: flex; align-items: center; gap: 20px; margin-top: 20px; flex-wrap: wrap; }
.profile-avatar { width: 74px; height: 74px; border-radius: 50%; object-fit: cover; border: 2px solid var(--border); flex-shrink: 0; }
.profile-info h2 { font-family: 'Cormorant Garamond', serif; font-size: 26px; font-weight: 400; }

/* Chat */
.chat-layout { display: grid; grid-template-columns: 250px 1fr; height: calc(100vh - 50px); overflow: hidden; }
.chat-sidebar { background: #fff; border-right: 1px solid var(--border); overflow-y: auto; }
.chat-sidebar-header { padding: 14px 16px; border-bottom: 1px solid var(--border); font-weight: 500; font-size: 14px; }
.chat-user-item { display: flex; align-items: center; gap: 10px; padding: 11px 14px; cursor: pointer; transition: background .15s; text-decoration: none; color: inherit; }
.chat-user-item:hover, .chat-user-item.active { background: var(--off-white); }
.chat-user-item img { width: 34px; height: 34px; border-radius: 50%; object-fit: cover; flex-shrink: 0; }
.chat-user-info { flex: 1; min-width: 0; }
.chat-user-info strong { display: block; font-size: 13px; }
.chat-user-info span { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.chat-messages-area { display: flex; flex-direction: column; height: 100%; overflow: hidden; }
.messages-list { flex: 1; overflow-y: auto; padding: 18px; display: flex; flex-direction: column; gap: 9px; }
.msg { max-width: 72%; }
.msg-bubble { padding: 9px 13px; border-radius: 14px; font-size: 13px; line-height: 1.5; word-break: break-word; }
.msg-in .msg-bubble { background: #fff; border: 1px solid var(--border); border-radius: 4px 14px 14px 14px; }
.msg-out { align-self: flex-end; }
.msg-out .msg-bubble { background: var(--primary); color: #fff; border-radius: 14px 14px 4px 14px; }
.msg-time { font-size: 10px; color: var(--muted); margin-top: 2px; }
.msg-out .msg-time { text-align: right; }
.chat-input-area { padding: 10px 14px; border-top: 1px solid var(--border); display: flex; gap: 9px; background: #fff; flex-shrink: 0; }
.chat-input-area input { flex: 1; padding: 9px 13px; border: 1px solid var(--border); border-radius: 40px; font-size: 13px; font-family: 'DM Sans', sans-serif; }
.chat-input-area input:focus { outline: none; border-color: var(--primary); }

/* Payment */
.pay-method-opt { display: flex; align-items: center; gap: 0; padding: 13px 15px; border: 1.5px solid var(--border); border-radius: 10px; cursor: pointer; transition: border-color .15s; background: #fff; user-select: none; }
.pay-method-opt:hover { border-color: #bbb; }
.pay-method-opt:has(input:checked) { border-color: var(--primary); background: #fafafa; }
.pay-method-opt input[type=radio] { width: 16px; height: 16px; flex-shrink: 0; cursor: pointer; margin: 0; accent-color: var(--primary); }
.pay-method-name { flex: 1; font-size: 14px; font-weight: 600; text-align: center; }
.payment-info-box { background: var(--off-white); border: 1px solid var(--border); border-radius: var(--r); padding: 13px; font-size: 13px; }

/* Pay badges */
.pay-badges { display: flex; gap: 5px; flex-wrap: wrap; }
.pay-badge { font-size: 10px; padding: 2px 7px; border-radius: 9px; border: 1px solid var(--border); color: var(--secondary); }
.pay-badge.active { background: #e8f5e9; border-color: #a5d6a7; color: #2e7d32; }

/* Admin */
.admin-layout { display: grid; grid-template-columns: 210px 1fr; min-height: 100vh; }
.admin-sidebar { background: #1a1a1a; }
.admin-brand { padding: 22px 18px; border-bottom: 1px solid rgba(255,255,255,.1); font-family: 'Cormorant Garamond', serif; font-size: 20px; color: #fff; letter-spacing: 4px; }
.admin-nav a { display: flex; align-items: center; gap: 10px; padding: 12px 18px; color: rgba(255,255,255,.55); text-decoration: none; font-size: 13px; transition: all .2s; }
.admin-nav a:hover, .admin-nav a.active { background: rgba(255,255,255,.08); color: #fff; }
.admin-content { padding: 28px 24px; }
.admin-stat-cards { display: grid; grid-template-columns: repeat(4,1fr); gap: 14px; margin-bottom: 28px; }
.stat-card { background: #fff; border: 1px solid var(--border); border-radius: var(--r); padding: 18px; }
.stat-card h3 { font-size: 26px; font-weight: 600; margin-bottom: 3px; }
.stat-card p { font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: 1px; }
.data-table { width: 100%; border-collapse: collapse; background: #fff; border-radius: var(--rl); overflow: hidden; border: 1px solid var(--border); }
.data-table th { padding: 11px 15px; text-align: left; font-size: 10px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); border-bottom: 1px solid var(--border); background: var(--off-white); }
.data-table td { padding: 11px 15px; font-size: 13px; border-bottom: 1px solid var(--border); }
.data-table tr:last-child td { border-bottom: none; }
.data-table tr:hover td { background: var(--off-white); }

/* Image upload */
.img-upload-grid { display: grid; grid-template-columns: repeat(6,1fr); gap: 7px; }
.img-preview { aspect-ratio: 1; border-radius: var(--r); overflow: hidden; background: var(--off-white); border: 2px dashed var(--border); display: flex; align-items: center; justify-content: center; cursor: pointer; transition: border-color .2s; }
.img-preview:hover { border-color: var(--primary); }
.img-preview img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* Misc */
.no-results { text-align: center; padding: 50px 20px; color: var(--muted); }
.divider { height: 1px; background: var(--border); margin: 16px 0; }
.toast-container { position: fixed; bottom: 80px; left: 50%; transform: translateX(-50%); z-index: 999; display: flex; flex-direction: column; gap: 7px; align-items: center; }
.toast { background: var(--primary); color: #fff; padding: 9px 18px; border-radius: 40px; font-size: 13px; animation: slideUp .25s ease; white-space: nowrap; }
.toast.success { background: var(--success); }
.toast.error { background: var(--danger); }
@keyframes slideUp { from { opacity:0; transform:translateY(8px); } to { opacity:1; transform:translateY(0); } }

/* ── RESPONSIVE ── */
@media(max-width: 1100px) {
    .admin-stat-cards { grid-template-columns: repeat(2,1fr); }
}
@media(max-width: 768px) {
    .chat-layout { grid-template-columns: 1fr; }
    .chat-sidebar { display: none; }
    .admin-layout { grid-template-columns: 1fr; }
    .admin-stat-cards { grid-template-columns: 1fr 1fr; }
    .form-row { grid-template-columns: 1fr; }
    .img-upload-grid { grid-template-columns: repeat(3,1fr); }
    .pd-wrap { grid-template-columns: 1fr; gap: 0; padding: 0; }
    .pd-main-img { border-radius: 0; aspect-ratio: 4/3; }
    .pd-info { padding: 14px; }
    .pd-thumbs { padding: 0 14px; }
}
@media(max-width: 480px) {
    /* 4 columns always - just smaller */
    .product-card-body { padding: 6px; }
    .product-name { font-size: 10px; }
    .product-price { font-size: 11px; }
    .product-meta { display: none; }
    .product-card-seller { display: none; }
    .nav-inner { padding: 0 10px; gap: 8px; }
    .nav-brand { font-size: 18px; letter-spacing: 3px; }
    .fab { padding: 10px 16px; font-size: 12px; bottom: 14px; }
    .container { padding: 0 10px; }
    .section-header { margin: 14px 0 10px; }
    .section-title { font-size: 18px; }
    .profile-header { padding: 16px 14px; gap: 14px; }
    .profile-avatar { width: 60px; height: 60px; }
    .profile-info h2 { font-size: 20px; }
    .admin-content { padding: 14px 12px; }
    .payment-options { grid-template-columns: 1fr; }
}
