/* ===== RESET & BASE STYLES ===== */
:root {
    /* Shop Color Themes */
    --theme-blue: #4361ee;
    --theme-green: #2ecc71;
    --theme-orange: #FF6B35;
    --theme-purple: #9d4edd;
    --theme-red: #e74c3c;
    --theme-teal: #00A896;
    --theme-gold: #f39c12;
    --theme-gray: #95a5a6;
    
    /* Main Colors */
    --primary: #FF6B35;
    --primary-dark: #E85A24;
    --secondary: #00A896;
    --secondary-dark: #00887A;
    --dark: #1A1A2E;
    --dark-light: #16213E;
    --light: #F8F9FA;
    --gray: #6C757D;
    --success: #2ECC71;
    --warning: #f39c12;
    --danger: #E74C3C;
    --shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    --radius: 12px;
    --transition: all 0.3s ease;
    --feed-blue: #4361ee;
    --feed-purple: #7209b7;
    --feed-green: #38b000;
    --feed-orange: #f8961e;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background-color: #f5f7fa;
    color: #333;
    line-height: 1.6;
    overflow-x: hidden;
    width: 100%;
    min-height: 100vh;
}

a {
    text-decoration: none;
    color: inherit;
}

button {
    cursor: pointer;
    font-family: inherit;
    border: none;
    transition: var(--transition);
    background: none;
}

button:focus {
    outline: none;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* ===== HEADER STYLES ===== */
header {
    background: linear-gradient(135deg, var(--dark) 0%, var(--dark-light) 100%);
    color: white;
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: var(--shadow);
    padding: 12px 0;
}

.header-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.logo-link {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    flex: 0 1 auto;
    min-width: 0;
}

.logo-img {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    border: 3px solid var(--primary);
    padding: 3px;
    object-fit: cover;
    flex-shrink: 0;
}

.brand-text {
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.brand-name {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(90deg, var(--primary), #FF9A3C);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    letter-spacing: -0.5px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.brand-slogan {
    font-size: 0.75rem;
    color: #A0AEC0;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.header-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
    justify-content: flex-end;
}

/* Header buttons */
.cart-btn,
.notification-btn,
.menu-btn {
    position: relative;
    background: none;
    color: white;
    font-size: 1.2rem;
    padding: 8px;
    border-radius: 50%;
    width: 42px;
    height: 42px;
    min-width: 42px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.1);
}

.cart-btn:hover,
.notification-btn:hover,
.menu-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.cart-count {
    position: absolute;
    top: 0;
    right: 0;
    background-color: var(--primary);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.notification-count {
    position: absolute;
    top: 0;
    right: 0;
    background-color: var(--danger);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.profile-btn {
    background: none;
    border: none;
    display: flex;
    align-items: center;
    gap: 8px;
    color: white;
    padding: 6px 12px;
    border-radius: 50px;
    transition: var(--transition);
    background: rgba(255, 255, 255, 0.1);
}

.profile-btn:hover {
    background-color: rgba(255, 255, 255, 0.2);
}

.profile-pic {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--secondary), var(--primary));
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    color: white;
}

/* ===== DROPDOWN MENUS ===== */
.dropdown {
    position: relative;
}

.dropdown-content {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    background: white;
    min-width: 220px;
    box-shadow: var(--shadow);
    border-radius: var(--radius);
    z-index: 1001;
    margin-top: 10px;
}

.dropdown-content.left {
    right: auto;
    left: 0;
}

.dropdown-content.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.dropdown-item {
    padding: 12px 20px;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 10px;
    border-bottom: 1px solid #e2e8f0;
    transition: var(--transition);
}

.dropdown-item:last-child {
    border-bottom: none;
}

.dropdown-item:hover {
    background: #f8f9fa;
}

.dropdown-item i {
    color: var(--primary);
    width: 20px;
}

/* ===== AD BANNER STYLES ===== */
.ad-banner {
    margin: 20px auto;
    border-radius: var(--radius);
    overflow: hidden;
    height: 180px;
    position: relative;
    box-shadow: var(--shadow);
    max-width: 1200px;
    width: calc(100% - 40px);
}

.ad-slides {
    width: 100%;
    height: 100%;
    position: relative;
}

.ad-slide {
    position: absolute;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 1s ease;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.ad-slide.active {
    opacity: 1;
}

.ad-content {
    background: rgba(26, 26, 46, 0.85);
    color: white;
    padding: 20px 30px;
    border-radius: 12px;
    text-align: center;
    max-width: 80%;
    backdrop-filter: blur(5px);
}

.ad-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 8px;
    color: white;
}

.ad-subtitle {
    font-size: 1rem;
    margin-bottom: 12px;
    opacity: 0.9;
}

.ad-price {
    background: var(--primary);
    color: white;
    padding: 6px 16px;
    border-radius: 50px;
    font-weight: 700;
    font-size: 1.2rem;
    display: inline-block;
    margin-top: 8px;
}

.report-ad {
    position: absolute;
    top: 10px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    font-size: 0.75rem;
    padding: 5px 12px;
    border-radius: 50px;
    z-index: 10;
    cursor: pointer;
    transition: var(--transition);
}

.report-ad:hover {
    background: rgba(231, 76, 60, 0.9);
}

/* ===== SEARCH SECTION ===== */
.search-section {
    max-width: 1200px;
    margin: 0 auto 25px;
    padding: 0 20px;
    position: relative;
}

.search-container {
    background: white;
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow);
    margin-bottom: 20px;
    position: relative;
}

.search-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.section-title {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.section-title i {
    color: var(--primary);
}

.search-bar {
    display: flex;
    background: #f8f9fa;
    border-radius: 50px;
    padding: 5px;
    margin-bottom: 20px;
    border: 2px solid #e2e8f0;
    position: relative;
}

.search-bar:focus-within {
    border-color: var(--primary);
}

.search-input {
    flex: 1;
    padding: 15px 20px;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    outline: none;
    background: transparent;
}

.search-btn {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    border-radius: 50px;
    padding: 0 30px;
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 44px;
}

.search-btn:hover {
    background: linear-gradient(135deg, var(--primary-dark), #D14913);
    transform: translateY(-2px);
}

/* Quick search suggestions */
.quick-search-suggestions {
    display: none;
    position: absolute;
    top: 100%;
    left: 25px;
    right: 25px;
    background: white;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    padding: 15px;
    margin-top: 5px;
    z-index: 99;
    border: 1px solid #e2e8f0;
    animation: fadeIn 0.3s ease;
}

.quick-search-suggestions.active {
    display: block;
}

.quick-search-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
}

.quick-search-btn {
    background: white;
    padding: 15px;
    border-radius: var(--radius);
    font-weight: 600;
    color: var(--dark);
    box-shadow: var(--shadow);
    border: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 12px;
    transition: var(--transition);
    text-align: left;
    min-height: 44px;
}

.quick-search-btn:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.quick-search-btn i {
    color: var(--primary);
    font-size: 1.2rem;
    width: 24px;
}

.quick-search-btn span {
    flex: 1;
}

/* ===== CATEGORIES - UPDATED WITH ALL BUTTON IN OWN ROW ===== */
.categories-section {
    padding: 0 20px;
    margin-bottom: 30px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    position: relative;
}

.categories-header {
    margin-bottom: 15px;
}

.categories-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    position: relative;
    z-index: 10;
}

/* All category - spans full width in its own row */
.category-item.all-category {
    grid-column: 1 / -1;
    margin-bottom: 5px;
}

.category-item {
    position: relative;
    width: 100%;
}

.category-btn {
    background: white;
    padding: 14px 10px;
    border-radius: 12px;
    width: 100%;
    font-weight: 600;
    color: var(--dark);
    box-shadow: var(--shadow);
    border: 1px solid #e2e8f0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: var(--transition);
    position: relative;
    z-index: 100;
    text-align: center;
    font-size: 0.9rem;
}

.category-btn:hover, .category-btn.active {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    transform: translateY(-3px);
}

.category-btn i {
    font-size: 1rem;
}

/* Responsive categories */
@media (max-width: 768px) {
    .categories-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 8px;
    }
    
    .category-btn {
        padding: 12px 8px;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .categories-container {
        grid-template-columns: repeat(3, 1fr);
        gap: 6px;
    }
    
    .category-btn {
        padding: 10px 5px;
        font-size: 0.75rem;
    }
    
    .category-btn i {
        font-size: 0.85rem;
    }
}

/* ===== MAIN MARKETPLACE LAYOUT - FULL WIDTH ===== */
.marketplace-main {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: 1fr;
    gap: 30px;
    position: relative;
    z-index: 1;
}

/* ===== MARKETPLACE CONTENT ===== */
.marketplace-content {
    display: flex;
    flex-direction: column;
    gap: 30px;
    width: 100%;
}

.content-section {
    background: white;
    border-radius: var(--radius);
    padding: 25px;
    box-shadow: var(--shadow);
    width: 100%;
}

/* ===== VIEW TOGGLE ===== */
.view-toggle {
    display: flex;
    gap: 10px;
    margin-bottom: 25px;
}

.toggle-btn {
    background: white;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    color: var(--dark);
    box-shadow: var(--shadow);
    border: 2px solid #e2e8f0;
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.95rem;
    min-height: 44px;
    flex: 1;
    justify-content: center;
}

.toggle-btn.active {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

/* ===== ITEMS GRID ===== */
.items-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    width: 100%;
}

.item-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    border: 3px solid transparent;
}

