* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Oxygen, Ubuntu, sans-serif;
}

:root {
  --page-bg: #f4f4f5;
  --card-bg: #fff;
  --gray-bg: #f3f3f3;
  --primary: #4f46e5;
  --black-text: #000;
  --gray-text: #9ca3af;
  --transition: all 0.3s ease-in-out;
}

html {
  font-size: 16px;
}

body {
  background-color: var(--page-bg);
  min-height: 100vh;
  overflow-x: hidden;
}

.truncate-1 {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.truncate-2 {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.header {
  margin: 2rem auto 0;
  display: flex;
  align-items: center;
  flex-direction: column;
  gap: 0.5rem;
}

.welcome-title {
  font-size: 2rem;
  color: var(--black-text);
  font-weight: 700;
}

.welcome-info {
  font-size: 1rem;
  color: var(--gray-text);
  font-weight: 400;
  display: flex;
  gap: 0.5rem;
}

#user-name {
  color: var(--primary);
}

.section {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  align-items: center;
  justify-content: center;
  padding: 2rem 1rem;
}

.section-title {
  position: relative;
  font-size: 2.25rem;
  color: var(--black-text);
  text-align: center;
  padding-bottom: 0.75rem;
}

.section-title::after {
  content: "";
  position: absolute;
  width: 5rem;
  height: 0.25rem;
  border-radius: 0.25rem;
  background-color: var(--primary);
  left: 50%;
  bottom: 0;
  transform: translate(-50%, 0);
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  padding: 1rem;
}

.product-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  border-radius: 0.75rem;
  background-color: var(--card-bg);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: var(--transition);
  overflow: hidden;
}

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

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

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

.product-info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  flex-grow: 1;
  gap: 0.75rem;
  padding: 1.25rem 1rem;
}

.product-category {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--gray-text);
  text-transform: uppercase;
  letter-spacing: 2px;
}

.product-title {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--black-text);
}

.product-desc {
  font-size: 0.75rem;
  font-weight: 400;
  color: var(--gray-text);
}

.product-features {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.25rem;
}

.feature-item {
  padding: 3px 6px;
  background-color: var(--gray-bg);
  color: var(--gray-text);
  font-size: 0.65rem;
  border-radius: 0.5rem;
}

.product-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.product-prices {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: max-content;
}

.new-price {
  color: var(--black-text);
  font-size: 1.25rem;
  font-weight: 600;
}

.old-price {
  color: var(--gray-text);
  font-size: 1rem;
  font-weight: 400;
  text-decoration-line: line-through;
}

.product-reviews {
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.review-stars {
  color: #ffd700;
  font-size: 0.75rem;
}

.review-count {
  font-size: 0.75rem;
  color: var(--gray-text);
}

.add-basket-btn {
  background-color: #000;
  color: #fff;
  padding: 0.75rem;
  border-radius: 0.5rem;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  border: none;
  outline: none;
  cursor: pointer;
  transition: 0.1s ease-in-out;
}

.add-basket-btn:active {
  transform: scale(0.9);
}

.status {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  font-size: 0.75rem;
  padding: 4px 6px;
  border-radius: 8px;
}

.status.red {
  background-color: #ffe4e6;
  color: #c90e43;
}

.status.green {
  background-color: #dcfce7;
  color: #166534;
}

.status.yellow {
  background-color: #ede9fe;
  color: #5b21b6;
}

.add-favorite-btn {
  position: absolute;
  top: 0.5rem;
  right: 0;
  width: 40px;
  height: 40px;
  font-size: 1rem;
  border-radius: 50%;
  background-color: #ffffffd3;
  color: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  border: none;
  outline: none;
  opacity: 0;
  pointer-events: none;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  transition: 0.25s ease-in-out;
}

.add-favorite-btn .fill-icon {
  display: none;
}

.add-favorite-btn:hover {
  color: #db2777;
}

.add-favorite-btn:hover .outline-icon {
  display: none;
}

.add-favorite-btn:hover .fill-icon {
  display: block;
}

.product-card:hover .add-favorite-btn {
  opacity: 1;
  pointer-events: visible;
  right: 0.5rem;
}

.shopping-card {
  background-color: var(--card-bg);
  padding: 2rem;
  border-radius: 1.5rem;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.shopping-item {
  display: grid;
  align-items: center;
  grid-template-columns: 200px 1fr;
  gap: 1rem;
}

.item-image {
  width: 100%;
  height: 150px;
  object-fit: contain;
  border-radius: 0.5rem;
  background-color: var(--gray-bg);
}

.item-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.item-texts {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.item-actions {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.remove-btn {
  width: max-content;
  padding: 0.5rem 1rem;
  border-radius: 0.25rem;
  background-color: #ffe4e6;
  color: #c90e43;
  font-size: 0.75rem;
  cursor: pointer;
  outline: none;
  border: none;
}

.item-price {
  color: var(--black-text);
  font-size: 1rem;
  font-weight: 600;
}

.payment-section {
  background-color: var(--page-bg);
  padding: 1.5rem;
  border-radius: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.payment-item {
  width: 100%;
  padding: 0.75rem 0;
  border-bottom: 1px solid #d7d7d7;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.payment-title {
  font-size: 0.85rem;
  color: var(--gray-text);
}

.payment-price {
  font-size: 0.85rem;
  color: var(--black-text);
}

.payment-item:last-child {
  border: none;
}

.payment-item:last-child .payment-title,
.payment-item:last-child .payment-price {
  font-weight: 600;
  font-size: 1rem;
  color: var(--black-text);
}

.order-btn {
  display: block;
  margin: 0 auto;
  width: max-content;
  padding: 1rem 1.5rem;
  border-radius: 0.25rem;
  background-color: var(--primary);
  color: #fff;
  display: flex;
  align-self: center;
  gap: 0.25rem;
  font-size: 1rem;
  cursor: pointer;
  outline: none;
  border: none;
  transition: 0.25s ease;
}

.order-btn:hover {
  gap: 1rem;
}

.count-select {
  width: max-content;
  min-width: 4rem;
  max-width: 6rem;
  padding: 0.5rem 0.75rem;
  font-size: 0.9rem;
  border: 1px solid #ccc;
  border-radius: 0.5rem;
  background-color: #fff;
  color: #333;
  background-image: url('data:image/svg+xml;utf8,<svg fill="gray" height="24" viewBox="0 0 24 24" width="24" xmlns="http://www.w3.org/2000/svg"><path d="M7 10l5 5 5-5z"/></svg>');
  background-repeat: no-repeat;
  background-position: right 0.5rem center;
  background-size: 1rem 1rem;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

.count-select:hover {
  border-color: #888;
}

.count-select:focus {
  border-color: var(--primary);
  outline: none;
}

/* Responsive Styles */

@media (max-width: 1200px) {
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
}

@media (max-width: 768px) {
  .shopping-item {
    grid-template-columns: 1fr;
  }

  .item-info {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
  }

  .item-texts {
    grid-column: 1 / -1;
  }

  .item-price {
    text-align: right;
  }
}
