/* ========================================
   MARN Products - CSS Components
   Product-specific styling
======================================== */

/* ========================================
   Page Header
======================================== */
.page-header {
  position: relative;
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  color: var(--text-white);
  padding: calc(70px + var(--space-3xl)) 0 var(--space-3xl);
  overflow: hidden;
}

.header-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image: url('../img/bg2.jpg');
  background-size: cover;
  background-position: center;
  z-index: 0;
}

.header-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    135deg, 
    rgba(0, 121, 107, 0.9) 0%, 
    rgba(44, 62, 80, 0.8) 100%
  );
}

.header-content {
  position: relative;
  z-index: 2;
  text-align: center;
}

.breadcrumb {
  margin-bottom: var(--space-md);
}

.breadcrumb-list {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: var(--space-sm);
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: var(--text-sm);
}

.breadcrumb-list li {
  display: flex;
  align-items: center;
}

.breadcrumb-list li:not(:last-child)::after {
  content: '/';
  margin-left: var(--space-sm);
  opacity: 0.6;
}

.breadcrumb-list a {
  color: rgba(255, 255, 255, 0.8);
  text-decoration: none;
  transition: color var(--transition-fast);
}

.breadcrumb-list a:hover {
  color: var(--text-white);
}

.breadcrumb-list li[aria-current="page"] {
  color: var(--text-white);
  font-weight: 500;
}

.page-title {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 700;
  margin: 0 0 var(--space-md);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.page-subtitle {
  font-size: clamp(1rem, 3vw, 1.25rem);
  font-weight: 300;
  margin: 0 0 var(--space-2xl);
  opacity: 0.9;
  max-width: 800px;
  margin-left: auto;
  margin-right: auto;
  line-height: 1.6;
}

.header-stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: var(--space-xl);
  max-width: 600px;
  margin: 0 auto;
}

.stat-item {
  text-align: center;
}

.stat-number {
  display: block;
  font-family: var(--font-heading);
  font-size: clamp(1.875rem, 4vw, 2.5rem);
  font-weight: 700;
  line-height: 1;
  margin-bottom: var(--space-xs);
}

.stat-label {
  font-size: var(--text-sm);
  opacity: 0.8;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ========================================
   Products Filter
======================================== */
.products-filter {
  background: var(--bg-secondary);
  padding: var(--space-xl) 0;
  border-bottom: 1px solid var(--bg-tertiary);
  position: sticky;
  top: 70px;
  z-index: 100;
}

.filter-controls {
  display: grid;
  gap: var(--space-lg);
  align-items: center;
}

.search-box {
  position: relative;
  max-width: 500px;
  width: 100%;
}

.search-box input {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  padding-right: 50px;
  border: 2px solid var(--bg-tertiary);
  border-radius: var(--border-radius-lg);
  font-size: var(--text-base);
  background: var(--bg-primary);
  transition: all var(--transition-base);
}

.search-box input:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(0, 121, 107, 0.1);
}

.search-btn {
  position: absolute;
  right: var(--space-xs);
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  background: var(--primary-color);
  border: none;
  border-radius: var(--border-radius-md);
  color: var(--text-white);
  cursor: pointer;
  transition: all var(--transition-base);
}

.search-btn:hover {
  background: var(--primary-light);
}

.filter-categories {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
  justify-content: center;
}

.filter-btn {
  padding: var(--space-sm) var(--space-lg);
  background: var(--bg-primary);
  border: 2px solid var(--bg-tertiary);
  border-radius: var(--border-radius-lg);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--text-primary);
  cursor: pointer;
  transition: all var(--transition-base);
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.filter-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.filter-btn.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: var(--text-white);
}

.view-toggle {
  display: flex;
  gap: var(--space-xs);
  justify-self: end;
}

.view-btn {
  width: 45px;
  height: 45px;
  background: var(--bg-primary);
  border: 2px solid var(--bg-tertiary);
  border-radius: var(--border-radius-md);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
}

.view-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
}

.view-btn.active {
  background: var(--primary-color);
  border-color: var(--primary-color);
  color: var(--text-white);
}

/* ========================================
   Products Section
======================================== */
.products-section {
  padding: var(--space-3xl) 0;
}

.products-grid {
  display: grid;
  gap: var(--space-xl);
  grid-template-columns: 1fr;
}

.products-grid.grid-view {
  grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
}

.products-grid.list-view .product-item {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: var(--space-xl);
  align-items: start;
}

.product-item {
  background: var(--bg-primary);
  border-radius: var(--border-radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: all var(--transition-base);
  border: 2px solid transparent;
  position: relative;
}

.product-item:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-xl);
  border-color: var(--primary-light);
}

.product-image {
  position: relative;
  height: 250px;
  overflow: hidden;
  background: var(--bg-secondary);
}

.products-grid.list-view .product-image {
  height: 200px;
}

.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

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

.product-badge {
  position: absolute;
  top: var(--space-sm);
  right: var(--space-sm);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--border-radius-lg);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: 2;
}

