/**
Alhadil Beauty - Shop Page Styles
*/

/* Shop Section */
.shop-section {
  padding: 0 0 80px;
}

/* Mobile Filter Toggle Button */
.btn-filter {
  background-color: var(--secondary-color);
  color: var(--text-color-light);
  padding: 12px 20px;
  border-radius: 5px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
}

.btn-filter:hover {
  background-color: var(--primary-color);
  color: var(--text-color-light);
  transform: translateY(-2px);
}

.btn-filter i {
  font-size: 1.1rem;
}

/* Shop Sidebar */
.shop-sidebar {
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  padding: 25px;
  margin-bottom: 30px;
  border: 1px solid var(--border-color);
}

.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 15px;
  border-bottom: 1px solid var(--border-color);
}

.sidebar-header h3 {
  color: var(--text-color-light);
  font-size: 1.4rem;
  margin-bottom: 0;
}

.close-sidebar {
  background: none;
  border: none;
  color: var(--text-color-light);
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.3s ease;
}

.close-sidebar:hover {
  color: var(--secondary-color);
}

.filter-group {
  margin-bottom: 25px;
  border-bottom: 1px solid var(--border-color);
  padding-bottom: 20px;
}

.filter-group:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.filter-group h4 {
  color: var(--text-color-light);
  font-size: 1.1rem;
  margin-bottom: 15px;
  font-weight: 600;
}

.filter-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.filter-list li {
  margin-bottom: 10px;
}

.filter-item {
  display: flex;
  align-items: center;
  color: rgba(255, 255, 255, 0.8);
  cursor: pointer;
  transition: all 0.3s ease;
  user-select: none;
  font-size: 0.95rem;
}

.filter-item input[type="checkbox"],
.filter-item input[type="radio"] {
  margin-right: 10px;
  cursor: pointer;
  accent-color: var(--secondary-color);
}

.filter-item:hover {
  color: var(--secondary-color);
}

/* Product Name Filter */
.product-name-filter {
  margin-bottom: 15px;
}

.product-name-filter input {
  width: 100%;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-color);
  color: var(--text-color-light);
  padding: 8px 12px;
  border-radius: 5px;
}

.product-name-filter input:focus {
  outline: none;
  border-color: var(--secondary-color);
}

.product-name-filter input::placeholder {
  color: rgba(255, 255, 255, 0.5);
}

/* Price Slider */
.price-slider-container {
  padding: 10px 5px 5px;
}

#priceSlider {
  height: 6px;
  background: rgba(255, 255, 255, 0.2);
  border: none;
  border-radius: 3px;
  margin-bottom: 20px;
}

.noUi-connect {
  background: var(--secondary-color);
}

.noUi-handle {
  width: 18px !important;
  height: 18px !important;
  border-radius: 50%;
  background: var(--secondary-color);
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.2);
  border: 2px solid var(--text-color-light);
  cursor: pointer;
}

.noUi-handle:before,
.noUi-handle:after {
  display: none;
}

.noUi-tooltip {
  background-color: var(--secondary-color);
  color: var(--text-color-light);
  border: none;
  padding: 5px 8px;
  font-size: 0.8rem;
  border-radius: 3px;
}

.price-inputs {
  display: flex;
  justify-content: space-between;
  gap: 15px;
}

.price-input {
  flex: 1;
}

.price-input label {
  display: block;
  font-size: 0.85rem;
  margin-bottom: 5px;
  color: rgba(255, 255, 255, 0.7);
}

/* Hide up/down arrows for number inputs */
input.no-spinner::-webkit-inner-spin-button,
input.no-spinner::-webkit-outer-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input.no-spinner {
  -moz-appearance: textfield; /* Firefox */
}

.price-input input {
  width: 100%;
  background-color: rgba(255, 255, 255, 0.1);
  border: 1px solid var(--border-color);
  color: var(--text-color-light);
  padding: 8px 10px;
  border-radius: 5px;
}

.price-input input:focus {
  outline: none;
  border-color: var(--secondary-color);
}

/* Filter Actions - Modified to stack buttons vertically */
.filter-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 25px;
}

