:root {
    /* Define a dark color palette based on the image */
    --dark-bg: #0e1518; /* Deep almost-black background */
    --dark-surface: #1b272c; /* Slightly lighter surface for cards, modals */
    --primary-text: #FFFFFF; /* White for main text */
    --secondary-text: #B0B0CC; /* Lighter grey for secondary text */
    --accent-orange: #FF7B00; /* Bright orange for highlights/buttons */
    --accent-green: #4CAF50; /* Green for success/veg mode */

    /* Additional variables for variant modal */
    --card-background: var(--dark-surface);
    --border-color: rgba(255, 255, 255, 0.1);
    --secondary-background: #1f2b31;
    --primary-color: var(--accent-orange);
    --primary-color-hover: #e56b00;

    --soft-shadow: 0px 4px 15px rgba(0, 0, 0, 0.25); /* Subtle shadows for depth */
    --border-radius-large: 24px;
    --border-radius-medium: 16px;
    --border-radius-small: 12px;
}

body {
    font-family: 'Nunito', sans-serif;
    margin: 0;
    padding: 0;
    background-color: var(--dark-bg); /* Dark background for the whole app */
    color: var(--primary-text); /* Default text color */
}

.app-container {
    max-width: 450px;
    margin: 0 auto;
    background-color: var(--dark-bg); /* Ensure container matches body bg */
    min-height: 100vh;
    position: relative;
    overflow-x: hidden;
    /* Remove the old ::before graphic that was light colored */
}
.app-container::before {
    content: none; /* Remove the old SVG background */
}

main {
    padding: 0 20px 20px 20px; /* Increased bottom padding from 20px to 90px */
    position: relative;
    z-index: 1;
}

/* Header (Welcome, Student!) */
header {
    background-color: var(--dark-surface); /* Dark surface for header */
    padding: 25px 20px;
    color: var(--primary-text);
    text-align: center;
    border-bottom-left-radius: var(--border-radius-large);
    border-bottom-right-radius: var(--border-radius-large);
    box-shadow: var(--soft-shadow);
    margin-bottom: 20px; /* Space between header and content */
}
header h1 {
    font-size: 1.8em;
    font-weight: 800;
    margin: 0 0 5px 0;
}
header p {
    font-size: 0.9em;
    color: var(--secondary-text);
    margin: 0;
}

/* Location Header (Deliver to, Select a location) */
.location-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 15px; /* Reduced padding from original for more compact look */
    position: relative;
    z-index: 2;
    background-color: var(--dark-bg); /* Consistent with header surface */
    margin: 0 10px 10px 10px; /* Add margin to lift it from edges */
    border-radius: var(--border-radius-medium);
}
.location-info {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    cursor: pointer;
}
.location-info .label {
    font-size: 0.8em; /* Slightly smaller */
    color: var(--secondary-text);
    margin-bottom: 2px;
}
.location-info #current-location {
    font-size: 1.05em; /* Slightly smaller */
    font-weight: 600;
    color: var(--primary-text);
    display: flex;
    align-items: center;
}
#current-location::after {
    /* Adjust arrow color for dark theme */
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='%23B0B0CC'%3E%3Cpath d='M7 10l5 5 5-5H7z'/%3E%3C/svg%3E");
}

.header-right-items {
    display: flex;
    align-items: center;
    gap: 15px;
}
.user-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background-size: cover;
    border: 2px solid var(--accent-green); /* Highlight avatar with accent color */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}
.user-avatar {
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5rem; /* Adjust size of the letter */
    font-weight: 700;
    color: var(--secondary-text);
    background-color: var(--dark-surface); /* A background for the circle */
}

/* Intro Section (What's ur 3am craving?) */
.intro-section {
    padding: 0 20px 20px 20px;
    position: relative;
    z-index: 1;
}
.intro-section h2 {
    font-size: 1.7em; /* Slightly smaller for better fit */
    font-weight: 800;
    line-height: 1.3;
    margin: 0 0 20px 0;
    color: var(--primary-text);
}

/* Search and Filter */
.search-and-filter-container {
    display: flex;
    align-items: center;
    gap: 15px;
}
.search-wrapper {
  position: relative;
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
}

