/* Specialty Products (Cardiology) - Improved Responsive Design */

/* CSS Variables */
:root {
  --primary-blue: #34588f;
  --dark-blue: #2b4a7a;
  --light-gray: #f9f9f9;
  --medium-gray: #666;
  --border-gray: #ddd;
  --white: #ffffff;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 4px 12px rgba(0, 0, 0, 0.2);
  --warning-yellow: #ffc107;
  --danger-red: #e74c3c;
  --radius-sm: 5px;
  --radius-md: 10px;
  --radius-lg: 25px;
  --radius-full: 50%;
  --transition: all 0.3s ease;
  --container-max: 1200px;
}

/* Header Styles */
.header {
  background-color: var(--white);
  padding: clamp(0.75rem, 2vw, 1rem) 0;
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-container {
  max-width: var(--container-max);
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 clamp(1rem, 3vw, 1.25rem);
  gap: 1rem;
}

.logo img {
  height: clamp(32px, 5vw, 40px);
  width: auto;
}

.main-nav ul {
  display: flex;
  list-style: none;
  gap: clamp(0.75rem, 2vw, 1.25rem);
  margin: 0;
  padding: 0;
}

.main-nav a {
  text-decoration: none;
  color: #333;
  font-weight: 500;
  font-size: clamp(0.875rem, 1.5vw, 1rem);
  transition: color 0.2s ease;
}

.main-nav a:hover {
  color: var(--primary-blue);
}

.header-buttons {
  display: flex;
  gap: clamp(0.5rem, 1.5vw, 0.625rem);
}

.btn {
  padding: clamp(0.5rem, 1.5vw, 0.625rem) clamp(1rem, 2.5vw, 1.25rem);
  border-radius: var(--radius-lg);
  text-decoration: none;
  font-weight: 600;
  font-size: clamp(0.875rem, 1.5vw, 1rem);
  transition: var(--transition);
  white-space: nowrap;
  border: 2px solid transparent;
}

.call-us {
  background-color: var(--primary-blue);
  color: var(--white);
  border-color: var(--primary-blue);
}

.call-us:hover {
  background-color: var(--dark-blue);
  border-color: var(--dark-blue);
  transform: translateY(-2px);
}

.login {
  background-color: transparent;
  color: var(--primary-blue);
  border: 2px solid var(--primary-blue);
}

.login:hover {
  background-color: var(--primary-blue);
  color: var(--white);
}

/* Main Container Layout */
.main-container {
  max-width: var(--container-max);
  margin: clamp(1.5rem, 3vw, 2.5rem) auto;
  padding: 0 clamp(1rem, 3vw, 1.25rem);
  display: grid;
  grid-template-columns: minmax(200px, 250px) 1fr;
  gap: clamp(1.5rem, 3vw, 2rem);
}

/* Sidebar */
.sidebar {
  background-color: var(--white);
  border-radius: var(--radius-md);
  padding: clamp(1rem, 2.5vw, 1.25rem);
  height: fit-content;
  position: sticky;
  top: 80px;
  box-shadow: var(--shadow-sm);
}

.product-grid {
  min-width: 0;
}

/* Filter Sidebar */
.filter-section h3 {
  color: var(--primary-blue);
  margin-bottom: clamp(1rem, 2vw, 1.25rem);
  font-size: clamp(1rem, 2vw, 1.125rem);
  font-weight: 600;
}

.filter-group {
  margin-bottom: clamp(1.25rem, 2.5vw, 1.5rem);
  padding-bottom: clamp(1rem, 2vw, 1.25rem);
  border-bottom: 1px solid #f0f0f0;
}

.filter-group:last-of-type {
  border-bottom: none;
}

.filter-group h4 {
  margin-bottom: clamp(0.625rem, 1.5vw, 0.75rem);
  color: var(--medium-gray);
  font-size: clamp(0.875rem, 1.5vw, 0.938rem);
  font-weight: 600;
}

.filter-options {
  display: flex;
  flex-direction: column;
  gap: clamp(0.5rem, 1vw, 0.625rem);
}

.filter-options label {
  display: flex;
  align-items: center;
  gap: clamp(0.5rem, 1vw, 0.625rem);
  cursor: pointer;
  font-size: clamp(0.875rem, 1.5vw, 0.938rem);
  transition: color 0.2s ease;
}

.filter-options label:hover {
  color: var(--primary-blue);
}

.filter-options input[type="checkbox"] {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--primary-blue);
}

