/* Products grid container */
#products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
  margin: 1rem 0;
  min-height: 200px;
}

/* List view mode */
.product-list-item {
  display: flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.5rem;
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--white);
  transition: all 0.3s ease;
  margin-bottom: 1rem;
  box-shadow: 0 2px 8px var(--shadow-color);
}

.product-list-item:hover {
  box-shadow: 0 8px 24px var(--shadow-color);
  transform: translateY(-2px);
  border-color: var(--primary-color);
}

.product-list-item .thumb {
  flex: 0 0 180px;
  position: relative;
  overflow: hidden;
  border-radius: 10px;
}

.product-list-item .thumb img {
  width: 100%;
  height: 140px;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.product-list-item:hover .thumb img {
  transform: scale(1.05);
}

.product-list-item .info {
  flex: 1;
  padding: 0.5rem 0;
  display: flex;
  flex-direction: column;
}

.product-list-item .name {
  font-size: 1.25rem;
  font-weight: 600;
  margin: 0 0 0.75rem;
  color: var(--secondary-color1);
}

.product-list-item .price {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.75rem;
}

.product-list-item .desc {
  font-size: 0.95rem;
  color: var(--gray);
  line-height: 1.5;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-list-item .actions {
  display: flex;
  gap: 0.5rem;
  width: 100%;
  flex: 1;
}

/* Product list item uses button.css styles */
.product-list-item .btn {
  flex: 1 1 auto;
  padding: 0.4rem 0.3rem;
  font-size: 0.8rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Card view mode */
.product-card {
  border: 1px solid var(--border-color);
  border-radius: 12px;
  background: var(--white);
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px var(--shadow-color);
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 12px 28px var(--shadow-color);
  border-color: var(--primary-color);
}

.product-card .thumb {
  position: relative;
  overflow: hidden;
}

.product-card .thumb img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform 0.5s ease;
}

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

.product-card .info {
  padding: 1.25rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.product-card .name {
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0 0 0.5rem;
  color: var(--secondary-color1);
}

.product-card .price {
  font-size: 1rem;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 0.75rem;
}

.product-card .actions {
  display: flex;
  gap: 0.5rem;
  margin-top: 1rem;
  width: 100%;
  flex: 1;
}

/* Product card uses button.css styles */
.product-card .btn {
  flex: 1 1 auto;
  padding: 0.4rem 0.3rem;
  font-size: 0.8rem;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* Out of stock styles */
.product-card.out-of-stock,
.product-list-item.out-of-stock {
  opacity: 0.8;
  filter: grayscale(70%);
}

.product-card.out-of-stock img,
.product-list-item.out-of-stock img {
  filter: grayscale(70%);
}

.related-product-item.out-of-stock {
  opacity: 0.8;
  filter: grayscale(70%);
}

/* Grid view classes */
#products-grid.card-view {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1.5rem;
}

#products-grid.list-view {
  display: block;
}

/* Pagination styles */
#pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin: 1rem 0;
  flex-wrap: wrap;
}

#pagination button,
#pagination span {
  border: 1px solid var(--border-color);
  background: var(--white);
  padding: 0.4rem 0.75rem;
  border-radius: 6px;
  cursor: pointer;
  transition: background 0.2s;
}

#pagination span.pagination-ellipsis {
  cursor: default;
  background: transparent;
  border: none;
}

#pagination button.active,
#pagination button:hover {
  background: var(--primary-color);
  color: var(--white);
  border-color: var(--primary-color);
}

#pagination button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* Loading state - Updated with new loading component */
#products-grid.loading {
  position: relative;
  min-height: 300px;
}

#products-grid.loading::after {
  content: "";
  display: none;
}

#products-grid.loading .loading-overlay {
  display: flex;
}

/* No results and error states */
#products-grid .no-results,
#products-grid .error {
  grid-column: 1/-1;
  text-align: center;
  padding: 2rem;
  color: var(--gray);
}

/* Products Toolbar - Clean Structure */
.products-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: var(--secondary-color1);
  border-radius: var(--radius-lg);
  padding: 1rem 1.5rem;
  margin: 3rem 0 1.5rem;
  box-shadow: var(--shadow-md);
}

/* Mobile Filter Toggle */
.mobile-filter-toggle {
  display: none;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  background: var(--primary-color);
  color: var(--white);
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  font-weight: 500;
  transition: all 0.2s ease;
}