.item-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

/* Color themes based on category */
.item-card.food { border-color: var(--theme-orange); }
.item-card.fashion { border-color: var(--theme-purple); }
.item-card.electronics { border-color: var(--theme-blue); }
.item-card.services { border-color: var(--theme-green); }
.item-card.transport { border-color: var(--theme-teal); }
.item-card.home { border-color: var(--theme-red); }
.item-card.general { border-color: var(--theme-gray); }

.item-header {
    height: 160px;
    position: relative;
    overflow: hidden;
}

.item-slideshow {
    width: 100%;
    height: 100%;
    position: relative;
}

.item-slide {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
    background-size: cover;
    background-position: center;
}

.item-slide.active {
    opacity: 1;
}

.item-status {
    position: absolute;
    top: 15px;
    left: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    z-index: 10;
}

.item-status.open {
    background: rgba(46, 204, 113, 0.9);
}

.item-status.closed {
    background: rgba(231, 76, 60, 0.9);
}

.item-verified {
    position: absolute;
    top: 15px;
    right: 15px;
    background: var(--primary);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    z-index: 10;
    box-shadow: 0 4px 10px rgba(255, 107, 53, 0.3);
}

.share-btn {
    position: absolute;
    bottom: 15px;
    right: 15px;
    background: rgba(0, 0, 0, 0.7);
    color: white;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    z-index: 10;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    transition: var(--transition);
}

.share-btn:hover {
    background: var(--primary);
    transform: scale(1.1);
}

.item-body {
    padding: 20px;
}

.item-title {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 5px;
    display: flex;
    align-items: center;
    gap: 8px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.item-category {
    color: var(--gray);
    font-size: 0.85rem;
    margin-bottom: 12px;
}

.item-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

.item-rating i {
    color: #FFD700;
    font-size: 0.9rem;
}

.item-rating span {
    font-size: 0.8rem;
    color: var(--gray);
}

.item-description {
    color: var(--dark);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 15px;
}

.item-pricing {
    background: #f8f9fa;
    padding: 12px 15px;
    border-radius: var(--radius);
    font-size: 0.85rem;
    color: var(--gray);
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    flex-wrap: wrap;
    gap: 8px;
}

.item-price {
    font-weight: 700;
    color: var(--primary);
    font-size: 1.1rem;
}

.action-btn {
    width: 100%;
    background: var(--primary);
    color: white;
    padding: 12px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
}

.action-btn:hover {
    background: var(--primary-dark);
}

.action-btn.book {
    background: var(--secondary);
}

.action-btn.book:hover {
    background: var(--secondary-dark);
}

/* ===== MAP SECTION - FULL WIDTH ===== */
.map-section {
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    position: relative;
    height: 500px;
    display: none;
    background: #f0f2f5;
    width: 100%;
    margin-left: 0;
    margin-right: 0;
}

#mapFrame {
    width: 100%;
    height: 100%;
    border: 0;
    display: block;
}

