:root {
  font-family: "Inter", sans-serif;
  --size-heading: 24px;
  --size-body: 16px;
  --w-bold: 700;
  --w-600: 600;
  --w-500: 500;
  --w-normal: 400;
  --primary: rgb(29, 29, 31);
  --blueish: rgb(57, 65, 80);
  --slate-gray: rgb(210, 213, 218);
  --extra-light-gray: rgb(243, 244, 246);
  --light-gray: rgb(229, 231, 235);
  --light: rgb(255, 255, 255);
}
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  font-family: inherit;
}
body {
  font-size: var(--size-body);
  font-weight: var(--w-normal);
  background: fixed no-repeat var(--extra-light-gray);
  min-height: 100vh;
  overflow-x: hidden;
}
form {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
}

form button[type="submit"] {
  grid-column: span 2;
  max-width: 100%;
  padding: 1.2rem 0.9rem;
  background: var(--primary);
  color: var(--light);
  border-radius: 8px;
  font-weight: var(--w-600);
  margin-top: 0.5rem;
}

form .form-group {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
form .form-group h1 {
  font-size: var(--size-heading) !important;
}
.form-group label {
  font-weight: var(--w-600);
  color: var(--blueish);
}
.form-group input,
.form-group select {
  max-width: 100%;
  border: 1px solid var(--slate-gray);
  padding: 1.2rem;
  border-radius: 8px;
  background: fixed var(--extra-light-gray);
}
.form-group:has(.select-icon) {
  position: relative;
}
.form-group .select-icon {
  position: absolute;
  right: 1.2rem;
  top: 55%;
  pointer-events: none;
}
.form-group select {
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%231D1D1F' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1.2rem center;
  padding-right: 3rem;
  font-size: var(--size-body);
}
.form-group:nth-child(1),
.form-group:nth-child(2) {
  grid-column: span 2;
}

h2 {
  font-size: var(--size-body) !important;
  font-weight: var(--w-600) !important;
}
hr {
  border: 1px solid rgba(0, 0, 0, 0.05);
}
button {
  cursor: pointer;
}
button,
input {
  max-width: max-content;
  border: none;
  outline: none;
  background-color: transparent;
  font-size: inherit;
}
input::placeholder {
  font-size: var(--size-body);
}
.coupon-container {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}
.coupon-container > input {
  flex: 2;
  max-width: 100% !important;
  border: 1px solid rgba(0, 0, 0, 0.2);
  background: fixed var(--light);
  padding: 0.9rem 1.2rem;
  border-radius: 8px;
  margin-top: 1rem;
}
.coupon-container > button {
  margin-top: 1rem;
  padding: 1rem 1.5rem;
  background: var(--primary);
  color: var(--light);
  border-radius: 8px;
  font-weight: var(--w-600);
}

.author-info {
  font-size: 14px;
  text-align: center;
  margin-top: 16px;
}

.author-info a {
  text-decoration: none;
}
.checkout {
  display: grid;
  grid-template-areas:
    "header header header"
    ". main .";
  grid-template-columns: 1fr minmax(auto, 1350px) 1fr;
  grid-template-rows: auto auto;
  gap: 3rem;
  margin: 0;
  padding: 0 72px 72px;
}
.checkout .checkout-header {
  position: relative;
  min-height: 200px;
  grid-area: header;
  display: flex;
  flex-direction: row;
  gap: 20px;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  width: 100%;

  overflow: hidden;
  margin-bottom: -90px;
}
.checkout-header > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: -1;
}
.checkout-header > h1,
.checkout-header > span {
  display: inline-block;
  text-align: center;
  color: var(--light);
  z-index: 1;
}
.checkout-header > span {
  background: fixed var(--primary);
  padding: 0.5rem 1rem;
  border-radius: 30px;
  font-size: 14px;
  white-space: nowrap;
}
.checkout .checkout-body {
  grid-area: main;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  max-width: 1350px;
  width: 100%;
  border-radius: 30px;
  box-shadow: 1px 1px 10px rgba(0, 0, 0, 0.3);
}
.checkout-body #item_list {
  border-radius: 30px 0 0 30px;
  display: flex;
  flex-direction: column;
  gap: 1rem;
  background: fixed var(--light-gray);
  padding: 2rem;
}
.checkout-body #form {
  background: fixed var(--light);
  padding: 2rem;
  border-radius: 0 30px 30px 0;
}
#item_list .item {
  display: flex;
  gap: 1rem;
}
.item .item-source {
  position: relative;
  background: fixed var(--extra-light-gray);
  border: 1px solid rgba(0, 0, 0, 0.1);
  padding: 2rem;
  border-radius: 12px;
  aspect-ratio: 1/1;
  width: 100px;
  height: 100px;
}
.item .item-source > img {
  position: absolute;
  object-fit: contain;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
}
.item .item-info {
  display: flex;
  flex-direction: column;
}
.item-price-quantity .item-price {
  font-weight: var(--w-600);
  color: var(--primary);
}
.item-info .item-color,
.item-info span:last-of-type {
  color: var(--blueish);
}
.item-info span:last-of-type {
  margin-top: auto;
}
.item .item-price-quantity {
  margin-left: auto;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: flex-end;
  min-height: 80px;
}
.summary {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 1rem;
}
.summary .summary-row {
  font-weight: var(--w-bold);
  display: flex;
  justify-content: space-between;
}
.summary-row:not(.total) {
  font-weight: var(--w-600) !important;
  color: var(--blueish);
}

/* Tablet responsiveness (max-width: 1024px) */
@media (max-width: 1024px) {
  .checkout {
    padding: 0 48px 48px;
    gap: 2rem;
  }

  .checkout .checkout-header {
    min-height: 180px;
    margin-bottom: -120px;
    padding: 2rem;
  }

  .checkout .checkout-body {
    gap: 1rem;
  }

  .checkout-body #item_list,
  .checkout-body #form {
    padding: 1.5rem;
  }
}

/* Mobile responsiveness (max-width: 768px) */
@media (max-width: 768px) {
  .checkout {
    padding: 0 16px 24px;
    gap: 1rem;
    grid-template-columns: 1fr;
  }

  .checkout .checkout-header {
    min-height: 150px;
    margin-bottom: -80px;
    padding: 1.5rem;
    gap: 10px;
    border-radius: 0 0 20px 20px;
  }

  .checkout-header > h1 {
    font-size: 20px !important;
  }

  .checkout-header > span {
    font-size: 12px;
    padding: 0.4rem 0.8rem;
  }

  .checkout .checkout-body {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .checkout-body #item_list {
    border-radius: 20px 20px 0 0;
    padding: 1.5rem 1rem;
  }

  .checkout-body #form {
    border-radius: 0 0 20px 20px;
    padding: 1.5rem 1rem;
  }

  .item .item-source {
    width: 80px;
    height: 80px;
    padding: 1.5rem;
  }

  .item .item-info {
    font-size: 14px;
  }

  .coupon-container {
    flex-direction: column;
    align-items: stretch;
  }

  .coupon-container > input,
  .coupon-container > button {
    width: 100%;
    max-width: 100%;
  }

  form {
    grid-template-columns: 1fr;
    gap: 1rem;
  }

  .form-group:nth-child(1),
  .form-group:nth-child(2) {
    grid-column: span 1;
  }

  form button[type="submit"] {
    grid-column: span 1;
  }

  .author-info {
    padding: 0 16px;
    font-size: 12px;
  }
}
