* { box-sizing: border-box; }

:root {
    --bg-primary: #ffffff;
    --bg-secondary: #f9fafb;
    --text-primary: #1f2933;
    --text-secondary: #6b7280;
    --border-color: #e5e7eb;
    --accent-color: #111827;
    --accent-hover: #374151;
}

/* Utility Classes */
.hidden {
    display: none !important;
}

body.dark-mode {
    --bg-primary: #1f2933;
    --bg-secondary: #2d3748;
    --text-primary: #f7fafc;
    --text-secondary: #cbd5e0;
    --border-color: #4a5568;
    --accent-color: #e2e8f0;
    --accent-hover: #cbd5e0;
}

body {
    margin: 0;
    font-family: "Segoe UI", Tahoma, sans-serif;
    color: var(--text-primary);
    background: var(--bg-primary);
    transition: background 0.3s, color 0.3s;
}

a { color: var(--accent-color); text-decoration: none; }
a:hover { color: var(--accent-hover); }

.container {
    width: min(1100px, 92%);
    margin: 0 auto;
}

.navbar {
    background: var(--bg-primary);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 10;
}
.nav-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1rem 0;
}
.brand {
    font-weight: 700;
    font-size: 1.2rem;
    color: var(--text-primary);
    white-space: nowrap;
}
.nav-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    align-items: center;
}

.nav-item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 6px;
    transition: all 0.2s;
    white-space: nowrap;
    color: var(--text-primary);
}

.nav-item:hover {
    background: var(--bg-secondary);
    color: var(--accent-color);
}

.nav-item span { display: inline; }

.nav-dropdown {
    position: relative;
}

.dropdown-toggle {
    position: relative;
}

.nav-alert-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.25rem;
    height: 1.25rem;
    padding: 0 0.35rem;
    margin-left: 0.15rem;
    border-radius: 999px;
    background: #dc2626;
    color: #fff;
    font-size: 0.72rem;
    font-weight: 700;
    line-height: 1;
}

/* Item Card Action Buttons */
.cart-btn:hover {
    background: #2d3748 !important;
    transform: scale(1.05);
}

.wishlist-btn:hover {
    background: #2d3748 !important;
    transform: scale(1.05);
}

.share-toggle-btn:hover {
    background: #2d3748 !important;
    transform: scale(1.05);
}

.more-options-btn:hover {
    background: #2d3748 !important;
    transform: scale(1.05);
}

.dropdown-toggle i:last-child {
    font-size: 0.7rem;
    transition: transform 0.2s;
}

.dropdown-menu {
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    min-width: 180px;
    display: none;
    flex-direction: column;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    z-index: 20;
    margin-top: 0.5rem;
    overflow: hidden;
    padding: 0.5rem 0;
    /* Add a transparent gap to prevent hover loss */
    margin-top: -0.25rem;
    padding-top: 0.75rem;
}

.dropdown-menu.active {
    display: flex;
}

.dropdown-menu a {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem 1rem;
    border: none;
    background: none;
    color: var(--text-primary);
    transition: all 0.2s;
    font-size: 0.95rem;
}

.dropdown-menu a:hover {
    background: var(--bg-secondary);
    color: var(--accent-color);
    padding-left: 1.25rem;
}

.dropdown-menu a:last-child {
    margin-bottom: 0;
}

.dropdown-menu .badge-small {
    background: #ef4444;
    color: #fff;
    font-size: 0.65rem;
    padding: 0.15rem 0.35rem;
    border-radius: 999px;
    margin-left: auto;
}

.dropdown-divider {
    height: 1px;
    background: var(--border-color);
    margin: 0.5rem 0;
}

.logout-item {
    color: #ef4444;
}

.logout-item:hover {
    background: #fee2e2;
}

.admin-item {
    background: var(--bg-secondary);
    color: #f97316;
}

.admin-item:hover {
    background: var(--border-color);
}