@media (max-width: 768px) {
  .mobile-filter-toggle {
    display: flex;
    flex: 1;
    justify-content: center;
  }
  
  .desktop-filters,
  .view-switch {
    display: none;
  }
}

.mobile-filter-toggle:hover {
  background: var(--primary-hover);
}

/* Desktop Filters */
.desktop-filters {
  display: flex;
  align-items: center;
  gap: 1rem;
  flex: 1;
}

.filter-item {
  display: flex;
  align-items: center;
}

.search-wrapper {
  position: relative;
  width: 100%;
}

.search-icon {
  position: absolute;
  left: 0.75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--gray);
  font-size: 0.9rem;
  z-index: 2;
  pointer-events: none;
}

.search-input,
.desktop-filters select {
  padding: 0.5rem 0.75rem 0.5rem 2.5rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--white);
  font-size: 0.9rem;
  transition: all 0.2s ease;
  width: 100%;
}

.desktop-filters select {
  padding: 0.5rem 0.75rem;
}

.search-input {
  min-width: 200px;
}

.desktop-filters select {
  min-width: 140px;
  cursor: pointer;
}

.search-input:focus,
.desktop-filters select:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(64, 1, 40, 0.1);
}

/* View Switch */
.view-switch {
  display: flex;
  background: rgba(255, 255, 255, 0.1);
  border-radius: var(--radius-md);
  padding: 0.25rem;
}

/* View buttons use unified button.css */

/* Mobile Filter Modal */
.mobile-filter-drawer {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 1000;
  align-items: center;
  justify-content: center;
}

.mobile-filter-drawer.active {
  display: flex;
}

.mobile-filter-content {
  background: var(--white);
  border-radius: 12px;
  width: 90%;
  max-width: 400px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--secondary-color1);
  color: var(--white);
  border-radius: 12px 12px 0 0;
}

.drawer-header h3 {
  margin: 0;
  font-size: 1.1rem;
}

.close-drawer {
  background: none;
  border: none;
  color: var(--white);
  font-size: 1.2rem;
  cursor: pointer;
  padding: 0.25rem;
}

.drawer-content {
  padding: 1rem;
}

.filter-group {
  margin-bottom: 1.5rem;
}

.filter-group label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 500;
  color: var(--text-primary);
  font-size: 0.9rem;
}

.filter-group input,
.filter-group select {
  width: 100%;
  padding: 0.75rem;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 0.9rem;
}

.filter-group .search-wrapper input {
  padding-left: 2.5rem;
}

.mobile-view-switch {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

/* Mobile view buttons use unified button.css */
.mobile-view-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem;
  background: var(--surface-color);
  color: var(--text-primary);
}

.drawer-actions {
  margin-top: 2rem;
  padding-top: 1rem;
}

/* Reset button uses button.css styles with overrides */
.btn-reset {
  width: 100%;
  padding: 0.75rem;
}

/* Overlay */
#toolbar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 999;
}

#toolbar-overlay.active {
  display: block;
}

/* Responsive Styles */
@media (max-width: 768px) {
  .mobile-filter-toggle {
    display: flex;
  }
  
  .desktop-filters,
  .view-switch {
    display: none;
  }
  
  .products-toolbar {
    justify-content: center;
  }
}

  .toolbar-content {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--white);
    z-index: 999;
    flex-direction: column;
    align-items: stretch;
    padding: 0;
    box-shadow: var(--shadow-lg);
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    border-radius: var(--radius-lg);
  }

  .toolbar-content.active {
    max-height: 100vh;
    opacity: 1;
    visibility: visible;
  }

  .toolbar-header-mobile {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1rem;
    border-bottom: 1px solid var(--border-color);
  }

  .toolbar-header-mobile h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
  }

  .close-drawer {
    background: none;
    border: none;
    padding: 0.5rem;
    border-radius: var(--radius-md);
    cursor: pointer;
    color: var(--text-secondary);
    transition: all 0.2s ease;
  }

  .close-drawer:hover {
    background: var(--border-color);
    color: var(--text-primary);
  }

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

  .filter-group label {
    display: block;
    margin-bottom: 0.75rem;
    font-weight: 500;
    color: var(--text-primary);
  }

  .filter-group select {
    width: 100%;
    min-width: unset;
  }

  .filter-actions {
    padding: 1rem;
    border-top: 1px solid var(--border-color);
  }

  .mobile-only {
    display: block;
  }
  
  .mobile-only .view-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    margin-bottom: 0.5rem;
    background: var(--surface-color);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
  }
  
  .mobile-only .view-btn.active {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
  }

  .toolbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
  }

  .toolbar-right .btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: transparent;
  }

  .toolbar-right .btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
  }

  .toolbar-right .view-btn {
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    padding: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: var(--white);
  }

  .toolbar-right .view-btn.active,
  .toolbar-right .view-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    color: var(--white);
  }

  #view-switch-desktop {
    display: none;
  }
}

