.itemimg {
  width: 70px;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  border-radius: 8px;
}
.horizontal-scroll-hide {
  display: flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  white-space: nowrap;
  gap: 16px;
  /* Hide scrollbar for all browsers */
  scrollbar-width: none; /* Firefox */
  -ms-overflow-style: none; /* IE/Edge */
  position: relative;
  padding-bottom: 4px; /* Space for the line */
}

.horizontal-scroll-hide::-webkit-scrollbar {
  display: none; /* Chrome/Safari/Opera */
}

/* Category indicator styles */
.scroll-item {
    padding: 8px 16px;
    border-radius: 0;
    background-color: transparent;
    color: #666;
    cursor: pointer;
    user-select: none;
    transition: all 0.2s ease;
    flex-shrink: 0;
    position: relative;
}

.scroll-item.active {
    color: #28A745;
    font-weight: 600;
}

/* Line under categories */
.categories-line {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background-color: #e0e0e0;
}

.category-indicator {
    height: 3px;
    background-color: #28A745;
    width: 0;
    transition: all 0.3s ease;
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 1;
}

/* Product item row styling */
.product-row {
    display: flex;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid #f0f0f0;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.product-row:hover {
    background-color: #f9f9f9;
}

/* Bottom Sheet Modal Styles */
.bottom-sheet-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 2000;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.bottom-sheet-container {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: white;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    z-index: 2001;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 0.3s ease;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
}

/* Fixed image section at top */
.bottom-sheet-fixed-image {
    flex-shrink: 0; /* Prevent shrinking */
    position: relative;
}

.bottom-sheet-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: white;
    font-size: 20px;
    z-index: 10;
    border: 2px solid white;
}

.bottom-sheet-image-container {
    width: 100%;
    height: 200px;
    overflow: hidden;
    border-top-left-radius: 16px;
    border-top-right-radius: 16px;
    position: relative;
}

.bottom-sheet-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Fixed actions at bottom */
.bottom-sheet-fixed-actions {
    flex-shrink: 0; /* Prevent shrinking */
    padding: 16px;
    border-top: 1px solid #f0f0f0;
    display: flex;
    align-items: center;
    gap: 16px;
    background-color: white;
}

/* Scrollable content area - ONLY product info and subcategories scroll */
.bottom-sheet-scrollable {
    flex: 1;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.bottomsheet-info {
    padding: 4px 16px;
    border-bottom: 1px solid #f0f0f0;
    background-color: white;
}

.bottomsheet-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 2px;
    color: #333;
}

.bottomsheet-store {
    font-size: 14px;
    color: #666;
	margin-top: 0;
    margin-bottom: 0;
}

.bottomsheet-price {
    font-size: 24px;
    font-weight: 700;
    color: #28A745;
}

.bottom-sheet-original-price {
    font-size: 16px;
    color: #999;
    text-decoration: line-through;
    margin-left: 8px;
}

.bottom-sheet-content {
    padding: 16px;
}

.subcategories-section {
    margin-bottom: 20px;
}

.subcategories-section h4 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    color: #333;
    padding-bottom: 8px;
    border-bottom: 1px solid #f0f0f0;
}

.subcategory-items {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.subcategory-item {
    display: flex;
    align-items: center;
    padding: 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s ease;
    background-color: #f9f9f9;
}

.subcategory-item:hover {
    background-color: #f0f0f0;
    border-color: #28A745;
}

.subcategory-item-image {
    width: 50px;
    height: 50px;
    border-radius: 6px;
    object-fit: cover;
    margin-right: 12px;
}

.subcategory-item-info {
    flex: 1;
}

.subcategory-item-name {
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
}

.subcategory-item-price {
    font-weight: 600;
    color: #28A745;
    font-size: 14px;
}

.subcategory-item-add {
    background-color: #28A745;
    color: white;
    border: none;
    border-radius: 6px;
    padding: 8px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
}

.subcategory-item-add:hover {
    background-color: #218838;
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    background-color: #f9f9f9;
}

.quantity-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: white;
    border: 1px solid #ddd;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 18px;
    color: #333;
}

