/* Точечные улучшения поверх исходного дизайна Nexoria. */

:root {
  --site-max: 1400px;
  --site-gutter: 28px;
}

.logo-mark {
  display: inline-flex !important;
  align-items: center;
  gap: 9px;
  white-space: nowrap;
}

.brand-logo-image,
.footer-brand-logo {
  display: block;
  object-fit: contain;
  flex: 0 0 auto;
}

.brand-logo-image {
  width: 42px;
  height: 42px;
  filter: drop-shadow(0 4px 7px rgba(21, 53, 204, 0.16));
}

.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.footer-brand-logo {
  width: 52px;
  height: 52px;
  filter: drop-shadow(0 6px 12px rgba(40, 87, 240, 0.3));
}

html {
  scroll-padding-top: 90px;
}

body {
  background: #f2f4ff;
}

.site-banner {
  width: min(calc(100% - (var(--site-gutter) * 2)), var(--site-max));
  margin: 28px auto 0;
  border-radius: 28px;
}

nav {
  padding-left: max(52px, calc((100vw - var(--site-max)) / 2)) !important;
  padding-right: max(52px, calc((100vw - var(--site-max)) / 2)) !important;
}

/* Персонажи стоят на нижней линии баннера и масштабируются только по ширине. */
.page-home .hero-char {
  display: block !important;
  top: auto !important;
  bottom: 24px !important;
  animation: none !important;
  transform: none !important;
}

.page-home .hero-char:nth-of-type(2) {
  left: 1.5% !important;
  width: clamp(250px, 26vw, 390px) !important;
}

.page-home .hero-char:nth-of-type(3) {
  right: 3% !important;
  width: clamp(230px, 23vw, 350px) !important;
}

#shop .products-grid {
  grid-template-columns: repeat(auto-fill, minmax(225px, 1fr)) !important;
}

.products-grid .product-media {
  height: auto !important;
  aspect-ratio: 1 / 1 !important;
}

.products-grid .product-body {
  padding: 20px 22px 22px !important;
}

.products-grid .product-buy {
  padding-left: 18px !important;
  padding-right: 18px !important;
}

/* Согласованный новый вид единственной карточки Wiki. */
.wiki-guides {
  grid-template-columns: minmax(0, 1fr) !important;
  max-width: 1100px;
  margin: 0 auto;
}

.wiki-guides > a {
  width: 100%;
}

.wiki-feature-card {
  display: grid !important;
  grid-template-columns: minmax(300px, .9fr) minmax(430px, 1.1fr);
  min-height: 360px !important;
  border-radius: 26px !important;
}

.wiki-feature-copy {
  padding: 48px 42px !important;
}

.wiki-feature-copy h3 {
  font-size: 30px !important;
  margin-bottom: 12px !important;
}

.wiki-feature-copy p {
  max-width: 440px;
  font-size: 16px !important;
}

.wiki-count {
  display: inline-block;
  margin-bottom: 24px;
  color: #1e3fcc;
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.wiki-feature-art {
  min-height: 360px;
  margin-top: 0 !important;
  background: linear-gradient(145deg, #f3f6ff, #e2e9ff);
  overflow: hidden;
}

.wiki-feature-art > div:last-child {
  bottom: -115px !important;
  width: 430px !important;
}

/* Окно оформления остаётся, на маленьких экранах прокручивается целиком. */
.modal-card {
  max-height: calc(100dvh - 28px);
  border-radius: 16px !important;
  overflow-y: auto !important;
  overscroll-behavior: contain;
}

.modal-left,
.modal-right {
  padding: 30px !important;
}

.modal-card input[type="text"],
.modal-card input[type="email"] {
  padding: 12px 15px !important;
  border-width: 1px !important;
  border-radius: 9px !important;
  font-size: 14px !important;
}

.mobile-order-product {
  display: none;
}

.cookie-panel {
  width: 100%;
}

.page-rules .rules-char,
.page-contacts .contacts-art {
  animation: none !important;
  transform: none !important;
}

.page-rules .rules-char img,
.page-contacts .contacts-art img {
  max-width: 100%;
}

@media (max-width: 1300px) {
  .page-rules .rules-layout {
    grid-template-columns: minmax(0, 680px) !important;
    justify-content: center;
  }

  .page-rules .rules-char {
    display: none !important;
  }
}

@media (max-width: 1100px) {
  #shop .products-grid {
    gap: 18px !important;
  }

  .page-contacts .contacts-layout {
    grid-template-columns: minmax(0, 1fr) !important;
    padding-top: 34px !important;
  }

  .page-contacts .contacts-char {
    display: none !important;
  }

  .page-contacts .contacts-cards {
    max-width: none !important;
  }
}

@media (max-width: 900px) {
  :root {
    --site-gutter: 20px;
  }

  .site-banner {
    margin-top: 20px;
    border-radius: 24px;
  }

  .page-home .hero-anim {
    padding-bottom: 90px !important;
    overflow: hidden !important;
  }

  .page-home .hero-char {
    display: none !important;
  }

  .modal-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }

  .wiki-feature-card {
    grid-template-columns: minmax(0, 1fr);
  }

  .wiki-feature-art {
    min-height: 320px;
  }

  .wiki-feature-art > div:last-child {
    bottom: -100px !important;
  }

  .page-crafts .recipes-grid {
    grid-template-columns: minmax(0, 1fr) !important;
  }
}

