/* === General === */
body, html { margin:0; font-family:'Segoe UI',sans-serif; background:#f2f3f7; display:flex; flex-direction:column; min-height:100vh; }
main { flex:1 0 auto; padding:40px 20px; }

/* === Navbar === */
.navbar .btn-outline-dark { margin-left:10px; padding:8px 22px; border-radius:10px; font-weight:600; transition:0.3s; }
.navbar .btn-outline-dark:hover { background:#0d6efd;color:#fff;transform:scale(1.05); }
.navbar-brand i { font-size:1.5rem; }

/* Search bar container */
form.d-flex.mx-auto {
    width: 60% !important;
    min-width: 280px !important;
    position: relative !important;
}

/* 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 */
}




.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); }
#cartItemCount { position:absolute; top:-10px; right:-10px; font-size:12px; }

/* 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; }

/* === Category Dropdown & Horizontal Menu === */
.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 menu container */
.navbar .container-fluid.d-flex {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 10px; /* spacing between dropdown and menu */
}

/* Horizontal category menu */
#horizontalCategoryMenu {
  display: flex;
  flex-wrap: nowrap;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
  overflow-x: auto;
  flex: 1; /* take remaining space next to dropdown */
}
#horizontalCategoryMenu .nav-link {
  font-weight: 500;
  color: #333;
  padding: 6px 12px;
  border-radius: 8px;
  white-space: nowrap;
  transition: 0.2s;
}
#horizontalCategoryMenu .nav-link:hover {
  background: #0d6efd;
  color: #fff;
}

.star-rating {
  font-size: 1.5rem; /* increase size as needed */
  line-height: 1;    /* optional: tighter spacing */
}




/* === Filter Sidebar === */
 #filterSidebar {
  flex: 0 0 280px;               /* fixed width */
  background-color: #fff;
  border-radius: 20px;
  padding: 25px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.03);

  height: auto;                   /* let it fit content naturally */
  max-height: 90vh;               /* limit to 80% of viewport height on desktop */
  overflow-y: auto;               /* add vertical scroll if content is too tall */
  overflow-x: hidden;
}