.search-bar {
  width: 100%;
  padding: 10px 16px 10px 42px; /* leave space for icon */
  border-radius: 25px;
  border: none;
  background: var(--dark-surface);
  color: var(--primary-text);
  font-family: 'Nunito', sans-serif;
  font-size: 1em;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
  backdrop-filter: blur(10px);
  outline: none;
}

.search-bar::placeholder {
  color: var(--secondary-text);
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: var(--secondary-text);
  pointer-events: none;
}

/* Filter Section (Veg Toggle) */
.filter-section {
    display: flex;
    align-items: center;
    flex-shrink :1;
}
.veg-mode-toggle {
    display: flex;
    align-items: center;
    gap: 4px;
    background-color: var(--dark-bg); /* Dark surface for toggle background */
    border-radius: var(--border-radius-medium);
    box-shadow: var(--soft-shadow);
}
.veg-mode-toggle span {
    font-size: 0.9em;
    font-weight: 500;
    color: var(--secondary-text);
}
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 50px;
    height: 28px;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.slider {
    position: absolute;
    cursor: pointer;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: #666; /* Darker grey for off state */
    transition: .4s;
    border-radius: 28px;
}
.slider:before {
    position: absolute;
    content: "";
    height: 20px;
    width: 20px;
    left: 4px;
    bottom: 4px;
    background-color: var(--primary-text); /* White circle */
    transition: .4s;
    border-radius: 50%;
}
input:checked + .slider {
    background-color: var(--accent-green); /* Green for on state */
}
input:checked + .slider:before {
    transform: translateX(22px);
}

/* Sections (Browse by Category, All Restaurants) */
section h3 {
    color: var(--primary-text);
    font-size: 1.25em;
    font-weight: 700; /* Bolder for prominence */
    margin: 25px 0 15px 0;
}
#tag-section .section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
}
#tag-section h3 {
    margin: 0;
}
#tag-list {
    display: flex;
    align-items: center;
    gap: 16px;
    overflow-x: auto;
    padding-bottom: 15px;
    margin: 0 -20px; /* Allow horizontal scroll to extend to edges */
    padding-left: 20px;
    padding-right: 20px;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
#tag-list::-webkit-scrollbar {
    display: none;
}
#tag-list a {
    display: flex;
    align-items: center;
    padding: -15px -15px -15px;
    background-color: var(--dark-bg); /* Dark surface for tags */
    color: var(--secondary-text); /* Secondary text for tags */
    border-radius: 50%;
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.2s ease-in-out;
    flex-shrink: 0;
    cursor: pointer;
    margin-right: 0px;
    margin-left: 0px;
}
#tag-list a.active,
#tag-list a:hover {
    background-color: var(--dark-bg); /* Orange accent on hover/active */
    color: var(--primary-text);
    font-weight: 600;
}

/* Restaurant Cards */
#all-vendor-list {
    display: grid;
    grid-template-columns: 1fr;
    gap: 20px;
    padding-bottom: 80px; /* Add extra padding at the bottom */
}
.restaurant-card {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: var(--primary-text);
    background-color: var(--dark-surface); /* Dark surface for cards */
    border-radius: var(--border-radius-large); /* More rounded corners */
    overflow: hidden;
    box-shadow: var(--soft-shadow);
    transition: transform 0.2s ease-in-out, box-shadow 0.2s ease-in-out;
    cursor: pointer;
}
.restaurant-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1); /* Slightly stronger hover shadow */
}
.card-image-container {
    height: 150px;
    background-size: cover;
    background-position: center;
    position: relative;
    display: flex;
    align-items: flex-end;
    padding: 12px;
}
.card-image-container::after {
    /* Keep the gradient overlay for readability of text on image */
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, rgba(0, 0, 0, 0) 60%);
}
.delivery-time {
    background-color: rgba(46, 46, 74, 0.9); /* Darker, semi-transparent background */
    backdrop-filter: blur(5px);
    color: var(--primary-text);
    padding: 4px 10px;
    border-radius: 99px;
    font-size: 0.8em;
    font-weight: 600;
    z-index: 1;
    border: 1px solid rgba(255, 255, 255, 0.1); /* Subtle border */
}
.card-content {
    padding: 15px;
}
.card-title-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}
.card-title-row h4 {
    margin: 0;
    font-size: 1.15em;
    font-weight: 700;
}
.rating-badge {
    display: flex;
    align-items: center;
    gap: 4px;
    background-color: var(--accent-green); /* Green for rating */
    color: var(--primary-text);
    padding: 4px 8px;
    border-radius: 8px;
    font-size: 0.85em;
    font-weight: 600;
}
.rating-badge svg {
    width: 14px;
    height: 14px;
    fill: var(--primary-text);
}
.card-tags,
.card-price {
    font-size: 0.9em;
    color: var(--secondary-text);
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Modals */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8); /* Darker, more opaque overlay */
    backdrop-filter: blur(8px); /* Stronger blur */
    z-index: 999;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}