.radius-info {
    position: absolute;
    bottom: 15px;
    left: 15px;
    background: rgba(26, 26, 46, 0.9);
    color: white;
    padding: 10px 15px;
    border-radius: var(--radius);
    font-size: 0.8rem;
    backdrop-filter: blur(10px);
    z-index: 1000;
    border: 2px solid var(--primary);
}

/* ===== FLOATING BUTTONS - KASI BUZZ & CHATBOT ===== */
/* Floating buttons - visible on ALL screens */
.chatbot-btn,
.kasi-buzz-toggle {
    position: fixed;
    z-index: 2000;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    cursor: pointer;
    border: none;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
    transition: var(--transition);
}

.chatbot-btn:hover,
.kasi-buzz-toggle:hover {
    transform: scale(1.1);
}

.chatbot-btn:active,
.kasi-buzz-toggle:active {
    transform: scale(0.95);
}

/* Chatbot button - bottom right */
.chatbot-btn {
    bottom: 30px;
    right: 30px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    box-shadow: 0 10px 25px rgba(255, 107, 53, 0.3);
}

/* Kasi Buzz button - positioned above chatbot with proper spacing */
.kasi-buzz-toggle {
    bottom: 100px;
    right: 30px;
    background: linear-gradient(135deg, var(--feed-blue), var(--feed-purple));
    box-shadow: 0 10px 25px rgba(67, 97, 238, 0.4);
    display: flex;
}

.kasi-buzz-toggle.active {
    transform: scale(0.95);
    background: linear-gradient(135deg, var(--feed-purple), var(--feed-blue));
}

/* Badge for new feed items */
.kasi-buzz-toggle .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: var(--danger);
    color: white;
    font-size: 0.7rem;
    font-weight: bold;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
}

/* ===== KASI BUZZ MODAL - FLOATING WINDOW FOR ALL SCREENS ===== */
.kasi-buzz-modal {
    position: fixed;
    bottom: 170px;
    right: 30px;
    width: 380px;
    height: 500px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    display: none;
    overflow: hidden;
    animation: slideInUp 0.3s ease;
    border: 1px solid rgba(67, 97, 238, 0.2);
}

.kasi-buzz-modal.active {
    display: block;
}

.kasi-buzz-modal-header {
    background: linear-gradient(135deg, var(--feed-blue), var(--feed-purple));
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: move;
    user-select: none;
}

.kasi-buzz-modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.kasi-buzz-modal-title i {
    font-size: 1.2rem;
}

.kasi-buzz-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    min-width: 32px;
}

.kasi-buzz-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.kasi-buzz-modal-content {
    width: 100%;
    height: calc(100% - 64px);
    background: white;
    overflow: hidden;
}

/* Minimize state */
.kasi-buzz-modal.minimized {
    height: 64px;
    overflow: hidden;
}

.kasi-buzz-minimize-icon {
    display: inline-block;
    transition: transform 0.3s ease;
}

.kasi-buzz-modal.minimized .kasi-buzz-minimize-icon {
    transform: rotate(180deg);
}

/* Hide the original sidebar on ALL screens */
.kasi-buzz-sidebar,
.marketplace-main .feed-container,
#marketplaceView .feed-container {
    display: none !important;
}

/* ===== CHATBOT MODAL ===== */
.chatbot-modal-overlay {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 380px;
    height: 500px;
    background: white;
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    z-index: 2000;
    display: none;
    overflow: hidden;
    animation: slideInUp 0.3s ease;
    border: 1px solid rgba(255, 107, 53, 0.2);
}

.chatbot-modal-overlay.active {
    display: block;
}

.chatbot-modal-header {
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: move;
    user-select: none;
}

.chatbot-modal-title {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 600;
}

.chatbot-modal-title i {
    font-size: 1.2rem;
}

.chatbot-close-btn {
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: var(--transition);
    min-width: 32px;
}

.chatbot-close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
    transform: rotate(90deg);
}

.chatbot-iframe-container {
    width: 100%;
    height: calc(100% - 64px);
    background: white;
}

.chatbot-iframe {
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* Chatbot minimize state */
.chatbot-modal-overlay.minimized {
    height: 64px;
    overflow: hidden;
}

.chatbot-minimize-icon {
    display: inline-block;
    transition: transform 0.3s ease;
}

.chatbot-modal-overlay.minimized .chatbot-minimize-icon {
    transform: rotate(180deg);
}

/* ===== FEED CONTAINER (used in modal) ===== */
.feed-container {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.95) 0%,
        rgba(255, 255, 255, 0.98) 100%);
    border-radius: var(--radius);
    box-shadow: 
        0 10px 30px rgba(0, 0, 0, 0.08),
        inset 0 0 0 1px rgba(255, 255, 255, 0.5);
    overflow: hidden;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, 0.3);
    backdrop-filter: blur(10px);
}

.feed-header {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.9) 0%,
        rgba(255, 255, 255, 0.95) 100%);
    padding: 20px 25px;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 15px;
    border-bottom: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.feed-header-icon {
    width: 50px;
    height: 50px;
    background: linear-gradient(135deg, var(--feed-blue), var(--feed-purple));
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.3rem;
    box-shadow: 0 5px 15px rgba(67, 97, 238, 0.3);
}

.feed-header-text {
    flex: 1;
}

