html, body { height: 100%; display: flex; flex-direction: column; margin:0; font-family:'Segoe UI',sans-serif; background:#f2f3f7; }
main { flex:1 0 auto; }

 body {
        overflow-x: hidden;
    }

/* Navbar & buttons */
.navbar .btn-outline-light { margin-left: 10px; padding: 8px 22px; border-radius: 10px; font-weight:600; transition:0.3s; }
.navbar .btn-outline-light:hover { background:#0d6efd;color:#fff;transform:scale(1.05); }

/* Navbar white theme */
.navbar-light .navbar-brand,
.navbar-light .navbar-nav .nav-link,
.navbar-light .btn-outline-light { color: #333; }
.navbar-light .btn-outline-light { border-color: #333; }
.navbar-light .btn-outline-light:hover { background: #0d6efd; color: #fff; }

/* Cart icon */
.cart-icon .nav-link { display:flex;align-items:center;justify-content:center;width:60px;height:42px;border-radius:10px;border:1px solid #ccc;position:relative; transition:0.3s; }
.cart-icon .nav-link:hover { background:#0d6efd;color:#fff;transform:scale(1.05); }

/* Cart dropdown */
#dropdown_menu_cart { min-width:300px; max-width:400px; max-height:400px; overflow-y:auto; background:#fff; box-shadow:0 6px 18px rgba(0,0,0,0.1); border-radius:8px; border:1px solid #ddd; padding:10px; z-index:9999; }
#dropdown_menu_cart li { border-bottom:1px solid #ddd; padding:12px; border-radius:8px; }
#dropdown_menu_cart li:last-child { border-bottom:none; }
#dropdown_menu_cart .d-flex { gap:15px; align-items:center; }
#dropdown_menu_cart img { width:50px; height:50px; object-fit:cover; border-radius:8px; }
#dropdown_menu_cart .remove-item { background:#dc3545;color:#fff;border:none;border-radius:50%;font-size:0.75rem;padding:2px 6px;cursor:pointer; }
#dropdown_menu_cart .remove-item:hover { background:#c82333; }
#dropdown_menu_cart .btn { background:#0d6efd;color:#fff;border-radius:12px;padding:10px 0;font-weight:bold; }
#dropdown_menu_cart .btn:hover { background:#0069d9; }



form.d-flex.mx-auto {
    width: 60% !important;
    min-width: 280px !important;
    position: relative !important;
    margin-left: 4% !important;   /* moves form to left */
    margin-right: auto !important; /* optional: keep right margin flexible */
}


/* Search input */
form.d-flex.mx-auto input.form-control {
    background: rgba(255,255,255,0.9) !important;
    border: 2px solid #000 !important; /* Thick black border */
    border-radius: 6px 0 0 6px !important;
    transition: 0.3s !important;
    box-shadow: none !important; /* optional to reset bootstrap shadow */
}

/* Focus state of input */
form.d-flex.mx-auto input.form-control:focus {
    border-color: #000 !important;
    box-shadow: 0 0 8px rgba(0,0,0,0.3) !important;
    outline: none !important;
}

/* Buttons next to input (voice/search) */
form.d-flex.mx-auto button {
    border: 2px solid #000 !important;
    height: 42px !important; /* match input height */
}

/* Voice search button (middle) */
#voiceSearchButton {
    border-radius: 0 !important;  /* no rounded corners */
    border-left: none !important;  /* remove double border with input */
}

/* Submit/search button (last) */
form.d-flex.mx-auto button[type="submit"] {
    border-radius: 0 6px 6px 0 !important; /* only the right side rounded */
    border-left: none !important; /* remove double border with voice button */
}


/* Suggestions dropdown */
#suggestions {
    border: 2px solid #0d6efd !important;
    border-top: none !important;
}



/* Featured Banner */
#carouselWrapper {
    width: 90%;
    margin: 20px auto;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 20px rgba(0,0,0,0.15);
    background: linear-gradient(135deg, #ffa64d, #ff8000);
    padding: 50px 20px;
    text-align: center;
    color: rgba(255,255,255,0.9);
}


/* Responsive banner */
@media (max-width:576px) {
   #carouselWrapper {
    padding: 30px 15px;
    width: 95%;          /* set width to 95% on mobile */
    margin: 0 auto;      /* center it horizontally */
  }
  #carouselWrapper h1 { font-size: 1.8rem; }
  #carouselWrapper p { font-size: 1rem; }
}

/* Category sections */
.category-section { margin-top:50px; }
.category-section h3 { font-weight:700; margin-bottom:25px; color:#333; text-align:center; }

/* Product card */
.product-card { border-radius:12px; background:#fff; display:flex; flex-direction:column; text-align:center; transition:transform 0.3s, box-shadow 0.3s; box-shadow:0 2px 6px rgba(0,0,0,0.1); width:100%; }
.product-card:hover { transform:translateY(-5px) scale(1.03); box-shadow:0 12px 24px rgba(0,0,0,0.15); }
.product-card img { width:100%; height:180px; object-fit:cover; background:#f8f9fa; }
.product-card .card-body { padding:12px; flex-grow:1; }
.product-card .card-body h6 { font-weight:600; color:#333; font-size:1rem; }
.product-card .card-body p { color:#0d6efd; font-weight:500; font-size:0.95rem; margin-bottom:10px; }

/* Add to cart button */
.product-card .btn-add-cart { width:90%; margin:0 auto 12px auto; background:linear-gradient(90deg,#0d6efd,#3a8cff); color:#fff; border:none; border-radius:10px; font-weight:600; font-size:0.95rem; padding:8px 0; transition:0.3s; }
.product-card .btn-add-cart:hover { background:linear-gradient(90deg,#0b5ed7,#2a6fd7); transform:scale(1.05); }

/* Footer */
footer { flex-shrink:0; background:#fff; color:#333; box-shadow: 0 -4px 12px rgba(0,0,0,0.08); padding-top:20px; }
footer a { color:#0d6efd; text-decoration:none; transition:0.3s; }
footer a:hover { color:#0a58ca; }
footer hr { border-color: #ddd; }

/* Category dropdown */
.custom-dropdown-btn { background:#f8f9fa; border:1px solid #ccc; border-radius:10px; padding:6px 18px; font-weight:600; color:#333; }
.custom-dropdown-menu { max-height:300px; overflow-y:auto; }

/* Horizontal category menu - mobile default */
#horizontalCategoryMenu {
  display: flex;
  gap: 10px;
  padding: 5px 0;
  margin: 0;
  list-style: none;
  overflow-x: auto;
  white-space: nowrap;
  flex-wrap: nowrap;
}

#horizontalCategoryMenu .nav-link {
  font-weight: 500 !important;
}


#userDropdown + .dropdown-menu {
  z-index: 2000 !important;
}


.product-card img {
    width: 100%;
    height: 180px;
    object-fit: contain;  /* <-- changed from cover to contain */
    background:#f8f9fa;
}/* Scrollbar styling */
#horizontalCategoryMenu::-webkit-scrollbar { height: 6px; }
#horizontalCategoryMenu::-webkit-scrollbar-thumb { background-color: rgba(0,0,0,0.2); border-radius: 3px; }

/* Desktop: horizontal menu immediately after dropdown */
@media (min-width: 768px) {
  .navbar .container-fluid.d-flex {
    display: flex;
    align-items: center;
    flex-wrap: nowrap;
  }

  #categoryDropdown {
    margin-right: 10px;
  }

  #horizontalCategoryMenu {
    display: flex;
    gap: 10px;
    list-style: none;
    padding: 0;
    margin: 0;
    flex-grow: 1;       /* take remaining space */
    justify-content: flex-start;
    overflow-x: auto;
    white-space: nowrap;
  }

  .scroll-wrapper::-webkit-scrollbar {
    display: none;
}

  #horizontalCategoryMenu .nav-item {
    margin: 0;
  }

  #horizontalCategoryMenu .nav-link {
    padding: 6px 12px;
  }
}


.horizontal-scroll {
    display: flex;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch; /* smooth scrolling on iOS */
    gap: 10px;
    padding: 0;
    margin: 0;
    list-style: none;
}

/* Hide scrollbar */
.horizontal-scroll::-webkit-scrollbar {
    display: none;
}

/* Buttons */
.scroll-btn {
    display: none; /* show only on mobile */
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0,0,0,0.5);
    color: #fff;
    border: none;
    padding: 0.3rem 0.5rem;
    border-radius: 50%;
    z-index: 10;
    cursor: pointer;
}

.left-btn { left: 0; }
.right-btn { right: 0; }



@media (max-width: 520px){
 .container-fluid {
    display: flex;
    flex-wrap: wrap; /* allow stacking for mobile */
    gap: 8px;
  }

    #horizontalCategoryMenu
    {
        display:none !important;
    }

    .scroll-btn {
        display: block;
    }




  /* ------------------ Top row: Logo left, Sign In right ------------------ */
  .navbar-brand {
    order: 1;
    flex: 1;
    text-align: left;
  }
   #navbarUserContainer {
    order: 2;
    flex: 0 0 auto;          /* don't take extra space */
    margin-left: auto;       /* push all the way right */
    text-align: right;
  }

  /* ------------------ Second row: Search bar full width ------------------ */
  form.d-flex.mx-auto {
    order: 3;
    flex-basis: 100%;
    width: 100% !important;
    margin: 0 !important;
  }

  /* ------------------ Third row: Shop left, Cart right ------------------ */
  .btn.btn-outline-light.ms-3 {
    order: 4;
    flex: 0 0 auto;
    width: 100px; /* smaller button */
    text-align: left;
  }

  .cart-icon {
    order: 5;
    flex: 0 0 auto;
    text-align: right;
    position: relative;
    top: 4px; /* move it down */
}

  /* ------------------ Fourth row: Category navbar full width ------------------ */
  .category-navbar .container-fluid {
    order: 6;
    flex-basis: 100%;
  }

  /* Categories horizontal for mobile */
  #horizontalCategoryMenu {
    flex-wrap: nowrap;        /* horizontal scroll if too many */
    overflow-x: auto;
    gap: 8px;
    padding: 0 5px;
  }
  #horizontalCategoryMenu li {
    white-space: nowrap;     /* keep text on one line */
  }

   .btn.btn-outline-light.ms-3 {
    position: relative;
    left: -14.5px; /* keep your horizontal adjustment */
    top: 4px;       /* move it down */
    font-size: 0.95rem;
    padding: 0.25rem 0.5rem;
}


 /* Stack entire order card vertically */
  #ordersList .order-card {
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 15px;
    padding: 15px !important;
    margin-bottom: 15px;
  }

  /* Stack image + buttons vertically */
  #ordersList .order-card .d-flex.gap-4.flex-grow-1 {
    flex-direction: column !important;
    gap: 15px;
  }

  /* Center image and buttons */
  #ordersList .order-card .text-center.flex-shrink-0 {
    min-width: 100% !important;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
  }

  /* Product image */
  #ordersList .order-card img {
    width: 100%;
    height: auto;
    max-height: 200px;
    object-fit: contain;
    margin-bottom: 10px;
  }

  /* Buy Again / View Item buttons under image */
  #ordersList .order-card .text-center.flex-shrink-0 .d-flex.gap-2.mt-2 {
    flex-direction: column !important;
    gap: 8px !important;
    width: 100%;
  }

  #ordersList .order-card .text-center.flex-shrink-0 .d-flex.gap-2.mt-2 .btn {
    flex: 1 1 100% !important;
    padding: 10px 0;
    font-size: 0.95rem;
  }

  /* Stack order info and items */
  #ordersList .order-info {
    width: 100%;
  }

  #ordersList .order-items div {
    font-size: 0.95rem;
  }

  /* Order actions buttons (Track, Cancel, etc.) */
  #ordersList .order-card .order-actions {
    flex-direction: row !important;
    flex-wrap: wrap;
    justify-content: space-between;
    min-width: 100% !important;
    margin-left: 0 !important;
    gap: 8px;
  }

  #ordersList .order-card .order-actions button {
    flex: 1 1 48% !important; /* two buttons per row */
    font-size: 0.9rem;
    padding: 10px 0;
  }


}


/* Make card full-width on desktop but centered */
  @media (min-width: 992px) {
    #trackOrderContainer #orderCard {
      max-width: 900px;
    }
  }
  @media (max-width: 576px) {
    /* Mobile tweaks */
    #trackOrderContainer h3 {
      font-size: 1.25rem;
      text-align: center;
    }
    #trackOrderContainer #orderCard {
      padding: 1rem;
    }
    #trackOrderContainer #orderCard img {
      height: 80px;
    }
  }

/* Bootstrap row adjustments */
.row.g-3 { margin-left: -5px; margin-right: -5px; }
.row.g-3 > [class*="col-"] { padding-left: 5px; padding-right: 5px; }