.modal-overlay.active {
    display: block;
    opacity: 1;
}

#modal-overlay {
    z-index: 999;
}
#location-overlay {
    z-index: 1000;
}
.modal {
    display: none;
    flex-direction: column;
    position: fixed;
    background: var(--dark-bg); /* Dark modal background */
    box-sizing: border-box;
    box-shadow: 0 -10px 40px rgba(0, 0, 0, 0.4); /* Stronger shadow */
    color: var(--primary-text); /* Default modal text color */
}
.bottom-sheet {
    overflow: scroll;
    z-index: 1001;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 450px;
    padding: 10px 15px 30px 15px;
    border-top-left-radius: var(--border-radius-large);
    border-top-right-radius: var(--border-radius-large);
    max-height: 85vh;
}
.bottom-sheet::before {
    content: '';
    display: block;
    width: 50px;
    height: 5px;
    background-color: rgba(255, 255, 255, 0.2); /* Lighter, subtle drag handle */
    border-radius: 3px;
    margin: 0 auto 20px auto;
}
.modal h3 {
    font-size: 1.4em;
    font-weight: 700;
    margin: 0 0 20px 0;
    color: var(--primary-text);
}


/* Location Modal Specifics */
#saved-locations-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
#saved-locations-list li {
    padding: 18px;
    margin-bottom: 9px;
    background-color: var(--dark-surface); /* Darker background for list items */
    border-radius: var(--border-radius-medium);
    font-weight: 500;
    text-align: left;
    cursor: pointer;
    transition: background-color 0.2s;
    border: 2px solid transparent;
    color: var(--primary-text);
}
#saved-locations-list li .location-details p {
    color: var(--secondary-text); /* Ensure landmark text is readable */
}
#saved-locations-list li span {
    color: var(--accent-green); /* Green for 'Default' label */
}
#saved-locations-list li.is-default {
    border-color: var(--accent-orange); /* Accent border for default location */
    font-weight: 600;
}
#saved-locations-list li:hover {
    background-color: rgba(255, 255, 255, 0.05); /* Subtle hover effect */
}
#add-new-location-btn {
    background: none;
    border: none;
    color: var(--accent-green); /* Accent color for add new button */
    font-size: 1em;
    font-weight: 600;
    padding: 15px 0;
    cursor: pointer;
    width: 100%;
    text-align: center;
    font-family: 'Nunito', sans-serif;
}

/* ============================================ */
/* Menu Modal Full Screen with Fixed Header */
/* ============================================ */
#menu-modal {
    z-index: 1002;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--dark-bg);
    border-radius: 0;
    box-sizing: border-box;
    display: none;
    flex-direction: column;
    overflow: hidden; /* Prevent body scroll when modal is open */
}

/* Fixed Header */
#menu-header {
    position: sticky;
    top: 0;
    z-index: 1003;
    background-color: var(--dark-bg);
    padding: 20px 20px 15px 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 60px;
    flex-shrink: 0; /* Prevent header from shrinking */
}

/* Back Button Styling */
#menu-modal-back-btn {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    background: var(--dark-surface);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0;
    color: var(--secondary-text);
}

#menu-modal-back-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    border-color: rgba(255, 255, 255, 0.15);
    color: var(--primary-text);
    transform: translateY(-50%) scale(1.05);
}

#menu-modal-back-btn:active {
    transform: translateY(-50%) scale(0.95);
}

#menu-modal-back-btn svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Menu Title */
#menu-title {
    font-size: 1.3em;
    font-weight: 700;
    text-align: center;
    margin: 0;
    color: var(--primary-text);
    max-width: 250px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Scrollable Menu List */
#menu-list {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    padding-top: 10px; /* Reduced top padding since header is fixed */
    padding-bottom: 100px;
    -webkit-overflow-scrolling: touch; /* Smooth scrolling on iOS */
}