.product-badge.popular {
  background: linear-gradient(135deg, #FF6B6B, #FF8E53);
  color: var(--text-white);
}

.product-badge.eco {
  background: linear-gradient(135deg, #4ECDC4, #44A08D);
  color: var(--text-white);
}

.product-badge.safety {
  background: linear-gradient(135deg, #FFE066, #FF6B6B);
  color: var(--text-primary);
}

.product-badge.energy {
  background: linear-gradient(135deg, #FFA726, #FF7043);
  color: var(--text-white);
}

.product-badge.landscape {
  background: linear-gradient(135deg, #66BB6A, #43A047);
  color: var(--text-white);
}

.product-badge.absorbent {
  background: linear-gradient(135deg, #42A5F5, #1E88E5);
  color: var(--text-white);
}

.product-badge.grade1 {
  background: linear-gradient(135deg, #8E24AA, #5E35B1);
  color: var(--text-white);
}

.product-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 121, 107, 0.9);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base);
}

.product-item:hover .product-overlay {
  opacity: 1;
  visibility: visible;
}

.quick-view-btn {
  background: var(--text-white);
  color: var(--primary-color);
  border: none;
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--border-radius-lg);
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  gap: var(--space-xs);
}

.quick-view-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.product-content {
  padding: var(--space-xl);
}

.products-grid.list-view .product-content {
  padding: var(--space-lg);
}

.product-category {
  display: inline-block;
  background: var(--bg-secondary);
  color: var(--primary-color);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--border-radius-lg);
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: var(--space-sm);
}

.product-title {
  font-family: var(--font-heading);
  font-size: var(--text-xl);
  font-weight: 600;
  color: var(--text-primary);
  margin: 0 0 var(--space-sm);
  line-height: 1.3;
}

.products-grid.list-view .product-title {
  font-size: var(--text-2xl);
}

.product-description {
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: var(--space-md);
}

.product-specs {
  background: var(--bg-secondary);
  border-radius: var(--border-radius-md);
  padding: var(--space-md);
  margin-bottom: var(--space-md);
}

.spec-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: var(--text-sm);
  margin-bottom: var(--space-xs);
}

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

.spec-label {
  color: var(--text-secondary);
  font-weight: 500;
}

.spec-value {
  color: var(--text-primary);
  font-weight: 600;
}

.product-applications {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-bottom: var(--space-lg);
}

.app-tag {
  background: linear-gradient(135deg, var(--primary-color), var(--primary-light));
  color: var(--text-white);
  padding: var(--space-xs) var(--space-sm);
  border-radius: var(--border-radius-lg);
  font-size: var(--text-xs);
  font-weight: 500;
  white-space: nowrap;
}

.product-actions {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.product-actions .btn {
  flex: 1;
  min-width: 120px;
}

.btn-outline {
  background: transparent;
  border: 2px solid var(--primary-color);
  color: var(--primary-color);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--border-radius-md);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition-base);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-xs);
  font-size: var(--text-sm);
}

.btn-outline:hover {
  background: var(--primary-color);
  color: var(--text-white);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.products-grid.list-view .product-actions {
  margin-top: var(--space-lg);
}

/* ========================================
   No Results
======================================== */
.no-results {
  text-align: center;
  padding: var(--space-3xl) 0;
  color: var(--text-secondary);
}

.no-results-content i {
  font-size: var(--text-5xl);
  color: var(--bg-tertiary);
  margin-bottom: var(--space-lg);
}

.no-results-content h3 {
  font-family: var(--font-heading);
  font-size: var(--text-2xl);
  color: var(--text-primary);
  margin-bottom: var(--space-sm);
}

.no-results-content p {
  margin-bottom: var(--space-lg);
  font-size: var(--text-lg);
}

/* ========================================
   Contact CTA
======================================== */
.contact-cta {
  background: linear-gradient(135deg, var(--primary-dark), var(--primary-color));
  color: var(--text-white);
  padding: var(--space-3xl) 0;
  position: relative;
  overflow: hidden;
}

.contact-cta::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><defs><pattern id="dots" width="20" height="20" patternUnits="userSpaceOnUse"><circle cx="10" cy="10" r="1" fill="%23ffffff" opacity="0.1"/></pattern></defs><rect width="100" height="100" fill="url(%23dots)"/></svg>');
  pointer-events: none;
}

.cta-content {
  display: grid;
  gap: var(--space-xl);
  align-items: center;
  text-align: center;
  position: relative;
  z-index: 1;
}

.cta-text h2 {
  font-family: var(--font-heading);
  font-size: clamp(1.875rem, 4vw, 2.5rem);
  font-weight: 700;
  margin-bottom: var(--space-md);
}

.cta-text p {
  font-size: var(--text-lg);
  opacity: 0.9;
  line-height: 1.6;
  max-width: 600px;
  margin: 0 auto;
}

.cta-actions {
  display: flex;
  gap: var(--space-md);
  justify-content: center;
  flex-wrap: wrap;
}

.btn-lg {
  padding: var(--space-md) var(--space-xl);
  font-size: var(--text-lg);
}

