/*
  Shop-only additions on top of /assets/original.css and /assets/site.css.
  Only what the live homytomy.ru CSS does not cover: cart motion, the request
  form panel, radio-based size options, messages and checkout helpers.
  Colours come from the live palette (olive #545846, ivory #f2efe8,
  cream #faf8f3, champagne #d8b98a).
*/

/* ---------- Cart motion ---------- */

.cart-fly {
  position: fixed;
  left: 0;
  top: 0;
  z-index: 1000;
  width: 18px;
  height: 18px;
  margin: -9px 0 0 -9px;
  border-radius: 50%;
  pointer-events: none;
  background: radial-gradient(circle at 35% 35%, #fffdf6 0, #f1dfbd 38%, #d8b98a 72%);
  box-shadow:
    0 0 6px 2px #fff8e6,
    0 0 18px 7px rgba(241, 223, 189, .95),
    0 0 38px 14px rgba(232, 196, 122, .8),
    0 0 64px 22px rgba(216, 185, 138, .42);
  will-change: transform;
}

.cart-spark {
  position: fixed;
  z-index: 1000;
  width: 5px;
  height: 5px;
  margin: -2.5px 0 0 -2.5px;
  border-radius: 50%;
  pointer-events: none;
  background: #f1dfbd;
  box-shadow: 0 0 8px 2px rgba(216, 185, 138, .75);
  animation: cart-spark .72s cubic-bezier(.2, .7, .3, 1) forwards;
}

/* Lives inside the cart dialog, so it is positioned against the panel. */
.cart-ash {
  position: absolute;
  z-index: 2;
  width: 4px;
  height: 4px;
  margin: -2px 0 0 -2px;
  border-radius: 50%;
  pointer-events: none;
  background: #8b7553;
  animation: cart-ash .66s ease-out forwards;
}

.header-cart-button.is-pop,
.cart-float.is-pop {
  animation: cart-pop .6s cubic-bezier(.3, 1.4, .5, 1);
}

/* Round cart button for scrolled pages, where the header cart is out of sight. */
.cart-float {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 40;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .22);
  border-radius: 50%;
  background: #545846;
  color: #fff;
  box-shadow: 0 14px 34px rgba(37, 39, 31, .28);
  opacity: 0;
  visibility: hidden;
  transform: translateY(12px) scale(.92);
  transition: opacity .3s ease, transform .3s ease, visibility 0s linear .3s, background-color .2s;
}

.cart-float.is-on {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity .3s ease, transform .3s ease, visibility 0s, background-color .2s;
}

