@import url("https://fonts.googleapis.com/css2?family=Montserrat:wght@400;500;600;700&display=swap");

:root {
  --bg: #000;
  --fg: #fff;
  --muted: #cfcfcf;
  --border: #444;
  --glass: rgba(0, 0, 0, 0.4);
  --glass-strong: rgba(0, 0, 0, 0.4);
  --line-soft: rgba(255, 255, 255, 0.28);
  --glow-soft: 0 0 0 1px rgba(255, 255, 255, 0.08), 0 12px 28px rgba(0, 0, 0, 0.34);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Montserrat", Arial, Helvetica, sans-serif;
  background: url("Fon.jpg") center center / cover no-repeat fixed;
  color: var(--fg);
  min-height: 100vh;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(15px);
  pointer-events: none;
  z-index: 0;
}

#splash-screen {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(15, 15, 15, 0.85);
  backdrop-filter: blur(25px);
  -webkit-backdrop-filter: blur(25px);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 10000;
  transition: opacity 0.6s ease-in-out;
}

.loader-wrapper {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
}

.loader-shoh {
  width: 16px;
  height: 16px;
  box-shadow: 0 30px, 0 -30px;
  border-radius: 4px;
  background: currentColor;
  display: block;
  position: relative;
  transform: translate(-150%, -20px);
  color: #fff;
  box-sizing: border-box;
  animation: animloader 2s ease infinite;
}

.loader-shoh::after,
.loader-shoh::before {
  content: "";
  box-sizing: border-box;
  width: 16px;
  height: 16px;
  box-shadow: 0 30px, 0 -30px;
  border-radius: 4px;
  background: currentColor;
  color: #fff;
  position: absolute;
  left: 30px;
  top: 0;
  animation: animloader 2s 0.2s ease infinite;
}

.loader-shoh::before {
  animation-delay: 0.4s;
  left: 60px;
}

@keyframes animloader {
  0% { top: 0; color: white; }
  50% { top: 30px; color: rgba(255, 255, 255, 0.2); }
  100% { top: 0; color: white; }
}

.loading-text {
  color: white;
  font-family: sans-serif;
  font-size: 14px;
  letter-spacing: 2px;
  opacity: 0.6;
}

main,
.topbar,
.cart-panel {
  position: relative;
  z-index: 1;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 9;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  border-bottom: 1px solid var(--line-soft);
  padding: 14px 16px;
  background: var(--glass-strong);
  backdrop-filter: blur(15px);
  box-shadow: none;
}

.header-logo {
  display: block;
  height: 50px;
  width: auto;
  border-radius: 0;
}

.cart-button {
  padding: 8px 12px;
  width: auto;
  min-width: 92px;
  height: 46px;
  letter-spacing: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
  margin: 0;
}

.cart-icon {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

#cart-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  line-height: 1;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.24);
}

main {
  max-width: 980px;
  margin: 0 auto;
  padding: 16px;
  backdrop-filter: blur(15px);
  background: rgba(0, 0, 0, 0.4);
  border: 1px solid var(--line-soft);
  border-radius: 0 0 20px 20px;
}

.search-wrap {
  display: block;
}

.search-input-row {
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 560px;
  margin: 0 auto;
}

.input-wrapper {
  width: 100%;
  max-width: none;
  height: 45px;
  border-radius: 20px;
  padding: 5px;
  box-sizing: content-box;
  display: flex;
  align-items: center;
  background-color: rgba(41, 37, 36, 0.6);
  border: 1px solid rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(15px);
  margin: 10px 0;
  gap: 6px;
  flex: 1;
}

.toolbar {
  margin-top: 10px;
  display: flex;
  align-items: center;
  gap: 8px;
  max-width: 560px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 66px;
}

#sort-select {
  width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background-color: rgba(41, 37, 36, 0.6);
  color: #fff;
  padding: 10px 44px 10px 16px;
  border-radius: 20px;
  font-family: "Montserrat", Arial, Helvetica, sans-serif;
  font-size: 14px;
  font-weight: 500;
  min-height: 55px;
  backdrop-filter: blur(15px);
  transition: background-color 0.2s ease, transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  box-shadow: -1px -5px 15px rgba(65, 70, 91, 0.35), 5px 5px 15px rgba(65, 70, 91, 0.35),
              inset 3px 3px 8px rgba(33, 33, 33, 0.75), inset -3px -3px 8px rgba(33, 33, 33, 0.75);
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, rgba(255, 255, 255, 0.78) 50%),
    linear-gradient(135deg, rgba(255, 255, 255, 0.78) 50%, transparent 50%);
  background-position:
    calc(100% - 22px) calc(50% + 1px),
    calc(100% - 16px) calc(50% + 1px);
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}

input,
textarea,
button,
select {
  font-size: 16px;
  font-family: "Montserrat", Arial, Helvetica, sans-serif;
}