/* Menu Item Styling */
.menu-item {
    background-color: var(--dark-surface);
    border-radius: var(--border-radius-medium);
    padding: 1.5rem;
    box-shadow: var(--soft-shadow);
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 600px;
    margin: 0 auto 1.5rem;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.item-details .item-name {
    margin: 0 0 0.25rem;
    font-size: 1.2rem;
    color: var(--primary-text);
}

.item-details .item-description {
    margin: 0 0 0.75rem;
    font-size: 0.9rem;
    color: var(--secondary-text);
    max-width: 300px;
}

.item-details .item-price {
    margin: 0;
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--primary-text);
}

/* --- Add to Cart Widget --- */
.add-to-cart-widget {
    min-width: 120px; /* Prevents layout shift */
    display: flex;
    justify-content: flex-end;
}

/* Base button style */
.btn {
    cursor: pointer;
    border: none;
    font-weight: bold;
    border-radius: var(--border-radius-small);
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.1s ease;
}

.btn:active {
    transform: scale(0.97); /* Click feedback */
}

/* Initial 'Add' button */
.btn-add.initial {
    background-color: var(--dark-bg);
    color: var(--accent-orange);
    border: 1px solid var(--accent-orange);
    padding: 0.75rem 1.5rem;
    font-size: 1rem;
}

.btn-add.initial:hover {
    background-color: var(--accent-orange);
    color: var(--dark-bg);
}

/* --- Quantity Stepper --- */
.quantity-stepper {
    display: flex;
    align-items: center;
    background-color: var(--dark-bg);
    border-radius: var(--border-radius-small);
    border: 1px solid var(--dark-surface);
}

/* Stepper buttons (+ and -) */
.btn-quantity {
    background-color: transparent;
    color: var(--accent-green);
    font-size: 1.5rem;
    width: 44px;
    height: 44px;
    line-height: 44px; /* Vertically centers the +/- */
    text-align: center;
    padding: 0;
}

.btn-quantity:hover {
    background-color: rgba(76, 175, 80, 0.1);
}

/* Quantity number display */
.quantity-display {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--primary-text);
    min-width: 40px;
    text-align: center;
}

/* Menu Category Styling */
.menu-category h4 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-size: 1.4rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary-text);
    padding: 0 1rem;
}

.category-indicator {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    display: inline-block;
}

.veg-indicator {
    background-color: var(--accent-green);
}

.non-veg-indicator {
    background-color: #d32f2f; /* Red for non-veg */
}

.drinks-indicator {
    background-color: #2196f3; /* Blue for drinks */
}

.alcoholic-indicator {
    background-color: #9c27b0; /* Purple for alcoholic */
}

.menu-category ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Styles for unavailable items */
.menu-item.unavailable {
    opacity: 0.6;
    pointer-events: none; /* Disable clicks */
    position: relative;
}

.item-unavailable-text::before {
    content: "Currently Unavailable";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 0.5rem 1rem;
    border-radius: 8px;
    font-size: 0.9rem;
    white-space: nowrap;
}

/* --- Utility Class --- */
.hidden {
    display: none !important;
}

/* Switch Toggle Styles */
.switch-wrapper .input {
   visibility: hidden;
   display: none;
}

.switch-wrapper .toggle {
   position: relative;
   display: block;
   width: 44.8px;
   height: 22.4px;
   cursor: pointer;
   -webkit-tap-highlight-color: transparent;
   transform: translate3d(0, 0, 0);
}

.switch-wrapper .toggle:before {
   content: "";
   position: relative;
   top: 3.4px;
   left: 3.4px;
   width: 38.1px;
   height: 15.7px;
   display: block;
   background: #9A9999;
   border-radius: 9px;
   transition: background 0.2s ease;
}

.switch-wrapper .toggle span {
   position: absolute;
   top: 0;
   left: 0;
   width: 22.4px;
   height: 22.4px;
   display: block;
   background: white;
   border-radius: 11.2px;
   box-shadow: 0 3px 8px rgba(154, 153, 153, 0.5);
   transition: all 0.2s ease;
}

.switch-wrapper .toggle span:before {
   content: "";
   position: absolute;
   display: block;
   margin: -20.2px;
   width: 62.7px;
   height: 62.7px;
   background: rgba(76,175,80,0.5);
   border-radius: 50%;
   transform: scale(0);
   opacity: 1;
   pointer-events: none;
}