.btn-apply,
.btn-reset {
  padding: 10px 15px;
  border-radius: 5px;
  font-size: 0.95rem;
  transition: all 0.3s ease;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  width: 100%; /* Make buttons take full width */
}

.btn-apply {
  background-color: var(--secondary-color);
  color: var(--text-color-light);
  border: none;
}

.btn-apply:hover {
  background-color: var(--primary-color);
  color: var(--text-color-light);
}

.btn-reset {
  background-color: transparent;
  color: var(--text-color-light);
  border: 1px solid var(--border-color);
}

.btn-reset:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: var(--secondary-color);
}

/* Alert Messages */
.alert {
  border-radius: 10px;
  padding: 15px 20px;
  margin-bottom: 20px;
}

.alert-success {
  background-color: rgba(40, 167, 69, 0.1);
  border: 1px solid rgba(40, 167, 69, 0.2);
  color: #28a745;
}

.alert-danger {
  background-color: rgba(220, 53, 69, 0.1);
  border: 1px solid rgba(220, 53, 69, 0.2);
  color: #dc3545;
}

/* Shop Toolbar */
.shop-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 15px 20px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  margin-bottom: 25px;
  border: 1px solid var(--border-color);
}

.product-count {
  color: rgba(255, 255, 255, 0.8);
  font-size: 0.95rem;
}

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
}

.view-switcher {
  display: flex;
  gap: 10px;
}

.view-btn {
  width: 35px;
  height: 35px;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
  border-radius: 5px;
  transition: all 0.3s ease;
}

.view-btn:hover,
.view-btn.active {
  background-color: var(--secondary-color);
  color: var(--text-color-light);
}

.sort-by select {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--text-color-light);
  border: 1px solid var(--border-color);
  padding: 8px 30px 8px 12px;
  border-radius: 5px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
}

.sort-by select:focus {
  outline: none;
  border-color: var(--secondary-color);
}

.sort-by select option {
  background-color: var(--primary-color);
  color: var(--text-color-light);
}

/* Active Filters */
.active-filters {
  margin-bottom: 25px;
  padding: 10px 15px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 8px;
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 10px;
  border: 1px solid var(--border-color);
}

.active-filters span {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
  margin-right: 5px;
}

.filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-tag {
  display: inline-flex;
  align-items: center;
  background-color: rgba(210, 133, 153, 0.2);
  color: var(--secondary-color);
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 0.85rem;
  transition: all 0.3s ease;
}

.filter-tag i {
  margin-left: 5px;
}

.filter-tag:hover {
  background-color: var(--secondary-color);
  color: var(--text-color-light);
}

.filter-tag.clear-all {
  background-color: rgba(255, 255, 255, 0.1);
  color: rgba(255, 255, 255, 0.7);
}

.filter-tag.clear-all:hover {
  background-color: var(--secondary-color);
  color: var(--text-color-light);
}

/* Product Container */
.product-container {
  margin-bottom: 30px;
}

/* Grid View (Default) */
.grid-view-active .product-description,
.grid-view-active .list-view-actions {
  display: none;
}

.grid-view-active .product-item {
  margin-bottom: 30px;
}

/* List View */
.list-view-active .row {
  margin-bottom: 30px;
}

.list-view-active .product-item {
  width: 100%;
  max-width: 100%;
  flex: 0 0 100%;
  margin-bottom: 20px;
}

.list-view-active .product-card {
  display: flex;
  flex-direction: row;
  align-items: center;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  border: 1px solid var(--border-color);
  overflow: hidden;
}