#filterSidebar h5 { font-weight:700; font-size:1.15rem; margin-bottom:15px; position:relative; }
#filterSidebar h5::after { content:""; position:absolute; left:0; bottom:-5px; width:40px; height:3px; background:linear-gradient(90deg,#0d6efd,#6610f2); border-radius:2px; }
.filter-section { margin-bottom:30px; }
.filter-section label { display:flex; align-items:center; gap:10px; cursor:pointer; font-weight:500; color:#495057; }
.filter-section input[type="checkbox"] { width:18px; height:18px; accent-color:#0d6efd; cursor:pointer; }
.filter-section input[type="range"] { width:100%; height:6px; border-radius:12px; background:#e9ecef; outline:none; margin-top:8px; }
.filter-section input[type="range"]::-webkit-slider-thumb { -webkit-appearance:none; width:22px; height:22px; border-radius:50%; background:#0d6efd; cursor:pointer; box-shadow:0 2px 8px rgba(13,110,253,0.4); }
.rating-pill { display:inline-block; padding:6px 12px; margin-right:8px; border-radius:14px; background-color:#f4f5f7; color:#495057; font-weight:500; font-size:0.9rem; cursor:pointer; }
.rating-pill.active, .rating-pill:hover { background-color:#ffc107; color:#fff; }

/* === Products === */
#shopContainer { display:flex; gap:25px; }
#productList { flex:1; display:flex; flex-direction:column; gap:0; }
.product-row { display:flex; align-items:center; gap:30px; padding:20px 0; position:relative; }
.product-row:not(:last-child)::after { content:""; position:absolute; bottom:0; left:0; width:100%; border-bottom:1px solid #e0e0e0; }
.product-image { flex:0 0 180px; height:180px; border-radius:14px; overflow:hidden; }
.product-image img { width:100%; height:100%; object-fit:cover; transition:transform 0.3s; }
.product-image img:hover { transform:scale(1.05); }
.product-details {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
  background-color: transparent !important;  /* remove background */
  padding: 0 !important;                     /* remove padding */
  border-radius: 0 !important;              /* remove corners */
  box-shadow: none !important;              /* remove shadow */
  min-width: 0;                              /* important for ellipsis */
}

.product-details:hover { transform:translateY(-3px); box-shadow:0 12px 28px rgba(0,0,0,0.12); }
.product-details h5 { font-weight:700; font-size:1.3rem; margin-bottom:4px; color:#212529; }
.product-details .price { font-size:1.25rem; font-weight:700; color:#0d6efd; }
.product-details .stars { color:#ffc107; font-size:1rem; }
.btn-add-cart {
  background-color: #0d6efd;
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 8px 18px;
  font-weight: 600;
  transition: 0.3s;
  align-self: flex-start;
  min-width: 140px;        /* increase minimum width */
  width: auto;             /* let it grow naturally */
}

.btn-add-cart:hover {
  background-color: #0b5ed7;
  transform: scale(1.05);
}

/* Pagination */
#paginationButtons { display:flex; justify-content:center; margin-top:20px; }
#paginationButtons .btn { min-width:80px; }

/* === Footer === */
footer { flex-shrink:0; background-color:#fff; color:#333; padding:40px 0; box-shadow:0 -4px 12px rgba(0,0,0,0.08); }
footer a { color:#0d6efd; text-decoration:none; }
footer a:hover { text-decoration:underline; }

/* === Responsive === */
@media(max-width:992px){
  #shopContainer { flex-direction:column; }
  .product-row { flex-direction:column; align-items:flex-start; }
  .product-image { width:100%; height:250px; margin-bottom:15px; }
  #horizontalCategoryMenu { margin-top:10px; overflow-x:auto; padding-bottom:5px; }
}


@media (max-width: 767.98px) {
  .product-details.flex-grow-1 {
    flex: 0 0 auto !important;  /* prevent stretching */
    max-width: 520px !important; /* cap width */
    width: 100% !important;
    margin: 0 auto !important;   /* center on mobile */
  }

  .star-rating {
  font-size: 1.5rem; /* increase size as needed */
  line-height: 1;    /* optional: tighter spacing */
}

    #filterSidebar {
    max-height: none;       /* remove max-height */
    overflow-y: visible;    /* show all content */
    flex: 1 1 auto;         /* allow flexible width if needed */
    padding: 15px;          /* optional: smaller padding for mobile */
  }

  .btn-add-cart {
    width: 90%;       /* 90% width on mobile */
    margin-left: 1%;  /* push it slightly to the left */
    margin-right: 0;  /* remove right auto margin */
  }

}


/* ================== Mobile Styles ================== */
@media (max-width: 520px) {
  /* Filter Sidebar */
  #filterSidebar {
    position: fixed;
    top: 0;
    left: -100%;
    width: 80%;
    height: 100%;
    background: #fff;
    z-index: 1050;
    padding: 20px;
    overflow-y: auto;
    box-shadow: 2px 0 15px rgba(0,0,0,0.2);
    transition: left 0.3s ease-in-out;
  }

  #filterSidebar.active {
    left: 0;
  }

  #filterSidebar h5 {
    font-size: 1.1rem;
    margin-bottom: 10px;
    cursor: pointer;
    font-weight: 600;
  }

  #filterSidebar .filter-section {
    margin-bottom: 20px;
    border-bottom: 1px solid #eee;
    padding-bottom: 10px;
  }

  /* Filter Toggle Button */
  #filterToggleBtn {
    display: block;
    margin: 10px auto;
    font-size: 1rem;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid #ddd;
    background-color: #fff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.1);
    text-align: center;
    font-weight: 500;
    cursor: pointer;
    z-index: 1052;
  }

  /* Optional overlay behind sidebar */
  #filterOverlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.4);
    display: none;
    z-index: 1040;
  }

  #filterOverlay.active {
    display: block;
  }

   .product-row {
    flex-direction: row !important; /* image left, details right */
    align-items: flex-start !important;
    gap: 10px !important;
    padding: 8px !important;
    width: 100% !important;
    box-sizing: border-box;
  }

 .product-row {
    display: flex;
    flex-direction: row;
    align-items: flex-start;  /* prevents stretching */
    gap: 12px;
    padding: 8px;
    width: 100%;
    max-width: 100%;          /* prevent overflow */
    box-sizing: border-box;
}



.product-image {
    width: 100px;
    height: 140px;     /* must be fixed */
    overflow: hidden;  /* clip any extra */
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
}

.product-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain !important;  /* keeps full image visible */
}

  .product-details {
    flex-grow: 1 !important;
    display: flex !important;
    flex-direction: column !important;
    justify-content: space-between !important;
    width: calc(100% - 110px) !important; /* leaves space for image + gap */
    min-width: 0; /* important for ellipsis */
       background: transparent;  /* remove background */
    gap: 2px !important;
       box-sizing: border-box;
  border: none;        /* remove border */
  background: none;    /* remove background */
  box-shadow: none;    /* remove shadow */
  }

  .product-details h5 {
    font-size: 0.95rem !important;
    font-weight: 600 !important;
    margin: 0 !important;
    line-height: 1.2 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important; /* max 2 lines */
    -webkit-box-orient: vertical !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: normal !important;
    word-break: break-word; /* break long words if needed */
  }

  .product-details .star-rating,
  .product-details .price,
  .btn-add-cart {
    width: 100% !important;
  }

  .btn-add-cart {
    font-size: 0.85rem !important;
    padding: 6px 8px !important;
    margin-top: 4px !important;
    width: fit-content !important; /* button adjusts to content */
  }
}



