@font-face {
  font-family: "KunstlerScript";
  src: url("../assets/fonts/KUNSTLER.TTF") format("truetype");
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  min-height: 100vh;
  color: #e6e6e6;
  background: linear-gradient(
    to bottom,
    #ffffff 0%,
    #ffffff 7%,
    #f1edff 12%,
    #7b5cff 35%,
    #4a2ad6 55%,
    #1b0f4d 75%,
    #050008 100%
  );
  background-attachment: fixed;
}

body::before {
  content: "Melysium";
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: "KunstlerScript", "Brush Script MT", cursive;
  font-size: clamp(120px, 28vw, 360px);
  color: rgba(255, 255, 255, 0.12);
  text-shadow: 0 0 20px rgba(255, 255, 255, 0.12), 0 0 50px rgba(255, 255, 255, 0.06);
  pointer-events: none;
  user-select: none;
  z-index: 1;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 4px 12px;
  padding: 18px 24px;
  background: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(6px);
  transition: all 0.3s ease;
}

header.header--shop.top {
  grid-template-rows: auto auto;
}

header.header--shop.scrolled {
  grid-template-rows: auto;
}

header.header--shop.top h1 {
  font-size: clamp(64px, 12vw, 120px);
}

header.header--shop.scrolled h1 {
  font-size: clamp(42px, 8vw, 62px);
}

header h1 {
  grid-column: 2;
  grid-row: 1;
  margin: 0;
  font-family: "KunstlerScript", "Brush Script MT", cursive;
  font-weight: normal;
  color: #000;
  text-align: center;
  line-height: 1;
  transition: font-size 0.3s ease;
}

header h1 a {
  color: inherit;
  text-decoration: none;
}

.slogan {
  grid-column: 2;
  grid-row: 2;
  margin: 0;
  font-size: 15px;
  letter-spacing: 1.5px;
  color: #000;
  text-align: center;
  font-weight: 600;
}

header.scrolled .slogan {
  display: none;
}

.lang-switch {
  grid-column: 1;
  grid-row: 1;
  align-self: center;
}

.lang-btn {
  background: transparent;
  border: 1px solid transparent;
  border-radius: 6px;
  color: #000;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  margin-right: 8px;
  padding: 4px 8px;
  transition: opacity 0.2s ease, border-color 0.2s ease;
}

.lang-btn:hover {
  opacity: 0.7;
}

.lang-btn--active {
  border-color: rgba(0, 0, 0, 0.35);
}

.site-nav {
  grid-column: 3;
  grid-row: 1;
  display: flex;
  justify-content: flex-end;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
}

.site-nav a {
  color: #000;
  text-decoration: none;
  font-size: 15px;
  font-weight: 600;
}

.site-nav a:hover,
.site-nav a:focus-visible {
  opacity: 0.75;
  outline: 2px solid rgba(0, 0, 0, 0.4);
  outline-offset: 2px;
}

main {
  position: relative;
  z-index: 2;
  padding: 40px 20px 60px;
}

h2 {
  text-align: center;
}

.filters {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  align-items: center;
  gap: 15px;
  margin: 20px auto 30px;
  padding: 15px 25px;
  width: fit-content;
  max-width: 100%;
  backdrop-filter: blur(12px);
  background: rgba(255, 255, 255, 0.08);
  border-radius: 16px;
}

.filters select {
  padding: 10px 36px 10px 18px;
  border-radius: 8px;
  border: 1px solid #444;
  font-size: 14px;
  background: #111;
  color: #fff;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='white' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}

#products {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
  padding: 0 10px 30px;
  max-width: 1400px;
  margin: 0 auto;
}

.product-card {
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.15);
  padding: 15px;
  text-align: center;
  border-radius: 12px;
}

.product-card img {
  width: 100%;
  height: 260px;
  object-fit: contain;
  border-radius: 8px;
  transition: transform 0.25s ease;
}

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

.product-card__price {
  font-weight: 600;
  margin: 8px 0;
}