.nav-btn-primary {
    background: #3b82f6;
    color: white;
}

.nav-btn-primary:hover {
    background: #2563eb;
}

.nav-btn-secondary {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
}

.nav-btn-secondary:hover {
    background: var(--border-color);
}

.nav-avatar-small {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
}

.mobile-menu-toggle {
    display: none;
    font-size: 1.5rem;
    cursor: pointer;
    color: var(--text-primary);
    background: none;
    border: none;
    padding: 0.5rem;
}

@media (max-width: 768px) {
    .mobile-menu-toggle { 
        display: flex;
        align-items: center;
    }
    
    .nav-links {
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--bg-primary);
        flex-direction: column;
        padding: 0;
        border-bottom: 1px solid var(--border-color);
        display: none;
        gap: 0;
        max-height: calc(100vh - 60px);
        overflow-y: auto;
    }
    
    .nav-links.active { 
        display: flex;
    }
    
    .nav-item {
        width: 100%;
        padding: 1rem;
        border-radius: 0;
        border-bottom: 1px solid var(--border-color);
    }
    
    .nav-item span { display: inline; }
    
    .nav-item:hover {
        background: var(--bg-secondary);
    }
    
    .nav-dropdown {
        width: 100%;
    }
    
    .dropdown-toggle {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .nav-alert-count {
        margin-left: auto;
        margin-right: 0.5rem;
    }
    
    .dropdown-toggle i:last-child {
        transform: rotate(0deg);
        transition: transform 0.2s;
        margin-left: auto;
    }
    
    .dropdown-menu {
        position: static;
        border: none;
        border-radius: 0;
        min-width: auto;
        box-shadow: none;
        margin: 0;
        display: none;
        flex-direction: column;
        background: var(--bg-secondary);
    }
    
    .dropdown-menu.active {
        display: flex;
    }
    
    .dropdown-toggle.active i:last-child {
        transform: rotate(180deg);
    }
    
    .dropdown-menu a {
        padding-left: 2rem;
        border-bottom: 1px solid var(--border-color);
    }
    
    .dropdown-menu a:hover {
        padding-left: 2.25rem;
    }
    
    .account-toggle span,
    .nav-dropdown:not(:has(.dropdown-menu)) .nav-item span {
        display: inline;
    }
}

.hero-section {
    background: linear-gradient(135deg, var(--accent-color) 0%, var(--accent-hover) 100%);
    color: #ffffff;
    padding: 4rem 2rem;
    text-align: center;
    margin-bottom: 2rem;
    border-radius: 12px;
}

.hero-content h1 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    justify-content: center;
    margin-top: 2rem;
    flex-wrap: wrap;
}

.btn-large {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.categories-section {
    margin: 3rem 0;
}

.categories-section h2 {
    text-align: center;
    margin-bottom: 1.5rem;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
    gap: 1rem;
}

.category-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    padding: 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: 12px;
    transition: all 0.2s;
    text-align: center;
    background: var(--bg-secondary);
}

.category-card:hover {
    transform: translateY(-4px);
    border-color: var(--accent-color);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.filters-section {
    margin: 2rem 0;
}

.filters-form {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
    justify-content: center;
}

.filters-form select, .filters-form input {
    padding: 0.6rem;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    background: var(--bg-primary);
    color: var(--text-primary);
}

.announcements {
    margin: 1rem 0;
}

.announcement-banner {
    background: #fef3c7;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 0.5rem;
    border-left: 4px solid #f59e0b;
}

body.dark-mode .announcement-banner {
    background: #78350f;
    border-left-color: #fbbf24;
}

.grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: 1.5rem;
    margin: 1.5rem 0 3rem;
}

@media (min-width: 1024px) {
    .grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}

@media (max-width: 480px) {
    .grid {
        grid-template-columns: 1fr;
    }
}

.card {
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    background: var(--bg-primary);
    position: relative;
    display: flex;
    flex-direction: column;
}