.feed-title {
    font-size: 1.4rem;
    font-weight: 800;
    background: linear-gradient(135deg, var(--feed-blue), var(--feed-purple));
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    margin-bottom: 3px;
}

.feed-subtitle {
    font-size: 0.85rem;
    color: var(--gray);
    font-weight: 500;
}

.feed-refresh-btn {
    background: rgba(67, 97, 238, 0.1);
    color: var(--feed-blue);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    cursor: pointer;
    transition: var(--transition);
}

.feed-refresh-btn:hover {
    background: rgba(67, 97, 238, 0.2);
    transform: rotate(45deg);
}

.feed-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px 20px;
    background: rgba(248, 249, 250, 0.5);
    position: relative;
}

.feed-messages::-webkit-scrollbar {
    width: 6px;
}

.feed-messages::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.05);
    border-radius: 10px;
}

.feed-messages::-webkit-scrollbar-thumb {
    background: var(--feed-blue);
    border-radius: 10px;
}

.feed-message {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 15px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.05);
    transition: var(--transition);
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.feed-message::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 4px;
    height: 100%;
    background: linear-gradient(to bottom, var(--feed-blue), var(--feed-purple));
}

.feed-message:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.message-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.message-avatar {
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--feed-green), var(--feed-blue));
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: bold;
    font-size: 1rem;
    flex-shrink: 0;
    border: 3px solid white;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
}