.product-card select,
.product-card button,
.cart-actions button,
.contact-card a {
  font: inherit;
}

.product-card select {
  margin-top: 10px;
  padding: 10px 30px 10px 14px;
  width: 100%;
  max-width: 200px;
  background: rgba(20, 20, 20, 0.9);
  color: #fff;
  border: 1px solid #444;
  border-radius: 10px;
  cursor: pointer;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8'%3E%3Cpath fill='white' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.product-card button,
.cart-actions button {
  margin-top: 10px;
  padding: 10px 18px;
  background: rgba(20, 20, 20, 0.9);
  color: #fff;
  border: 1px solid #444;
  cursor: pointer;
  border-radius: 10px;
  transition: background 0.2s ease, transform 0.1s ease;
}

.product-card button:hover,
.cart-actions button:hover {
  background: rgba(40, 40, 40, 0.9);
  transform: translateY(-1px);
}

.content-card {
  max-width: 900px;
  margin: 20px auto;
  padding: 40px 50px;
  background: rgba(0, 0, 0, 0.55);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 12px;
  line-height: 1.7;
}

.content-card--narrow {
  max-width: 700px;
}

.contact-card {
  text-align: center;
}

.contact-card iframe {
  margin-top: 20px;
  border: 0;
  border-radius: 12px;
  width: 100%;
  max-width: 100%;
}

.contact-card a {
  color: #c4b5ff;
}

#cart-items {
  max-width: 900px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.cart-empty {
  text-align: center;
  opacity: 0.9;
}

.cart-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 16px;
  padding: 20px 26px;
  border-radius: 14px;
  background: linear-gradient(to bottom, rgba(60, 45, 140, 0.9), rgba(35, 20, 90, 0.9));
  border: 1px solid rgba(255, 255, 255, 0.15);
}

.cart-item h3 {
  margin: 0;
  font-size: 1.05rem;
}

.cart-item__info p {
  margin: 4px 0 0;
  font-size: 0.9rem;
  color: #ddd;
}

.cart-item__price {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 600;
}

.cart-item__remove {
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  color: #fff;
  font-size: 1.4rem;
  line-height: 1;
  cursor: pointer;
}

.cart-item__remove:hover {
  background: rgba(80, 20, 20, 0.6);
}

#total {
  max-width: 900px;
  margin: 30px auto 10px;
  text-align: right;
  font-size: 1.4rem;
  font-weight: 600;
}

.cart-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 16px;
  margin-top: 24px;
}

footer {
  text-align: center;
  padding: 20px;
  font-size: 0.9em;
  color: #888;
  position: relative;
  z-index: 2;
}

.site-footer {
  margin-top: 80px;
  padding: 32px 20px;
  background: #000;
  color: #aaa;
  text-align: center;
  position: relative;
  z-index: 2;
}

.footer-links {
  display: flex;
  justify-content: center;
  gap: 30px;
  flex-wrap: wrap;
}

.footer-links a {
  color: #aaa;
  text-decoration: none;
  font-size: 14px;
}

.footer-links a:hover {
  color: #fff;
}

.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  padding: 12px 22px;
  background: rgba(10, 10, 10, 0.92);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 10px;
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.toast--visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

@media (max-width: 1100px) {
  #products {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 820px) {
  #products {
    grid-template-columns: repeat(2, 1fr);
  }

  header {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto auto;
  }

  .lang-switch {
    grid-column: 1;
    grid-row: 1;
  }

  header h1 {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .slogan {
    grid-column: 1 / -1;
    grid-row: 3;
  }

  .site-nav {
    grid-column: 2;
    grid-row: 1;
  }

  .content-card {
    padding: 28px 24px;
  }

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

  .cart-item__remove {
    grid-column: 2;
    grid-row: 1 / span 2;
    align-self: start;
  }
}

@media (max-width: 520px) {
  #products {
    grid-template-columns: 1fr;
    padding: 0;
  }

  header.header--shop.top h1,
  header.header--shop.scrolled h1 {
    font-size: clamp(36px, 14vw, 56px);
  }
}