.switch-wrapper .input:checked + .toggle:before {
   background: #80c883;
}

.switch-wrapper .input:checked + .toggle span {
   background: #4caf50;
   transform: translateX(22.4px);
   transition: all 0.2s cubic-bezier(0.8, 0.4, 0.3, 1.25), background 0.15s ease;
   box-shadow: 0 3px 8px rgba(76,175,80,0.2);
}

.switch-wrapper .input:checked + .toggle span:before {
   transform: scale(1);
   opacity: 0;
   transition: all 0.4s ease;
}

/* Tag with Image Styles */
.tag-with-image {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin: 8px;
  text-decoration: none;
  color: white;
}

.tag-with-image img.tag-icon {
  width: 69px;
  height: auto;
  object-fit: contain;
  border-radius: 50%;
  background-color: var(--dark-bg);
  padding: 6px;
}

/* Floating Cart Bar */
.floating-cart-bar {
  position: fixed;
  bottom: 16px;
  left: 16px;
  right: 16px;
  background-color: var(--dark-surface);
  color: var(--primary-text);
  padding: 12px 16px;
  border-radius: 14px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  box-shadow: 0 8px 25px rgba(126, 127, 128, 0.4);
  z-index: 9999;
  transition: all 0.3s ease;
  height: 45px;
  opacity: 1;
}

.floating-cart-bar.hidden {
  transform: translateY(100%);
  opacity: 0;
  pointer-events: none;
}

#floating-cart-btn {
  background: linear-gradient(45deg, #57C785, var(--accent-green));;
  color: white;
  border: none;
  padding: 5px 16px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  height: 40px
}

/* Mobile Responsive */
@media (max-width: 500px) {
    main {
        padding: 0 20px 20px 20px; /* Slightly more padding on mobile */
    }

    .floating-cart-bar {
        left: 12px;
        right: 12px;
        bottom: 12px;
    }

    #menu-modal {
        max-width: 100%;
    }

    #menu-header {
        padding: 15px 15px 10px 15px;
        min-height: 50px;
    }

    #menu-modal-back-btn {
        left: 15px;
        width: 36px;
        height: 36px;
    }

    #menu-modal-back-btn svg {
        width: 18px;
        height: 18px;
    }

    #menu-title {
        font-size: 1.2em;
        max-width: 200px;
    }

    #menu-list {
        padding: 15px;
        padding-top: 10px;
        padding-bottom: 100px;
    }

    .menu-item {
        padding: 1.2rem;
        margin-bottom: 1.2rem;
    }

    .item-details .item-name {
        font-size: 1.1rem;
    }

    .add-to-cart-widget {
        min-width: 100px;
    }
}

/* ============================================ */
/* UPDATED VARIANT MODAL STYLES */
/* ============================================ */

/* The main modal container for variants */
#variant-modal {
    position: fixed;
    bottom: -100%; /* Start off-screen at the bottom */
    left: 50%;
    transform: translateX(-50%);
    width: 90%; /* Adjust as needed */
    max-width: 450px; /* Max width for desktop/tablet */
    background-color: var(--dark-surface); /* Dark surface for the modal itself */
    border-radius: var(--border-radius-large) var(--border-radius-large) 0 0; /* Rounded top corners */
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.4); /* Stronger shadow for pop-up effect */
    display: flex;
    flex-direction: column;
    z-index: 1004; /* IMPORTANT: Higher than #menu-modal (1002) and its header (1003) */
    opacity: 0;
    visibility: hidden;
    transition: bottom 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.3s ease-in-out, visibility 0s linear 0.4s;
    max-height: 85vh; /* Allow it to take most of the screen height */
    overflow-y: auto; /* Enable scrolling for long variant lists */
}

/* Active state for the variant modal */
#variant-modal.active {
    bottom: 0;
    opacity: 1;
    visibility: visible;
    transition: bottom 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), opacity 0.3s ease-in-out, visibility 0s linear 0s;
}

/* Ensure overlay for variant modal is above other overlays but below variant modal */
#variant-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Slightly more opaque overlay */
    backdrop-filter: blur(6px); /* Consistent blur */
    display: none; /* Hidden by default */
    z-index: 1003; /* Directly below the variant modal, above menu modal */
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    pointer-events: none; /* Allows clicks through when not active */
}

