/* =========================================
   1. GLOBAL VARIABLES & RESET (YOUR COLORS)
   ========================================= */
:root {
    --primary-coral: #F45D5D;
    --primary-gold: #F4B95B;
    --text-dark: #333;
    --bg-light: #f9f9f9;
    --white: #fff;
    --success: #4CAF50;
    --info: #2196F3;
    --danger: #f44336;
}

* { box-sizing: border-box; margin: 0; padding: 0; font-family: 'Segoe UI', sans-serif; }
body { background: var(--bg-light); color: var(--text-dark); padding-bottom: 80px; font-size: 16px; line-height: 1.5; }
a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }
.container { max-width: 1200px; margin: 0 auto; padding: 20px; width: 100%; }

/* =========================================
   2. BUTTONS
   ========================================= */
.btn { cursor: pointer; border: none; padding: 12px 20px; border-radius: 4px; font-weight: bold; transition: 0.2s; font-size: 1rem; display: inline-block; text-align: center; }
@media (max-width: 600px) { .btn { width: 100%; margin-bottom: 5px; } }
.btn-primary { background: var(--primary-coral); color: white; }
.btn-primary:hover { background: #d44545; }
.btn-secondary { background: var(--primary-gold); color: #333; }
.btn-outline { border: 2px solid var(--primary-coral); color: var(--primary-coral); background: transparent; }
.btn-outline:hover { background: var(--primary-coral); color: white; }
.btn-cancel { background: #999; color: white; display: none; }

/* =========================================
   3. HEADER
   ========================================= */
header { background: white; box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1); position: sticky; top: 0; z-index: 100; }
.top-bar { background: var(--primary-coral); color: white; text-align: center; font-size: 0.8rem; padding: 8px; }
.main-header { display: flex; align-items: center; justify-content: space-between; padding: 15px 20px; gap: 20px; }
.logo { font-size: 1.6rem; font-weight: 800; color: var(--primary-coral); text-transform: uppercase; letter-spacing: 1px; white-space: nowrap; }
.logo span { color: var(--primary-gold); }

.search-group { display: flex; flex: 1; max-width: 500px; border: 2px solid var(--primary-coral); border-radius: 4px; overflow: hidden; }
.search-category { background: #f0f0f0; border: none; padding: 0 10px; border-right: 1px solid #ccc; cursor: pointer; outline: none; color: #555; display: block; }
.search-input { flex: 1; border: none; padding: 10px; outline: none; font-size: 1rem; min-width: 0; }
.search-btn { background: var(--primary-coral); color: white; border: none; padding: 0 15px; cursor: pointer; font-size: 1.1rem; }

.menu-icons { display: flex; gap: 20px; font-size: 1.1rem; justify-content: flex-end; align-items: center; }
.menu-item { position: relative; cursor: pointer; text-align: center; color: #555; display: flex; flex-direction: column; align-items: center; }
.menu-item:hover { color: var(--primary-coral); }
.menu-item i { font-size: 1.3rem; margin-bottom: 2px; }
.menu-item span { font-size: 0.7rem; display: block; }
.badge { position: absolute; top: -5px; right: -5px; background: var(--primary-coral); color: white; font-size: 0.65rem; padding: 2px 5px; min-width: 18px; text-align: center; border-radius: 10px; font-weight: bold; border: 2px solid white; }

@media (max-width: 900px) {
    .main-header { flex-direction: column; align-items: stretch; gap: 15px; padding: 15px; }
    .logo { text-align: center; }
    .search-group { max-width: 100%; order: 2; }
    .menu-icons { width: 100%; justify-content: space-between; gap: 10px; order: 3; }
    .search-category { display: none; }
}

/* =========================================
   4. LAYOUT
   ========================================= */
.section { display: none; padding-top: 20px; }
.section.active { display: block; animation: fadein 0.4s; }
@keyframes fadein { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }

/* =========================================
   5. PRODUCT GRID
   ========================================= */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 15px; margin-top: 20px; }
.card { background: white; border-radius: 8px; overflow: hidden; box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05); transition: transform 0.2s; border: 1px solid #eee; display: flex; flex-direction: column; cursor: pointer; }
.card:hover { transform: translateY(-3px); border-color: var(--primary-gold); }
.card img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.card-body { padding: 12px; flex: 1; display: flex; flex-direction: column; justify-content: space-between; }
.card-cat { font-size: 0.7rem; color: #999; text-transform: uppercase; margin-bottom: 4px; }
.card-title { font-weight: bold; margin-bottom: 5px; font-size: 0.95rem; color: var(--text-dark); }
.card-price { color: var(--primary-coral); font-size: 1.1rem; font-weight: bold; }

/* =========================================
   6. FORMS
   ========================================= */
.input-group { margin-bottom: 15px; width: 100%; }
.input-group input { width: 100%; height: 50px;}
#pDesc { width: 100%;}
.input-group textarea { width: 100%; }
.input-group label { display: block; margin-bottom: 5px; font-weight: bold; color: #555; font-size: 0.9rem; }
.form-control { width: 100%; padding: 12px; border: 1px solid #ccc; border-radius: 4px; font-size: 1rem; background: #fff; }
.form-row { display: flex; gap: 15px; width: 100%; align-items: flex-end; }
@media (max-width: 600px) { .form-row { flex-direction: column; gap: 10px; align-items: stretch; } .form-row .btn { width: 100%; } }

/* =========================================
   7. CHECKOUT & ACCOUNT
   ========================================= */
.checkout-container { display: flex; gap: 30px; flex-wrap: wrap; }
.checkout-form { flex: 2; background: white; padding: 30px; border-radius: 8px; min-width: 300px; }
.checkout-summary { flex: 1; background: white; padding: 30px; border-radius: 8px; height: fit-content; border: 2px solid var(--primary-gold); min-width: 300px; }
.summary-row { display: flex; justify-content: space-between; margin-bottom: 10px; font-size: 0.9rem; }
.summary-total { border-top: 1px solid #ddd; padding-top: 10px; margin-top: 10px; font-weight: bold; font-size: 1.2rem; color: var(--primary-coral); display: flex; justify-content: space-between; }
@media (max-width: 768px) { .checkout-container { flex-direction: column; } .checkout-form, .checkout-summary { width: 100%; min-width: 0; padding: 20px; } }

.account-header { background: white; padding: 30px; border-radius: 8px; text-align: center; margin-bottom: 20px; border: 1px solid #eee; }
.order-item { background: white; padding: 20px; margin-bottom: 15px; border-left: 5px solid var(--primary-coral); border-radius: 4px; box-shadow: 0 2px 5px rgba(0,0,0,0.02); }

/* =========================================
   8. MODALS & CHAT
   ========================================= */
.modal-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.6); z-index: 2000; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal-box { background: white; padding: 30px; border-radius: 8px; width: 600px; max-width: 95%; max-height: 90vh; overflow-y: auto; position: relative; box-shadow: 0 10px 25px rgba(0,0,0,0.2); }
.modal-hidden { display: none !important; }
.close-modal { position: absolute; top: 15px; right: 15px; font-size: 1.5rem; cursor: pointer; color: #999; padding: 5px; }
.auth-toggle { margin-top: 15px; font-size: 0.9rem; color: #666; text-align: center; }
.auth-toggle span { color: var(--primary-coral); cursor: pointer; font-weight: bold; text-decoration: underline; }

.chat-box { border: 1px solid #eee; background: #f9f9f9; height: 350px; max-height: 50vh; overflow-y: auto; padding: 15px; margin-bottom: 15px; border-radius: 8px; display: flex; flex-direction: column; gap: 10px; }
.chat-bubble { max-width: 85%; padding: 10px 15px; border-radius: 15px; font-size: 0.95rem; line-height: 1.4; position: relative; word-wrap: break-word; }
.chat-bubble.admin { background-color: var(--primary-coral); color: white; align-self: flex-end; border-bottom-right-radius: 2px; }
.chat-bubble.customer { background-color: #e0e0e0; color: #333; align-self: flex-start; border-bottom-left-radius: 2px; }
.chat-time { font-size: 0.7rem; margin-top: 5px; opacity: 0.8; text-align: right; display: block; }
.chat-input-area { display: flex; gap: 10px; }
.chat-input-area input { margin-bottom: 0; }

.notif-card { background: white; border: 1px solid #eee; padding: 15px; margin-bottom: 10px; border-radius: 8px; display: flex; align-items: center; gap: 15px; transition: transform 0.2s; box-shadow: 0 1px 3px rgba(0,0,0,0.05); }
.notif-card.status { border-left: 5px solid var(--success); }
.notif-card.message { border-left: 5px solid var(--info); cursor: pointer; background-color: #f0f8ff; }
.notif-card.message:hover { transform: translateX(5px); }
.notif-icon { font-size: 1.4rem; flex-shrink: 0; }
.notif-text { flex: 1; }
.notif-text strong { display: block; margin-bottom: 3px; color: #333; font-size: 0.95rem; }
.notif-text small { color: #666; font-size: 0.85rem; }

/* =========================================
   9. FLOATING MESSENGER
   ========================================= */
.floating-messenger { position: fixed; bottom: 20px; right: 20px; width: 60px; height: 60px; background-color: #0084FF; color: white; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 32px; box-shadow: 0 4px 15px rgba(0,0,0,0.3); z-index: 9999; transition: transform 0.3s; }
.floating-messenger:hover { transform: scale(1.1); }
.messenger-tooltip { position: absolute; right: 70px; background: white; color: #333; padding: 12px 15px; border-radius: 8px; font-size: 0.9rem; width: 220px; box-shadow: 0 4px 15px rgba(0,0,0,0.15); opacity: 1; transition: opacity 0.5s ease-out; pointer-events: none; font-weight: 500; }
.messenger-tooltip::after { content: ''; position: absolute; top: 50%; right: -8px; transform: translateY(-50%); border-width: 8px 0 8px 8px; border-style: solid; border-color: transparent transparent transparent white; }
.messenger-tooltip.hide { opacity: 0; }

/* =========================================
   10. CONTACT PAGE STYLES
   ========================================= */
.contact-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 30px; margin-bottom: 40px; }
.contact-card { background: white; padding: 30px 20px; border-radius: 10px; text-align: center; box-shadow: 0 5px 20px rgba(0,0,0,0.05); transition: transform 0.3s ease; border: 1px solid #eee; }
.contact-card:hover { transform: translateY(-5px); border-color: var(--primary-gold); }
.icon-box { width: 60px; height: 60px; background: #FFF5F5; color: var(--primary-coral); border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 1.5rem; margin: 0 auto 20px auto; }
.contact-card h3 { font-size: 1.2rem; margin-bottom: 10px; color: var(--text-dark); }
.contact-card p { color: #666; margin-bottom: 15px; line-height: 1.6; }
.btn-link { display: inline-block; margin-top: 10px; color: var(--primary-coral); font-weight: 600; text-decoration: none; border-bottom: 2px solid transparent; transition: 0.2s; }
.btn-link:hover { border-bottom-color: var(--primary-coral); }
.map-container { width: 100%; height: 400px; border-radius: 10px; overflow: hidden; box-shadow: 0 5px 15px rgba(0,0,0,0.1); }

/* =========================================
   11. QUANTITY CONTROLS
   ========================================= */
.qty-group { display: flex; align-items: center; gap: 5px; }
.qty-btn { background: #eee; border: 1px solid #ddd; width: 25px; height: 25px; border-radius: 4px; cursor: pointer; font-weight: bold; display: flex; align-items: center; justify-content: center; }
.qty-btn:hover { background: #ddd; }
.qty-val { font-weight: bold; min-width: 20px; text-align: center; }
.edit-qty-input { width: 60px; padding: 5px; border: 1px solid #ccc; border-radius: 4px; text-align: center; }

/* =========================================
   12. MOBILE BOTTOM NAVIGATION
   ========================================= */
.bottom-nav { display: none; position: fixed; bottom: 0; left: 0; width: 100%; background: white; box-shadow: 0 -2px 10px rgba(0,0,0,0.1); z-index: 2000; justify-content: space-around; padding: 10px 0; }
.nav-item { display: flex; flex-direction: column; align-items: center; color: #555; font-size: 0.8rem; cursor: pointer; }
.nav-item i { font-size: 1.2rem; margin-bottom: 4px; }
.nav-item:hover, .nav-item.active { color: var(--primary-coral); }
.mobile-bell { display: none; position: relative; font-size: 1.4rem; color: #555; cursor: pointer; }

@media (max-width: 900px) {
    .desktop-menu { display: none !important; }
    .hamburger-menu { display: none !important; } 
    .mobile-bell { display: block; margin-left: auto; }
    .logo { margin-right: 0; text-align: left; flex-grow: 1; font-size: 1.4rem; }
    .main-header { padding: 10px 15px; flex-wrap: nowrap; }
    .bottom-nav { display: flex; }
    .mobile-only-link { display: block; }
}
@media (min-width: 901px) { .mobile-only-link { display: none; } }

/* =========================================
   13. FIX MESSENGER ICON ON MOBILE
   ========================================= */
@media (max-width: 900px) {
    .floating-messenger { bottom: 85px !important; right: 15px !important; }
    .floating-messenger i { width: 30px; height: 50px; line-height: 50px; font-size: 28px; }
}

/* =========================================
   14. ORDER NOW BUTTON
   ========================================= */
.btn-buy-now { background-color: var(--primary-gold) !important; color: #333 !important; border: none; transition: all 0.3s ease; box-shadow: 0 4px 6px rgba(0,0,0,0.1); }
.btn-buy-now:hover { background-color: #e0a84b !important; color: black !important; transform: translateY(-3px); box-shadow: 0 6px 12px rgba(244, 185, 91, 0.4); }
.btn-buy-now:active { transform: translateY(-1px); box-shadow: 0 2px 4px rgba(0,0,0,0.1); }

/* =========================================
   15. SIDEBAR STYLES (Filter & Menu)
   ========================================= */
.sidebar-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.5); z-index: 2001; opacity: 0; visibility: hidden; transition: 0.3s ease-in-out; }
.sidebar-overlay.active { opacity: 1; visibility: visible; }
.sidebar { position: fixed; top: 0; left: 0; height: 100%; width: 280px; background: white; z-index: 2002; transform: translateX(-100%); transition: 0.3s ease-in-out; box-shadow: 2px 0 10px rgba(0,0,0,0.1); display: flex; flex-direction: column; }
.sidebar.active { transform: translateX(0); }
.sidebar-header { background: var(--primary-coral); color: white; padding: 20px; display: flex; justify-content: space-between; align-items: center; }
.sidebar-header h3 { margin: 0; font-weight: 600; }
.close-sidebar { font-size: 1.8rem; cursor: pointer; }
.sidebar-list { list-style: none; padding: 0; margin: 0; overflow-y: auto; }
.sidebar-list li { padding: 15px 20px; border-bottom: 1px solid #eee; cursor: pointer; transition: 0.2s; display: flex; align-items: center; color: #555; font-weight: 500; }
.sidebar-list li i { margin-right: 15px; width: 20px; text-align: center; color: var(--primary-gold); }
.sidebar-list li:hover { background: #fff5f5; color: var(--primary-coral); }

/* PRODUCT DETAILS PAGE */
.product-detail-card { background: white; padding: 30px; border-radius: 8px; box-shadow: 0 2px 10px rgba(0,0,0,0.05); }
.detail-layout { display: flex; gap: 40px; flex-wrap: wrap; }
.detail-left, .detail-right { flex: 1; min-width: 300px; }
.main-img { width: 100%; height: 400px; object-fit: cover; border-radius: 4px; border: 1px solid #eee; }
.p-title { font-size: 1.8rem; font-weight: 600; margin-bottom: 15px; color: #333; }
.p-price { font-size: 2rem; color: var(--primary-coral); font-weight: bold; background: #fafafa; padding: 15px; margin-bottom: 25px; }
.p-section { margin-bottom: 25px; }
.p-desc { line-height: 1.6; color: #555; white-space: pre-line; }
.color-options { display: flex; gap: 10px; flex-wrap: wrap; }
.color-btn { padding: 8px 20px; border: 1px solid #ddd; background: white; cursor: pointer; border-radius: 2px; }
.color-btn.active { border-color: var(--primary-coral); color: var(--primary-coral); background: #fff5f5; font-weight: bold; }

/* Tables Responsive */
.table-responsive { width: 100%; overflow-x: auto; margin-bottom: 20px; }
table { width: 100%; border-collapse: collapse; background: white; min-width: 600px; }
th { background: var(--primary-gold); padding: 12px; text-align: left; font-weight: 600; }
td { padding: 15px 12px; border-bottom: 1px solid #eee; font-size: 0.95rem; }

/* ADD THIS IF MISSING */
.status-badge { padding: 5px 12px; border-radius: 20px; font-size: 0.8rem; font-weight: bold; color: white; }
.status-Pending { background: #FFC107; color: #333; }
.status-Processing { background: #2196F3; }
.status-Shipped { background: #9C27B0; }
.status-Delivered, .status-Completed { background: #4CAF50; }
.status-Cancelled { background: #F44336; }

/* =========================================
   16. CUSTOMER REVIEWS
   ========================================= */
.reviews-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-top: 20px; }
.review-card { background: white; padding: 20px; border-radius: 8px; border: 1px solid #eee; box-shadow: 0 2px 5px rgba(0,0,0,0.05); transition: transform 0.2s; display: flex; justify-content: space-between; align-items: center; gap: 15px; }
.review-card:hover { transform: translateY(-3px); border-color: var(--primary-gold); }
.review-content { flex: 1; }
.review-stars { color: #FFD700; font-size: 0.9rem; margin-bottom: 5px; }
.review-text { font-style: italic; color: #555; font-size: 0.95rem; line-height: 1.4; margin-bottom: 8px; }
.review-name { font-weight: bold; color: var(--text-dark); font-size: 0.9rem; }
.review-img-box { flex-shrink: 0; width: 80px; height: 80px; overflow: hidden; border-radius: 6px; border: 1px solid #ddd; cursor: zoom-in; }
.review-img-box img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.3s; }
.review-img-box:hover img { transform: scale(1.1); }

/* Image Preview Modal */
#previewImage { max-width: 90%; max-height: 90vh; border-radius: 8px; box-shadow: 0 5px 25px rgba(0,0,0,0.5); }

/* =========================================
   17. ADDED STYLES FOR GALLERY & ADMIN (REQUIRED)
   ========================================= */
/* Gallery Thumbnails */
.thumbnail-row { display: flex; gap: 10px; margin-top: 10px; overflow-x: auto; padding-bottom: 5px; }
.thumbnail-row img { width: 70px; height: 70px; object-fit: cover; border-radius: 6px; cursor: pointer; border: 2px solid transparent; transition: all 0.2s; opacity: 0.7; }
.thumbnail-row img:hover { border-color: var(--primary-coral); opacity: 1; transform: scale(1.05); }

/* Admin Thumbnails & Actions */
.admin-thumb { width: 50px; height: 50px; object-fit: cover; border-radius: 4px; border: 1px solid #ddd; }
.action-btns { display: flex; gap: 5px; }
.btn-edit { background: #333; color: white; border: none; padding: 5px 10px; border-radius: 4px; cursor: pointer; }
.btn-delete { background: var(--danger); color: white; border: none; padding: 5px 10px; border-radius: 4px; cursor: pointer; }

/* Admin Notifications */
.notif-item-admin { display: flex; gap: 15px; align-items: center; padding: 15px; background: #fff; border-bottom: 1px solid #eee; cursor: pointer; transition: 0.2s; }
.notif-item-admin:hover { background-color: #f9f9f9; }
.notif-item-admin.unread { background-color: #e3f2fd; border-left: 4px solid var(--info); }

/* Admin Messages */
.msg-item-admin { display: flex; gap: 15px; align-items: center; padding: 15px; border-bottom: 1px solid #eee; cursor: pointer; transition: 0.2s; }
.msg-item-admin:hover { background-color: #f9f9f9; }
.msg-item-admin.unread { background-color: #fff3e0; border-left: 4px solid var(--primary-gold); }
.msg-content { flex: 1; overflow: hidden; }
.msg-header { display: flex; justify-content: space-between; margin-bottom: 5px; }
.msg-name { font-weight: bold; }
.msg-date { font-size: 0.8rem; color: #888; }
.msg-preview { color: #666; font-size: 0.9rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Admin Reviews - FIXED SIZE FOR PHOTOS */
.review-item-admin { display: flex; gap: 15px; align-items: center; padding: 15px; border-bottom: 1px solid #eee; cursor: pointer; transition: 0.2s; }
.review-item-admin:hover { background-color: #f9f9f9; }
.review-item-admin img { width: 60px; height: 60px; object-fit: cover; border-radius: 4px; flex-shrink: 0; }