.quantity-value {
    min-width: 24px;
    text-align: center;
    font-weight: 600;
    font-size: 16px;
}

.add-to-cart-btn {
    flex: 1;
    background-color: #28A745;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 12px 20px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.add-to-cart-btn:hover {
    background-color: #218838;
}

/* Notification animations */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
    to {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
}

@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }
    to {
        opacity: 0;
        transform: translate(-50%, -50%) scale(0.9);
    }
}

/* Cart Floating Button Styles - ADDED */
.cart-floating-button {
    position: fixed;
    bottom: 20px;
    left: 16px;
    right: 16px;
    background-color: #28A745;
    color: white;
    border: none;
    border-radius: 50px;
    padding: 16px 24px;
    font-size: 16px;
    font-weight: 600;
    z-index: 1000;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: grab;
    transition: all 0.3s ease;
    text-decoration: none;
    text-align: center;
    width: calc(100% - 32px);
    margin: 0 auto;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
}

.cart-floating-button:hover {
    background-color: #218838;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(0,0,0,0.2);
}

.cart-floating-button:active {
    transform: translateY(0);
}

.cart-floating-button.hidden {
    display: none;
}

.cart-icon {
    font-size: 18px;
}

.cart-price {
    font-weight: 700;
    font-size: 17px;
}


.circle-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    box-shadow: 0 2px 8px rgba(0,0,0,0.2);
    color: #333;
    font-size: 18px;
    transition: all 0.2s ease;
}

.circle-button:hover {
    background-color: #f8f9fa;
    transform: scale(1.05);
    box-shadow: 0 3px 10px rgba(0,0,0,0.25);
}

.circle-button:active {
    transform: scale(0.95);
}

/* Cart badge styling */
.cart-button {
    position: relative;
}

.cart-badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background-color: #dc3545;
    color: white;
    font-size: 11px;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
}

