
/* Vendors Section */
.vendors-section {
    max-width: 1280px;
    margin: 0 auto;
    padding: 3rem 1.5rem;
    padding-bottom: 2rem;
    transition: background-color 0.3s;
}

.light-theme .vendors-section {
    background: linear-gradient(to bottom, white, #f9fafb);
}

.dark-theme .vendors-section {
    background: linear-gradient(to bottom, #111827, #1f2937);
}

.section-title {
    font-size: 1.875rem;
    font-weight: 900;
    margin-bottom: 2rem;
    animation: fadeIn 0.5s;
}

.vendors-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
}

.vendor-card {
    border-radius: 1.5rem;
    box-shadow: 0 4px 6px -1px var(--shadow);
    overflow: hidden;
    transition: all 0.3s;
    border: 2px solid;
    animation: fadeIn 0.6s both;
}

.light-theme .vendor-card {
    background: white;
    border-color: #f3f4f6;
}

.dark-theme .vendor-card {
    background: #1f2937;
    border-color: #374151;
}

.vendor-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px var(--shadow);
}

.vendor-image-container {
    position: relative;
    height: 224px;
    overflow: hidden;
}

.vendor-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.vendor-card:hover .vendor-image {
    transform: scale(1.1);
}

.vendor-gradient {
    position: absolute;
    inset: 0;
    
    background: linear-gradient(
        to top, 
        rgba(0, 0, 0, 0.9) 0%,
        rgba(0, 0, 0, 0.4) 40%,  
        transparent 70%          
    );
}
.vendor-rating {
    position: absolute;
    top: 1rem;
    right: 1rem;
    font-weight: 700;
    font-size: 0.875rem;
    
    /* Liquid Glass Effect */
    background: rgba(255, 255, 255, 0.2); 
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: white; /* Contrast fix */
    
    padding: 0.5rem 1rem;
    border-radius: 9999px;
    display: flex;
    align-items: center;
    gap: 0.25rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

.dark-theme .vendor-rating {
    background: rgba(0, 0, 0, 0.5); 
}

/* Ensure the text is readable in both themes */
.light-theme .vendor-rating, 
.dark-theme .vendor-rating {
    color: white; 
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

.vendor-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    /* The Glass Look */
    background: rgba(255, 255, 255, 0.2); 
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    /* Spacing & Layout */
    padding: 1.5rem 1rem; /* Adds space inside so text isn't cramped */
    margin: 0;            /* Ensures no gaps at the edges */
    border-top: 1px solid rgba(255, 255, 255, 0.3);
    animation: fadeIn 0.5s;
}

.dark-theme .vendor-info {
    background: rgba(0, 0, 0, 0.5); 
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.vendor-name {
    font-weight: 900;
    font-size: 1.5rem;
    color: white;
    margin-bottom: 0.25rem;
}

.vendor-delivery {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    color: rgba(255, 255, 255, 0.9);
}


.vendor-delivery span {
    font-size: 0.875rem;
    font-weight: 500;
}


.vendor-foods {
    padding: 1.25rem;
}

.food-items {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.food-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1rem;
    border-radius: 1rem;
    transition: all 0.3s;
    border: 2px solid;
    animation: fadeIn 0.4s both;
}

.light-theme .food-item {
    background: linear-gradient(to right, #f9fafb, white);
    border-color: #f3f4f6;
}

.dark-theme .food-item {
    background: #374151;
    border-color: #4b5563;
}

.food-item:hover {
    transform: scale(1.02) translateX(4px);
}

.light-theme .food-item:hover {
    background: linear-gradient(to right, #fff7ed, #fce7f3);
    border-color: #fdba74;
}

.dark-theme .food-item:hover {
    background: #4b5563;
    border-color: #f97316;
}

.food-image {
    width: 64px;
    height: 64px;
    border-radius: 0.75rem;
    object-fit: cover;
    box-shadow: 0 4px 6px -1px var(--shadow);
}

.food-details {
    flex: 1;
    min-width: 0;
}

.food-name {
    font-weight: 700;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.food-price {
    font-weight: 900;
    font-size: 1.125rem;
}

.light-theme .food-price {
    color: #ea580c;
}

.dark-theme .food-price {
    color: #fb923c;
}

.add-to-cart-btn {
    background: linear-gradient(to right, #f97316, #ef4444);
    color: white;
    padding: 0.75rem;
    border-radius: 0.75rem;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.2);
    transition: all 0.3s;
}

.add-to-cart-btn:hover {
    background: linear-gradient(to right, #ea580c, #dc2626);
    transform: scale(1.15) rotate(90deg);
    box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
}



/* ============================================ */
/* VIEW SWITCHER MENU                           */
/* ============================================ */


/* Center the container */
.view-toggle {
    display: none;
    justify-content: center;
    align-items: center;
    margin: 2.5rem 0; /* Space between title and cards */
}

.view-toggle button {
    padding: 0.8rem 2rem;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    border: none;
    color: #813803;
    transition: all 0.3s ease;
    outline: none;
}

/* Round only the outer corners to join them */
#grid {
    border-radius: 50px 0 0 50px;
    border-right: none; /* Remove the double border in the middle */
}

#list {
    border-radius: 0 50px 50px 0;
}

/* Active State (The orange fill) */
.view-toggle button.active {
    background: linear-gradient(to right, #ea580c, #dc2626);
    color: white;
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

/* Hover effect for non-active buttons */
.view-toggle button:hover:not(.active) {
    background-color: rgba(249, 115, 22, 0.1);
}

/* Dark Theme Adjustments */
.dark-theme .view-toggle button {
    border-color: #fb923c;
    color: #813803;
}

.dark-theme .view-toggle button.active {
    background-color: #fb923c;
    color: #111827;
}

/* Hide the list-specific text when in Grid mode */
.list-only-title, .list-only-info {
    display: none;
}

@media (min-width: 768px) {
    .view-toggle {
        display: block;
        margin: 1rem auto;
        text-align: center;
    }


    .vendors-grid {
    grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
}
    /* --- LIST MODE OVERRIDES --- */
        
    /*  Change the wrapper to a simple vertical column */
    #cards.list #all-vendors-grid {
        display: flex;
        flex-direction: column;
        gap: 0;
    }

    /*  Strip the card look and force a straight line */
    #cards.list .vendor-card {
        display: grid;
        grid-template-columns: 1.5fr 1.5fr 1fr .5fr; /* Name, Address, Delivery, Phone */
        align-items: center;
        padding: 1rem 1.5rem;
        border-radius: 0;
        border: none;
        border-bottom: 1px solid rgba(0, 0, 0, 0.1);
        background: transparent;
        box-shadow: none;

    }

    /* Hide the entire image container (and everything inside it) in List Mode */
    #cards.list .vendor-image-container {
        display: none;
    }

    /* Show the plain text elements for the list */
    #cards.list .list-only-title {
        display: block;
        font-size: 1.1rem;
        font-weight: 700;
        margin: 0;
    }

    #cards.list .list-only-info {
        display: block;
        margin: 0;
        font-size: 0.95rem;
    }

    /* Zebra Striping */

    #cards.list .vendor-card:nth-child(even) {
        background-color: #f9f9f9;
    }

    .dark-theme #cards.list .vendor-card:nth-child(even) {
        background-color: #374151;
    }

    /* Reset hover for list mode */
    #cards.list .vendor-card:hover {
        transform: none;
        box-shadow: none;
        background-color: rgba(0, 0, 0, 0.05);
    }
}
