/* ================ VARIABLES ================ */
:root {
  --primary-color: #2A5BDD;
  --primary-hover: #1e4ac4;
  --secondary-color: #28a745;
  --text-color: #333;
  --text-light: #666;
  --text-lighter: #777;
  --bg-light: #f8f8f8;
  --border-color: #e0e0e0;
  --shadow: 0 3px 15px rgba(0, 0, 0, 0.1);
  --transition: all 0.3s ease;
  --border-radius: 8px;
}

/* ================ BASE STYLES ================ */
body {
  font-family: 'Poppins', sans-serif;
  line-height: 1.6;
  color: var(--text-color);
  background-color: #fff;
  margin: 0;
  padding: 0;
}

* {
  box-sizing: border-box;
}

/* ================ LAYOUT ================ */
.main-content-wrapper {
  max-width: 1200px;
  margin: 150px auto;
  padding: 0 20px;
}

/* ================ SEARCH BAR ================ */
.search-container {
  margin: 20px auto 30px;
  width: 100%;
  display: flex;
  justify-content: center;
}

.search-form {
  display: flex;
  width: 100%;
  max-width: 600px;
  box-shadow: var(--shadow);
  border-radius: 30px;
  overflow: hidden;
  transition: var(--transition);
}

.search-form:focus-within {
  box-shadow: 0 5px 20px rgba(0, 0, 0, 0.15);
}

.search-input {
  flex: 1;
  padding: 12px 20px;
  border: none;
  font-size: 16px;
  outline: none;
}

.search-button {
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 0 25px;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 50px;
}

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

/* ================ TITLE SECTION ================ */
.products-section {
  margin-top: 40px;
}

.section-title {
  color: var(--primary-color);
  font-size: 28px;
  text-align: center;
  margin: 0 0 15px;
  font-weight: 600;
  line-height: 1.3;
}

.section-description {
  color: var(--text-light);
  text-align: center;
  max-width: 700px;
  margin: 0 auto 30px;
  line-height: 1.6;
}

/* ================ PRODUCT GRID ================ */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 30px;
  margin-top: 30px;
}

/* ================ PRODUCT CARD ================ */
.product-card {
  background: white;
  border-radius: var(--border-radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
}

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

.product-image-container {
  height: 200px;
  overflow: hidden;
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

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

.product-info {
  padding: 20px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.product-title {
  margin: 0 0 10px;
  color: var(--text-color);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
}

.product-benefits {
  color: var(--text-light);
  font-size: 14px;
  margin-bottom: 15px;
  line-height: 1.5;
  flex-grow: 1;
}

/* ================ PRODUCT DESCRIPTION ================ */
.product-description {
  margin-bottom: 15px;
}

.description-preview {
  color: var(--text-light);
  font-size: 14px;
  line-height: 1.5;
  min-height: 45px;
}

.read-more {
  color: var(--primary-color);
  cursor: pointer;
  font-weight: 500;
  text-decoration: underline;
  display: inline-block;
  margin-top: 5px;
  transition: var(--transition);
}

.read-more:hover {
  color: var(--primary-hover);
}

/* ================ PRICE & ACTIONS ================ */
.product-price-container {
  margin: 15px 0;
}

.product-price {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-color);
}

.product-weight {
  font-size: 14px;
  color: var(--text-lighter);
}

.product-actions {
  display: flex;
  gap: 10px;
  margin-top: 15px;
}

.button {
  flex: 1;
  padding: 10px;
  border: none;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 14px;
}

.button i {
  font-size: 14px;
}

.add-to-cart {
  background: var(--primary-color);
  color: white;
}

.add-to-cart:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
}

.view-details {
  background: #f0f0f0;
  color: var(--text-color);
}

.view-details:hover {
  background: #e0e0e0;
  transform: translateY(-2px);
}

/* ================ MODAL STYLES ================ */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

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

.modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.7);
}