.cart-float:hover { background: #3f4435; }

.cart-float svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cart-float b {
  position: absolute;
  top: -4px;
  right: -4px;
  display: grid;
  place-items: center;
  min-width: 21px;
  height: 21px;
  padding: 0 4px;
  box-sizing: border-box;
  border: 2px solid #faf8f3;
  border-radius: 999px;
  background: #d8b98a;
  color: #303128;
  font-size: 11px;
  font-weight: 600;
  line-height: 1;
}

.cart-remove {
  display: grid;
  place-items: center;
  padding: 0;
  border-radius: 4px;
  transition: color .2s, background-color .2s;
}

.cart-remove:hover { color: #6d4030; background: #f2ede2; }

.cart-remove svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cart-item.is-leaving {
  opacity: 0;
  transform: translateX(22px);
  pointer-events: none;
  transition: opacity .4s ease, transform .4s ease;
}

@keyframes cart-spark {
  from { opacity: 1; transform: translate(0, 0) scale(1); }
  to { opacity: 0; transform: translate(var(--dx, 0), var(--dy, 0)) scale(.2); }
}

@keyframes cart-ash {
  from { opacity: .85; transform: translate(0, 0) scale(1); }
  to { opacity: 0; transform: translate(var(--dx, 0), var(--dy, 0)) scale(.3); }
}

@keyframes cart-pop {
  0% { transform: scale(1); box-shadow: 0 0 0 0 rgba(216, 185, 138, .85); }
  35% { transform: scale(1.2); }
  100% { transform: scale(1); box-shadow: 0 0 0 14px rgba(216, 185, 138, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .cart-fly,
  .cart-spark,
  .cart-ash { display: none; }
  .header-cart-button.is-pop,
  .cart-float.is-pop { animation: none; }
  .cart-float,
  .cart-float.is-on { transform: none; transition: none; }
  .cart-item.is-leaving { opacity: .4; transform: none; transition: none; }
}

/* ---------- Homepage request form ---------- */

.inquiry {
  display: grid;
  gap: 18px;
  margin-top: 20px;
  padding: 38px;
  border: 1px solid #e0d9ce;
  background: #fff;
}

.inquiry h3 {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 32px;
  font-weight: 500;
  line-height: 1.15;
}

.inquiry textarea { min-height: 120px; }
.inquiry .ht-btn { justify-self: start; }
.inquiry .alert,
.inquiry .notice { margin: 0 !important; }

@media (max-width: 640px) {
  .inquiry { padding: 28px; }
}

/* ---------- Size options built on radios ---------- */

.size-option {
  position: relative;
  cursor: pointer;
}

/* Out of sight but still focusable; also undoes the live text-input box. */
.size-option input[type="radio"] {
  position: absolute;
  left: 0;
  top: 0;
  width: 1px;
  height: 1px;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  opacity: 0;
  pointer-events: none;
}

.size-option:has(input:checked) {
  border-color: #545846;
  background: #545846;
  color: #fff;
}

.size-option:has(input:checked) strong { color: #e9e4d8; }

.size-option:has(input:focus-visible) {
  outline: 3px solid #a18354;
  outline-offset: 4px;
}

/* ---------- Product and form messages ---------- */

.alert,
.notice {
  box-sizing: border-box;
  margin: 16px 0;
  padding: 12px 16px;
  border: 1px solid #d6cfc2;
  border-left: 3px solid #545846;
  border-radius: 4px;
  background: #f2efe8;
  color: #45493e;
  font-size: 13px;
  line-height: 1.5;
}

#ht-site .alert a,
#ht-site .notice a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

/* ---------- Product gallery ---------- */

.thumbnails img {
  width: 72px;
  height: 72px;
  object-fit: cover;
}

/* ---------- Cart and checkout pages ---------- */

.summary {
  box-sizing: border-box;
  padding: 28px;
  border: 1px solid #e0d9ce;
  background: #f2efe8;
}

.summary-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 0;
  font-size: 14px;
}

/* The live text-input rule also hits radios; give payment choices a normal radio. */
form[action="/checkout"] label:has(input[type="radio"]) {
  flex-direction: row;
  align-items: flex-start;
  gap: 11px;
}

form[action="/checkout"] input[type="radio"] {
  flex: 0 0 17px;
  width: 17px;
  height: 17px;
  min-height: 0;
  margin: 2px 0 0;
  padding: 0;
  accent-color: #545846;
}

/* ---------- Subsections in the catalogue ---------- */

.section-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 4px 0 18px;
}

/* "#ht-site a" sets the colour of every link, so these rules carry the same id. */
#ht-site .section-chips a {
  padding: 9px 16px;
  border: 1px solid #d6cfc2;
  border-radius: 999px;
  background: #fffefa;
  color: #45493e;
  font-size: 13px;
  line-height: 1.2;
  transition: border-color .2s, background-color .2s, color .2s;
}

#ht-site .section-chips a:hover { border-color: #545846; }

#ht-site .section-chips a.is-active {
  border-color: #545846;
  background: #545846;
  color: #fff;
}

.catalog-group + .catalog-group { margin-top: 54px; }

.catalog-group__title {
  margin: 0 0 22px !important;
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 34px;
  font-weight: 500;
  line-height: 1.1;
  color: #303128;
}

#ht-site .catalog-group__title a:hover { color: #545846; }

@media (max-width: 640px) {
  /* One swipeable row instead of a tall block of chips above the products. */
  .section-chips {
    flex-wrap: nowrap;
    margin-right: -20px;
    padding-right: 20px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .section-chips::-webkit-scrollbar { display: none; }
  .section-chips a { flex: 0 0 auto; }
  .catalog-group__title { font-size: 28px; }
  .catalog-group + .catalog-group { margin-top: 40px; }
}

/* ---------- Product options built on radios ---------- */

/* Name on the first line, surcharge under it — the same shape as a size option. */
.config-option {
  position: relative;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 3px;
  min-height: 46px;
  box-sizing: border-box;
  vertical-align: top;
}

.config-group--size { margin-top: 22px; }
.config-group--size .size-selector { margin: 0; }

.config-option small {
  font-size: 11px;
  color: #777b6a;
  white-space: nowrap;
}

.config-option small:empty { display: none; }

.config-option:has(input:checked) {
  border-color: #545846;
  background: #545846;
  color: #fff;
}

.config-option.is-active small,
.config-option:has(input:checked) small { color: #e9e4d8; }

.config-option:has(input:focus-visible) {
  outline: 3px solid #a18354;
  outline-offset: 4px;
}

.detail-actions .ht-btn:disabled {
  opacity: .5;
  cursor: default;
}

/* ---------- Seller details in the footer ---------- */

.ht-footer-seller {
  margin-top: 14px;
  font-size: 11px;
  line-height: 1.6;
  opacity: .72;
}