.message-avatar.food {
    background: linear-gradient(135deg, #f8961e, #f3722c);
}

.message-avatar.services {
    background: linear-gradient(135deg, #43aa8b, #4d908e);
}

.message-avatar.tech {
    background: linear-gradient(135deg, #577590, #4a4e69);
}

.message-avatar.fashion {
    background: linear-gradient(135deg, #9d4edd, #c77dff);
}

.message-avatar.transport {
    background: linear-gradient(135deg, #1982c4, #6a4c93);
}

.message-info {
    flex: 1;
    min-width: 0;
}

.message-trader {
    font-weight: 700;
    color: var(--dark);
    font-size: 1rem;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.message-category {
    display: inline-block;
    background: rgba(67, 97, 238, 0.1);
    color: var(--feed-blue);
    padding: 3px 10px;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-bottom: 5px;
}

.message-time {
    font-size: 0.75rem;
    color: var(--gray);
    display: flex;
    align-items: center;
    gap: 5px;
}

.message-content {
    color: var(--dark);
    font-size: 0.95rem;
    line-height: 1.5;
    margin-bottom: 15px;
    word-wrap: break-word;
    overflow-wrap: break-word;
    white-space: normal;
}

.message-offer {
    display: inline-block;
    background: linear-gradient(135deg, var(--feed-blue), var(--feed-purple));
    color: white;
    padding: 8px 18px;
    border-radius: 12px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-top: 5px;
    box-shadow: 0 4px 10px rgba(67, 97, 238, 0.2);
}

.message-actions {
    display: flex;
    gap: 15px;
    margin-top: 15px;
    padding-top: 15px;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    flex-wrap: wrap;
}

.message-action {
    display: flex;
    align-items: center;
    gap: 6px;
    color: var(--gray);
    font-size: 0.85rem;
    cursor: pointer;
    transition: var(--transition);
    min-height: 44px;
    min-width: 44px;
}

.message-action:hover {
    color: var(--feed-blue);
}

.feed-footer {
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.9) 0%,
        rgba(255, 255, 255, 0.95) 100%);
    padding: 15px 25px;
    text-align: center;
    color: var(--gray);
    font-size: 0.85rem;
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

/* ===== PRODUCTS GRID ===== */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
    width: 100%;
}

.product-card {
    background: white;
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
}

.product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.product-image {
    height: 150px;
    width: 100%;
    background-size: cover;
    background-position: center;
    position: relative;
}

.product-info {
    padding: 15px;
}

.product-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 8px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.product-description {
    color: var(--gray);
    font-size: 0.8rem;
    margin-bottom: 12px;
    line-height: 1.4;
}

.product-weight {
    color: var(--gray);
    font-size: 0.75rem;
    margin-bottom: 10px;
}

.product-price {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--primary);
    margin-bottom: 15px;
}

.add-to-cart-btn {
    width: 100%;
    background: var(--primary);
    color: white;
    padding: 10px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
}

.add-to-cart-btn:hover {
    background: var(--primary-dark);
}

/* ===== CART SIDEBAR ===== */
.cart-sidebar {
    position: fixed;
    top: 0;
    right: -400px;
    width: 400px;
    height: 100vh;
    background: white;
    box-shadow: -5px 0 30px rgba(0, 0, 0, 0.15);
    z-index: 2000;
    transition: right 0.3s ease;
    display: flex;
    flex-direction: column;
}

.cart-sidebar.active {
    right: 0;
}

.cart-header {
    padding: 25px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.cart-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 10px;
}

.close-cart {
    background: none;
    color: var(--gray);
    font-size: 1.8rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    min-width: 40px;
}

.close-cart:hover {
    background: #f8f9fa;
    color: var(--dark);
}

.cart-items {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

.cart-group {
    margin-bottom: 30px;
}

.cart-shop-header {
    background: #f8f9fa;
    padding: 15px;
    border-radius: var(--radius);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.cart-shop-name {
    font-weight: 700;
    color: var(--dark);
    display: flex;
    align-items: center;
    gap: 10px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.cart-item {
    display: flex;
    gap: 15px;
    padding: 15px;
    border-bottom: 1px solid #e2e8f0;
    flex-wrap: wrap;
}

.cart-item-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.cart-item-details {
    flex: 1;
    min-width: 0;
}

.cart-item-name {
    font-weight: 600;
    color: var(--dark);
    margin-bottom: 5px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.cart-item-weight {
    color: var(--gray);
    font-size: 0.85rem;
    margin-bottom: 10px;
}

.cart-item-controls {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.cart-item-price {
    font-weight: 700;
    color: var(--primary);
}

.cart-item-quantity {
    display: flex;
    align-items: center;
    gap: 10px;
}

.quantity-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--dark);
    font-size: 1.2rem;
    min-width: 30px;
}

.quantity-value {
    font-weight: 600;
    min-width: 30px;
    text-align: center;
}

.cart-summary {
    padding: 25px;
    border-top: 1px solid #e2e8f0;
    background: white;
}

.cart-totals {
    margin-bottom: 20px;
}

.total-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 12px;
    font-size: 0.95rem;
    flex-wrap: wrap;
    gap: 8px;
}

.total-row.subtotal {
    font-weight: 600;
    color: var(--dark);
}

.total-row.delivery {
    color: var(--success);
}

.total-row.total {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--dark);
    padding-top: 15px;
    border-top: 2px solid #e2e8f0;
}

.delivery-options {
    background: #f8f9fa;
    padding: 15px;
    border-radius: var(--radius);
    margin-bottom: 20px;
}

.delivery-options-title {
    font-weight: 600;
    margin-bottom: 10px;
    color: var(--dark);
}

.vehicle-icons {
    display: flex;
    gap: 15px;
    margin-top: 10px;
    flex-wrap: wrap;
    justify-content: center;
}

.vehicle-icon {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    color: var(--gray);
    font-size: 0.8rem;
}

.vehicle-icon i {
    font-size: 1.5rem;
    color: var(--primary);
}

.vehicle-icon.active i {
    color: var(--success);
}

.vehicle-icon.disabled {
    opacity: 0.3;
}

.checkout-btn {
    width: 100%;
    background: var(--primary);
    color: white;
    padding: 18px;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 44px;
}

.checkout-btn:hover {
    background: var(--primary-dark);
}

.checkout-btn.disabled {
    background: var(--gray);
    cursor: not-allowed;
}

/* ===== BOOKING MODAL ===== */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    background: rgba(0, 0, 0, 0.7);
    z-index: 3000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(5px);
}

.modal-overlay.active {
    display: flex;
}

.modal {
    background: white;
    border-radius: var(--radius);
    max-width: 500px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-header {
    padding: 25px;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.modal-title {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--dark);
}

.modal-close {
    background: none;
    color: var(--gray);
    font-size: 1.8rem;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    min-width: 40px;
}

.modal-body {
    padding: 25px;
}

.booking-details {
    margin-bottom: 25px;
}

.booking-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.booking-image {
    width: 80px;
    height: 80px;
    border-radius: 8px;
    background-size: cover;
    background-position: center;
    flex-shrink: 0;
}

.booking-info {
    flex: 1;
    min-width: 0;
}

.booking-name {
    font-weight: 700;
    color: var(--dark);
    margin-bottom: 5px;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.booking-provider {
    color: var(--gray);
    font-size: 0.9rem;
    margin-bottom: 10px;
}

.booking-fee {
    font-weight: 700;
    color: var(--primary);
}

.booking-form {
    margin-top: 25px;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--dark);
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    font-size: 0.95rem;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary);
}

.modal-actions {
    display: flex;
    gap: 15px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.modal-btn {
    flex: 1;
    padding: 15px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 44px;
}

.modal-btn.primary {
    background: var(--primary);
    color: white;
}

.modal-btn.secondary {
    background: #f8f9fa;
    color: var(--dark);
}

/* ===== JOIN BANNER ===== */
.join-banner {
    max-width: 1200px;
    margin: 40px auto;
    padding: 0 20px;
    position: relative;
    z-index: 1;
}

.join-container {
    background: linear-gradient(135deg, var(--secondary), var(--secondary-dark));
    border-radius: var(--radius);
    padding: 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    color: white;
    box-shadow: var(--shadow);
    position: relative;
    overflow: hidden;
}

.join-container::before {
    content: "";
    position: absolute;
    width: 200px;
    height: 200px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    top: -80px;
    right: -80px;
}

.join-container::after {
    content: "";
    position: absolute;
    width: 150px;
    height: 150px;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    bottom: -60px;
    left: -60px;
}

.join-title {
    font-size: 2rem;
    font-weight: 800;
    margin-bottom: 15px;
    position: relative;
    z-index: 2;
}

.join-subtitle {
    font-size: 1.1rem;
    max-width: 700px;
    margin-bottom: 30px;
    opacity: 0.9;
    position: relative;
    z-index: 2;
}

.join-buttons {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
    justify-content: center;
    position: relative;
    z-index: 2;
    width: 100%;
}

.join-btn {
    padding: 16px 32px;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1.1rem;
    display: flex;
    align-items: center;
    gap: 10px;
    transition: var(--transition);
    min-height: 44px;
}

.btn-trader {
    background: white;
    color: var(--secondary-dark);
}

.btn-trader:hover {
    background: #f0f0f0;
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.btn-driver {
    background: var(--primary);
    color: white;
}

.btn-driver:hover {
    background: var(--primary-dark);
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.2);
}

.qr-codes {
    display: flex;
    gap: 40px;
    margin-top: 30px;
    flex-wrap: wrap;
    justify-content: center;
    position: relative;
    z-index: 2;
}

.qr-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
}

.qr-code {
    width: 120px;
    height: 120px;
    background: white;
    border-radius: 12px;
    padding: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5rem;
    color: var(--dark);
}

.qr-label {
    font-weight: 600;
    font-size: 0.9rem;
}

/* ===== SHOP PAGE ===== */
.shop-page {
    display: none;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.shop-header {
    background: white;
    border-radius: var(--radius);
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: var(--shadow);
    display: flex;
    gap: 30px;
    align-items: center;
    flex-wrap: wrap;
}

.shop-logo {
    width: 150px;
    height: 150px;
    border-radius: 50%;
    border: 5px solid var(--primary);
    object-fit: cover;
}

.shop-info {
    flex: 1;
    min-width: 0;
}

.shop-name {
    font-size: 2rem;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.shop-rating {
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.shop-description {
    color: var(--gray);
    margin-bottom: 20px;
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.shop-meta {
    display: flex;
    gap: 20px;
    flex-wrap: wrap;
}

.shop-meta-item {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--dark);
    font-size: 0.9rem;
    flex-wrap: wrap;
}

.shop-meta-item i {
    color: var(--primary);
}

.back-to-marketplace {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--primary);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    margin-top: 20px;
    transition: var(--transition);
    min-height: 44px;
}

.back-to-marketplace:hover {
    background: var(--primary-dark);
    transform: translateY(-3px);
}

/* ===== FOOTER ===== */
footer {
    background: var(--dark);
    color: white;
    padding: 50px 0 20px;
    margin-top: 60px;
    position: relative;
    z-index: 1;
}

.footer-content {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
}

.footer-logo {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 15px;
    text-align: center;
}

.footer-logo-img {
    width: 180px;
    height: 180px;
    border-radius: 50%;
    border: 4px solid var(--primary);
    object-fit: cover;
    margin-bottom: 10px;
}

.footer-brand {
    font-size: 1.8rem;
    font-weight: 800;
    background: linear-gradient(90deg, var(--primary), #FF9A3C);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

.footer-slogan {
    font-size: 1rem;
    color: #A0AEC0;
}

.footer-section h3 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: white;
    position: relative;
    padding-bottom: 10px;
}

.footer-section h3::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 40px;
    height: 3px;
    background: var(--primary);
    border-radius: 3px;
}

.footer-links {
    list-style: none;
}

.footer-links li {
    margin-bottom: 12px;
}

.footer-links a {
    color: #A0AEC0;
    transition: var(--transition);
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
}

.footer-links a:hover {
    color: white;
    padding-left: 5px;
}

.social-icons {
    display: flex;
    gap: 15px;
    margin-top: 20px;
    flex-wrap: wrap;
    justify-content: center;
}

.social-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.2rem;
    transition: var(--transition);
    min-width: 40px;
}

.social-icon:hover {
    background: var(--primary);
    transform: translateY(-5px);
}

.sponsor-pack {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: linear-gradient(135deg, var(--primary), var(--primary-dark));
    color: white;
    padding: 10px 20px;
    border-radius: 50px;
    font-weight: 600;
    margin-top: 10px;
    transition: var(--transition);
    min-height: 44px;
}

.sponsor-pack:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(255, 107, 53, 0.3);
}

.footer-bottom {
    max-width: 1200px;
    margin: 40px auto 0;
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    color: #A0AEC0;
    font-size: 0.9rem;
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes slideInRight {
    from { transform: translateX(20px); opacity: 0; }
    to { transform: translateX(0); opacity: 1; }
}

@keyframes slideInUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* ===== RESPONSIVE BREAKPOINTS ===== */

/* Small phones */
@media (max-width: 480px) {
    .header-container {
        gap: 5px;
    }
    
    .logo-img {
        width: 40px;
        height: 40px;
        border-width: 2px;
    }
    
    .brand-name {
        font-size: 1rem;
    }
    
    .brand-slogan {
        font-size: 0.55rem;
    }
    
    .cart-btn,
    .notification-btn,
    .menu-btn {
        width: 36px;
        height: 36px;
        min-width: 36px;
        font-size: 1rem;
    }
    
    .profile-pic {
        width: 28px;
        height: 28px;
        font-size: 0.8rem;
    }
    
    .profile-btn span {
        display: none;
    }
    
    .profile-btn {
        width: 36px;
        padding: 0;
    }
    
    .ad-banner {
        height: 120px;
        margin: 10px auto;
        width: calc(100% - 20px);
    }
    
    .ad-content {
        padding: 10px 15px;
    }
    
    .ad-title {
        font-size: 1rem;
    }
    
    .ad-subtitle {
        font-size: 0.7rem;
        margin-bottom: 5px;
    }
    
    .ad-price {
        padding: 3px 10px;
        font-size: 0.9rem;
    }
    
    .search-container {
        padding: 12px;
    }
    
    .section-title {
        font-size: 1rem;
    }
    
    .search-bar {
        flex-direction: column;
        gap: 8px;
        background: none;
        border: none;
        padding: 0;
    }
    
    .search-input {
        width: 100%;
        padding: 10px 15px;
        background: white;
        border: 2px solid #e2e8f0;
    }
    
    .search-btn {
        width: 100%;
        padding: 10px;
    }
    
    .quick-search-suggestions {
        left: 10px;
        right: 10px;
        padding: 8px;
    }
    
    .quick-search-grid {
        grid-template-columns: 1fr;
        gap: 5px;
    }
    
    .quick-search-btn {
        padding: 10px;
        font-size: 0.85rem;
        min-height: 40px;
    }
    
    .category-btn {
        padding: 10px 5px;
        font-size: 0.75rem;
    }
    
    .category-btn i {
        font-size: 0.85rem;
    }
    
    .marketplace-main {
        padding: 0 10px;
        gap: 15px;
    }
    
    .content-section {
        padding: 12px;
    }
    
    .view-toggle {
        gap: 5px;
        margin-bottom: 15px;
    }
    
    .toggle-btn {
        padding: 8px 10px;
        font-size: 0.8rem;
    }
    
    .items-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .item-header {
        height: 120px;
    }
    
    .item-body {
        padding: 12px;
    }
    
    .item-title {
        font-size: 1rem;
    }
    
    .item-category {
        font-size: 0.7rem;
        margin-bottom: 5px;
    }
    
    .item-rating i {
        font-size: 0.7rem;
    }
    
    .item-rating span {
        font-size: 0.7rem;
    }
    
    .item-description {
        font-size: 0.8rem;
        margin-bottom: 10px;
    }
    
    .item-pricing {
        padding: 8px 10px;
        font-size: 0.75rem;
    }
    
    .item-price {
        font-size: 0.9rem;
    }
    
    .action-btn {
        padding: 8px;
        font-size: 0.85rem;
        min-height: 40px;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .product-image {
        height: 110px;
    }
    
    .product-info {
        padding: 10px;
    }
    
    .product-title {
        font-size: 0.9rem;
    }
    
    .product-description {
        font-size: 0.7rem;
    }
    
    .product-weight {
        font-size: 0.65rem;
    }
    
    .product-price {
        font-size: 0.9rem;
    }
    
    .add-to-cart-btn {
        padding: 8px;
        font-size: 0.8rem;
        min-height: 40px;
    }
    
    .map-section {
        height: 350px;
    }
    
    .join-banner {
        padding: 0 10px;
        margin: 20px auto;
    }
    
    .join-container {
        padding: 20px 15px;
    }
    
    .join-title {
        font-size: 1.3rem;
    }
    
    .join-subtitle {
        font-size: 0.85rem;
        margin-bottom: 15px;
    }
    
    .join-buttons {
        gap: 8px;
        flex-direction: column;
    }
    
    .join-btn {
        width: 100%;
        padding: 12px;
        font-size: 0.9rem;
    }
    
    .qr-codes {
        gap: 15px;
    }
    
    .qr-code {
        width: 70px;
        height: 70px;
        font-size: 1.5rem;
    }
    
    .qr-label {
        font-size: 0.7rem;
    }
    
    .shop-page {
        padding: 0 10px;
    }
    
    .shop-header {
        padding: 15px;
        gap: 15px;
    }
    
    .shop-logo {
        width: 80px;
        height: 80px;
        border-width: 3px;
    }
    
    .shop-name {
        font-size: 1.2rem;
        justify-content: center;
    }
    
    .shop-rating {
        font-size: 0.8rem;
        justify-content: center;
    }
    
    .shop-description {
        font-size: 0.85rem;
    }
    
    .shop-meta {
        gap: 8px;
        justify-content: center;
        flex-direction: column;
        align-items: center;
    }
    
    .shop-meta-item {
        font-size: 0.75rem;
        justify-content: center;
    }
    
    .back-to-marketplace {
        width: 100%;
        padding: 10px;
        font-size: 0.85rem;
        justify-content: center;
    }
    
    .footer-logo-img {
        width: 80px;
        height: 80px;
    }
    
    .footer-brand {
        font-size: 1.2rem;
    }
    
    .footer-slogan {
        font-size: 0.8rem;
    }
    
    .footer-section h3 {
        font-size: 1rem;
    }
    
    .footer-links {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    
    .footer-links li {
        margin-bottom: 0;
    }
    
    .footer-links a {
        font-size: 0.8rem;
        min-height: 40px;
    }
    
    .social-icons {
        justify-content: center;
    }
    
    .social-icon {
        width: 35px;
        height: 35px;
        font-size: 1rem;
    }
    
    .sponsor-pack {
        padding: 6px 12px;
        font-size: 0.8rem;
    }
    
    .footer-bottom {
        font-size: 0.7rem;
        padding: 15px;
    }
}

/* Small tablets and large phones */
@media (min-width: 481px) and (max-width: 768px) {
    .header-container {
        gap: 8px;
    }
    
    .logo-img {
        width: 50px;
        height: 50px;
    }
    
    .brand-name {
        font-size: 1.2rem;
    }
    
    .brand-slogan {
        font-size: 0.65rem;
    }
    
    .profile-btn span {
        display: none;
    }
    
    .profile-btn {
        width: 40px;
        padding: 0;
    }
    
    .ad-banner {
        height: 140px;
        width: calc(100% - 30px);
    }
    
    .search-bar {
        flex-direction: column;
        gap: 8px;
        background: none;
        border: none;
        padding: 0;
    }
    
    .search-input {
        width: 100%;
        background: white;
    }
    
    .search-btn {
        width: 100%;
    }
    
    .quick-search-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .categories-container {
        gap: 8px;
    }
    
    .category-btn {
        padding: 12px 8px;
        font-size: 0.85rem;
    }
    
    .marketplace-main {
        padding: 0 15px;
    }
    
    .items-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .map-section {
        height: 400px;
    }
    
    .join-buttons {
        flex-direction: row;
    }
    
    .join-btn {
        width: auto;
    }
    
    .modal-actions {
        flex-direction: row;
    }
}

/* Tablets and small desktops */
@media (min-width: 769px) and (max-width: 1024px) {
    .logo-img {
        width: 70px;
        height: 70px;
    }
    
    .brand-name {
        font-size: 1.4rem;
    }
    
    .profile-btn span {
        display: inline;
        font-size: 0.9rem;
    }
    
    .marketplace-main {
        padding: 0 20px;
    }
    
    .categories-container {
        gap: 10px;
    }
    
    .items-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .quick-search-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* Desktops */
@media (min-width: 1025px) {
    .logo-img {
        width: 100px;
        height: 100px;
    }
    
    .brand-name {
        font-size: 1.8rem;
    }
    
    .profile-btn span {
        display: inline;
    }
    
    .search-bar {
        flex-direction: row;
    }
    
    .search-input {
        width: auto;
        flex: 1;
    }
    
    .search-btn {
        width: auto;
    }
    
    .categories-container {
        gap: 12px;
    }
    
    .items-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .quick-search-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Large desktops */
@media (min-width: 1400px) {
    .container,
    .marketplace-main,
    .ad-banner,
    .search-section,
    .categories-section,
    .join-banner,
    .shop-page {
        max-width: 1400px;
    }
    
    .items-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* ===== MOBILE RESPONSIVE FIXES FOR MODALS ===== */
@media (max-width: 768px) {
    /* Fix button positioning and spacing */
    .chatbot-btn {
        bottom: 20px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }
    
    .kasi-buzz-toggle {
        bottom: 80px;
        right: 20px;
        width: 50px;
        height: 50px;
        font-size: 1.3rem;
    }
    
    /* Center modals on mobile */
    .kasi-buzz-modal,
    .chatbot-modal-overlay {
        width: calc(100% - 40px);
        max-width: 380px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
    }
    
    .kasi-buzz-modal {
        bottom: 140px;
    }
    
    .chatbot-modal-overlay {
        bottom: 80px;
    }
}

@media (max-width: 480px) {
    .chatbot-btn {
        bottom: 15px;
        right: 15px;
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
    
    .kasi-buzz-toggle {
        bottom: 70px;
        right: 15px;
        width: 45px;
        height: 45px;
        font-size: 1.2rem;
    }
    
    .kasi-buzz-modal,
    .chatbot-modal-overlay {
        width: calc(100% - 30px);
        max-width: none;
        left: 15px;
        right: 15px;
        transform: none;
    }
    
    .kasi-buzz-modal {
        bottom: 130px;
    }
    
    .chatbot-modal-overlay {
        bottom: 75px;
    }
}

/* ===== TOUCH OPTIMIZATIONS ===== */
@media (hover: none) and (pointer: coarse) {
    button,
    .category-btn,
    .quick-search-btn,
    .action-btn,
    .add-to-cart-btn,
    .join-btn,
    .footer-links a,
    .social-icon,
    .message-action,
    .quantity-btn,
    .modal-btn,
    .back-to-marketplace,
    .sponsor-pack {
        min-height: 44px;
        min-width: 44px;
    }
    
    .item-card:hover,
    .product-card:hover,
    .quick-search-btn:hover,
    .category-btn:hover,
    .action-btn:hover,
    .add-to-cart-btn:hover {
        transform: none;
    }
    
    .item-card:active,
    .product-card:active,
    .quick-search-btn:active,
    .category-btn:active,
    .action-btn:active,
    .add-to-cart-btn:active {
        transform: scale(0.98);
        transition: transform 0.1s;
    }
}

/* ===== LANDSCAPE MODE ===== */
@media (orientation: landscape) and (max-height: 600px) {
    .kasi-buzz-modal {
        height: 300px;
        bottom: 120px;
    }
    
    .chatbot-modal-overlay {
        height: 350px;
        bottom: 80px;
    }
    
    .modal {
        max-height: 80vh;
    }
    
    .cart-sidebar {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* ===== SAFE AREA INSETS FOR NOTCHED DEVICES ===== */
@supports (padding: max(0px)) {
    .chatbot-btn {
        bottom: max(30px, env(safe-area-inset-bottom));
        right: max(30px, env(safe-area-inset-right));
    }
    
    .kasi-buzz-toggle {
        bottom: max(100px, calc(env(safe-area-inset-bottom) + 70px));
        right: max(30px, env(safe-area-inset-right));
    }
    
    @media (max-width: 768px) {
        .chatbot-btn {
            bottom: max(20px, env(safe-area-inset-bottom));
            right: max(20px, env(safe-area-inset-right));
        }
        
        .kasi-buzz-toggle {
            bottom: max(80px, calc(env(safe-area-inset-bottom) + 60px));
            right: max(20px, env(safe-area-inset-right));
        }
        
        .kasi-buzz-modal {
            bottom: max(140px, calc(env(safe-area-inset-bottom) + 120px));
            left: 50%;
            right: auto;
            transform: translateX(-50%);
        }
        
        .chatbot-modal-overlay {
            bottom: max(80px, calc(env(safe-area-inset-bottom) + 60px));
            left: 50%;
            right: auto;
            transform: translateX(-50%);
        }
    }
    
    @media (max-width: 480px) {
        .kasi-buzz-modal {
            bottom: max(130px, calc(env(safe-area-inset-bottom) + 110px));
            left: 15px;
            right: 15px;
            transform: none;
        }
        
        .chatbot-modal-overlay {
            bottom: max(75px, calc(env(safe-area-inset-bottom) + 55px));
            left: 15px;
            right: 15px;
            transform: none;
        }
    }
}

/* ===== FIXES ===== */
/* Prevent horizontal scroll */
html, body {
    max-width: 100%;
    overflow-x: hidden;
    position: relative;
}

/* Fix for iOS input zoom */
@media screen and (-webkit-min-device-pixel-ratio: 0) { 
    select,
    textarea,
    input {
        font-size: 16px !important;
    }
}

/* Fix grid alignment */
.items-grid,
.products-grid,
.quick-search-grid,
.categories-container,
.footer-content {
    align-items: start;
}

/* Fix for sticky hover on mobile */
@media (hover: none) {
    .category-btn:hover,
    .quick-search-btn:hover,
    .item-card:hover,
    .product-card:hover,
    .action-btn:hover,
    .add-to-cart-btn:hover {
        background: initial;
        color: initial;
        transform: none;
    }
    
    .category-btn.active {
        background: linear-gradient(135deg, var(--primary), var(--primary-dark));
        color: white;
    }
    
    .action-btn,
    .add-to-cart-btn {
        background: var(--primary);
        color: white;
    }
    
    .action-btn.book {
        background: var(--secondary);
    }
}

/* Fix flexbox gaps on older browsers */
@supports not (gap: 10px) {
    .header-controls > * {
        margin-right: 5px;
    }
    
    .header-controls > *:last-child {
        margin-right: 0;
    }
    
    .categories-container > * {
        margin-right: 8px;
    }
    
    .categories-container > *:last-child {
        margin-right: 0;
    }
    
    .items-grid > * {
        margin-bottom: 15px;
    }
}

/* Ensure images don't overflow */
img {
    max-width: 100%;
    height: auto;
    object-fit: cover;
}

/* Fix radius info on mobile */
.radius-info {
    bottom: 10px;
    left: 10px;
    padding: 8px 12px;
    font-size: 0.7rem;
}

/* Fix ad banner images on mobile */
.ad-slide {
    background-size: cover;
    background-position: center;
}