@import url('https://fonts.googleapis.com/css2?family=Archivo:wght@400;500;600;700;800&display=swap');

:root {
  --blue: #004384;
  --white: #ffffff;
  --light: rgba(255,255,255,.12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: "Archivo", Arial, sans-serif;
  background: var(--blue);
  color: var(--white);
}

body { min-height: 100vh; }

button, a { font: inherit; }

.site-header {
  height: 92px;
  max-width: 1040px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 22px;
}

.home-link, .brand {
  color: #fff;
  text-decoration: none;
}

.home-link {
  justify-self: start;
  letter-spacing: 2px;
  font-size: 14px;
  font-weight: 600;
}

.brand {
  justify-self: center;
  font-size: 29px;
  letter-spacing: 1px;
  font-weight: 800;
}

.cart-button {
  justify-self: end;
  color: #fff;
  background: none;
  border: 0;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
}

#cart-count {
  display: inline-flex;
  min-width: 24px;
  height: 24px;
  margin-left: 5px;
  padding: 0 6px;
  border-radius: 50%;
  background: #fff;
  color: var(--blue);
  align-items: center;
  justify-content: center;
  font-size: 12px;
}

.catalog {
  width: min(1180px, calc(100% - 48px));
  margin: 80px auto 70px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 68px 42px;
  align-items: start;
}

.product-card {
  text-align: center;
  animation: fadeIn .35s ease both;
}

.product-card.hidden-product { display: none; }

.product-image {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  display: block;
  cursor: pointer;
  transition: transform .2s ease;
}

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

.product-card h2 {
  margin: 14px 0 9px;
  font-size: 15px;
  line-height: 1.3;
  font-weight: 700;
}

.price {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 11px;
}

.view-button, .add-button, .checkout-button {
  border: 1px solid #fff;
  background: transparent;
  color: #fff;
  padding: 9px 14px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  transition: .18s ease;
}

.view-button:hover, .add-button:hover, .checkout-button:hover {
  background: #fff;
  color: var(--blue);
}

.product-page {
  width: min(1050px, calc(100% - 48px));
  margin: 55px auto 80px;
  display: grid;
  grid-template-columns: minmax(400px, 1.08fr) minmax(320px, .82fr);
  gap: 55px;
  align-items: start;
}

.hidden { display: none !important; }

.main-image-wrap {
  width: 100%;
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

#main-product-image {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.thumbnails {
  display: flex;
  gap: 4px;
  justify-content: center;
  margin-top: 10px;
}

.thumbnail {
  width: 92px;
  height: 92px;
  border: 1px solid rgba(255,255,255,.35);
  cursor: pointer;
  padding: 0;
  background: rgba(255,255,255,.05);
}

.thumbnail.active { border: 2px solid #fff; }

.thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.product-info { padding-top: 4px; }

.product-info h1 {
  margin: 0 0 16px;
  font-size: 25px;
  line-height: 1.2;
}

.product-price {
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 28px;
}

.share-line {
  border-top: 1px solid rgba(255,255,255,.75);
  padding-top: 17px;
  margin-bottom: 18px;
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  font-weight: 600;
}

.share-line button {
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 3px;
  background: #fff;
  color: var(--blue);
  cursor: pointer;
  font-weight: 800;
}

.product-note {
  font-size: 12px;
  line-height: 1.45;
  font-weight: 600;
  margin-top: 22px;
}

.overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  justify-content: flex-end;
  z-index: 20;
}

.cart-panel {
  position: relative;
  width: min(460px, 100%);
  min-height: 100%;
  background: var(--blue);
  padding: 42px 34px;
  box-shadow: -12px 0 35px rgba(0,0,0,.18);
}

.cart-panel h2, .message-panel h2 {
  margin: 0 0 28px;
  font-size: 23px;
}

.close-button {
  position: absolute;
  right: 22px;
  top: 15px;
  background: none;
  color: #fff;
  border: 0;
  cursor: pointer;
  font-size: 30px;
  line-height: 1;
}

.cart-item {
  display: grid;
  grid-template-columns: 82px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 15px 0;
  border-top: 1px solid rgba(255,255,255,.3);
}

.cart-item img {
  width: 82px;
  height: 82px;
  object-fit: contain;
}

.cart-item-name {
  font-weight: 700;
  font-size: 13px;
  line-height: 1.3;
}

.cart-item-price {
  margin-top: 5px;
  font-size: 12px;
}

.remove-item {
  border: 0;
  background: none;
  color: #fff;
  cursor: pointer;
  font-size: 12px;
  text-decoration: underline;
}

.cart-total {
  border-top: 1px solid rgba(255,255,255,.75);
  margin-top: 20px;
  padding-top: 18px;
  font-size: 17px;
  font-weight: 800;
}

.checkout-button {
  width: 100%;
  margin-top: 22px;
}

.empty-cart {
  font-size: 14px;
  line-height: 1.5;
  opacity: .9;
}

.message-panel {
  position: relative;
  width: min(420px, calc(100% - 36px));
  background: var(--blue);
  border: 1px solid rgba(255,255,255,.7);
  padding: 40px 32px 32px;
  align-self: center;
  box-shadow: 0 15px 50px rgba(0,0,0,.25);
}

.message-panel p {
  font-size: 14px;
  line-height: 1.55;
}

.message-panel .add-button { margin-top: 8px; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 900px) {
  .catalog {
    grid-template-columns: repeat(2, 1fr);
    gap: 50px 28px;
  }

  .product-page {
    grid-template-columns: 1fr;
    max-width: 650px;
  }
}

@media (max-width: 560px) {
  .site-header {
    height: 76px;
    padding: 0 14px;
  }

  .brand { font-size: 19px; }
  .home-link, .cart-button { font-size: 11px; }

  .catalog {
    width: calc(100% - 28px);
    margin-top: 45px;
    grid-template-columns: 1fr 1fr;
    gap: 42px 14px;
  }

  .product-page {
    width: calc(100% - 28px);
    margin-top: 30px;
  }

  .product-info h1 { font-size: 21px; }
}