.card-image {
    height: 240px;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.card-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
    background: var(--bg-secondary);
}

.card-image:hover img {
    transform: scale(1.05);
}

.card-image img {
    transition: transform 0.3s ease;
}
.card-body {
    padding: 1rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.card-actions {
    position: absolute;
    top: 0.5rem;
    right: 0.5rem;
    display: flex;
    gap: 0.5rem;
}

.icon-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}

.icon-btn:hover {
    background: #ef4444;
    color: #fff;
    transform: scale(1.1);
}

.badge-outofstock {
    position: absolute;
    top: 0.5rem;
    left: 0.5rem;
    background: #ef4444;
    color: #fff;
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
}

.category-badge {
    display: inline-block;
    background: var(--accent-color);
    color: #fff;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.75rem;
    margin-bottom: 0.5rem;
}

.verified-badge {
    color: #3b82f6;
    margin-left: 0.3rem;
}

.rating {
    display: flex;
    align-items: center;
    gap: 0.2rem;
    margin: 0.5rem 0;
    font-size: 0.9rem;
}

.rating .fa-star {
    color: #d1d5db;
}

.rating .fa-star.rated {
    color: #fbbf24;
}

.placeholder {
    color: #6b7280;
}

.form-card {
    max-width: 520px;
    margin: 2rem auto;
    padding: 2rem;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    background: #ffffff;
}

form label {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    margin-bottom: 1rem;
    font-weight: 600;
}
input, textarea, select {
    padding: 0.6rem 0.8rem;
    border-radius: 8px;
    border: 1px solid #d1d5db;
    font-size: 0.95rem;
}

.btn {
    display: inline-block;
    padding: 0.6rem 1.2rem;
    border-radius: 8px;
    background: var(--accent-color);
    color: #ffffff;
    border: none;
    cursor: pointer;
    transition: all 0.2s;
}
.btn.secondary {
    background: var(--text-secondary);
}
.btn.danger {
    background: #dc2626;
    color: #111111;
}
.btn.success {
    background: #059669;
}
.btn:hover { 
    opacity: 0.9;
    transform: translateY(-2px);
}

.spinner {
    border: 3px solid var(--border-color);
    border-top: 3px solid var(--accent-color);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    animation: spin 1s linear infinite;
    margin: 2rem auto;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.panel {
    padding: 1.5rem;
    margin: 1.5rem 0;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
}

.detail {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 2rem;
    margin: 2rem 0;
}
.detail-image img {
    width: 100%;
    border-radius: 12px;
}
.detail-info .price {
    font-size: 1.3rem;
    font-weight: 700;
}

.list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    margin: 1rem 0 2rem;
}
.list-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem;
}