.price-slider {
  height: 4px;
  background-color: var(--border-gray);
  border-radius: 2px;
  margin: clamp(0.75rem, 1.5vw, 1rem) 0;
  position: relative;
  cursor: pointer;
}

.price-slider::after {
  content: "";
  position: absolute;
  left: 30%;
  top: -4px;
  width: 12px;
  height: 12px;
  background-color: var(--primary-blue);
  border-radius: var(--radius-full);
  cursor: grab;
}

.apply-filters {
  background-color: var(--primary-blue);
  color: var(--white);
  border: none;
  padding: clamp(0.625rem, 1.5vw, 0.75rem);
  border-radius: var(--radius-sm);
  width: 100%;
  cursor: pointer;
  font-weight: 600;
  font-size: clamp(0.875rem, 1.5vw, 1rem);
  transition: var(--transition);
}

.apply-filters:hover {
  background-color: var(--dark-blue);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* Product Grid */
.product-sort {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: clamp(1rem, 2vw, 1.25rem);
  flex-wrap: wrap;
  gap: 1rem;
}

.product-sort h2 {
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
  color: #333;
  margin: 0;
}

.sort-options select {
  padding: clamp(0.5rem, 1.5vw, 0.625rem) clamp(0.75rem, 2vw, 1rem);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-gray);
  font-size: clamp(0.875rem, 1.5vw, 0.938rem);
  cursor: pointer;
  transition: var(--transition);
  background-color: var(--white);
}

.sort-options select:hover,
.sort-options select:focus {
  border-color: var(--primary-blue);
  outline: none;
}

.products {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr));
  gap: clamp(1rem, 2vw, 1.25rem);
  margin-bottom: clamp(1.5rem, 3vw, 2rem);
}

.product-card {
  background-color: var(--white);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  position: relative;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  height: 100%;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.product-image {
  position: relative;
  width: 100%;
  padding-top: 75%;
  background-color: var(--light-gray);
  overflow: hidden;
}

.product-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: clamp(0.75rem, 2vw, 1.25rem);
  transition: transform 0.4s ease;
}

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

.product-info {
  padding: clamp(0.875rem, 2vw, 1rem);
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-info h3 {
  font-size: clamp(0.938rem, 1.8vw, 1rem);
  margin-bottom: clamp(0.5rem, 1vw, 0.625rem);
  line-height: 1.4;
  min-height: 2.8em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-info a {
  text-decoration: none;
  color: #333;
  transition: color 0.2s ease;
}

.product-info a:hover {
  color: var(--primary-blue);
}

.product-desc {
  color: var(--medium-gray);
  font-size: clamp(0.813rem, 1.5vw, 0.875rem);
  margin-bottom: clamp(0.625rem, 1.5vw, 0.75rem);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-price {
  font-weight: 700;
  color: var(--primary-blue);
  margin-bottom: clamp(0.5rem, 1vw, 0.625rem);
  font-size: clamp(1.063rem, 2vw, 1.125rem);
}

.product-rating {
  color: var(--warning-yellow);
  margin-bottom: clamp(0.625rem, 1.5vw, 0.75rem);
  font-size: clamp(0.875rem, 1.5vw, 1rem);
  margin-top: auto;
}

.add-to-cart {
  background-color: var(--primary-blue);
  color: var(--white);
  border: none;
  padding: clamp(0.625rem, 1.5vw, 0.75rem) clamp(0.875rem, 2vw, 1rem);
  border-radius: var(--radius-sm);
  cursor: pointer;
  width: 100%;
  font-weight: 600;
  font-size: clamp(0.875rem, 1.5vw, 0.938rem);
  transition: var(--transition);
}

.add-to-cart:hover {
  background-color: var(--dark-blue);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

/* Wishlist Button */
.wishlist-container {
  position: absolute;
  top: clamp(0.5rem, 1.5vw, 0.625rem);
  right: clamp(0.5rem, 1.5vw, 0.625rem);
  z-index: 10;
}

.wishlist-form {
  margin: 0;
  padding: 0;
}

.wishlist-btn {
  background-color: rgba(255, 255, 255, 0.95);
  border: none;
  border-radius: var(--radius-full);
  width: clamp(36px, 5vw, 40px);
  height: clamp(36px, 5vw, 40px);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: var(--transition);
  padding: 0;
}

.wishlist-btn:hover {
  transform: scale(1.1);
  box-shadow: var(--shadow-lg);
  background-color: var(--white);
}

.wishlist-btn svg {
  color: var(--medium-gray);
  transition: color 0.3s ease;
  width: clamp(18px, 3vw, 20px);
  height: clamp(18px, 3vw, 20px);
}

.wishlist-btn:hover svg {
  color: var(--danger-red);
}

.wishlist-btn.in-wishlist svg {
  color: var(--danger-red);
}

@keyframes heartPop {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.3);
  }
  100% {
    transform: scale(1);
  }
}

.wishlist-btn.animating {
  animation: heartPop 0.3s ease;
}

.wishlist-btn.loading {
  opacity: 0.6;
  pointer-events: none;
}

/* Load More Button */
.load-more {
  background-color: var(--primary-blue);
  color: var(--white);
  border: none;
  padding: clamp(0.75rem, 2vw, 0.938rem) clamp(1.5rem, 3vw, 2rem);
  border-radius: var(--radius-lg);
  cursor: pointer;
  display: block;
  margin: 0 auto;
  font-weight: 600;
  font-size: clamp(0.938rem, 1.8vw, 1rem);
  transition: var(--transition);
}

.load-more:hover {
  background-color: var(--dark-blue);
  transform: translateY(-2px);
  box-shadow: var(--shadow-sm);
}

.product-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 8px 0;
}

.category-tag {
  display: inline-block;
  padding: 4px 10px;
  background-color: #e3f2fd;
  color: #1976d2;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: capitalize;
  text-decoration: none;
  transition: all 0.2s ease;
}

.category-tag:hover {
  background-color: #1976d2;
  color: white;
  transform: translateY(-1px);
}

.price-range-container {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

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

.price-input {
  width: 100%;
  padding: 6px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
}

.price-slider {
  width: 100%;
  height: 6px;
  border-radius: 3px;
  background: #ddd;
  outline: none;
}

.price-slider::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #007bff;
  cursor: pointer;
}

.price-slider::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #007bff;
  cursor: pointer;
  border: none;
}