.list-view-active .product-image {
  width: 30%;
  position: relative;
  padding-top: 0;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.list-view-active .product-image img,
.list-view-active .product-image svg {
  max-width: 100%;
  max-height: 180px;
  object-fit: contain;
}

.list-view-active .product-info {
  width: 70%;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

.list-view-active .product-title {
  font-size: 1.2rem;
  margin-bottom: 10px;
}

.list-view-active .product-price {
  margin-bottom: 15px;
}

.list-view-active .product-description {
  display: block;
  margin: 15px 0;
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.95rem;
  line-height: 1.5;
}

.list-view-active .list-view-actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.list-view-active .product-actions {
  display: none;
}

.btn-add-to-cart,
.btn-view-details {
  padding: 8px 15px;
  border-radius: 5px;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.btn-add-to-cart {
  background-color: var(--secondary-color);
  color: var(--text-color-light);
  border: none;
}

.btn-add-to-cart:hover {
  background-color: var(--primary-color);
  color: var(--text-color-light);
}

.btn-view-details {
  background-color: transparent;
  color: var(--text-color-light);
  border: 1px solid var(--border-color);
}

.btn-view-details:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: var(--secondary-color);
}

/* Product Card */
.product-card {
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  overflow: hidden;
  box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  height: 100%;
  border: 1px solid var(--border-color);
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.product-image {
  position: relative;
  padding-top: 100%;
  overflow: hidden;
}

.product-image img,
.product-image svg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: all 0.5s ease;
}

.product-card:hover .product-image img {
  transform: scale(1.05);
}

.product-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 5px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
  z-index: 2;
}

.product-badge.new {
  background-color: #17a2b8;
  color: var(--text-color-light);
}

.product-badge.sale {
  background-color: #dc3545;
  color: var(--text-color-light);
  top: 40px; /* Position below new badge */
}

.product-badge.bestseller {
  background-color: var(--secondary-color);
  color: var(--text-color-light);
  top: 70px; /* Position below sale badge */
}

.product-actions {
  position: absolute;
  bottom: -50px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: center;
  gap: 10px;
  padding: 10px;
  background-color: rgba(0, 0, 0, 0.5);
  transition: all 0.3s ease;
}

.product-card:hover .product-actions {
  bottom: 0;
}

.action-btn {
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background-color: var(--secondary-color);
  color: var(--text-color-light);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
  border: none;
  cursor: pointer;
  font-size: 0.9rem;
}

.action-btn:hover,
.action-btn:focus {
  background-color: var(--primary-color);
  color: var(--text-color-light);
  transform: translateY(-3px);
}

/* Wishlist button specific styles */
.action-btn.wishlist-btn.in-wishlist {
  background-color: #dc3545;
}

.action-btn.wishlist-btn.in-wishlist i {
  color: var(--text-color-light);
}

.action-btn.active {
  background-color: #dc3545;
}

.action-btn.adding {
  animation: pulse 1s infinite;
}

@keyframes pulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.1);
  }
  100% {
    transform: scale(1);
  }
}

.product-info {
  padding: 15px;
}

.product-title {
  font-size: 1rem;
  margin-bottom: 10px;
  font-weight: 600;
  height: 40px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.product-title a {
  color: var(--text-color-light);
  text-decoration: none;
  transition: color 0.3s ease;
}

.product-title a:hover {
  color: var(--secondary-color);
}

.product-price {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.price,
.price-new {
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--secondary-color);
}

.price-old {
  font-size: 0.9rem;
  color: rgba(255, 255, 255, 0.5);
  text-decoration: line-through;
}

/* No Products Found */
.no-products {
  text-align: center;
  padding: 50px 20px;
  background-color: rgba(255, 255, 255, 0.05);
  border-radius: 10px;
  border: 1px solid var(--border-color);
}

.no-products i {
  font-size: 3rem;
  color: var(--secondary-color);
  margin-bottom: 20px;
  opacity: 0.8;
}

.no-products h3 {
  color: var(--text-color-light);
  font-size: 1.5rem;
  margin-bottom: 10px;
}

.no-products p {
  color: rgba(255, 255, 255, 0.7);
  margin-bottom: 20px;
}

.btn-outline {
  background-color: transparent;
  border: 1px solid var(--secondary-color);
  color: var(--secondary-color);
  padding: 10px 25px;
  border-radius: 30px;
  transition: all 0.3s ease;
  display: inline-block;
}

.btn-outline:hover {
  background-color: var(--secondary-color);
  color: var(--text-color-light);
}

/* Pagination */
.pagination-container {
  margin-top: 40px;
  display: flex;
  justify-content: center;
}

.pagination {
  display: flex;
  padding-left: 0;
  list-style: none;
  gap: 5px;
}

.page-item .page-link {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255, 255, 255, 0.8);
  background-color: rgba(255, 255, 255, 0.05);
  border: 1px solid var(--border-color);
  border-radius: 5px;
  font-size: 0.9rem;
  transition: all 0.3s ease;
}

