:root {
  --gran-paper: #faf7f2;
  --gran-ink: #2b231f;
  --gran-dark: #302322;
  --gran-line: #dfd5cb;
  --gran-gutter: clamp(16px, 4.2vw, 70px);
  --gran-serif: Georgia, 'Times New Roman', serif;
}
body { background: var(--gran-paper); color: var(--gran-ink); }
.mg-servicebar { background: var(--gran-dark); }
.mg-servicebar > .mg-container { justify-content: center; min-height: 40px; }
.mg-header, .mg-navigation, .mg-footer { background: var(--gran-paper); color: var(--gran-ink); }
.mg-header .mg-header-main { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr); gap: clamp(12px, 2vw, 30px); min-height: 95px; }
.mg-header-main .mg-logo { grid-column: 2; grid-row: 1; }
.mg-header-main .mg-header-actions { grid-column: 3; grid-row: 1; justify-content: end; }
.mg-logo.mg-logo-engraving { display: inline-flex; justify-content: center; align-items: center; width: clamp(126px, 17.5vw, 272px); height: auto; min-height: 44px; flex: none; }
.mg-logo-engraving img { display: block; width: 100%; height: auto; }
.mg-footer .mg-logo.mg-logo-engraving { width: 115px; }
.mg-navigation, .mg-footer, .mg-footer-contacts { border-color: var(--gran-line); }
.mg-catalog-toggle, .mg-button, .woocommerce a.button.alt, .woocommerce button.button.alt, .woocommerce input.button.alt {
  background: var(--gran-dark); color: var(--gran-paper); border-radius: 0;
}
.mg-catalog-toggle:hover, .mg-button:hover, .woocommerce a.button.alt:hover, .woocommerce button.button.alt:hover { background: #58443d; color: var(--gran-paper); }
.mg-header-actions a:hover, .mg-navigation a:hover, .mg-category-sidebar a:hover { color: #785747; }
.mg-cart-count { background: var(--gran-dark); }
.mg-home.mg-container { width: 100%; max-width: none; padding-top: 0; }
.mg-home > :not(.mg-first-screen) { width: min(1440px, calc(100% - 2 * var(--gran-gutter))); margin-inline: auto; }
.mg-home .mg-first-screen { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(14px, 2.3vw, 35px); }
.mg-home .mg-hero { grid-row: 1; grid-column: 1; border-radius: 0; min-height: clamp(380px, 43vw, 660px); background-color: #2c1b19; background-image: linear-gradient(90deg, #211613ed, #241815ab 32%, transparent 68%), url('hero.jpg'); background-position: center, center 49%; }
.mg-home .mg-hero-copy { width: min(50%, 760px); padding: clamp(28px, 4.4vw, 68px) var(--gran-gutter); }
.mg-home .mg-hero h1 { font: 400 clamp(41px, 5.7vw, 88px)/.95 var(--gran-serif); letter-spacing: -.055em; text-transform: none; transform: none; text-shadow: none; color: #fff7ee; }
.mg-home .mg-hero p { max-width: 34ch; font-size: clamp(15px, 1.5vw, 23px); }
.mg-home .mg-hero .mg-button { background: #f9f0e6; color: var(--gran-dark); min-height: 44px; }
.mg-home .mg-category-sidebar, .mg-home .mg-side-promos { grid-column: 1; width: min(1440px, calc(100% - 2 * var(--gran-gutter))); margin-inline: auto; }
.mg-home .mg-category-sidebar { grid-row: 2; padding: 0; display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); background: transparent; border-radius: 0; }
.mg-home .mg-category-sidebar a { min-width: 0; min-height: 58px; gap: 8px; padding: 8px; border-bottom: 1px solid var(--gran-line); }
.mg-home .mg-category-sidebar .mg-icon { flex-shrink: 0; }
.mg-home .mg-side-promos { grid-row: 3; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: auto; gap: clamp(10px, 1.6vw, 24px); margin-top: 0; }
.mg-home .mg-promo, .mg-home .mg-goal-card, .mg-home .mg-journal-card { border-radius: 0; }
.mg-home .mg-section-title h2, .mg-page > h1, .mg-shop > h1, .mg-footer h2 { font: 400 clamp(30px, 3.4vw, 52px)/1.03 var(--gran-serif); letter-spacing: -.04em; text-transform: none; }
.mg-footer h2 { font-size: 20px; }
@media (max-width: 1000px) {
  .mg-home .mg-category-sidebar { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .mg-header .mg-header-main { grid-template-columns: minmax(0, 1fr) auto; row-gap: 8px; padding-block: 8px; }
  .mg-header-main .mg-logo { grid-column: 1; justify-self: start; }
  .mg-header-main .mg-header-actions { grid-column: 2; }
  .mg-home .mg-hero { min-height: 380px; align-items: end; background-image: linear-gradient(0deg, #211613 0%, #211613e6 23%, #21161348 55%, transparent 85%), url('hero.jpg'); background-position: center, 64% center; }
  .mg-home .mg-hero-copy { width: 100%; padding-block: 24px; }
  .mg-home .mg-hero p { margin-block: 10px 14px; }
  .mg-home .mg-category-sidebar { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mg-home .mg-side-promos { grid-template-columns: minmax(0, 1fr); }
}
.gran-catalog-hero { position: relative; isolation: isolate; display: grid; align-items: center; overflow: hidden; min-height: clamp(400px, 43vw, 660px); background: #2c1b19; color: #fff7ee; }
.gran-catalog-hero-photo { position: absolute; z-index: -2; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 50% 49%; }
.gran-catalog-hero::after { position: absolute; z-index: -1; inset: 0; content: ''; background: linear-gradient(90deg, #211613e6, #241815aa 31%, transparent 61%); }
.gran-catalog-hero-copy { padding: 25px var(--gran-gutter); }
.gran-catalog-kicker { margin: 0 0 10px; font-size: clamp(11px, 1.08vw, 17px); font-weight: 700; line-height: 1.4; letter-spacing: .16em; text-transform: uppercase; }
.gran-catalog-hero h1 { margin: 0; font: 400 clamp(56px, 9vw, 142px)/.95 var(--gran-serif); letter-spacing: -.06em; color: inherit; }
.gran-catalog-intro { margin: 16px 0 22px; max-width: 27ch; font-size: clamp(15px, 1.65vw, 25px); }
.gran-catalog-hero .mg-button { background: #f9f0e6; color: var(--gran-dark); min-height: 44px; }
.gran-catalog-credit { position: absolute; bottom: 16px; right: var(--gran-gutter); padding: 7px 11px; background: #211715d9; text-transform: uppercase; font-size: 11px; letter-spacing: .1em; }
.gran-catalog-section { padding-block: clamp(23px, 2.4vw, 37px); }
.gran-catalog-heading { display: flex; align-items: end; justify-content: space-between; gap: 10px 16px; flex-wrap: wrap; margin-bottom: 16px; }
.gran-catalog-heading h2 { margin: 0; font: 400 clamp(30px, 4.2vw, 66px)/1.05 var(--gran-serif); letter-spacing: -.048em; }
.gran-catalog-heading a { text-decoration: underline; text-underline-offset: .24em; }
.gran-catalog-heading .gran-catalog-kicker { color: #665951; }
.gran-catalog-categories { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: clamp(8px, 1.4vw, 24px); }
.gran-catalog-category img { display: block; width: 100%; aspect-ratio: 1.35; object-fit: cover; }
.gran-catalog-category[href*="/necklaces/"] img { object-position: center 77%; }
.gran-catalog-category > span { display: flex; justify-content: space-between; gap: 4px; align-items: center; padding: 9px 2px; border-bottom: 1px solid var(--gran-line); }
.gran-catalog-collection { border-top: 1px solid var(--gran-line); }
.gran-catalog-collection .mg-product-card { border-radius: 0; }
.gran-catalog-collection .mg-product-brand:empty { display: none; }
.gran-catalog-collection .mg-product-image { aspect-ratio: 1; }
.gran-catalog-collection .mg-product-image img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 720px) {
  .gran-catalog-hero { min-height: 390px; align-items: end; }
  .gran-catalog-hero-photo { height: 76%; object-position: 73% 44%; }
  .gran-catalog-hero::after { background: linear-gradient(0deg, #211613 19%, #211613e6 34%, transparent 76%); }
  .gran-catalog-credit { display: none; }
  .gran-catalog-categories { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

.mg-header-main .mg-mobile-search { display: none; }
@media (max-width: 720px) {
  .mg-header-main .mg-mobile-search { display: flex; grid-column: 1 / -1; grid-row: 2; width: 100%; min-width: 0; }
  .mg-mobile-search button { background: var(--gran-dark); color: var(--gran-paper); border-radius: 0; }
  .mg-mobile-search button:hover { background: #58443d; color: var(--gran-paper); }
}

/* Грань — светлая галерея */
.mg-shop > .page-title {
  font-size: clamp(34px, 4.3vw, 64px);
  text-align: center;
}

.mg-shop .woocommerce-ordering select {
  background-color: transparent;
  border-color: var(--gran-line, #dfd5cb);
  border-radius: 24px;
  color: inherit;
}

.mg-shop > ul.products {
  column-gap: clamp(12px, 1.7vw, 24px);
  row-gap: clamp(24px, 3vw, 40px);
}

.mg-shop > ul.products > .mg-product-card {
  padding: 0;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  overflow: visible;
}

.mg-shop .mg-product-card > .mg-product-image {
  display: block;
  height: auto;
  padding: 0;
  aspect-ratio: 11 / 10;
  overflow: hidden;
  border-radius: 5px;
  background: #ece4d9;
}

.mg-shop .mg-product-card > .mg-product-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.mg-shop .mg-product-image .woocommerce-placeholder {
  object-fit: contain;
  padding: 19%;
  mix-blend-mode: multiply;
}

.mg-shop .mg-product-card > .mg-wishlist-button {
  top: 9px;
  right: 9px;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  background: var(--gran-paper, #faf7f2);
  color: var(--gran-dark, #302322);
}

.mg-shop .mg-wishlist-button .mg-icon {
  width: 18px;
  height: 18px;
}

.mg-shop .mg-product-info {
  padding-top: 12px;
}

.mg-shop .mg-product-brand:empty {
  display: none;
}

.mg-shop .mg-product-info h3 {
  min-height: 0;
  margin-bottom: 12px;
  font: 400 clamp(16px, 1.8vw, 24px) / 1.17 var(--gran-serif, Georgia, serif);
  letter-spacing: -.035em;
}

.mg-shop .mg-product-info h3 a:hover {
  color: #69483d;
}

.mg-shop .mg-product-buy {
  flex-flow: row wrap;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}

.mg-shop .mg-product-buy .price {
  font-size: clamp(13px, 1.35vw, 17px);
  font-weight: 600;
  letter-spacing: -.02em;
}

.mg-shop .mg-product-buy .price del {
  display: block;
  font-size: .8em;
}

.mg-shop .mg-product-buy .mg-cart-button {
  flex: 0 0 auto;
  width: auto;
  min-height: 44px;
  padding: 0 12px;
  gap: 6px;
  border: 1px solid #8a6c60;
  border-radius: 999px;
  background: transparent;
  color: var(--gran-dark, #302322);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}

.mg-shop .mg-cart-button .mg-icon {
  width: 16px;
  height: 16px;
}

.mg-shop .mg-product-buy .mg-cart-button:hover {
  border-color: var(--gran-dark, #302322);
  background: var(--gran-dark, #302322);
  color: var(--gran-paper, #faf7f2);
}

@media (max-width: 480px) {
  .mg-shop .mg-product-card > .mg-wishlist-button {
    top: 6px;
    right: 6px;
    width: 34px;
    height: 34px;
  }

  .mg-shop .mg-product-buy .mg-cart-button {
    padding-inline: 8px;
  }

  .mg-shop .mg-cart-button .mg-icon {
    display: none;
  }
}

/* Gran: taller desktop navigation */
.mg-navigation .mg-catalog-toggle {
  position: relative;
}

.mg-navigation .mg-catalog-toggle::after {
  content: '';
  position: absolute;
  inset-inline: 0;
  inset-block-end: -1px;
  block-size: 1px;
  background: inherit;
  pointer-events: none;
}

@media (min-width: 721px) {
  .mg-navigation {
    display: grid;
    min-block-size: 55px;
  }

  .mg-navigation > .mg-container > nav {
    align-items: stretch;
  }

  .mg-navigation > .mg-container > nav > a {
    display: flex;
    align-items: center;
    padding-block: 0;
  }
}

@media (max-width: 720px) {
  .mg-header-main .mg-logo-engraving { width: min(151.2px, 100%); }
}

/* Gran: crystal catalog cards */
.mg-shop > ul.products > .mg-product-card {
  justify-self: center;
  width: 100%;
  max-width: calc(100% - clamp(8px, 5vw - 36px, 28px));
}

.mg-shop .mg-product-card > .mg-product-image {
  aspect-ratio: 1;
  border-radius: 24px;
}

.mg-shop .mg-product-card > .mg-wishlist-button {
  --gran-heart-radius: 15px;
  background: radial-gradient(circle, var(--gran-paper, #faf7f2) calc(var(--gran-heart-radius) - .5px), transparent var(--gran-heart-radius));
}

.mg-shop .mg-wishlist-button .mg-icon {
  width: 14px;
  height: 14px;
}

.mg-shop .mg-product-card > .mg-wishlist-button[aria-pressed='true'] {
  color: #71383f;
}

.mg-shop .mg-wishlist-button[aria-pressed='true'] .mg-icon {
  fill: currentColor;
}

.mg-shop .gran-product-model {
  font-style: italic;
}

.mg-shop .mg-product-buy .mg-cart-button,
.mg-shop .mg-product-buy .mg-cart-button:hover {
  position: relative;
  isolation: isolate;
  min-width: 102px;
  min-height: 34px;
  gap: 6px;
  padding: 0 10px;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #523831;
}

.mg-shop .mg-cart-button::before {
  position: absolute;
  z-index: -1;
  inset: 0;
  content: '';
  background: center / 100% 100% no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 102 34' preserveAspectRatio='none'%3E%3Cpath d='M12 .5H90L101.5 11v12L90 33.5H12L.5 23V11Z' fill='%23f8f0e8' stroke='%23ab9182' vector-effect='non-scaling-stroke'/%3E%3C/svg%3E");
}

.mg-shop .mg-cart-button:hover::before {
  filter: brightness(.95);
}

.mg-shop .mg-cart-button .mg-icon {
  display: none;
}

.mg-shop .mg-cart-button::after {
  order: -1;
  flex: 0 0 13px;
  height: 15px;
  content: '';
  background: currentColor;
  mask: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 28'%3E%3Cpath d='m18 2 3 10.5L8.5 26 3 15.5 18 2 6 21l15-8.5' fill='none' stroke='black' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

@media (max-width: 720px) {
  .mg-shop .mg-product-card > .mg-wishlist-button {
    --gran-heart-radius: 13px;
    top: 1px;
    right: 1px;
    width: 44px;
    height: 44px;
  }

  .mg-shop .mg-wishlist-button .mg-icon {
    width: 13px;
    height: 13px;
  }

  .mg-shop .mg-product-buy .mg-cart-button,
  .mg-shop .mg-product-buy .mg-cart-button:hover {
    min-height: 44px;
  }

  .mg-shop .mg-cart-button::before {
    inset-block: 5px;
  }
}

@media (max-width: 365px) {
  .mg-shop > ul.products > .mg-product-card {
    max-width: 100%;
  }

  .mg-shop .mg-product-buy .mg-cart-button,
  .mg-shop .mg-product-buy .mg-cart-button:hover {
    min-width: 87px;
    gap: 4px;
    padding-inline: 6px;
    font-size: 11px;
  }
}

/* Gran: compact mobile footer */
.mg-footer .gran-footer-contacts--mobile {
  display: none;
}

@media (max-width: 720px) {
  .mg-footer .mg-footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .mg-footer .mg-footer-grid > div:first-child {
    grid-column: 1 / -1;
  }

  .mg-footer .mg-footer-grid > .gran-footer-catalog,
  .gran-footer-contacts--desktop {
    display: none;
  }

  .mg-footer .mg-footer-grid > .gran-footer-about,
  .mg-footer .gran-footer-about > a {
    display: block;
  }

  .mg-footer .gran-footer-contacts--mobile {
    display: grid;
    justify-items: start;
    gap: 3px;
    margin-top: 16px;
    padding-block: 0;
    line-height: 1.5;
    overflow-wrap: anywhere;
  }

  .mg-footer .gran-footer-contacts--mobile > :is(br, .mg-footer-contact-separator) {
    display: none;
  }

  .mg-footer .mg-footer-bottom {
    margin-top: 16px;
    border-top-color: var(--gran-line);
  }

  .mg-footer .mg-footer-bottom-links {
    padding-inline-end: 90px;
  }
}

/* Gran: mobile footer links beside copyright */
@media (max-width: 720px) {
  .mg-footer .mg-footer-bottom {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 3px;
    padding-bottom: 0;
    font-size: clamp(9.4px, 2.8vw, 12px);
    white-space: nowrap;
  }

  .mg-footer .mg-footer-bottom-links {
    display: flex;
    flex-wrap: nowrap;
    gap: clamp(12px, 4vw, 32px);
    margin-inline-start: auto;
    padding-inline-end: 0;
  }

  body > .mg-callback-launch {
    --gran-chat-footer-offset: 42px;
    position: sticky;
    right: auto;
    bottom: calc(max(14px, env(safe-area-inset-bottom)) - var(--gran-chat-footer-offset));
    display: flex;
    width: max-content;
    margin: -44px max(14px, env(safe-area-inset-right)) 0 auto;
    /* Keep the floating position during scroll and clear the links at page end. */
    transform: translateY(calc(-1 * var(--gran-chat-footer-offset)));
  }
}

/* Gran: mobile footer logo spacing */
@media (max-width: 720px) {
  footer.mg-footer {
    padding-top: 5.25px;
  }

  .mg-footer > .mg-container.mg-footer-grid {
    /* The logo link adds 19.45px below the image, and the heading adds 3px. */
    row-gap: 10.55px;
  }

  .mg-footer .mg-footer-grid > div:first-child {
    flex-direction: row;
    align-items: center;
  }

  .mg-footer .mg-footer-grid > div:first-child .mg-logo {
    flex-basis: 130px;
  }
}

@media (max-width: 700px) {
  footer.mg-footer {
    padding-top: 2.75px;
  }
}

/* Pearl portrait on the homepage. */
.gran-catalog-hero--pearl {
  background-color: #250108;
}

.gran-catalog-hero--pearl .gran-catalog-hero-photo {
  inset: -6% 0 auto auto;
  width: auto;
  height: 112%;
  max-width: none;
  mask-image: linear-gradient(90deg, transparent, #000 22%);
}

.gran-catalog-hero--pearl::after {
  display: none;
}

@media (max-width: 720px) {
  .gran-catalog-hero--pearl {
    min-height: clamp(346.5px, 61.2vw, 382.5px);
    align-items: end;
  }

  .gran-catalog-hero--pearl .gran-catalog-hero-photo {
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 60% 40%;
    mask-image: none;
  }

  .gran-catalog-hero--pearl .gran-catalog-hero-copy {
    padding-block-end: 30px;
  }

  .gran-catalog-hero--pearl .gran-catalog-intro {
    margin-block: 8px 7px;
  }

  .gran-catalog-hero--pearl .gran-catalog-kicker,
  .gran-catalog-hero--pearl h1,
  .gran-catalog-hero--pearl .gran-catalog-intro {
    text-shadow: 0 1px 5px #17040bb3;
  }
}

@media (max-width: 360px) {
  .gran-catalog-hero--pearl {
    min-height: 327.25px;
  }

  .gran-catalog-hero--pearl .gran-catalog-hero-photo {
    object-position: 74% 38%;
  }
}
