/* -------------------
🔁 Reset
-------------------- */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Red Hat Text', sans-serif;
  font-size: 16px;
  background-color: hsl(20, 50%, 98%);
  color: hsl(14, 65%, 9%);
  line-height: 1.5;
  padding: 40px;
}

img {
  max-width: 100%;
  display: block;
}

/* -------------------
📦 Layout
-------------------- */
.container {
  max-width: 1400px;
  margin: 0 auto;
}

.section-title {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 40px;
}

.main-wrapper {
  /* display: flex; */
  display: grid;
  grid-template-columns: 3fr 1fr; /*이거 알아야함*/
  gap: 40px;
  align-items: start;
  
  /* align-items: flex-start; */
}

/* -------------------
🧁 Product List (Grid)
-------------------- */
.product-list {
  /* flex: 1; */
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 30px;
  grid-column: 1;
}

/* -------------------
🃏 Product Card
-------------------- */
.product-card {
  background-color: #fff;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 6px 16px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s ease;
  position: relative;
}

.product-card:hover {
  transform: translateY(-4px);
}

.product-thumb {
  position: relative;
}

.product-thumb img {
  width: 100%;
  border-bottom: 1px solid #eee;
}

/* -------------------
🛒 Add to Cart Button
-------------------- */
.btn-add {
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 16px;
  font-weight: 600;
  font-size: 0.9rem;
  color: hsl(14, 86%, 42%);
  background-color: #fff;
  border: 1.5px solid hsl(14, 86%, 42%);
  border-radius: 999px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08);
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-add:hover {
  background-color: hsl(14, 86%, 42%);
  color: white;
}

.btn-add:hover img {
  filter: brightness(100) invert(1);
}

.btn-add img {
  width: 16px;
  height: 16px;
}

/* -------------------
✏️ Product Text
-------------------- */
.product-info {
  padding: 24px 20px 20px;
  text-align: left;
}

.product-type {
  font-size: 0.75rem;
  color: hsl(12, 20%, 44%);
  margin-bottom: 4px;
}

.product-title {
  font-weight: 700;
  font-size: 1.05rem;
  margin-bottom: 8px;
}

.product-price {
  font-weight: 600;
  font-size: 1rem;
}

/* -------------------
🛒 Cart
-------------------- */
.cart {
  /* position: fixed; */
  position: static;
  /* top: 80px; */
  /* right : 40px; */
  width: 280px;
  max-width: 280px;
  padding: 24px;
  border-top: 2px solid #eee;
  background-color: white;
  border-radius: 12px;
  box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
  margin-top: 40px;
}

.cart-title {
  font-size: 1.1rem;
  margin-bottom: 16px;
}

.cart-empty {
  text-align: center;
  color: #888;
  font-size: 0.95rem;
}

.cart-items {
  list-style: none;
  padding: 0;
  margin: 20px 0;
}

.cart-total {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  margin-top: 12px;
  font-size: 0.95rem;
}

.cart-note {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.85rem;
  margin-top: 20px;
  color: #666;
}

.cart-note img {
  width: 20px;
}

/* 주문 버튼 */
.btn-confirm {
  margin-top: 16px;
  width: 100%;
  background-color: hsl(159, 69%, 38%);
  color: white;
  border: none;
  padding: 12px;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.3s ease;
}

.btn-confirm:hover {
  background-color: hsl(159, 69%, 30%);
}


/* -------------------
✅ Modal
-------------------- */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}

.hidden {
  display: none;
}

.modal-content {
  background: white;
  padding: 30px 40px;
  border-radius: 12px;
  text-align: center;
  width: 90%;
  max-width: 400px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

.modal-content h2 {
  margin-top: 16px;
  font-size: 1.4rem;
}

.modal-items {
  margin: 24px 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.modal-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.modal-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
}

.modal-item-info {
  flex: 1;
}

.modal-item-title {
  font-weight: 600;
  /*font-size: 1rem;*/
  margin-bottom: 4px;
}

.modal-item-sub {
  font-size: 0.85rem;
  color: hsl(12, 20%, 44%);
}

.modal-item-price {
  font-weight: 600;
  font-size: 1rem;
}

.modal-total {
  display: flex;
  justify-content: space-between;
  font-weight: 600;
  margin-top: 12px;
}

.btn-close {
  margin-top: 20px;
  background-color: hsl(14, 86%, 42%);
  color: white;
  border: none;
  padding: 12px 24px;
  border-radius: 8px;
  cursor: pointer;
}








/* 미디어 쿼리 모바일 반응형 */
@media (max-width: 768px) {
  body {
    padding: 20px;
  }

  .section-title {
    font-size: 1.5rem;
    margin-bottom: 24px;
    text-align: center;
  }

  .main-wrapper {
    /* flex-direction: column; */
    display:block;
  }

  .product-list {
    grid-template-columns: 1fr;
    gap: 20px;
    padding-bottom: 140px;
  }

  .product-card {
    border-radius: 10px;
  }

  .btn-add {
    bottom: -18px;
    font-size: 0.85rem;
    padding: 8px 14px;
  }

  .product-info {
    padding: 20px 16px;
  }

  .product-type {
    font-size: 0.75rem;
  }

  .product-title {
    font-size: 1rem;
  }

  .product-price {
    font-size: 0.95rem;
  }

  /* ✅ 장바구니 모바일 하단 고정 */
  .cart {
    width: 100%;
    max-width: none;
    position: static;
    margin-top: 32px;
    padding: 20px;
    box-shadow: none;
    border-radius: 12px 12px 0 0;
    box-shadow: 0 -4px 12px rgba(0, 0, 0, 0.05);
  }

  .btn-add h2 {
    font-size: 1rem;
  }

  .cart-title {
    font-size: 1rem;
    margin-bottom: 12px;
  }

  .cart .btn-confirm {
    width: 100%;
    padding: 14px;
    font-size: 1rem;
    margin-top: 16px;
  }

  .cart-empty {
    font-size: 0.9rem;
  }

  .cart-note {
    font-size: 0.8rem;
    margin-top: 16px;
  }

  .product-list {
    grid-template-columns: 1fr;
    gap: 20px;
    padding-bottom: 120px;
    /* cart 높이만큼 여백 확보 */
  }

  /* ✅ 모달 중앙 유지 */
  @media (max-width: 768px) {
    .modal-content {
      width: 90%;
      padding: 24px 20px;
      max-height: 80vh;
      overflow-y: auto;
      border-radius: 12px;
    }

    .modal-content h2 {
      font-size: 1.3rem;
      margin-bottom: 12px;
    }

    .modal-content p {
      font-size: 1rem;
      margin-bottom: 16px;
    }

    .modal-items {
      font-size: 0.95rem;
      margin-bottom: 16px;
    }

    .modal-total {
      font-size: 1rem;
      justify-content: space-between;
    }

    .btn-close {
      width: 100%;
      padding: 12px;
      font-size: 1rem;
      margin-top: 16px;
    }

    .modal-check {
      width: 48px;
      height: 48px;
      margin: 0 auto 12px;
    }

    .modal-thumb {
      width: 40px;
      height: 40px;
      margin-right: 12px;
    }

    .modal-item-title {
      font-size: 0.95rem;
    }

    .modal-item-sub {
      font-size: 0.8rem;
    }

    .modal-item-price {
      font-size: 0.95rem;
    }
  }
}