.page-item .page-link:hover {
  background-color: rgba(255, 255, 255, 0.1);
  color: var(--secondary-color);
  border-color: var(--secondary-color);
}

.page-item.active .page-link {
  background-color: var(--secondary-color);
  color: var(--text-color-light);
  border-color: var(--secondary-color);
}

.page-item.disabled .page-link {
  color: rgba(255, 255, 255, 0.4);
  pointer-events: none;
  background-color: rgba(255, 255, 255, 0.02);
}

/* Sidebar Overlay */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}

.sidebar-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Responsive Styles */
@media (max-width: 1199px) {
  .shop-toolbar {
    flex-wrap: wrap;
  }

  .toolbar-left,
  .toolbar-right {
    width: 100%;
  }

  .toolbar-right {
    margin-top: 10px;
    justify-content: flex-end;
  }

  .product-card {
    height: 100%;
  }
}

@media (max-width: 991px) {
  .shop-sidebar {
    position: fixed;
    top: 0;
    left: -300px;
    width: 280px;
    height: 100%;
    z-index: 1050;
    overflow-y: auto;
    background-color: var(--primary-color);
    border-radius: 0;
    box-shadow: 5px 0 15px rgba(0, 0, 0, 0.2);
    transition: left 0.3s ease;
    padding-top: 60px;
  }

  .shop-sidebar.active {
    left: 0;
  }

  .close-sidebar {
    position: absolute;
    top: 15px;
    right: 15px;
  }

  /* Force grid view on mobile and hide list view */
  .product-container {
    display: block !important;
  }

  .product-container.list-view-active {
    display: block !important;
  }

  .list-view-active .product-card {
    display: block !important;
    flex-direction: unset !important;
  }

  .list-view-active .product-image,
  .list-view-active .product-info {
    width: 100% !important;
  }

  .list-view-active .product-image {
    height: auto !important;
    padding-top: 100% !important;
  }

  .list-view-active .product-description,
  .list-view-active .list-view-actions {
    display: none !important;
  }
}

@media (max-width: 767px) {
  .toolbar-right {
    flex-wrap: wrap;
    gap: 10px;
  }

  .sort-by {
    width: 100%;
  }

  .sort-by select {
    width: 100%;
  }

  /* Hide view switcher on mobile */
  .view-switcher {
    display: none !important;
  }

  .active-filters {
    flex-direction: column;
    align-items: flex-start;
  }

  .pagination .page-item:nth-child(n + 4):nth-child(-n + 7) {
    display: none;
  }
}

/* Mobile specific styles for 2 products per row */
@media (max-width: 575px) {
  .shop-toolbar {
    padding: 10px 15px;
  }

  .product-count {
    font-size: 0.85rem;
  }

  .filter-tag {
    font-size: 0.8rem;
    padding: 4px 8px;
  }

  /* Make product cards adapt better for 2 products per row on mobile */
  .product-card {
    height: 100%;
  }

  .product-title {
    font-size: 0.9rem;
    height: 36px;
    -webkit-line-clamp: 2;
  }

  .product-price {
    font-size: 0.95rem;
  }

  .price,
  .price-new {
    font-size: 1rem;
  }

  .price-old {
    font-size: 0.85rem;
  }

  .product-info {
    padding: 10px;
  }

  .product-badge {
    font-size: 0.65rem;
    padding: 3px 8px;
  }

  .action-btn {
    width: 30px;
    height: 30px;
    font-size: 0.8rem;
  }

  .pagination .page-item .page-link {
    width: 35px;
    height: 35px;
    font-size: 0.85rem;
  }
}

/* Fix for select options in dark mode */
#sortProducts option,
select.form-select option {
  background-color: #333 !important;
  color: white !important;
  padding: 8px 12px;
}
