/* Products Page Specific Styles */
.product-tabs-wrapper {
  margin-bottom: 2rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  /* hide scrollbar */
  scrollbar-width: none;
}
.product-tabs-wrapper::-webkit-scrollbar {
  display: none;
}

.product-tabs {
  display: flex;
  gap: 0.5rem;
  white-space: nowrap;
}

.tab-btn {
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  color: var(--text-secondary);
  border-radius: 30px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: var(--font-heading);
}

.tab-btn:hover {
  background: var(--bg-hover);
  color: var(--text-primary);
}

.tab-btn.active {
  background: var(--primary);
  color: #fff;
  border-color: var(--primary);
  box-shadow: 0 4px 10px rgba(13, 148, 136, 0.3);
}

.category-title {
  margin-bottom: 1.5rem;
  font-size: var(--text-2xl);
  color: var(--text-primary);
  border-bottom: 2px solid var(--primary-light);
  padding-bottom: 0.5rem;
  display: inline-block;
}

.product-category-content {
  display: none;
  animation: fadeIn 0.4s ease;
}

.product-category-content.active {
  display: block;
}

/* Accordion */
.subcategory-accordion {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin-bottom: 2rem;
}

.accordion-item {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
  box-shadow: var(--shadow-sm);
}

.accordion-header {
  width: 100%;
  padding: 1.25rem 1.5rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--bg-card);
  border: none;
  cursor: pointer;
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text-primary);
  font-family: var(--font-heading);
  transition: background 0.3s ease;
}

.accordion-header:hover {
  background: var(--bg-hover);
}

.accordion-header i {
  transition: transform 0.3s ease;
  color: var(--primary);
}

.accordion-item.active .accordion-header i {
  transform: rotate(180deg);
}

.accordion-body {
  display: none;
  padding: 1.5rem;
  border-top: 1px solid var(--border-color);
  background: var(--bg-primary);
}

.accordion-item.active .accordion-body {
  display: block;
  animation: slideDown 0.3s ease;
}

/* Premium Product Card */
.premium-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
  height: 100%;
}

.premium-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
  border-color: var(--primary-light);
}

.card-img {
  width: 100%;
  height: 200px;
  overflow: hidden;
  position: relative;
  background: var(--bg-hover);
}

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

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

.card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1 0 auto; /* Ensure body takes up remaining space */
}

.badge {
  display: inline-block;
  padding: 0.25rem 0.75rem;
  background: var(--primary-light);
  color: var(--primary-dark);
  border-radius: 20px;
  font-size: var(--text-xs);
  font-weight: 600;
  margin-bottom: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  align-self: flex-start;
}

[data-theme='dark'] .badge {
  background: rgba(255, 255, 255, 0.1);
  color: #ffffff;
}

.premium-card h3 {
  font-size: var(--text-lg);
  margin-bottom: 0.5rem;
  color: var(--text-primary);
}

.premium-card p {
  font-size: var(--text-sm);
  color: var(--text-secondary);
  margin-bottom: 1.5rem;
  flex: 1 0 auto; /* Pushes the button to the bottom */
}

/* View More */
.view-more-container {
  text-align: center;
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px dashed var(--border-color);
}

.view-more-btn {
  border-radius: 30px;
  padding: 0.5rem 2rem;
}

/* Modal Improvements */
.modal {
  max-width: 600px;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-xl);
}

.modal-header {
  padding: 1.5rem;
  border-bottom: 1px solid var(--border-color);
  background: var(--bg-card);
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}

.modal-header h3 {
  margin: 0;
  font-size: var(--text-xl);
  color: var(--text-primary);
}

#quote-form {
  padding: 1.5rem;
}

.product-autofill-badge {
  display: inline-flex;
  align-items: center;
  background: var(--bg-hover);
  padding: 0.5rem 1rem;
  border-radius: var(--radius-md);
  margin-bottom: 1.5rem;
  font-weight: 500;
  color: var(--primary);
  border: 1px solid var(--primary-light);
  width: 100%;
}

.product-autofill-badge i {
  margin-right: 0.5rem;
}