.modal-container {
  position: relative;
  width: 90%;
  max-width: 900px;
  max-height: 90vh;
  background: white;
  border-radius: 12px;
  overflow: hidden;
  transform: translateY(20px);
  transition: var(--transition);
  display: flex;
}

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

.modal-close {
  position: absolute;
  top: 15px;
  right: 15px;
  background: none;
  border: none;
  font-size: 28px;
  color: var(--text-lighter);
  cursor: pointer;
  z-index: 10;
  transition: var(--transition);
}

.modal-close:hover {
  color: var(--text-color);
}

.modal-content {
  display: flex;
  width: 100%;
}

.modal-product-image-wrapper {
  flex: 1;
  min-height: 400px;
  background: var(--bg-light);
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-product-image {
  max-width: 100%;
  max-height: 400px;
  object-fit: contain;
}

.modal-product-details {
  flex: 1;
  padding: 40px;
  overflow-y: auto;
}

.modal-product-title {
  color: var(--primary-color);
  font-size: 28px;
  margin-bottom: 15px;
  font-weight: 600;
}

.modal-product-price-container {
  margin-bottom: 20px;
}

.modal-product-price {
  font-size: 24px;
  font-weight: 700;
  color: var(--secondary-color);
}

.modal-product-weight {
  font-size: 16px;
  color: var(--text-lighter);
}

.modal-product-short-desc {
  font-style: italic;
  color: var(--text-light);
  margin-bottom: 20px;
  line-height: 1.6;
}

.modal-product-description {
  color: #444;
  line-height: 1.7;
  margin-bottom: 25px;
  white-space: pre-wrap;
  max-height: 200px;
  overflow-y: auto;
  padding-right: 10px;
  background: var(--bg-light);
  padding: 15px;
  border-radius: 5px;
  border-left: 3px solid var(--primary-color);
}

.modal-product-benefits ul {
  list-style: none;
  padding: 0;
  margin: 0 0 25px;
}

.modal-product-benefits li {
  padding: 8px 0;
  position: relative;
  padding-left: 25px;
  line-height: 1.5;
}

.modal-product-benefits li:before {
  content: "âœ“";
  color: var(--secondary-color);
  position: absolute;
  left: 0;
  font-weight: bold;
}

.modal-add-to-cart {
  width: 100%;
  padding: 15px;
  background: var(--primary-color);
  color: white;
  border: none;
  border-radius: 6px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}

.modal-add-to-cart:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
}

/* ================ NO PRODUCTS MESSAGE ================ */
.no-products {
  grid-column: 1 / -1;
  text-align: center;
  padding: 40px;
  color: var(--text-light);
  font-size: 16px;
  border: 1px dashed var(--border-color);
  border-radius: var(--border-radius);
  background: var(--bg-light);
}

/* ================ RESPONSIVE DESIGN ================ */
@media (max-width: 768px) {
  .modal-container {
    flex-direction: column;
    max-height: 85vh;
  }
  
  .modal-product-image-wrapper {
    min-height: 250px;
  }
  
  .modal-product-details {
    padding: 25px;
  }
  
  .modal-product-title {
    font-size: 24px;
  }
  
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 20px;
  }
}

@media (max-width: 480px) {
  .main-content-wrapper {
    padding: 10px 15px;
  }
  
  .search-input {
    padding: 10px 15px;
    font-size: 14px;
  }
  
  .search-button {
    padding: 10px 15px;
  }
  
  .section-title {
    font-size: 22px;
    margin-top: 10px;
  }
  
  .section-description {
    font-size: 14px;
  }
  
  .product-grid {
    grid-template-columns: 1fr;
  }
  
  .modal-product-details {
    padding: 20px;
  }
  
  .modal-product-title {
    font-size: 20px;
  }
  
  .modal-product-price {
    font-size: 20px;
  }
  
  .product-actions .button {
    padding: 8px 12px;
    font-size: 13px;
  }
}