#variant-overlay.active {
    opacity: 1;
    pointer-events: auto; /* Enable clicks on overlay to close */
}


.modal-header { /* Re-using existing modal-header for consistent look */
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0; /* Prevent header from shrinking */
}

#variant-modal-title {
    font-size: 1.3em; /* Slightly larger for main title */
    font-weight: 700;
    color: var(--primary-text);
    margin: 0;
    text-align: center;
    flex-grow: 1; /* Allows title to take available space */
}

#variant-modal-close { /* Re-using existing modal-close-btn for consistency */
    background: none;
    border: none;
    font-size: 1.8em;
    cursor: pointer;
    color: var(--secondary-text);
    padding: 5px;
    transition: color 0.2s ease;
    ;
}

#variant-modal-close:hover {
    color: var(--primary-text);
}

.modal-body { /* Generic modal body style applied to variant modal */
    padding: 20px;
    overflow-y: auto;
    flex-grow: 1; /* Allows the options list to scroll */
    padding-bottom: 90px; /* Ensure footer is not overlapped on mobile */
}

#variant-options {
    display: flex;
    flex-direction: column;
    gap: 12px; /* Space between variant options */
}

.variant-option {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px;
    background: var(--secondary-background);
    border-radius: var(--border-radius-medium);
    border: 1px solid var(--border-color);
    cursor: pointer; /* Indicate clickable */
    transition: background-color 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}

.variant-option:hover {
    background-color: rgba(255, 255, 255, 0.08); /* Subtle hover effect */
}

.variant-option.selected {
    border-color: var(--accent-orange); /* Highlight selected option */
    background-color: rgba(255, 123, 0, 0.1); /* Light orange background for selected */
}

.variant-option-details {
    flex: 1;
}

.variant-option-name {
    font-size: 1.05em;
    font-weight: 500;
    color: var(--primary-text);
    margin: 0 0 4px 0;
}

.variant-option-price {
    font-size: 0.9em;
    color: var(--secondary-text);
    margin: 0;
}

.variant-option-add-btn {
    background-color: var(--accent-orange);
    color: var(--dark-bg);
    border: none;
    border-radius: var(--border-radius-small);
    font-weight: bold;
    font-size: 1em;
    padding: 8px 22px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    box-shadow: 0 2px 8px rgba(255,123,0,0.10);
    min-width: 70px;
}
.variant-option-add-btn:active,
.variant-option-add-btn:hover {
    background-color: #e06a00;
    color: #fff;
}

/* Additional media query for smaller screens, if needed for variant modal */
@media (max-width: 768px) {
    #variant-modal {
        width: 100%; /* Full width on smaller screens */
        border-radius: 24px 24px 0 0;
    }
}

@media (max-width: 500px) {
  .variant-option-add-btn {
    font-size: 0.98em;
    padding: 7px 14px;
    min-width: 60px;
  }
}

.quantity-stepper {
    display: flex;
    align-items: center;
    background: var(--dark-bg);
    border-radius: 8px;
    border: 1px solid var(--dark-surface);
    margin-right: 10px;
}
.quantity-stepper .btn-quantity {
    background: transparent;
    color: var(--accent-orange);
    font-size: 1.3em;
    width: 41px;
    height: 44px;
    border: none;
    cursor: pointer;
    transition: background 0.2s;
}
.quantity-stepper .btn-quantity:active,
.quantity-stepper .btn-quantity:hover {
    background: rgba(76, 175, 80, 0.08);
}
.quantity-display {
    font-size: 1.1em;
    font-weight: bold;
    color: var(--primary-text);
    min-width: 28px;
    text-align: center;
}
.variant-option-add-btn {
    background-color: var(--accent-green);
    color: var(--dark-bg);
    border: none;
    border-radius: var(--border-radius-small);
    font-weight: bold;
    font-size: 1em;
    padding: 8px 22px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    box-shadow: 0 2px 8px rgba(255,123,0,0.10);
    min-width: 70px;
}
.variant-option-add-btn:active,
.variant-option-add-btn:hover {
    background-color: #e06a00;
    color: #fff;
}
.modal-footer {
    position: sticky;
    bottom: 80px;
    padding: 15px 20px;
    border-top: 1px solid var(--border-color);
    text-align: right;
    flex-shrink: 0;
    background: var(--dark-surface);
    z-index: 10;
}
#variant-modal-add-to-cart {
    background: linear-gradient(45deg, #57C785, var(--accent-green));
    color: var(--primary-text);
    border: none;
    padding: 16px 0;
    border-radius: var(--border-radius-medium);
    font-size: 1.1em;
    font-weight: 600;
    cursor: pointer;
    width: 100%;
    margin-top: 8px;
    transition: background-color 0.2s, transform 0.1s;
    box-shadow: 0 2px 8px rgba(76,175,80,0.10);
}
#variant-modal-add-to-cart:disabled {
    background-color: #666;
    cursor: not-allowed;
    opacity: 0.7;
}
#variant-modal-add-to-cart:hover:not(:disabled) {
    background-color: #3e8e41;
}
@media (max-width: 500px) {
    #variant-modal-add-to-cart {
        font-size: 1em;
        padding: 14px 0;
    }
    .modal-footer {
        padding: 10px 10px;
    }
}