/* ==================== DESKTOP LAYOUT - 2/3 products + 1/3 cart sidebar ==================== */
@media (min-width: 993px) { /* w3-hide-large breakpoint */
    .vendorord-desktop-container {
        display: flex;
        gap: 24px;
        padding: 0 24px;
        max-width: 1400px;
        margin: 0 auto;
    }
    
    .vendorord-products-section {
        flex: 2; /* 2/3 width */
        min-width: 0; /* Allow flex shrink */
    }
    
    .vendorord-cart-section {
        flex: 1; /* 1/3 width */
        min-width: 300px;
        max-width: 400px;
    }
    
    /* Adjust product container for desktop */
    #productsContainer.vendorord-desktop-products {
        display: block;
    }
    
    .product-row.vendorord-desktop-product {
        width: 100%;
        margin-bottom: 8px;
        border-radius: 8px;
        border: 1px solid #e0e0e0;
    }
    
    .product-row.vendorord-desktop-product:hover {
        border-color: #28A745;
        box-shadow: 0 2px 8px rgba(40, 167, 69, 0.1);
    }
    
    /* Cart sidebar styling - UPDATED to match cart.php layout */
    .cart-sidebar {
        background: white;
        border-radius: 12px;
        border: 1px solid #e0e0e0;
        box-shadow: 0 2px 12px rgba(0,0,0,0.08);
        position: sticky;
        top: 0px;
        max-height: calc(100vh - 100px);
        overflow-y: auto;
    }
    
    .cart-sidebar-header {
        padding: 20px;
        border-bottom: 1px solid #e0e0e0;
        background: #f8f9fa;
        border-radius: 12px 12px 0 0;
    }
    
    .cart-sidebar-title {
        font-size: 20px;
        font-weight: 600;
        color: #333;
        margin: 0;
        display: flex;
        align-items: center;
        gap: 8px;
    }
    
    .cart-sidebar-items {
        padding: 16px;
    }
    
    /* UPDATED: New cart item layout matching cart.php */
    .cart-sidebar-item {
        display: flex;
        align-items: center;
        padding: 12px 0;
        border-bottom: 1px solid #f0f0f0;
        gap: 12px;
    }
    
    .cart-sidebar-item:last-child {
        border-bottom: none;
    }
    
    .cart-sidebar-item-image {
        width: 50px;
        height: 50px;
        border-radius: 6px;
        object-fit: cover;
    }
    
    .cart-sidebar-item-content {
        flex: 1;
        display: flex;
        flex-direction: column;
        gap: 4px;
    }
    
    .cart-sidebar-item-name {
        font-weight: 500;
        color: #333;
        font-size: 14px;
        margin: 0;
    }
    
    /* Quantity controls matching cart.php */
    .cart-sidebar-item-quantity {
        display: flex;
        align-items: center;
        margin-top: 5px;
    }
    
    .cart-sidebar-quantity-btn {
        width: 28px;
        height: 28px;
        border-radius: 50%;
        background: #f8f9fa;
        border: 1px solid #ddd;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        font-size: 12px;
        color: #333;
    }
    
    .cart-sidebar-quantity-btn:disabled {
        opacity: 0.5;
        cursor: not-allowed;
    }
    
    .cart-sidebar-quantity-value {
        min-width: 24px;
        text-align: center;
        font-weight: 500;
        font-size: 14px;
        margin: 0 10px;
    }
    
    /* Price and delete section matching cart.php */
    .cart-sidebar-item-right {
        display: flex;
        flex-direction: column;
        align-items: flex-end;
        gap: 4px;
    }
    
    .cart-sidebar-item-price {
        font-weight: 600;
        color: #28A745;
        font-size: 14px;
        margin: 0;
        text-align: right;
    }
    
    .cart-sidebar-delete-btn {
        background: none;
        border: none;
        color: #dc3545;
        cursor: pointer;
        padding: 0;
        font-size: 16px;
        display: flex;
        align-items: center;
        justify-content: center;
        width: 24px;
        height: 24px;
        border-radius: 4px;
        transition: background-color 0.2s;
    }
    
    .cart-sidebar-delete-btn:hover {
        background-color: #f8f9fa;
    }
    
    .cart-sidebar-footer {
        padding: 20px;
        border-top: 1px solid #e0e0e0;
        background: #f8f9fa;
        border-radius: 0 0 12px 12px;
    }
    
    .cart-sidebar-total {
        display: flex;
        justify-content: space-between;
        align-items: center;
        margin-bottom: 16px;
    }
    
    .cart-sidebar-total-label {
        font-size: 16px;
        font-weight: 600;
        color: #333;
    }
    
    .cart-sidebar-total-amount {
        font-size: 24px;
        font-weight: 700;
        color: #28A745;
    }
    
    .cart-sidebar-checkout-btn {
        width: 100%;
        background-color: #28A745;
        color: white;
        border: none;
        border-radius: 8px;
        padding: 16px;
        font-size: 16px;
        font-weight: 600;
        cursor: pointer;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        transition: all 0.3s ease;
    }
    
    .cart-sidebar-checkout-btn:hover {
        background-color: #218838;
        transform: translateY(-2px);
        box-shadow: 0 4px 12px rgba(0,0,0,0.15);
    }
    
    .cart-sidebar-empty {
        padding: 40px 20px;
        text-align: center;
        color: #666;
    }
    
    .cart-sidebar-empty-icon {
        font-size: 48px;
        color: #ddd;
        margin-bottom: 16px;
    }
    
    .cart-sidebar-empty-text {
        font-size: 16px;
        margin: 0;
    }
    
    /* Hide floating cart button on desktop */
    .cart-floating-button {
        display: none !important;
    }
}

/* MOBILE: Hide cart sidebar, show floating button */
@media (max-width: 992px) {
    .vendorord-desktop-container {
        display: block;
    }
    
    .vendorord-cart-section {
        display: none;
    }
    
    .cart-sidebar {
        display: none;
    }
    
    /* Adjust floating button for mobile */
    .cart-floating-button.vendorord-mobile {
        bottom: 80px; /* Above mobile nav */
    }
}