.flash-area { margin-top: 1rem; }
.flash {
    padding: 0.8rem 1rem;
    border-radius: 10px;
    margin-bottom: 0.6rem;
}
.flash.success { background: #d1fae5; }
.flash.warning { background: #fef3c7; }
.flash.danger { background: #fee2e2; }
.flash.info { background: #e0e7ff; }

.footer {
    margin-top: 3rem;
    padding: 1.5rem 0;
    border-top: 1px solid #e5e7eb;
    color: #6b7280;
}

.highlight {
    background: #f3f4f6;
    padding: 1rem;
    border-radius: 10px;
    margin-bottom: 1rem;
}

.profile-preview img {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
    margin-top: 1rem;
}

.nav-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    vertical-align: middle;
}

.profile-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.profile-avatar-large {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    border: 3px solid #e5e7eb;
}

.mini-avatar {
    width: 24px;
    height: 24px;
    border-radius: 50%;
    object-fit: cover;
    vertical-align: middle;
    margin-right: 0.3rem;
}

.card-avatar {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 0.8rem;
}

.item-card {
    transition: transform 0.2s;
}
.item-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.seller-link {
    display: flex;
    align-items: center;
    margin: 0.5rem 0;
    color: #374151;
    font-weight: 500;
}

.empty-state {
    text-align: center;
    padding: 3rem;
    color: #9ca3af;
    grid-column: 1 / -1;
}

.frozen-card {
    border: 2px solid #ef4444;
    background: #fef2f2;
}

.danger {
    color: #dc2626;
    font-weight: 600;
}

.btn-group {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.btn.danger {
    background: #dc2626;
    color: #111111;
}

.btn.danger i {
    color: #111111;
}

.btn.success {
    background: #059669;
}

.status-badge {
    display: inline-block;
    padding: 0.3rem 0.6rem;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
}
.status-badge.pending { background: #fef3c7; color: #92400e; }
.status-badge.seen { background: #dbeafe; color: #1e40af; }
.status-badge.attended { background: #e0e7ff; color: #4338ca; }
.status-badge.payment { background: #d1fae5; color: #065f46; }
.status-badge.done { background: #d1fae5; color: #065f46; }

.order-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
}

.order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.order-list {
    margin: 1.5rem 0;
}

.search-container {
    margin: 2rem 0;
}

.search-form {
    display: flex;
    gap: 0.5rem;
    max-width: 600px;
    margin: 1rem 0;
}

.search-form input {
    flex: 1;
}

.profile-public {
    margin: 2rem 0;
}

.profile-header-public {
    display: flex;
    gap: 2rem;
    align-items: center;
    padding: 2rem;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .nav-links { gap: 0.6rem; }
    .list-item { flex-direction: column; align-items: flex-start; gap: 0.6rem; }
    .profile-header-public { flex-direction: column; text-align: center; }
    .nav-avatar { width: 28px; height: 28px; }
    .hero-content h1 { font-size: 1.8rem; }
    .categories-grid { grid-template-columns: repeat(auto-fit, minmax(100px, 1fr)); }
    .card-image { height: 200px; }
}

/* Image Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.9);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.modal.active {
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
}

.modal-content {
    max-width: 90vw;
    max-height: 90vh;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: white;
    font-size: 28px;
    font-weight: bold;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(0, 0, 0, 0.8);
    transform: scale(1.1);
}

.modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: white;
    font-size: 30px;
    cursor: pointer;
    background: rgba(0, 0, 0, 0.5);
    border: none;
    width: 50px;
    height: 50px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.modal-nav:hover {
    background: rgba(0, 0, 0, 0.8);
}

.modal-prev {
    left: 20px;
}

.modal-next {
    right: 20px;
}

@media (max-width: 768px) {
    .modal-content {
        max-width: 95vw;
        max-height: 95vh;
    }
    .modal-nav { width: 40px; height: 40px; font-size: 24px; }
    .modal-prev { left: 10px; }
    .modal-next { right: 10px; }
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1.5rem;
    margin: 2rem 0;
}

.stat-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 2rem;
    text-align: center;
}

.stat-card i {
    color: var(--text-secondary);
    margin-bottom: 1rem;
}

.stat-card h3 {
    font-size: 2rem;
    margin: 0.5rem 0;
    color: var(--accent-color);
}

.reviews-section {
    margin: 3rem 0;
}

.reviews-list {
    margin-top: 1.5rem;
}

.review-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 1rem;
}

.review-card .rating {
    margin-bottom: 0.8rem;
}

/* New Styled Items Grid */
.items-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 2rem;
    margin: 2rem 0 3rem;
}

.item-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.item-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.item-image {
    height: 240px;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.item-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 8px;
    transition: transform 0.3s ease;
}

.item-card:hover .item-image img {
    transform: scale(1.05);
}

.image-placeholder {
    color: var(--text-secondary);
    opacity: 0.3;
}

.out-of-stock-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #ef4444;
    color: #fff;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(239, 68, 68, 0.4);
}

.low-stock-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #f59e0b;
    color: #fff;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(245, 158, 11, 0.4);
}

.item-quick-actions {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    flex-direction: column;
    gap: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.item-card:hover .item-quick-actions {
    opacity: 1;
}

.quick-action-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent-color);
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
    border: none;
}

.quick-action-btn:hover {
    background: #ef4444;
    color: #fff;
    transform: scale(1.15);
}

/* Three Dots Menu */
.item-menu-trigger {
    position: absolute;
    top: 12px;
    right: 12px;
}

.menu-dots-btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    border: none;
    color: white;
    font-size: 1.1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.menu-dots-btn:hover {
    background: rgba(0, 0, 0, 0.85);
    transform: scale(1.1);
}

.item-dropdown-menu {
    position: absolute;
    top: 45px;
    right: 0;
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
    min-width: 200px;
    max-height: 400px;
    max-width: 90vw;
    z-index: 100;
    display: none;
    overflow-y: auto;
    overflow-x: hidden;
}

.item-dropdown-menu.active {
    display: flex;
    flex-direction: column;
    animation: slideDown 0.2s ease;
}

/* Scrollbar styling */
.item-dropdown-menu::-webkit-scrollbar {
    width: 6px;
}

.item-dropdown-menu::-webkit-scrollbar-track {
    background: transparent;
}

.item-dropdown-menu::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.item-dropdown-menu::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    color: var(--text-primary);
    text-decoration: none;
    transition: all 0.2s;
    cursor: pointer;
    border: none;
    background: none;
    width: 100%;
    text-align: left;
    font-size: 0.95rem;
}

.menu-item:hover {
    background: var(--bg-secondary);
}

.menu-item i {
    width: 18px;
    text-align: center;
}

.submenu-trigger {
    position: relative;
}

.submenu-arrow {
    margin-left: auto;
    font-size: 0.8rem;
}

.share-submenu {
    display: none;
    background: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    max-height: 300px;
    overflow-y: auto;
}

.submenu-trigger:hover + .share-submenu,
.share-submenu:hover {
    display: flex;
    flex-direction: column;
}

/* Scrollbar for submenus */
.share-submenu::-webkit-scrollbar {
    width: 6px;
}

.share-submenu::-webkit-scrollbar-track {
    background: transparent;
}

.share-submenu::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border-radius: 3px;
}

.share-submenu::-webkit-scrollbar-thumb:hover {
    background: var(--text-secondary);
}

.share-submenu .menu-item {
    padding-left: 32px;
    font-size: 0.9rem;
}

.item-details {
    padding: 1rem;
    text-align: center;
}

.item-category {
    display: inline-block;
    background: var(--accent-color);
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    letter-spacing: 0.5px;
}

.item-title {
    font-size: 1.1rem;
    margin: 0.5rem 0;
    color: var(--text-primary);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.item-seller {
    margin: 1rem 0;
}

.seller-info {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    transition: color 0.2s;
}

.seller-info:hover {
    color: var(--accent-color);
}

.seller-avatar {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid var(--border-color);
}

.seller-avatar-placeholder {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-secondary);
    border: 2px solid var(--border-color);
    font-size: 0.75rem;
}

.seller-name {
    font-weight: 500;
}

.verified-icon {
    color: #10b981;
    margin-left: 4px;
    font-size: 0.85rem;
}

.item-rating {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0.8rem 0;
}

.stars {
    display: flex;
    gap: 2px;
}

.stars .fa-star {
    color: #d1d5db;
    font-size: 0.9rem;
}

.stars .fa-star.filled {
    color: #fbbf24;
}

.rating-count {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

.item-price {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--accent-color);
    margin: 0.5rem 0;
}

.login-prompt {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0.5rem 0;
}

/* Social Media Share Section */
.item-share-section {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 0.75rem 0;
    padding: 0.75rem;
    background: var(--bg-secondary);
    border-radius: 8px;
}

.share-label {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    white-space: nowrap;
}

.share-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.share-btn {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    transition: all 0.2s ease;
    font-size: 0.9rem;
}

.share-btn:hover {
    transform: scale(1.15);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.share-facebook {
    background: #1877f2;
}

.share-facebook:hover {
    background: #145dbf;
}

.share-twitter {
    background: #1da1f2;
}

.share-twitter:hover {
    background: #0c85d0;
}

.share-whatsapp {
    background: #25d366;
}

.share-whatsapp:hover {
    background: #1faa52;
}

.share-linkedin {
    background: #0077b5;
}

.share-linkedin:hover {
    background: #005885;
}

.share-copy {
    background: #6b7280;
}

.share-copy:hover {
    background: #4b5563;
}

.share-copy.copied {
    background: #10b981;
}

.item-view-btn {
    display: block;
    width: 100%;
    padding: 12px;
    background: var(--accent-color);
    color: #fff;
    text-align: center;
    border-radius: 10px;
    font-weight: 600;
    transition: all 0.2s ease;
    margin-top: 1rem;
}

.item-view-btn:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.login-prompt {
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin: 0.8rem 0;
    text-align: center;
}

body.dark-mode .quick-action-btn {
    background: rgba(45, 55, 72, 0.95);
    color: #e2e8f0;
}

body.dark-mode .quick-action-btn:hover {
    background: #ef4444;
    color: #fff;
}

body.dark-mode .menu-dots-btn {
    background: rgba(255, 255, 255, 0.2);
}

body.dark-mode .menu-dots-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

body.dark-mode .item-dropdown-menu {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

body.dark-mode .menu-item:hover {
    background: var(--bg-primary);
}

/* Collections Grid Styles */
.collections-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 2rem;
    margin: 2rem 0 3rem;
}

.collection-card {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.collection-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 8px 24px rgba(0,0,0,0.15);
}

.collection-link {
    text-decoration: none;
    color: inherit;
    display: block;
}

.collection-image {
    height: 240px;
    background: var(--bg-secondary);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

.collection-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.collection-card:hover .collection-image img {
    transform: scale(1.05);
}

.collection-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: rgba(0, 123, 255, 0.9);
    color: #fff;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.85rem;
    font-weight: 600;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.4);
}

.collection-details {
    padding: 1.25rem;
}

.collection-category-badge {
    display: inline-block;
    background: var(--accent-color);
    color: #fff;
    padding: 4px 10px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
    letter-spacing: 0.5px;
}

.collection-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0.5rem 0;
    color: var(--text-primary);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.collection-description {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin: 0.5rem 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.collection-price-range {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--accent-color);
    margin: 0.75rem 0;
}

.collection-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.85rem;
    color: var(--text-secondary);
    margin: 0.5rem 0;
}

.collection-meta span {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}

.collection-seller {
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-top: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

/* Collection Highlighting Styles */
.collection-highlight-home {
    border: 2px solid #f97316;
    box-shadow: 0 0 10px rgba(249, 115, 22, 0.3);
}

.collection-badge-top {
    position: absolute;
    top: 8px;
    left: 8px;
    background: linear-gradient(135deg, #f97316 0%, #fb923c 100%);
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.collection-count-home {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: #f97316;
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 2;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
}

.collection-price-display {
    font-size: 0.85rem;
    color: #f97316;
    font-weight: 600;
    margin-top: 0.5rem;
}

body.dark-mode .collection-card {
    background: var(--bg-secondary);
    border-color: var(--border-color);
}

body.dark-mode .collection-badge {
    background: rgba(0, 123, 255, 0.8);
}

@media (max-width: 768px) {
    .items-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .item-card {
        display: flex;
        flex-direction: column;
    }
    
    .item-image {
        height: 180px;
    }
    
    .item-image img {
        object-fit: contain;
    }
    
    .item-details {
        padding: 0.75rem;
        text-align: center;
    }
    
    .item-price {
        font-size: 1.1rem;
        margin: 0.5rem 0;
    }
    
    .menu-dots-btn {
        width: 32px;
        height: 32px;
        font-size: 1rem;
    }
    
    .item-dropdown-menu {
        min-width: 180px;
    }
    
    .menu-item {
        padding: 10px 14px;
        font-size: 0.9rem;
    }
    
    .login-prompt {
        font-size: 0.85rem;
        margin: 0.5rem 0;
    }
    
    .collections-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 1.5rem;
    }
    
    .collection-card {
        border-radius: 12px;
    }
    
    .collection-image {
        height: 200px;
    }
    
    .collection-details {
        padding: 1rem;
    }
    
    .collection-title {
        font-size: 1rem;
    }
    
    .collection-price-range {
        font-size: 1.1rem;
    }
}

@media (max-width: 480px) {
    .collections-grid {
        grid-template-columns: 1fr;
    }
}
/* IMAGE MODAL/LIGHTBOX */
.image-modal {
    display: none;
    position: fixed;
    z-index: 2000;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.95);
    opacity: 0;
    transition: opacity 0.3s ease;
    justify-content: center;
    align-items: center;
}

.image-modal.active {
    display: flex;
    opacity: 1;
}

.modal-image-container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-image-wrapper {
    max-width: 100%;
    max-height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.modal-image {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.modal-image-counter {
    position: absolute;
    left: 50%;
    bottom: 14px;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.58);
    color: #fff;
    border-radius: 999px;
    padding: 0.24rem 0.6rem;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.gallery-more-badge {
    position: absolute;
    right: 8px;
    bottom: 8px;
    background: rgba(17, 24, 39, 0.8);
    color: #fff;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    font-size: 0.72rem;
    font-weight: 600;
    z-index: 2;
    pointer-events: none;
}

.modal-close-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 32px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 2001;
}

.modal-close-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
}

.modal-prev-btn, 
.modal-next-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: white;
    font-size: 28px;
    width: 48px;
    height: 48px;
    border-radius: 4px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    z-index: 2001;
}

.modal-prev-btn:hover,
.modal-next-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.modal-prev-btn {
    left: 20px;
}

.modal-next-btn {
    right: 20px;
}

.modal-prev-btn:disabled,
.modal-next-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

@media (max-width: 768px) {
    .modal-close-btn {
        top: 10px;
        right: 10px;
        width: 40px;
        height: 40px;
        font-size: 28px;
    }
    
    .modal-prev-btn,
    .modal-next-btn {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
    
    .modal-prev-btn {
        left: 10px;
    }
    
    .modal-next-btn {
        right: 10px;
    }

    .modal-image-counter {
        bottom: 10px;
        font-size: 0.74rem;
    }
}

/* NOTIFICATION TOAST */
.notification-toast {
    position: fixed;
    bottom: 20px;
    right: 20px;
    background: #10b981;
    color: white;
    padding: 1rem 1.5rem;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    gap: 1rem;
    z-index: 3000;
    opacity: 0;
    transform: translateX(400px);
    transition: all 0.3s ease;
    max-width: 300px;
}

.notification-toast.show {
    opacity: 1;
    transform: translateX(0);
}

.notification-toast.notification-error {
    background: #ef4444;
}

.notification-toast.notification-warning {
    background: #f59e0b;
}

.notification-toast.notification-info {
    background: #3b82f6;
}

.notification-toast.notification-success {
    background: #10b981;
}

.toast-close {
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    font-size: 1.2rem;
    opacity: 0.8;
    transition: opacity 0.2s;
    margin-left: auto;
    padding: 0;
    display: flex;
    align-items: center;
}

.toast-close:hover {
    opacity: 1;
}

@media (max-width: 768px) {
    .notification-toast {
        bottom: 10px;
        right: 10px;
        left: 10px;
        max-width: none;
        transform: translateY(200px);
    }

    .notification-toast.show {
        transform: translateY(0);
    }
}