.order-status-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 450px;
    background-color: var(--dark-surface);
    color: var(--primary-text);
    padding: 12px 16px;
    border-radius: var(--border-radius-medium);
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    z-index: 9998;
    transition: all 0.3s ease-in-out;
    cursor: pointer;
}

.order-status-bar.hidden {
    transform: translate(-50%, 150%);
    opacity: 0;
    pointer-events: none;
}

.order-status-info {
    font-weight: 500;
}

#order-status-bar button {
    background-color: var(--accent-green);
    color: var(--primary-text);
    border: none;
    padding: 8px 16px;
    border-radius: var(--border-radius-small);
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0; /* Prevent button from shrinking */
    margin-left: 15px;
}
/* Multi-Order Status Container */
.multi-order-status-container {
    position: fixed;
    bottom: 16px; /* Adjust as needed, similar to cart bar */
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 40px);
    max-width: 450px;
    background-color: var(--dark-surface); /* Use a dark surface for the container */
    color: var(--primary-text);
    border-radius: var(--border-radius-large);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    z-index: 9998; /* Below the single status bar, but above cart */
    display: flex;
    flex-direction: column;
    max-height: 80vh; /* Limit height and allow scrolling */
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease-in-out;
}

.multi-order-status-container.active {
    opacity: 1;
    visibility: visible;
    bottom: 16px; /* Ensure it's visible */
}

.multi-order-status-container.hidden {
    bottom: -100%; /* Move off-screen when hidden */
    opacity: 0;
    pointer-events: none;
}

.multi-order-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    flex-shrink: 0; /* Prevent header from shrinking */
}

.multi-order-header h3 {
    margin: 0;
    font-size: 1.2em;
    font-weight: 700;
}

.multi-order-header button {
    background: none;
    border: none;
    font-size: 1.8em;
    cursor: pointer;
    color: var(--secondary-text);
    padding: 5px;
    transition: color 0.2s ease;
}

.multi-order-header button:hover {
    color: var(--primary-text);
}

.active-orders-list {
    padding: 10px 20px;
    flex-grow: 1; /* Allow list to take available space and scroll */
}

/* Style for individual order bars within the multi-order container */
.order-status-item {
    background-color: var(--dark-bg); /* Darker background for individual items */
    border-radius: var(--border-radius-medium);
    padding: 12px 15px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.order-status-item-info {
    flex-grow: 1;
    font-size: 0.95em;
    font-weight: 500;
    color: var(--primary-text);
}

.order-status-item-info strong {
    color: var(--accent-orange); /* Highlight order ID */
}

.order-status-item button {
    background-color: var(--accent-green);
    color: white;
    border: none;
    border-radius: 5px;
    padding: 6px 12px;
    font-size: 0.85em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
}

.order-status-item button:hover {
    background-color: #388E3C;
}

.view-all-orders-btn {
    background-color: var(--accent-orange);
    color: var(--primary-text);
    border: none;
    padding: 15px 20px;
    width: 100%;
    border-radius: 0 0 var(--border-radius-large) var(--border-radius-large);
    font-size: 1em;
    font-weight: 600;
    cursor: pointer;
    transition: background-color 0.2s ease;
    flex-shrink: 0; /* Prevent button from shrinking */
}

.view-all-orders-btn:hover {
    background-color: #e56b00;
}

/* Adjust position if both cart and order status bars are visible */
.floating-cart-bar + .order-status-bar {
    bottom: 90px;
}

/* Adjust position of multi-order container if cart bar is visible */
.floating-cart-bar + .multi-order-status-container {
    bottom: 90px;
}


/* ============================================ */
/* CUSTOM ALERT/CONFIRMATION MODAL STYLES       */
/* ============================================ */

.custom-modal-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.2s ease-in-out;
    pointer-events: none;
}