/* ========================================
   Modal
======================================== */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 9999;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-base, 250ms ease-in-out);
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

.modal-backdrop {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.9);
  backdrop-filter: blur(5px);
}

.modal-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: var(--bg-primary, #ffffff);
  border-radius: var(--border-radius-xl, 1rem);
  box-shadow: var(--shadow-xl, 0 20px 25px -5px rgba(0, 0, 0, 0.3));
  border: 2px solid var(--bg-tertiary, #e9ecef);
  width: 90%;
  max-width: 800px;
  max-height: 90vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  z-index: 10000;
}

.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: var(--space-lg, 2rem) var(--space-xl, 3rem);
  border-bottom: 1px solid var(--bg-tertiary, #e9ecef);
  background: var(--bg-secondary, #f8f9fa);
}

.modal-title {
  font-family: var(--font-heading, 'Montserrat', sans-serif);
  font-size: var(--text-xl, 1.25rem);
  font-weight: 600;
  color: var(--text-primary, #2c3e50);
  margin: 0;
}

.modal-close {
  width: 40px;
  height: 40px;
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: var(--text-lg);
  cursor: pointer;
  border-radius: var(--border-radius-full);
  transition: all var(--transition-base);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-close:hover {
  background: var(--bg-tertiary);
  color: var(--text-primary);
}

.modal-body {
  padding: var(--space-xl, 3rem);
  overflow-y: auto;
  flex: 1;
  background: var(--bg-primary, #ffffff);
}

/* ========================================
   Footer Enhancements
======================================== */
.footer-links {
  display: flex;
  gap: var(--space-lg);
  justify-content: center;
  margin-bottom: var(--space-lg);
}

.footer-links a {
  color: rgba(255, 255, 255, 0.8);
  font-size: var(--text-sm);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--text-white);
}

/* ========================================
   Responsive Design
======================================== */

/* Small devices (576px and up) */
@media (min-width: 576px) {
  .filter-controls {
    grid-template-columns: 1fr auto;
    gap: var(--space-xl);
  }
  
  .search-box {
    justify-self: start;
  }
  
  .filter-categories {
    justify-content: flex-start;
  }
  
  .view-toggle {
    grid-column: 2;
    grid-row: 1;
  }
  
  .cta-content {
    grid-template-columns: 2fr 1fr;
    text-align: left;
  }
  
  .cta-actions {
    justify-content: flex-start;
  }
}

/* Medium devices (768px and up) */
@media (min-width: 768px) {
  .header-stats {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .filter-controls {
    grid-template-columns: 1fr 2fr auto;
    align-items: center;
  }
  
  .filter-categories {
    justify-self: center;
  }
  
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  
  .products-grid.grid-view {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }
  
  .products-grid.list-view {
    grid-template-columns: 1fr;
  }
  
  .products-grid.list-view .product-item {
    grid-template-columns: 250px 1fr;
  }
}

/* Large devices (992px and up) */
@media (min-width: 992px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .products-grid.list-view .product-item {
    grid-template-columns: 300px 1fr;
  }
}

/* Extra large devices (1200px and up) */
@media (min-width: 1200px) {
  .products-grid.grid-view {
    grid-template-columns: repeat(3, 1fr);
  }
  
  .search-box {
    max-width: 700px;
  }
  
  .filter-controls {
    gap: var(--space-2xl, 4rem);
  }
}

/* ========================================
   Mobile Specific Adjustments
======================================== */
@media (max-width: 575px) {
  .page-header {
    padding: calc(70px + var(--space-2xl)) 0 var(--space-2xl);
  }
  
  .header-stats {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
  }
  
  .stat-number {
    font-size: var(--text-xl);
  }
  
  .stat-label {
    font-size: var(--text-xs);
  }
  
  .filter-controls {
    grid-template-columns: 1fr;
    text-align: center;
  }
  
  .search-box {
    max-width: 600px;
  }
  
  .filter-categories {
    justify-content: center;
  }
  
  .view-toggle {
    justify-self: center;
  }
  
  .product-actions {
    flex-direction: column;
  }
  
  .product-actions .btn {
    flex: none;
  }
  
  .cta-actions {
    flex-direction: column;
  }
  
  .modal-content {
    width: 95%;
    max-height: 95vh;
  }
  
  .modal-header {
    padding: var(--space-md);
  }
  
  .modal-body {
    padding: var(--space-md);
  }
  
  .footer-links {
    flex-wrap: wrap;
    gap: var(--space-md);
  }
}

/* ========================================
   Print Styles
======================================== */
@media print {
  .navbar,
  .products-filter,
  .contact-cta,
  .modal,
  .product-overlay,
  .product-actions {
    display: none !important;
  }
  
  .page-header {
    padding: var(--space-lg) 0;
    background: none !important;
    color: var(--text-primary) !important;
  }
  
  .product-item {
    page-break-inside: avoid;
    margin-bottom: var(--space-lg);
    box-shadow: none;
    border: 1px solid var(--bg-tertiary);
  }
  
  .products-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
  }
}