button {
  height: 50px;
  margin: 5px;
  width: 120px;
  background: #333;
  display: flex;
  justify-content: center;
  align-items: center;
  cursor: pointer;
  font-family: "Montserrat", Arial, Helvetica, sans-serif;
  border: solid #404c5d 1px;
  font-size: 16px;
  color: rgb(161, 161, 161);
  transition: 500ms;
  border-radius: 5px;
  background: linear-gradient(145deg, #2e2d2d, #212121);
  box-shadow: -1px -5px 15px #41465b, 5px 5px 15px #41465b,
              inset 5px 5px 10px #212121, inset -5px -5px 10px #212121;
}

button:hover {
  box-shadow: 1px 1px 13px #20232e, -1px -1px 13px #545b78;
  color: #d6d6d6;
  transition: 500ms;
}

button:active {
  box-shadow: 1px 1px 13px #20232e, -1px -1px 33px #545b78;
  color: #d6d6d6;
  transition: 100ms;
}

.input {
  flex-grow: 1;
  height: 100%;
  border: none;
  outline: none;
  padding-left: 15px;
  background-color: transparent;
  color: white;
  font-size: 1em;
}

#search-input {
  border: 1px solid #404c5d;
  background: rgba(41, 37, 36, 0.6);
  color: var(--fg);
  padding: 10px 12px;
  border-radius: 18px;
  font-family: "Montserrat", Arial, Helvetica, sans-serif;
  font-size: 14px;
  outline: none;
  width: 100%;
  resize: none;
  line-height: 1.35;
  min-height: 45px;
  max-height: 45px;
  overflow-y: hidden;
  backdrop-filter: blur(15px);
  transition: background-color 0.2s ease, transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
  padding-right: 15px;
  margin: 0;
  box-shadow: none;
}

#search-input:focus,
#sort-select:focus {
  border: 1px solid #fff;
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.24), 0 0 18px rgba(255, 255, 255, 0.18);
  outline: none;
}

.input-wrapper:focus-within #search-input {
  border-color: rgba(255, 255, 255, 0.95);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, 0.2), 0 0 16px rgba(255, 255, 255, 0.16);
}

#search-btn,
.order-btn,
.load-more-btn,
.add-btn {
  padding: 8px 16px;
  border-radius: 5px;
  letter-spacing: 0;
}

.Subscribe-btn {
  height: 100%;
  width: 80px;
  border: none;
  border-radius: 25px;
  color: rgb(0, 0, 0);
  cursor: pointer;
  background-color: #ffffff;
  font-weight: 600;
  font-size: 12px;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  transition: all 0.5s ease;
  margin: 0;
  padding: 0 8px;
  flex-shrink: 0;
}

.arrow {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) translateX(-12px);
  opacity: 0;
  transition: all 0.5s ease;
  fill: #000;
  pointer-events: none;
}

.btn-text {
  display: inline-block;
  white-space: nowrap;
  line-height: 1;
  transition: all 0.5s ease;
}

.Subscribe-btn:hover {
  color: #000;
  background-color: #f0f0f0;
}

.Subscribe-btn.is-animating .arrow {
  transform: translate(-50%, -50%) translateX(0);
  opacity: 0.95;
  animation: jello-vertical 0.9s both;
  transform-origin: right;
}

.Subscribe-btn.is-animating .btn-text {
  transform: translateX(10px);
  opacity: 0;
}

.Subscribe-btn:active {
  transform: scale(0.9);
}

.photo-search-btn {
  width: 58px;
  min-width: 58px;
  height: 58px;
  border-radius: 12px;
  font-size: 20px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
}

.photo-search-btn:active {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  transform: scale(0.98);
}

.photo-icon {
  width: 30px;
  height: 30px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.15));
}

.hidden-file-input {
  display: none;
}

#search-btn:active,
.order-btn:active,
.load-more-btn:active,
.add-btn:active,
.cart-button:active {
  background: #fff;
  color: #000;
  transform: scale(0.98);
}

.status {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  border: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

#loader-container {
  display: none;
  justify-content: center;
  padding: 20px;
  margin: 12px 0 16px;
}

.loader {
  width: 52px;
  height: 52px;
  position: relative;
  transform: rotate(45deg);
}

.loader span {
  position: absolute;
  width: 22px;
  height: 22px;
  background: rgba(255, 255, 255, 0.88);
  border-radius: 6px;
  box-shadow: 0 0 12px rgba(255, 255, 255, 0.35);
  animation: loaderPulse 1.2s ease-in-out infinite;
}

.loader span:nth-child(1) { top: 0; left: 0; animation-delay: 0s; }
.loader span:nth-child(2) { top: 0; right: 0; animation-delay: 0.15s; }
.loader span:nth-child(3) { bottom: 0; right: 0; animation-delay: 0.3s; }
.loader span:nth-child(4) { bottom: 0; left: 0; animation-delay: 0.45s; }

.results {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}

.results-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 28px 16px;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(41, 37, 36, 0.45);
}

.load-more-wrap {
  margin-top: 14px;
  display: flex;
  justify-content: center;
}

.load-more-btn {
  min-width: 170px;
}

.card {
  border: 1px solid var(--line-soft);
  border-radius: 16px;
  padding: 12px;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(15px);
  box-shadow: none;
  transform: translateY(0);
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
  animation: fadeIn 0.5s ease both;
}