.custom-modal-overlay:not(.hidden) {
    opacity: 1;
    pointer-events: auto;
}

.custom-modal-content {
    background-color: var(--dark-surface);
    padding: 2rem;
    border-radius: var(--border-radius-medium);
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
    text-align: center;
    max-width: 90%;
    width: 350px;
    color: var(--primary-text);
}

.custom-modal-content p {
    margin: 0 0 1.5rem 0;
    font-size: 1.1em;
    line-height: 1.5;
}

.custom-modal-actions {
    display: flex;
    justify-content: center;
    gap: 1rem;
}

.custom-modal-actions .btn-primary {
    background-color: var(--accent-green);
    color: white;
    border: none;
    padding: 10px 24px;
    border-radius: var(--border-radius-small);
    font-weight: 600;
    cursor: pointer;
}

.custom-modal-actions .btn-secondary {
    background-color: var(--dark-bg);
    color: var(--secondary-text);
    border: 1px solid var(--secondary-text);
    padding: 10px 24px;
    border-radius: var(--border-radius-small);
    font-weight: 600;
    cursor: pointer;
}


/* css for the notification of closed pop up start here */

.vendor-closed-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    backdrop-filter: blur(4px);
}

.vendor-closed-notification {
    background: white;
    border-radius: 16px;
    padding: 32px;
    max-width: 400px;
    width: 90%;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
    text-align: center;
    animation: slideIn 0.3s ease-out;
}

@keyframes slideIn {
    from {
        transform: translateY(-20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.notification-icon {
    color: #ff6b6b;
    margin-bottom: 16px;
}

.notification-icon svg {
    width: 48px;
    height: 48px;
}

.notification-content h3 {
    color: #333;
    margin: 0 0 12px 0;
    font-size: 20px;
    font-weight: 600;
}

.notification-content p {
    color: #666;
    margin: 8px 0;
    line-height: 1.5;
}

.notification-content strong {
    color: #333;
    font-weight: 600;
}

.notification-actions {
    margin-top: 24px;
    display: flex;
    gap: 12px;
    justify-content: center;
}

.btn-primary, .btn-secondary {
    padding: 10px 20px;
    border: none;
    border-radius: 8px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
}

.btn-primary {
    background: #007bff;
    color: white;
}

.btn-primary:hover {
    background: #0056b3;
    transform: translateY(-1px);
}

.btn-secondary {
    background: #f8f9fa;
    color: #333;
    border: 1px solid #dee2e6;
}

.btn-secondary:hover {
    background: #e9ecef;
    transform: translateY(-1px);
}

@media (max-width: 480px) {
    .vendor-closed-notification {
        padding: 24px;
    }

    .notification-actions {
        flex-direction: column;
    }
}

/* css for the notification of closed pop up ends here */


/* --- User Profile Dropdown --- */
.user-profile-container {
    position: relative;
}

.user-avatar {
    cursor: pointer; /* Changes the cursor to a pointer on hover */
}

.avatar-dropdown {
    display: none; /* Hidden by default */
    position: absolute;
    top: calc(100% + 10px); /* Position it below the avatar with a 10px gap */
    right: 0;
    background-color: var(--dark-surface);
    border-radius: var(--border-radius-medium);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.4);
    width: 200px;
    z-index: 100;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.1);
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.2s ease, transform 0.2s ease;
}

/* This class will be toggled by JavaScript to show the menu */
.avatar-dropdown.show {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

.dropdown-item {
    display: block;
    padding: 12px 16px;
    color: var(--primary-text);
    text-decoration: none;
    font-size: 0.95em;
    transition: background-color 0.2s ease;
}

.dropdown-item:hover {
    background-color: rgba(255, 255, 255, 0.05); /* Subtle hover effect */
}

/* Adds a line between items */
.dropdown-item:not(:last-child) {
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}