.apply-price-filter {
  padding: 8px 16px;
  background-color: #617da8;
  color: white;
  border: none;
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
}

.apply-price-filter:hover {
  background-color: #34588f;
}
/* Responsive Design */

/* Large Tablets (≤992px) */
@media (max-width: 992px) {
  .main-container {
    grid-template-columns: minmax(180px, 220px) 1fr;
    gap: 1.25rem;
  }

  .products {
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr));
  }

  .main-nav ul {
    gap: 0.75rem;
  }
}

/* Tablets (≤768px) */
@media (max-width: 768px) {
  .main-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .sidebar {
    position: static;
    order: -1;
  }

  .filter-section h3 {
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
  }

  .filter-section h3::after {
    content: "▼";
    font-size: 0.75rem;
    transition: transform 0.3s ease;
  }

  .filter-section.collapsed h3::after {
    transform: rotate(-90deg);
  }

  .products {
    grid-template-columns: repeat(2, 1fr);
  }

  .main-nav {
    display: none;
  }

  .header-buttons .btn {
    padding: 0.5rem 1rem;
    font-size: 0.875rem;
  }
}

/* Mobile (≤576px) */
@media (max-width: 576px) {
  .products {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.75rem;
  }

  .product-sort {
    flex-direction: column;
    align-items: stretch;
  }

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

  .header-container {
    flex-wrap: wrap;
  }

  .header-buttons {
    width: 100%;
    justify-content: space-between;
  }

  .header-buttons .btn {
    flex: 1;
  }
}

/* Small Mobile (≤480px) */
@media (max-width: 480px) {
  .products {
    grid-template-columns: 1fr;
  }

  .product-image {
    padding-top: 85%;
  }
}

/* Extra Small Devices (≤360px) */
@media (max-width: 360px) {
  .header-buttons {
    flex-direction: column;
    gap: 0.5rem;
  }

  .header-buttons .btn {
    width: 100%;
  }
}

/* Print Styles */
@media print {
  .header,
  .sidebar,
  .wishlist-btn,
  .add-to-cart,
  .load-more,
  .filter-section {
    display: none;
  }

  .main-container {
    grid-template-columns: 1fr;
  }

  .products {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }

  .product-card {
    box-shadow: none;
    border: 1px solid #ddd;
    break-inside: avoid;
  }
}