.card:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14), 0 14px 30px rgba(0, 0, 0, 0.45);
}

.carousel-wrap {
  position: relative;
}

.carousel {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 12px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.carousel::-webkit-scrollbar {
  display: none;
}

.carousel-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  scroll-snap-align: start;
}

.title {
  margin: 8px 0;
  font-family: "Montserrat", Arial, Helvetica, sans-serif;
  font-size: 24px;
  letter-spacing: 0;
  line-height: 1.35;
  min-height: 56px;
  font-weight: 700;
}

.price {
  margin: 0 0 8px;
  font-size: 18px;
  font-weight: bold;
  font-family: "Montserrat", Arial, Helvetica, sans-serif;
}

.add-btn {
  width: 100%;
  margin-top: 4px;
}

.cart-panel {
  position: fixed;
  right: 0;
  top: 0;
  width: min(420px, 100%);
  height: 100%;
  background: rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(15px);
  border: 1px solid var(--line-soft);
  border-top: 0;
  border-radius: 0 0 20px 20px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  transform: translateX(0);
  opacity: 1;
  transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease;
}

.hidden {
  display: none;
}

.cart-panel.hidden {
  display: flex;
  transform: translateX(104%);
  opacity: 0;
  pointer-events: none;
}

.cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  border-bottom: 1px solid var(--line-soft);
}

.cart-header h2 {
  margin: 0;
  font-family: "Montserrat", Arial, Helvetica, sans-serif;
  letter-spacing: 0;
  font-size: 26px;
  font-weight: 700;
}

.link-btn {
  border-radius: 10px;
  padding: 5px 8px;
  text-decoration: none;
  font-family: "Montserrat", Arial, Helvetica, sans-serif;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.18s ease;
  width: auto;
  min-width: 46px;
  height: 42px;
  margin: 0;
}

.close-icon {
  width: 30px;
  height: 30px;
  object-fit: contain;
  filter: drop-shadow(0 0 8px rgba(255, 255, 255, 0.15));
}

.cart-items {
  flex: 1;
  overflow: auto;
  padding: 12px;
}

.cart-item {
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding: 8px 0;
  font-family: "Montserrat", Arial, Helvetica, sans-serif;
}

.cart-footer {
  border-top: 1px solid var(--line-soft);
  padding: 12px;
}

.title,
.price,
.cart-header h2,
.total-line,
.cart-item,
#sort-select,
#search-input,
#search-btn,
.order-btn,
.load-more-btn,
.add-btn,
.link-btn {
  color: #fff;
}

.cart-button:hover,
.order-btn:hover,
.load-more-btn:hover,
.add-btn:hover,
.photo-search-btn:hover,
.link-btn:hover {
  border-color: rgba(255, 255, 255, 0.65);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.18), 0 0 20px rgba(255, 255, 255, 0.12);
}

.cart-button:hover,
.order-btn:hover,
.load-more-btn:hover,
.add-btn:hover,
.photo-search-btn:hover,
.link-btn:hover {
  transform: translateY(-1px);
}

button:active {
  transform: scale(0.95);
}

.Subscribe-btn:active {
  transform: scale(0.9);
}

@keyframes jello-vertical {
  0% { transform: translate(-50%, -50%) scale3d(1, 1, 1); }
  30% { transform: translate(-50%, -50%) scale3d(0.75, 1.25, 1); }
  40% { transform: translate(-50%, -50%) scale3d(1.25, 0.75, 1); }
  50% { transform: translate(-50%, -50%) scale3d(0.85, 1.15, 1); }
  65% { transform: translate(-50%, -50%) scale3d(1.05, 0.95, 1); }
  75% { transform: translate(-50%, -50%) scale3d(0.95, 1.05, 1); }
  100% { transform: translate(-50%, -50%) scale3d(1, 1, 1); }
}

.total-line {
  margin-bottom: 10px;
  font-family: "Montserrat", Arial, Helvetica, sans-serif;
}

.cart-bounce {
  animation: cartBounce 0.48s ease;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes cartBounce {
  0% { transform: scale(1); }
  30% { transform: scale(1.2); }
  50% { transform: scale(0.92); }
  70% { transform: scale(1.08); }
  100% { transform: scale(1); }
}

@keyframes loaderPulse {
  0%, 100% { transform: scale(0.65); opacity: 0.55; }
  50% { transform: scale(1); opacity: 1; }
}

@media (max-width: 640px) {
  main {
    padding: 12px;
  }

  .results {
    grid-template-columns: 1fr;
  }

  .toolbar {
    margin-top: 8px;
  }

  #sort-select {
    width: 100%;
  }

  .toolbar {
    padding-left: 0;
  }

  .photo-search-btn {
    width: 52px;
    min-width: 52px;
    height: 52px;
  }

  #search-input {
    min-height: 44px;
    max-height: 44px;
    padding-right: 12px;
  }

  .input-wrapper {
    width: 100%;
    max-width: none;
  }

  .Subscribe-btn {
    width: 76px;
    font-size: 11px;
  }
}