/* Consolidated Search Bar Styles moved to the bottom of the file to ensure override */


@keyframes slideDown {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

/* Mobile optimizations */
@media (max-width: 768px) {
  .product-tabs-wrapper {
    margin: 0 -1rem 1.5rem -1rem;
    padding: 0 1rem 0.5rem 1rem;
  }
  
  .accordion-header {
    font-size: var(--text-base);
    padding: 1rem;
  }
  
  .accordion-body {
    padding: 1rem;
  }
  
  .card-img {
    height: 180px;
  }
}
.card-top-icon {
  width: 100%;
  height: 220px; /* Fixed container height */
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px; /* More padding for a premium look */
  background: var(--bg-hover);
  overflow: hidden;
}

.product-card-image {
  width: 100%;
  height: 100%;
  object-fit: contain; /* Requirement: contain within container */
  transition: transform 0.5s ease;
}

.premium-card:hover .product-card-image {
  transform: scale(1.08);
}
.card-top-icon.blue { background: #e0f2fe; color: #0284c7; }
.card-top-icon.green { background: #dcfce7; color: #16a34a; }
.card-top-icon.yellow { background: #fef9c3; color: #ca8a04; }
.card-top-icon.pink { background: #fce7f3; color: #db2777; }
.card-top-icon.purple { background: #f3e8ff; color: #9333ea; }
[data-theme='dark'] .card-top-icon.blue { background: rgba(2, 132, 199, 0.2); }
[data-theme='dark'] .card-top-icon.green { background: rgba(22, 163, 74, 0.2); }
[data-theme='dark'] .card-top-icon.yellow { background: rgba(202, 138, 4, 0.2); }
[data-theme='dark'] .card-top-icon.pink { background: rgba(219, 39, 119, 0.2); }
[data-theme='dark'] .card-top-icon.purple { background: rgba(147, 51, 234, 0.2); }

/* ============================================================
   PILL-SHAPED SEARCH BAR REDESIGN
   This block replaces all previous .search-container, 
   .search-input-wrapper, and #product-search styles.
   ============================================================ */

/* 1. Main Container Reset */
.search-container.centered-search {
    display: flex !important;
    justify-content: center !important;
    margin-bottom: 3.5rem !important;
    background: transparent !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
}

/* 2. The Pill Shape Wrapper */
.search-input-wrapper.with-btn {
    display: flex !important;
    flex-direction: row !important; /* Force horizontal row */
    align-items: center !important;
    background: #ffffff !important;
    border-radius: 50px !important;
    padding: 6px 6px 6px 20px !important;
    border: 1px solid #ddd !important;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.06) !important;
    width: 100% !important;
    max-width: 750px !important;
    position: relative !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.search-input-wrapper.with-btn:focus-within {
    border-color: var(--primary) !important;
    box-shadow: 0 8px 25px rgba(var(--primary-rgb), 0.12) !important;
    transform: translateY(-2px);
}

/* 3. Static Search Icon */
.search-icon {
    position: static !important;
    transform: none !important;
    color: var(--primary) !important;
    font-size: 1.15rem !important;
    margin-right: 15px !important;
    flex-shrink: 0 !important;
    opacity: 0.8;
}

/* 4. Clean Input Field */
#product-search {
    flex-grow: 1 !important;
    border: none !important;
    background: transparent !important;
    padding: 12px 0 !important;
    font-size: 16px !important;
    outline: none !important;
    box-shadow: none !important;
    color: var(--text-primary) !important;
    min-width: 0 !important; /* Vital for flexbox scaling */
    margin: 0 !important;
}

#product-search::placeholder {
    color: var(--text-muted) !important;
    opacity: 0.7;
}

/* 5. Integrated Search Button */
.search-btn {
    background: var(--primary) !important;
    color: #ffffff !important;
    border: none !important;
    border-radius: 40px !important;
    padding: 10px 30px !important;
    font-weight: 600 !important;
    font-size: 15px !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    white-space: nowrap !important;
    flex-shrink: 0 !important;
    margin-left: 10px !important;
    height: auto !important;
    box-shadow: 0 4px 10px rgba(var(--primary-rgb), 0.2) !important;
}

.search-btn:hover {
    background: var(--primary-dark) !important;
    box-shadow: 0 6px 15px rgba(var(--primary-rgb), 0.3) !important;
}

/* 6. Mobile Optimization (Scales down height, maintains pill) */
@media (max-width: 768px) {
    .search-input-wrapper.with-btn {
        padding: 4px 4px 4px 15px !important;
        max-width: 100% !important;
    }
    
    .search-btn {
        padding: 8px 20px !important;
        font-size: 14px !important;
    }
    
    .search-icon {
        margin-right: 10px !important;
        font-size: 1rem !important;
    }
    
    #product-search {
        font-size: 14px !important;
        padding: 8px 0 !important;
    }
}

/* Dark Mode Overrides for Search */
[data-theme='dark'] .search-input-wrapper.with-btn {
    background: var(--bg-secondary) !important;
    border-color: var(--border) !important;
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4) !important;
}

[data-theme='dark'] #product-search {
    color: var(--text-primary) !important;
}


/* Enhancing the Premium Cards */
.premium-card {
  border-radius: 20px !important;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275), box-shadow 0.3s ease !important;
}
.premium-card:hover {
  transform: translateY(-5px) !important;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12) !important;
}