/* Desktop styles */
@media (min-width: 993px) {
  .toolbar-header-mobile,
  .close-drawer,
  .mobile-only {
    display: none;
  }
  
  .toolbar-content {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 2rem;
    margin-top: 1rem;
  }
  
  .filter-group {
    flex-direction: row;
    align-items: center;
    gap: 0.5rem;
  }
  
  .filter-group label {
    margin-bottom: 0;
    white-space: nowrap;
  }

  .desktop-only {
    display: flex !important;
  }

  .toolbar-right {
    display: flex;
    align-items: center;
    gap: 1rem;
  }

  .toolbar-right .btn {
    padding: 0.75rem 1.5rem;
    border-radius: var(--radius-md);
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
    font-size: 0.9rem;
    color: var(--white);
    border: 1px solid rgba(255, 255, 255, 0.3);
    background: transparent;
  }

  .toolbar-right .btn:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: rgba(255, 255, 255, 0.5);
  }

  .toolbar-left .view-btn {
    border: none;
    background: transparent;
    border-radius: var(--radius-sm);
    padding: 0.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: var(--white);
  }

  .toolbar-left .view-btn.active,
  .toolbar-left .view-btn:hover {
    background: rgba(255, 255, 255, 0.2);
  }

  /* Ensure overlay is hidden on desktop */
  .toolbar-overlay {
    display: none !important;
  }
}

/* Responsive adjustments */
@media (max-width: 768px) {
  .products-toolbar {
    margin: 1rem 0;
  }

  .action-buttons {
    flex-direction: column;
  }

  /* Force list view on mobile */
  #products-grid {
    display: block !important;
  }

  .product-card {
    display: flex !important;
    flex-direction: column;
    margin-bottom: 1rem;
  }

  .product-card .thumb img {
    height: 150px;
  }

  .product-list-item {
    flex-direction: column;
    text-align: center;
    gap: 1rem;
  }

  .product-list-item .thumb {
    flex: 0 0 auto;
    width: 100%;
    max-width: 300px;
    margin: 0 auto;
  }

  .product-list-item .actions {
    display: flex;
    gap: 0.5rem;
    width: 100%;
  }

  .product-list-item .btn {
    flex: 1;
    padding: 0.4rem 0.3rem;
    border-radius: 6px;
    font-size: 0.8rem;
    font-weight: 500;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }



  #products-grid.card-view {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
  }
}

/* Products page specific styles */
.products-page {
  max-width: 1200px;
  margin: 30px auto;
  padding: 1rem;
  padding-top: 60px;
}

.products-toolbar {
  margin-top: 60px;
}

/* Ensure toolbar visibility on desktop */
@media (min-width: 769px) {
  .products-toolbar {
    display: flex !important;
    visibility: visible !important;
    opacity: 1 !important;
  }

  /* Hide overlay on desktop */
  .toolbar-overlay {
    display: none !important;
  }
}

.toolbar-overlay.active {
  display: block;
}

/* Additional fix for overlay on resize */
@media (max-width: 992px) {
  .toolbar-overlay.active {
    display: block;
  }

  /* Ensure overlay covers entire screen */
  .toolbar-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 998;
  }
}

/* Hierarchical category tree styles */
.category-option {
  position: relative;
  padding-right: 30px !important;
}

.category-option[data-level="0"] {
  font-weight: 600;
  color: var(--text-primary);
}

.category-option[data-level="1"] {
  color: var(--text-secondary);
  font-size: 0.95em;
}

.category-option[data-level="2"] {
  color: var(--gray);
  font-size: 0.9em;
}

