:root {
  --primary-color: #007bff;
  --secondary-color: #264653;
  --light-color: #f8f9fa;
  --dark-color: #212529;
}
body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  padding-top: 80px;
  background-color: #f8f9fa;
  line-height: 1.6;
  overflow-x: hidden;
  overflow-y: auto;
}
.main-content {
  padding: 40px 0;
}
.container-fluid {
  padding-left: 15px;
  padding-right: 15px;
  position: relative;
}
.page-title {
  text-align: center;
  margin-bottom: 40px;
  font-weight: 600;
  color: #333;
  animation: fadeInUp 0.8s ease;
}
body.shop-page .navbar .search-container {
  display: none !important;
}

.shop-search-section {
  margin-bottom: 40px;
  animation: fadeInUp 0.8s ease 0.2s both;
  position: relative;
  z-index: 100;
}
.shop-search-container {
  position: relative;
  max-width: 600px;
  margin: 0 auto;
  z-index: 101;
  isolation: isolate;
  box-sizing: border-box;
}
.shop-search-input {
  width: 100%;
  padding: 15px 90px 15px 20px;
  border: 2px solid #e9ecef;
  border-radius: 50px;
  font-size: 1rem;
  transition: all 0.3s ease;
  box-sizing: border-box;
}
.shop-search-input:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}
.shop-search-btn {
  position: absolute;
  right: 45px;
  top: 50%;
  transform: translateY(-50%);
  background: #007bff;
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
}
.shop-search-btn:hover {
  background: #0056b3;
  transform: translateY(-50%) scale(1.05);
}
.shop-search-cancel {
  position: absolute;
  right: 5px;
  top: 50%;
  transform: translateY(-50%);
  background: #dc3545;
  border: none;
  border-radius: 50%;
  width: 35px;
  height: 35px;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  display: none;
}
.shop-search-cancel:hover {
  background: #c82333;
  transform: translateY(-50%) scale(1.05);
}
.shop-search-history {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  z-index: 102;
  max-height: 300px;
  overflow-y: auto;
  display: none;
  animation: slideDown 0.3s ease;
}
.shop-search-history-item {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  cursor: pointer;
  transition: background 0.2s ease;
  border-bottom: 1px solid #f8f9fa;
  background-color: white;
}
.shop-search-history-item:hover {
  background: #f8f9fa;
}
.shop-search-history-item:last-child {
  border-bottom: none;
}
.history-item-image {
  width: 35px;
  height: 35px;
  object-fit: cover;
  border-radius: 5px;
  margin-right: 12px;
  background-color: #f8f9fa;
}
.history-item-text {
  flex: 1;
  font-size: 14px;
  color: #333;
}
.shop-search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: white;
  border: 1px solid #e9ecef;
  border-radius: 10px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  z-index: 102;
  max-height: 300px;
  overflow-y: auto;
  display: none;
  animation: slideDown 0.3s ease;
}
.shop-suggestion-item {
  display: flex;
  align-items: center;
  padding: 12px 15px;
  cursor: pointer;
  transition: background 0.2s ease;
  border-bottom: 1px solid #f8f9fa;
  background-color: white;
}
.shop-suggestion-item:hover {
  background: #f8f9fa;
}
.shop-suggestion-item:last-child {
  border-bottom: none;
}
.suggestion-item-image {
  width: 40px;
  height: 40px;
  object-fit: cover;
  border-radius: 5px;
  margin-right: 12px;
}
.suggestion-item-details {
  flex: 1;
}
.suggestion-item-name {
  font-size: 14px;
  font-weight: 500;
  color: #333;
  margin-bottom: 2px;
}
.suggestion-item-price {
  font-size: 12px;
  color: #007bff;
}
.filter-section {
  background: white;
  border-radius: 10px;
  padding: 25px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
  margin-bottom: 30px;
  animation: fadeInLeft 0.8s ease 0.3s both;
  height: auto;
  max-height: none;
  overflow-y: visible;
  overflow-x: visible;
  position: sticky;
  top: 100px;
  z-index: 0;
}
.filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}
.filter-title {
  font-weight: 600;
  color: #333;
  margin: 0;
}
.clear-filters {
  color: #007bff;
  text-decoration: none;
  font-weight: 500;
  cursor: pointer;
  transition: color 0.3s ease;
  display: none;
}
.clear-filters.show {
  display: inline-block;
}
.clear-filters:hover {
  color: #0056b3;
}
.active-filters {
  margin-bottom: 20px;
}
.filter-tag {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: #f8f9fa;
  padding: 8px 12px;
  border-radius: 6px;
  margin: 8px 0;
  font-size: 0.9rem;
  animation: fadeIn 0.3s ease;
  border: 1px solid #e9ecef;
}
.filter-tag-text {
  flex: 1;
  color: #333;
}
.remove-filter {
  margin-left: 10px;
  cursor: pointer;
  color: #666;
  font-size: 1rem;
  padding: 2px;
  transition: color 0.2s ease;
}
.remove-filter:hover {
  color: #dc3545;
}
.filter-group {
  margin-bottom: 25px;
  border-bottom: 1px solid #000000;
  padding-bottom: 20px;
}
.filter-group:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.filter-group-title {
  font-weight: 600;
  color: #333;
  margin-bottom: 15px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: color 0.3s ease;
  padding: 5px 0;
}
.filter-group-title i {
  transition: transform 0.3s ease;
}
.filter-group-title[aria-expanded="false"] i {
  transform: rotate(-90deg);
}
.filter-group-title[aria-expanded="true"] i {
  transform: rotate(0deg);
}
.filter-options {
  max-height: none;
  overflow-y: visible;
  overflow-x: visible;
  transition: all 0.3s ease;
}
.filter-option {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 2px 0;
}
.filter-option input[type="checkbox"] {
  margin-right: 10px;
  transform: scale(1.2);
}
.filter-option label {
  cursor: pointer;
  margin: 0;
}
.price-range {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}
.price-input {
  flex: 1;
  padding: 8px 12px;
  border: 1px solid #e9ecef;
  border-radius: 5px;
  font-size: 0.9rem;
}
.rating-filter {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  cursor: pointer;
  transition: all 0.2s ease;
  padding: 2px 0;
}
.rating-filter input[type="checkbox"] {
  margin-right: 10px;
  transform: scale(1.2);
}
.rating-stars {
  display: flex;
  gap: 2px;
  margin-right: 8px;
}
.rating-stars i {
  color: #ffc107;
  font-size: 0.9rem;
}
.rating-text {
  font-size: 0.9rem;
  color: #666;
}
.products-section {
  animation: fadeInRight 0.8s ease 0.4s both;
  position: relative;
  z-index: 1;
}
.products-header {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 30px;
  flex-wrap: wrap;
  gap: 15px;
}
.sort-select {
  padding: 8px 15px;
  border: 1px solid #e9ecef;
  border-radius: 5px;
  background: white;
  cursor: pointer;
}
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 25px;
  margin-bottom: 50px;
}
@media (min-width: 1400px) {
  .products-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (min-width: 1200px) and (max-width: 1399px) {
  .products-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
@media (min-width: 992px) and (max-width: 1199px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}
.product-card {
  background: white;
  border-radius: 15px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
  transition: all 0.3s ease;
  animation: fadeInUp 0.6s ease;
  position: relative;
  pointer-events: auto !important;
}
.product-card * {
  pointer-events: none;
}

.product-card {
  pointer-events: auto !important;
}

/* Allow wishlist button to be clickable */
.wishlist-btn,
.wishlist-btn * {
  pointer-events: auto !important;
}
.product-card:hover {
  transform: translateY(-10px);
  box-shadow: 0 15px 30px rgba(0, 0, 0, 0.15);
  cursor: pointer;
}
.product-image {
  position: relative;
  overflow: hidden;
  height: 250px;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.product-card:hover .product-image img {
  transform: scale(1.05);
}
.wishlist-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  z-index: 10;
}

.wishlist-btn:hover {
  background: #dc3545;
  color: white;
  transform: scale(1.1);
}

.wishlist-btn.active {
  background: #dc3545;
  color: white;
}
.product-info {
  padding: 20px;
}
.product-brand {
  color: #666;
  font-size: 0.9rem;
  margin-bottom: 5px;
  text-transform: uppercase;
  letter-spacing: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}
.product-name {
  font-weight: 400;
  color: #333;
  margin-bottom: 15px;
  font-size: 1rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  height: 4.1rem;
  min-height: 4.1rem;
}

.discount-badge {
  background: #ff4444;
  color: white;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 600;
  display: inline-block;
  margin-bottom: 8px;
}
.product-rating {
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  gap: 5px;
}
.product-rating .stars {
  display: flex;
  gap: 2px;
}
.product-rating .stars i {
  color: #ffc107;
  font-size: 0.9rem;
}
.product-rating .rating-text {
  font-size: 0.8rem;
  color: #666;
}
.product-price {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 15px;
}
.price-current {
  font-weight: 700;
  color: #333;
  font-size: 1.2rem;
}
.price-original {
  color: #999;
  text-decoration: line-through;
  font-size: 0.9rem;
  margin-left: 10px;
}
.add-to-cart-btn {
  width: 100%;
  padding: 12px;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.add-to-cart-btn:hover {
  background: #0056b3;
  transform: translateY(-2px);
}
.add-to-cart-btn:active {
  transform: translateY(0);
}
.popup-message {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(100px);
  background: #28a745;
  color: white;
  padding: 15px 25px;
  border-radius: 50px;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
  z-index: 1000;
  opacity: 0;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 10px;
}
.popup-message.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.popup-message.error {
  background: #dc3545;
}
.filter-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1050;
  display: none;
  animation: fadeIn 0.3s ease;
  overflow: hidden;
}
.filter-modal-content {
  position: absolute;
  top: 0;
  right: 0;
  width: 350px;
  max-width: 100%;
  height: 100%;
  background: white;
  padding: 30px;
  overflow-y: auto;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  box-sizing: border-box;
}
.filter-modal.show .filter-modal-content {
  transform: translateX(0);
}
.filter-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 30px;
  padding-bottom: 15px;
  border-bottom: 1px solid #e9ecef;
}
.close-modal {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #666;
  transition: color 0.3s ease;
}
.close-modal:hover {
  color: #333;
}
.mobile-filter-btn {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: #007bff;
  color: white;
  border: none;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  font-size: 1.2rem;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  transition: all 0.3s ease;
  z-index: 1000;
  display: none;
}
.mobile-filter-btn:hover {
  background: #0056b3;
  transform: scale(1.1);
}
@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
@keyframes fadeInLeft {
  from {
    opacity: 0;
    transform: translateX(-30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
@keyframes fadeInRight {
  from {
    opacity: 0;
    transform: translateX(30px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}
@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}
/* Tablet landscape */
@media (max-width: 991px) {
  .filter-section {
    display: none;
  }
  .filter-modal-content .filter-section {
    display: block !important;
    position: relative !important;
    top: 0 !important;
    animation: none !important;
    box-shadow: none;
    padding: 0;
    margin-bottom: 0;
  }
  .mobile-filter-btn {
    display: flex;
    align-items: center;
    justify-content: center;
  }
  .col-lg-9 {
    width: 100%;
    padding-left: 0;
  }
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }
}

/* Tablet portrait */
@media (max-width: 768px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
  }
  .products-header {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }
  .products-header > .d-flex {
    justify-content: center;
  }
  .filter-modal-content {
    width: 85%;
  }
  .main-content {
    padding: 20px 0;
  }
  .shop-search-container {
      max-width: 100%;
      padding: 0;
      margin: 0 10px;
    }
  .pagination-custom {
    flex-direction: column;
    gap: 15px;
    text-align: center;
  }
  .pagination-buttons {
    flex-wrap: wrap;
    justify-content: center;
  }
  .product-image {
    height: 200px;
  }
}

/* Mobile large */
@media (max-width: 576px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }
  .product-info {
    padding: 12px;
  }
  .product-name {
    font-size: 0.9rem;
    height: 3.5rem;
    min-height: 3.5rem;
    -webkit-line-clamp: 2;
  }
  .product-brand {
    font-size: 0.75rem;
  }
  .price-current {
    font-size: 1rem;
  }
  .price-original {
    font-size: 0.8rem;
  }
  .discount-badge {
    font-size: 0.7rem;
    padding: 2px 6px;
  }
  .shop-search-input {
      padding: 12px 75px 12px 15px;
      font-size: 0.9rem;
    }
    .shop-search-btn {
      width: 32px;
      height: 32px;
      right: 38px;
    }
    .shop-search-cancel {
      width: 30px;
      height: 30px;
      right: 5px;
    }
  .container-fluid {
    padding-left: 10px;
    padding-right: 10px;
  }
  .filter-modal-content {
    width: 100%;
    padding: 20px;
  }
  .product-image {
    height: 160px;
  }
  .wishlist-btn {
    width: 30px;
    height: 30px;
    font-size: 0.8rem;
  }
  .product-rating .stars i {
    font-size: 0.75rem;
  }
  .product-rating .rating-text {
    font-size: 0.7rem;
  }
  .page-btn {
    width: 28px;
    height: 28px;
    font-size: 0.85rem;
  }
  .shop-search-section {
    margin-bottom: 25px;
  }
}

/* Mobile small */
@media (max-width: 400px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 8px;
  }
  .product-info {
    padding: 10px;
  }
  .product-name {
    font-size: 0.8rem;
    height: 3rem;
    min-height: 3rem;
  }
  .product-brand {
    font-size: 0.7rem;
    margin-bottom: 3px;
  }
  .price-current {
    font-size: 0.9rem;
  }
  .price-original {
    font-size: 0.7rem;
    margin-left: 5px;
  }
  .product-image {
    height: 140px;
  }
  .product-price {
    margin-bottom: 0;
  }
  .product-rating {
    margin-bottom: 5px;
  }
  .discount-badge {
    font-size: 0.65rem;
    padding: 2px 5px;
    margin-bottom: 5px;
  }
  .mobile-filter-btn {
    width: 50px;
    height: 50px;
    font-size: 1rem;
    bottom: 15px;
    right: 15px;
  }
  .pagination-custom {
    font-size: 12px;
    padding: 8px 10px;
  }
  .page-btn {
    width: 25px;
    height: 25px;
    font-size: 0.75rem;
  }
  .shop-search-container {
      margin: 0 5px;
      padding: 0;
    }
    .shop-search-input {
      padding: 10px 70px 10px 12px;
      font-size: 0.85rem;
    }
    .shop-search-btn {
      width: 28px;
      height: 28px;
      right: 34px;
    }
    .shop-search-cancel {
      width: 26px;
      height: 26px;
      right: 4px;
    }
}

/* Very small screens */
@media (max-width: 320px) {
  .products-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .product-image {
    height: 180px;
  }
  .product-info {
    padding: 12px;
  }
  .product-name {
    font-size: 0.9rem;
    height: auto;
    min-height: auto;
    -webkit-line-clamp: 3;
  }
  .shop-search-container {
    margin: 0 3px;
    padding: 0;
  }
  .shop-search-input {
    padding: 10px 65px 10px 10px;
    font-size: 0.8rem;
  }
  .shop-search-btn {
    width: 26px;
    height: 26px;
    right: 32px;
  }
  .shop-search-cancel {
    width: 24px;
    height: 24px;
    right: 4px;
  }
}
.loading {
  display: none;
  text-align: center;
  padding: 50px;
}
.spinner {
  border: 4px solid #f3f3f3;
  border-top: 4px solid #007bff;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin: 0 auto 20px;
}
@keyframes spin {
  0% {
    transform: rotate(0deg);
  }
  100% {
    transform: rotate(360deg);
  }
}
.pagination-custom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 15px;
  background-color: #fff;
  border-radius: 5px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
  margin-top: 20px;
  font-size: 14px;
  color: #666;
}
.pagination-buttons {
  display: flex;
  align-items: center;
  gap: 5px;
}
.page-btn {
  width: 30px;
  height: 30px;
  border: 1px solid #e0e0e0;
  background-color: #fff;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 500;
  color: #333;
  transition: all 0.3s ease;
}
.page-btn:hover:not(.disabled) {
  background-color: #f0f0f0;
}
.page-btn.active {
  background-color: #dc3545;
  color: #fff;
  border-color: #dc3545;
}
.page-btn.disabled {
  background-color: #f0f0f0;
  color: #ccc;
  cursor: not-allowed;
  border-color: #e0e0e0;
}
.row {
  margin: 0;
  overflow: visible;
}
.col-lg-3 {
  padding-left: 0;
  padding-right: 15px;
  overflow: visible;
}
.col-lg-9 {
  padding-left: 15px;
  padding-right: 0;
  overflow: visible;
}
.container-fluid {
  padding-left: 15px;
  padding-right: 15px;
  overflow: visible;
}
.main-content {
  padding: 40px 0;
  overflow: visible;
}
body.shop-page .search-container {
  display: none !important;
}