/* Explicitly Appended Fixes for Category Cards, Borders and Tabs */
.premium-card {
  box-shadow: 0 4px 20px rgba(0,0,0,0.05) !important;
  border-radius: 20px !important;
  background: var(--bg-card);
}
.premium-card.border-blue { border: 1px solid #bae6fd !important; }
.premium-card.border-yellow { border: 1px solid #fde68a !important; }
.premium-card.border-pink { border: 1px solid #fbcfe8 !important; }
.premium-card.border-teal { border: 1px solid #a7f3d0 !important; }
.premium-card.border-green { border: 1px solid #bbf7d0 !important; }
.premium-card.border-red { border: 1px solid #fecaca !important; }

/* Category Pastel Backgrounds per the Original Request */
.card-top-icon.blue { background: #e0f2fe !important; color: #0284c7 !important; }
.card-top-icon.yellow { background: #fef3c7 !important; color: #d97706 !important; }
.card-top-icon.pink { background: #fce7f3 !important; color: #db2777 !important; }
.card-top-icon.teal { background: #d1fae5 !important; color: #059669 !important; }
.card-top-icon.green { background: #dcfce7 !important; color: #16a34a !important; }
.card-top-icon.red { background: #fee2e2 !important; color: #dc2626 !important; }

/* Filter Tabs Premium Styling Fixes */
.tab-btn {
  background: transparent !important;
  border: 1px solid #e5e7eb !important;
  color: var(--text-secondary) !important;
  border-radius: 30px !important;
}
.tab-btn:hover {
  background: #f3f4f6 !important;
  color: var(--text-primary) !important;
}
.tab-btn.active {
  background: var(--primary) !important;
  color: #fff !important;
  border-color: var(--primary) !important;
}

[data-theme='dark'] .tab-btn {
  border-color: var(--border-color) !important;
  color: var(--text-muted) !important;
}
[data-theme='dark'] .tab-btn:hover {
  background: var(--bg-hover) !important;
  color: var(--text-primary) !important;
}
[data-theme='dark'] .tab-btn.active {
  background: var(--primary) !important;
  color: #fff !important;
}
[data-theme='dark'] .premium-card.border-blue { border-color: rgba(2, 132, 199, 0.3) !important; }
[data-theme='dark'] .premium-card.border-yellow { border-color: rgba(217, 119, 6, 0.3) !important; }
[data-theme='dark'] .premium-card.border-pink { border-color: rgba(219, 39, 119, 0.3) !important; }
[data-theme='dark'] .premium-card.border-teal { border-color: rgba(5, 150, 105, 0.3) !important; }
[data-theme='dark'] .premium-card.border-green { border-color: rgba(22, 163, 74, 0.3) !important; }
[data-theme='dark'] .premium-card.border-red { border-color: rgba(220, 38, 38, 0.3) !important; }