@media (max-width: 640px) {
  :root {
    --site-gutter: 12px;
  }

  nav {
    height: auto !important;
    min-height: 0;
    padding: 13px 12px 11px !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 9px;
  }

  nav > div:first-child {
    justify-self: center;
  }

  nav .logo-mark {
    font-size: 19px !important;
  }

  .brand-logo-image {
    width: 36px;
    height: 36px;
  }

  nav > div:nth-child(2) {
    width: 100%;
    justify-self: stretch !important;
    justify-content: center;
    gap: 2px !important;
  }

  nav > div:nth-child(2) a {
    min-height: 38px;
    padding: 9px 10px !important;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px !important;
    white-space: nowrap;
  }

  .site-banner {
    margin-top: 12px;
    border-radius: 20px;
  }

  .site-banner:not(.hero-anim) {
    padding: 46px 22px 54px !important;
  }

  .site-banner:not(.hero-anim) h1 {
    font-size: clamp(38px, 12vw, 54px) !important;
    letter-spacing: -1.5px !important;
  }

  .site-banner:not(.hero-anim) p {
    font-size: 16px !important;
  }

  .page-home .hero-anim {
    padding: 58px 18px 64px !important;
  }

  .page-home .hero-anim h1 {
    font-size: clamp(48px, 19vw, 78px) !important;
    letter-spacing: -3px !important;
  }

  .page-home .hero-anim p {
    margin-bottom: 34px !important;
  }

  #shop {
    padding-top: 52px !important;
  }

  #shop > div:first-child {
    align-items: flex-start !important;
  }

  #shop .currency-switcher {
    max-width: 100%;
    gap: 2px !important;
  }

  #shop .currency-switcher button {
    padding: 9px 10px !important;
    font-size: 13px !important;
    white-space: nowrap;
  }

  .shop-sidebar {
    margin-left: -8px;
    margin-right: -8px;
    padding: 0 8px 8px !important;
    scrollbar-width: none;
  }

  .shop-sidebar::-webkit-scrollbar {
    display: none;
  }

  .shop-sidebar button {
    min-height: 46px;
  }

  #shop .products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    gap: 10px !important;
  }

  .product-card {
    border-radius: 16px !important;
  }

  .products-grid .product-media {
    height: auto !important;
    aspect-ratio: 1 / 1 !important;
  }

  .products-grid .product-body {
    padding: 13px 11px 12px !important;
  }

  .products-grid .product-icon {
    width: 48px !important;
    height: 48px !important;
    border-radius: 13px !important;
  }

  .products-grid .product-name {
    min-height: 38px;
    font-size: 17px !important;
    letter-spacing: -0.25px !important;
    overflow-wrap: anywhere;
  }

  .products-grid .product-actions {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    align-items: stretch !important;
    gap: 11px;
    margin-top: 15px !important;
    padding-top: 13px !important;
  }

  .products-grid .product-price {
    font-size: 25px !important;
  }

  .products-grid .product-currency {
    font-size: 15px !important;
  }

  .products-grid .product-buy {
    width: 100%;
    min-height: 44px;
    padding: 11px 8px !important;
    border-radius: 12px !important;
    font-size: 14px !important;
  }

  .modal-card {
    max-height: calc(100dvh - 16px);
    border-radius: 20px !important;
  }

  .modal-left,
  .modal-right {
    padding-left: 20px !important;
    padding-right: 20px !important;
  }

  .modal-card input[type="text"],
  .modal-card input[type="email"] {
    font-size: 16px !important;
  }

  .mobile-order-product {
    display: block;
    margin: -6px 0 22px;
    color: #0b1a6e;
    font-size: 24px;
    font-weight: 900;
    line-height: 1.15;
  }

  .cookie-panel {
    display: grid !important;
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 12px !important;
    padding: 14px !important;
    border-radius: 16px !important;
  }

  .cookie-panel > img {
    width: 46px !important;
    height: 46px !important;
  }

  .cookie-panel > div:nth-of-type(1) {
    min-width: 0 !important;
    font-size: 12px !important;
    line-height: 1.45 !important;
  }

  .cookie-panel > div:nth-of-type(2) {
    grid-column: 1 / -1;
    justify-content: flex-end;
  }

  .cookie-panel button {
    min-height: 42px;
    padding: 10px 16px !important;
  }

  .dur-row,
  .qty-row {
    flex-wrap: wrap;
  }

  .dur-row button,
  .qty-row button {
    flex: 1 1 calc(50% - 4px) !important;
  }

  .wiki-page-content {
    padding-top: 38px !important;
  }

  .wiki-feature-card {
    min-height: 0 !important;
    border-radius: 22px !important;
  }

  .wiki-feature-copy {
    padding: 28px 24px !important;
  }

  .wiki-feature-copy h3 {
    font-size: 25px !important;
  }

  .wiki-feature-copy p {
    font-size: 15px !important;
  }

  .wiki-feature-art {
    min-height: 270px;
  }

  .wiki-feature-art > div:last-child {
    bottom: -78px !important;
    width: 320px !important;
  }

  .page-crafts .recipes-section {
    padding-top: 38px !important;
  }

  .recipe-card {
    padding: 21px 18px !important;
  }

  .recipe-card > div:last-child {
    justify-content: center;
    gap: 10px !important;
  }

  .contacts-layout {
    padding-top: 28px !important;
  }

  .contacts-cards a {
    padding: 17px !important;
  }

  footer > div {
    padding-top: 52px !important;
  }
}

@media (max-width: 380px) {
  nav > div:nth-child(2) a {
    padding: 8px 7px !important;
    font-size: 11px !important;
  }

  .ip-pill {
    width: 100%;
  }

  .hero-cta-row > a {
    width: 100%;
    justify-content: center;
  }

  .cookie-panel {
    padding: 16px !important;
  }
}