.category-option.has-children {
  font-weight: 500;
}

.category-option.selected {
  background-color: var(--secondary-color1) !important;
  color: var(--secondary-color3) !important;
  font-weight: 600;
}

.category-option.selected::before {
  content: "✓";
  position: absolute;
  right: 10px;
  font-weight: bold;
}

.category-option.child-selected {
  background-color: #f0f9ff !important;
  color: var(--secondary-color3) !important;
}

/* Consistent hover styles for select options */
.products-toolbar select option:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  color: var(--white) !important;
}

.category-option:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  color: var(--white) !important;
}

/* To display a check mark on selected options on mobile */
.filter-group option:checked {
  background-color: #e8f4fd;
  color: var(--secondary-color3);
  font-weight: 600;
}

.filter-group option:hover {
  background: rgba(255, 255, 255, 0.1) !important;
  color: var(--white) !important;
}

/* Modal styles for inquiry options */
.inquiry-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.7);
  z-index: 10000;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.inquiry-modal.active {
  display: flex;
  opacity: 1;
}

.inquiry-modal-content {
  background-color: var(--white);
  border-radius: 12px;
  padding: 2rem;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  transform: translateY(-20px);
  transition: transform 0.3s ease;
  position: relative;
}

.inquiry-modal.active .inquiry-modal-content {
  transform: translateY(0);
}

.inquiry-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-color);
}

.inquiry-modal-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--secondary-color1);
  margin: 0;
}

.inquiry-modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--gray);
  transition: color 0.2s ease;
}

.inquiry-modal-close:hover {
  color: var(--secondary-color1);
}

.inquiry-options {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.inquiry-option {
  display: flex;
  align-items: center;
  padding: 1rem;
  border-radius: 8px;
  background-color: var(--surface-color);
  text-decoration: none;
  color: var(--text-primary);
  transition: all 0.2s ease;
  border: 1px solid transparent;
}

.inquiry-option:hover {
  background-color: var(--primary-color);
  color: var(--white);
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.inquiry-option-icon {
  width: 24px;
  height: 24px;
  margin-right: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
}

.inquiry-option-text {
  font-weight: 500;
}

/* WhatsApp specific style */
.inquiry-option.whatsapp:hover {
  background-color: #25d366;
  color: white;
}

/* Telegram specific style */
.inquiry-option.telegram:hover {
  background-color: #0088cc;
  color: white;
}

/* Responsive adjustments */
@media (max-width: 480px) {
  .inquiry-modal-content {
    width: 95%;
    padding: 1.5rem;
  }

  .inquiry-option {
    padding: 0.75rem;
  }
}

/* ===== ADDITIONAL PRODUCT STYLES FROM OTHER FILES ===== */

/* Discount Styles */
.discount-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: linear-gradient(135deg, #ff4444, #cc0000);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(255, 68, 68, 0.3);
  z-index: 2;
}

.product-card .thumb .discount-badge,
.product-list-item .thumb .discount-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
}

.price-container {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.price-sale {
  font-size: 1.2rem;
  font-weight: bold;
  color: var(--primary-color);
}

.price-original {
  font-size: 1rem;
  color: var(--text-secondary);
  text-decoration: line-through;
}

/* Product Detail Page Discount */
.price-section {
  margin: 1rem 0;
}

.price-section .price-sale {
  font-size: 2rem;
  margin-bottom: 0.5rem;
}

.price-section .price-original {
  font-size: 1.5rem;
  margin-bottom: 0.5rem;
}

.discount-info {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-top: 0.5rem;
}

.discount-badge-large {
  background: linear-gradient(135deg, #ff4444, #cc0000);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 1rem;
  font-weight: bold;
  box-shadow: 0 4px 12px rgba(255, 68, 68, 0.3);
}

.savings {
  background: var(--success);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 600;
}

/* Product Details */
.product-details {
  margin: 1rem 0;
  padding: 1rem;
  background: var(--surface-color);
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

.detail-item {
  margin-bottom: 0.5rem;
  font-size: 0.9rem;
}

.detail-item:last-child {
  margin-bottom: 0;
}

.detail-item strong {
  color: var(--primary-color);
  min-width: 120px;
  display: inline-block;
}

/* Modern Product Gallery */
.product-gallery {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.main-image {
  position: relative;
  background: var(--surface-color);
  border-radius: 12px;
  overflow: hidden;
}

.main-image img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

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

.image-counter {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 0.5rem 1rem;
  border-radius: 20px;
  font-size: 0.9rem;
  font-weight: 500;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 0.5rem;
  max-height: 200px;
  overflow-y: auto;
}

.gallery-item {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all 0.3s ease;
}

.gallery-item:hover {
  border-color: var(--primary-color);
  transform: translateY(-2px);
}

.gallery-item.active {
  border-color: var(--primary-color);
  box-shadow: 0 0 0 2px rgba(64, 1, 40, 0.2);
}

.gallery-item img {
  width: 100%;
  height: 80px;
  object-fit: cover;
}

/* Product Detail Page */
.product-detail {
  padding: 2rem 0;
  background: var(--surface-color);
  min-height: calc(100vh - 80px);
}

.back-navigation {
  margin-bottom: 2rem;
}

.back-btn {
  margin: 0;
}

.product-container {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  background: var(--white);
  border-radius: var(--radius-lg);
  padding: 2rem;
  box-shadow: var(--shadow-md);
  align-items: start;
}

.product-image img {
  width: 100%;
  height: auto;
  max-height: 500px;
  object-fit: cover;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.product-info h1 {
  font-size: 2rem;
  color: var(--text-primary);
  margin-bottom: 1rem;
}

.product-info .description {
  font-size: 1rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin-bottom: 2rem;
}

.product-info .actions {
  display: flex;
  gap: 1rem;
}

/* Related Products Section */
.related-products-section {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-color);
}

.related-products-section h2 {
  font-size: 1.5rem;
  color: var(--text-primary);
  margin-bottom: 1.5rem;
  text-align: center;
}

.related-products-slider {
  position: relative;
  overflow: hidden;
  padding: 0 50px;
}

.related-products-container {
  display: flex;
  gap: 20px;
  transition: transform 0.3s ease;
  touch-action: pan-x;
  user-select: none;
}

.related-product-item {
  flex: 0 0 230px;
  background: var(--white);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
  transition: transform 0.3s ease;
  position: relative;
}

.related-product-item .discount-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: linear-gradient(135deg, #ff4444, #cc0000);
  color: white;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: bold;
  z-index: 2;
}

.related-product-item:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-md);
}

.related-product-item a {
  display: block;
  text-decoration: none;
  color: inherit;
}

.related-product-item img {
  width: 100%;
  height: 150px;
  object-fit: cover;
}

.related-product-item h4 {
  padding: 10px 15px 5px;
  font-size: 0.9rem;
  color: var(--text-primary);
  margin: 0;
}

.related-product-item .price {
  padding: 0 15px 15px;
  font-size: 0.8rem;
  color: var(--primary-color);
  font-weight: bold;
}

.related-product-item .price-container {
  padding: 0 15px 15px;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.related-product-item .price-sale {
  font-size: 0.85rem;
  font-weight: bold;
  color: var(--primary-color);
}

.related-product-item .price-original {
  font-size: 0.75rem;
  color: var(--text-secondary);
  text-decoration: line-through;
}



.slider-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--primary-color);
  color: var(--white);
  border: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  z-index: 2;
  transition: all 0.3s ease;
  display: none;
}

.slider-arrow:hover {
  background: var(--primary-hover);
  transform: translateY(-50%) scale(1.1);
}

.slider-arrow.prev {
  left: 10px;
}

.slider-arrow.next {
  right: 10px;
}

/* Show arrows when they have display: block set by JavaScript */
.slider-arrow[style*="display: block"] {
  display: block !important;
}

/* Additional Product Responsive Styles */
@media (max-width: 768px) {
  .main-image img {
    height: 300px;
  }
  
  .gallery-grid {
    grid-template-columns: repeat(auto-fill, minmax(60px, 1fr));
  }
  
  .gallery-item img {
    height: 60px;
  }
  
  .price-container {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.25rem;
  }
  
  .discount-info {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
  
  .price-section .price-sale {
    font-size: 1.5rem;
  }
  
  .price-section .price-original {
    font-size: 1.2rem;
  }

  .product-container {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 1.5rem;
  }

  .product-info h1 {
    font-size: 1.5rem;
  }

  .product-info .actions {
    flex-direction: column;
  }
}