/* ============================================
   ФОТОКУБИК.РФ — компоненты
   ============================================ */

/* ---------- Hero (главная) ---------- */
.hero{
  position: relative;
  overflow: hidden;
  padding: 64px 0 40px;
}
.hero .container{
  display:grid;
  grid-template-columns: 1.05fr .95fr;
  gap: 56px;
  align-items: center;
}
.hero__badges{ display:flex; gap:10px; flex-wrap:wrap; margin-bottom: 22px; }
.hero h1{
  font-size: clamp(36px, 4.6vw, 58px);
  letter-spacing: -.01em;
}
.hero h1 em{
  font-style: normal;
  color: var(--terracotta);
}
.hero__lede{ font-size: 18.5px; color: var(--ink-soft); max-width: 480px; }
.hero__cta{ display:flex; gap:14px; margin-top: 30px; flex-wrap: wrap; }
.hero__stats{ display:flex; gap:36px; margin-top: 44px; flex-wrap:wrap; }
.hero__stat-num{ font-family: var(--font-display); font-size: 30px; font-weight:700; color: var(--ink); }
.hero__stat-label{ font-size: 13px; color: var(--ink-soft); max-width: 130px; }

/* --- Куб-сцена (3D CSS) --- */
.cube-stage{
  position: relative;
  height: 460px;
  display:flex; align-items:center; justify-content:center;
  perspective: 1400px;
}
.cube-stage::before{
  content:"";
  position:absolute; width: 320px; height:320px;
  background: radial-gradient(circle, rgba(212,99,47,.16), transparent 70%);
  filter: blur(10px);
}
.cube{
  width: 200px; height:200px;
  position: relative;
  transform-style: preserve-3d;
  animation: cubeSpin 16s linear infinite;
}
@media (prefers-reduced-motion: reduce){
  .cube{ animation: none; transform: rotateX(-22deg) rotateY(35deg); }
}
.cube__face{
  position:absolute; width:200px; height:200px;
  background-size: cover; background-position:center;
  border: 3px solid var(--cream);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.06);
}
.cube__face--front{ transform: translateZ(100px); background-color:#E7B7A0; }
.cube__face--back{ transform: rotateY(180deg) translateZ(100px); background-color:#C9D0BC; }
.cube__face--right{ transform: rotateY(90deg) translateZ(100px); background-color:#EAD2A3; }
.cube__face--left{ transform: rotateY(-90deg) translateZ(100px); background-color:#D7C4E0; }
.cube__face--top{ transform: rotateX(90deg) translateZ(100px); background-color:#B8D4D9; }
.cube__face--bottom{ transform: rotateX(-90deg) translateZ(100px); background-color:#E3B0B8; }
@keyframes cubeSpin{
  from{ transform: rotateX(-18deg) rotateY(0deg); }
  to{ transform: rotateX(-18deg) rotateY(360deg); }
}
.cube-stage__caption{
  position:absolute; bottom:0; left:50%; transform:translateX(-50%);
  font-size: 13px; color: var(--ink-soft); white-space:nowrap;
  display:flex; align-items:center; gap:8px;
}

/* ---------- Логотип-мини-куб (используется в header/footer) ---------- */
.logo__mark svg{ width:100%; height:100%; }

/* ---------- USP strip ---------- */
.usp-strip{
  background: var(--white);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.usp-strip .container{
  display:grid; grid-template-columns: repeat(4,1fr);
  gap: 20px;
  padding: 30px 24px;
}
.usp-item{ display:flex; gap:14px; align-items:flex-start; }
.usp-item__icon{
  width:44px; height:44px; border-radius:50%;
  background: var(--cream-deep);
  display:flex; align-items:center; justify-content:center;
  flex-shrink:0; color: var(--terracotta);
}
.usp-item strong{ display:block; font-size:14.5px; margin-bottom:2px; }
.usp-item span{ font-size: 13px; color: var(--ink-soft); }

/* ---------- Product grid / cards ---------- */
.products-grid{
  display:grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.product-card{
  background: var(--white);
  border-radius: var(--radius);
  border: 1px solid var(--line);
  overflow:hidden;
  transition: transform .2s ease, box-shadow .2s ease;
  display:flex; flex-direction:column;
}
.product-card:hover{
  transform: translateY(-5px);
  box-shadow: 0 18px 34px -16px rgba(var(--shadow-color), .25);
}
.product-card__media{
  aspect-ratio: 4/3.1;
  position:relative;
  overflow:hidden;
  background: var(--cream-deep);
}
.product-card__media img{ width:100%; height:100%; object-fit:cover; }
.product-card__badge{ position:absolute; top:14px; left:14px; }
.product-card__body{ padding: 22px; display:flex; flex-direction:column; gap:10px; flex:1; }
.product-card__title{ font-family:var(--font-display); font-size:19px; font-weight:600; }
.product-card__desc{ font-size: 13.5px; color: var(--ink-soft); flex:1; }
.product-card__meta{ display:flex; gap:8px; flex-wrap:wrap; font-size:12px; color: var(--ink-soft); }
.product-card__meta span{
  border:1px solid var(--line); border-radius:100px; padding:3px 10px;
}
.product-card__footer{
  display:flex; align-items:center; justify-content:space-between;
  margin-top:6px; padding-top: 16px; border-top:1px dashed var(--line);
}
.product-card__price{ font-family: var(--font-display); font-weight:700; font-size: 21px; }
.product-card__price small{ font-family: var(--font-body); font-weight:500; font-size:12.5px; color: var(--ink-soft); }

/* ---------- Section: how it works ---------- */
.steps{
  display:grid; grid-template-columns: repeat(4, 1fr); gap: 28px;
  counter-reset: step;
}
.step{ position:relative; padding-top: 8px; }
.step__num{
  font-family: var(--font-display); font-size: 46px; font-weight:700;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--terracotta);
  line-height:1;
  margin-bottom: 14px;
}
.step h3{ font-size: 18px; margin-bottom:8px; }
.step p{ font-size: 14.5px; color: var(--ink-soft); margin:0; }

/* ---------- Testimonials ---------- */
.testi-track{
  display:grid; grid-template-columns: repeat(3,1fr); gap:24px;
}
.testi{
  background: var(--white); border:1px solid var(--line); border-radius: var(--radius);
  padding: 26px;
}
.testi__stars{ color: var(--sand); font-size:14px; margin-bottom:12px; letter-spacing:2px; }
.testi p{ font-size: 14.5px; color: var(--ink); }
.testi__author{ display:flex; align-items:center; gap:10px; margin-top:16px; }
.testi__avatar{
  width:38px; height:38px; border-radius:50%;
  background: var(--sage); color:#fff;
  display:flex; align-items:center; justify-content:center;
  font-weight:700; font-size:14px; font-family: var(--font-display);
  flex-shrink:0;
}
.testi__author strong{ font-size:13.5px; display:block; }
.testi__author span{ font-size:12px; color: var(--ink-soft); }

/* ---------- SEO regions / cities cloud ---------- */
.cities-cloud{ display:flex; flex-wrap:wrap; gap:10px; }
.cities-cloud a{
  border:1px solid var(--line); border-radius:100px;
  padding: 8px 16px; font-size: 13.5px; color: var(--ink-soft);
  background: var(--white);
}
.cities-cloud a:hover{ border-color: var(--terracotta); color: var(--terracotta); }

/* ---------- CTA band ---------- */
.cta-band{
  background: var(--ink);
  border-radius: 28px;
  padding: 56px;
  display:flex; align-items:center; justify-content:space-between; gap:40px;
  color: #fff;
  position:relative;
  overflow:hidden;
}
.cta-band::after{
  content:""; position:absolute; right:-60px; top:-60px;
  width:240px; height:240px; border-radius:50%;
  background: radial-gradient(circle, rgba(212,99,47,.35), transparent 70%);
}
.cta-band h2{ color:#fff; font-size: 30px; max-width:480px; margin-bottom:10px; }
.cta-band p{ color: rgba(255,255,255,.7); margin:0; max-width: 420px; }
.cta-band__actions{ display:flex; gap:14px; flex-shrink:0; position:relative; z-index:1; }

/* ============================================
   ФЛИПЕР-КУБИК — честная имитация трансформации
   реального фотокубика (8 малых кубиков, 12 фото)
   ============================================ */
.flipcube-viewport{
  height: 320px;
  display:flex; align-items:center; justify-content:center;
  perspective: 1400px;
  margin-bottom: 22px;
}
.flipcube{
  width: 220px; height:220px;
  position:relative;
  transform-style: preserve-3d;
}
.flipcube__panel{
  position:absolute; inset:0;
  background-size: cover; background-position:center;
  background-color: var(--cream-deep);
  background-image: repeating-conic-gradient(var(--line) 0% 25%, transparent 0% 50%);
  background-size: 30px 30px, cover;
  border: 3px solid var(--white);
  box-shadow: 0 18px 40px -16px rgba(var(--shadow-color), .35);
  border-radius: 4px;
  overflow:hidden;
  backface-visibility: hidden;
  display:flex; align-items:center; justify-content:center;
}
.flipcube__panel.has-photo{ background-image: var(--photo-url); background-size: cover; }
.flipcube__panel__placeholder{
  font-size:13px; color: var(--ink-soft); text-align:center; padding: 0 20px;
}
.flipcube__panel.has-photo .flipcube__panel__placeholder{ display:none; }
.flipcube__panel--current{
  transform: rotateY(0deg);
  z-index:2;
  transition: transform .55s cubic-bezier(.6,.05,.4,.95);
  transform-origin: right center;
}
.flipcube__panel--next{
  transform: rotateY(-150deg);
  z-index:1;
  transition: transform .55s cubic-bezier(.6,.05,.4,.95);
  transform-origin: left center;
}
.flipcube.is-flipping .flipcube__panel--current{ transform: rotateY(150deg); transform-origin: right center; }
.flipcube.is-flipping .flipcube__panel--next{ transform: rotateY(0deg); transform-origin: left center; }
.flipcube__num{
  position:absolute; top:8px; right:10px;
  font-family: var(--font-display); font-weight:700; font-size:26px;
  color: rgba(255,255,255,.92);
  text-shadow: 0 1px 6px rgba(0,0,0,.35);
}
.flipcube__cut{
  position:absolute; background: rgba(255,255,255,.85);
  box-shadow: 0 0 0 1px rgba(38,34,32,.25);
  pointer-events:none; z-index:3;
}
.flipcube__cut--v{ left:50%; top:0; bottom:0; width:2px; transform:translateX(-1px); }
.flipcube__cut--h{ top:50%; left:0; right:0; height:2px; transform:translateY(-1px); }
.flipcube__cut-hint{
  text-align:center; font-size:12px; color: var(--ink-soft); margin: 12px 0 0;
}
.flipcube__dots{
  display:flex; gap:6px; justify-content:center; flex-wrap:wrap; margin-top:14px;
}
.flipcube__dot{
  width:8px; height:8px; border-radius:50%;
  background: var(--line); border:none; padding:0; cursor:pointer;
}
.flipcube__dot.active{ background: var(--terracotta); }

/* ============================================
   ОТДЕЛЬНЫЙ 3D-КУБИК — форма и пропорции готового изделия
   ============================================ */
.builder-stage--3d{ padding-top: 28px; }
.cube3d-viewport{
  height: 260px;
  display:flex; align-items:center; justify-content:center;
  perspective: 1200px;
}
.cube3d{
  width: 160px; height:160px;
  position:relative;
  transform-style: preserve-3d;
  transform: rotateX(-22deg) rotateY(35deg);
  transition: transform .4s ease;
}
.cube3d__face{
  position:absolute; width:160px; height:160px;
  background-size:cover; background-position:center;
  background-color: var(--cream-deep);
  border: 3px solid #fff;
  background-image:
    linear-gradient(rgba(255,255,255,.7), rgba(255,255,255,.7)),
    linear-gradient(rgba(255,255,255,.7), rgba(255,255,255,.7));
  background-size: 2px 100%, 100% 2px;
  background-position: center, center;
  background-repeat: no-repeat;
}
.cube3d__face.has-photo{ background-color: transparent; }
.cube3d__face[data-face="front"]{ transform: translateZ(80px); }
.cube3d__face[data-face="back"]{ transform: rotateY(180deg) translateZ(80px); }
.cube3d__face[data-face="right"]{ transform: rotateY(90deg) translateZ(80px); }
.cube3d__face[data-face="left"]{ transform: rotateY(-90deg) translateZ(80px); }
.cube3d__face[data-face="top"]{ transform: rotateX(90deg) translateZ(80px); }
.cube3d__face[data-face="bottom"]{ transform: rotateX(-90deg) translateZ(80px); }

.builder{
  display:grid;
  grid-template-columns: 460px 1fr;
  gap: 48px;
  align-items:flex-start;
}
.builder-preview-stack{
  display:flex; flex-direction:column; gap:28px;
  position: sticky; top: 110px;
}
.builder-stage{
  background: var(--white);
  border:1px solid var(--line);
  border-radius: var(--radius);
  padding: 36px;
}
.builder-stage__viewport{
  height: 320px;
  display:flex; align-items:center; justify-content:center;
  perspective: 1200px;
  margin-bottom: 22px;
}
.builder-cube{
  width: 168px; height:168px;
  position:relative;
  transform-style: preserve-3d;
  transform: rotateX(-22deg) rotateY(35deg);
  transition: transform .4s ease;
}
.builder-cube__face{
  position:absolute; width:168px; height:168px;
  background-size:cover; background-position:center;
  background-color: var(--cream-deep);
  border: 3px solid #fff;
  display:flex; align-items:center; justify-content:center;
  color: var(--ink-soft); font-size:12px; text-align:center;
}
.builder-cube__face[data-face="front"]{ transform: translateZ(84px); }
.builder-cube__face[data-face="back"]{ transform: rotateY(180deg) translateZ(84px); }
.builder-cube__face[data-face="right"]{ transform: rotateY(90deg) translateZ(84px); }
.builder-cube__face[data-face="left"]{ transform: rotateY(-90deg) translateZ(84px); }
.builder-cube__face[data-face="top"]{ transform: rotateX(90deg) translateZ(84px); }
.builder-cube__face[data-face="bottom"]{ transform: rotateX(-90deg) translateZ(84px); }
.builder-stage__rotate{ display:flex; gap:10px; justify-content:center; }

.builder-panel h2{ font-size: 24px; }
.builder-summary{
  display:flex; justify-content:space-between; align-items:center;
  background: var(--cream-deep); border-radius: var(--radius-sm);
  padding: 16px 20px; margin: 18px 0 26px;
}
.builder-summary__price{ font-family: var(--font-display); font-weight:700; font-size: 24px; }

.faces-grid{
  display:grid; grid-template-columns: repeat(4, 1fr); gap: 14px;
}
.face-slot{
  border: 2px dashed var(--line);
  border-radius: var(--radius-sm);
  aspect-ratio: 1;
  display:flex; flex-direction:column; align-items:center; justify-content:center;
  gap: 8px; cursor:pointer;
  background-size: cover; background-position:center;
  position: relative;
  text-align:center;
  transition: border-color .15s ease;
}
.face-slot:hover{ border-color: var(--terracotta); }
.face-slot.has-photo{ border-style: solid; border-color: var(--sage); }
.face-slot__label{
  font-size: 11.5px; font-weight:700; text-transform:uppercase; letter-spacing:.05em;
  color: var(--ink-soft);
  background: rgba(255,255,255,.88);
  padding: 3px 8px; border-radius:6px;
}
.face-slot.has-photo .face-slot__label{ position:absolute; top:8px; }
.face-slot__plus{
  width:34px;height:34px;border-radius:50%;
  background: var(--white); border:1px solid var(--line);
  display:flex; align-items:center; justify-content:center;
  color: var(--terracotta); font-size:18px; font-weight:700;
}
.face-slot.has-photo .face-slot__plus{ display:none; }
.face-slot__remove{
  position:absolute; top:8px; right:8px;
  width:24px;height:24px;border-radius:50%;
  background: rgba(38,34,32,.7); color:#fff;
  display:none; align-items:center; justify-content:center; font-size:13px;
}
.face-slot.has-photo .face-slot__remove{ display:flex; }
.face-slot input[type="file"]{
  position:absolute; width:1px; height:1px;
  padding:0; margin:-1px; overflow:hidden;
  clip:rect(0,0,0,0); white-space:nowrap; border:0;
}

.builder-options{ margin-top: 30px; }
.opt-group{ margin-bottom: 24px; }
.opt-group__label{ font-weight:700; font-size: 14px; margin-bottom: 10px; display:block; }
.opt-pills{ display:flex; gap:10px; flex-wrap:wrap; }
.opt-pill{
  border:1.5px solid var(--line); border-radius:100px;
  padding: 9px 18px; font-size: 13.5px; font-weight:600;
  background: var(--white); color: var(--ink-soft);
}
.opt-pill.active{ border-color: var(--terracotta); color: var(--terracotta); background: #FBE9E0; }
.opt-pill small{ display:block; font-weight:500; font-size:11px; opacity:.8; }

.qty-control{
  display:inline-flex; align-items:center; border:1.5px solid var(--line); border-radius:100px; overflow:hidden;
}
.qty-control button{ width:38px; height:38px; background:var(--white); border:none; font-size:16px; font-weight:700; }
.qty-control button:hover{ background: var(--cream-deep); }
.qty-control input{
  width:44px; text-align:center; border:none; font-weight:700; font-size:14px; background:transparent;
}

/* ---------- Forms ---------- */
.form-grid{ display:grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field{ display:flex; flex-direction:column; gap:7px; }
.field.full{ grid-column: 1 / -1; }
.field label{ font-size: 13px; font-weight:700; color: var(--ink-soft); }
.field input,
.field select,
.field textarea{
  border: 1.5px solid var(--line);
  border-radius: 10px;
  padding: 13px 15px;
  font-family: var(--font-body);
  font-size: 14.5px;
  background: var(--white);
  color: var(--ink);
}
.field input:focus,
.field select:focus,
.field textarea:focus{
  outline:none; border-color: var(--terracotta);
}
.field--checkbox{ flex-direction:row; align-items:flex-start; gap:10px; }
.field--checkbox input{ width:18px; height:18px; margin-top:2px; accent-color: var(--terracotta); }
.field--checkbox label{ font-weight:500; font-size: 13px; }

/* ---------- Checkout / payment ---------- */
.checkout-grid{ display:grid; grid-template-columns: 1.3fr .9fr; gap: 40px; align-items:flex-start; }
.order-summary{
  background: var(--white); border:1px solid var(--line); border-radius: var(--radius);
  padding: 26px; position:sticky; top:110px;
}
.order-line{ display:flex; justify-content:space-between; gap:12px; padding: 12px 0; border-bottom:1px solid var(--line); font-size:14px; }
.order-line:last-of-type{ border-bottom:none; }
.order-total{ display:flex; justify-content:space-between; align-items:center; margin-top:18px; padding-top:18px; border-top: 2px solid var(--ink); }
.order-total strong{ font-family: var(--font-display); font-size: 24px; }

.pay-methods{ display:grid; gap:12px; margin: 20px 0; }
.pay-method{
  display:flex; align-items:center; gap:14px;
  border:1.5px solid var(--line); border-radius: var(--radius-sm);
  padding: 14px 16px; cursor:pointer;
}
.pay-method.active{ border-color: var(--terracotta); background:#FBE9E0; }
.pay-method input{ accent-color: var(--terracotta); width:18px; height:18px; }
.pay-method__icon{ width:38px; height:38px; border-radius:8px; background: var(--cream-deep); display:flex; align-items:center; justify-content:center; flex-shrink:0; }
.pay-method strong{ font-size:14px; display:block; }
.pay-method span{ font-size:12px; color: var(--ink-soft); }

.sbp-box{
  text-align:center; padding: 28px;
  border: 1px dashed var(--line); border-radius: var(--radius-sm);
  background: var(--cream-deep);
}
.sbp-qr{
  width:280px; height:360px; margin: 0 auto 16px;
  background: var(--white); border-radius: 12px;
  display:flex; align-items:center; justify-content:center;
  border:1px solid var(--line);
}
.sbp-timer{ font-family: var(--font-display); font-size: 22px; font-weight:700; color: var(--terracotta); }
.sbp-status{ font-size: 13px; color: var(--ink-soft); margin-top: 8px; display:flex; align-items:center; justify-content:center; gap:8px; }
.dot-pulse{ width:8px; height:8px; border-radius:50%; background: var(--sage); animation: pulse 1.4s infinite; }
@keyframes pulse{ 0%,100%{ opacity:1; } 50%{ opacity:.3; } }

/* ---------- Mini cart drawer ---------- */
.cart-drawer{
  position: fixed; top:0; right:-440px; width: 420px; max-width:92vw; height:100vh;
  background: var(--cream); z-index: 200; box-shadow: -20px 0 50px rgba(0,0,0,.18);
  transition: right .3s ease; display:flex; flex-direction:column;
}
.cart-drawer.open{ right:0; }
.cart-drawer__head{ display:flex; justify-content:space-between; align-items:center; padding: 22px 24px; border-bottom:1px solid var(--line); }
.cart-drawer__items{ flex:1; overflow-y:auto; padding: 18px 24px; display:flex; flex-direction:column; gap:16px; }
.cart-item{ display:flex; gap:14px; }
.cart-item__thumb{ width:64px; height:64px; border-radius:10px; background: var(--cream-deep); flex-shrink:0; }
.cart-item__title{ font-size:14px; font-weight:700; }
.cart-item__meta{ font-size:12px; color: var(--ink-soft); }
.cart-drawer__foot{ padding: 22px 24px; border-top:1px solid var(--line); display:flex; flex-direction:column; gap:12px; }
.cart-overlay{ position:fixed; inset:0; background: rgba(38,34,32,.4); z-index:190; opacity:0; pointer-events:none; transition: opacity .3s ease; }
.cart-overlay.open{ opacity:1; pointer-events:auto; }

/* ---------- FAQ accordion ---------- */
.faq-item{ border-bottom: 1px solid var(--line); }
.faq-item__q{
  display:flex; justify-content:space-between; align-items:center;
  padding: 20px 0; font-weight:700; font-size:15.5px; cursor:pointer;
}
.faq-item__icon{ flex-shrink:0; transition: transform .2s ease; }
.faq-item.open .faq-item__icon{ transform: rotate(45deg); }
.faq-item__a{ max-height:0; overflow:hidden; transition: max-height .25s ease; font-size:14.5px; color: var(--ink-soft); }
.faq-item.open .faq-item__a{ max-height: 320px; padding-bottom: 20px; }

/* ---------- Toast ---------- */
.toast{
  position: fixed; bottom: 24px; left:50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color:#fff; padding: 14px 24px; border-radius: 100px;
  font-size: 14px; font-weight:600; z-index: 300; opacity:0; pointer-events:none;
  transition: all .25s ease; display:flex; align-items:center; gap:10px;
}
.toast.show{ opacity:1; transform: translateX(-50%) translateY(0); }

/* ============================================
   responsive
   ============================================ */
@media (max-width: 980px){
  .hero .container{ grid-template-columns: 1fr; }
  .cube-stage{ height: 320px; order:-1; }
  .usp-strip .container{ grid-template-columns: repeat(2,1fr); }
  .products-grid{ grid-template-columns: repeat(2,1fr); }
  .steps{ grid-template-columns: repeat(2,1fr); }
  .testi-track{ grid-template-columns: 1fr; }
  .builder{ grid-template-columns: 1fr; }
  .builder-preview-stack{ position:static; }
  .checkout-grid{ grid-template-columns: 1fr; }
  .order-summary{ position:static; }
  .cta-band{ flex-direction:column; text-align:center; padding: 40px 28px; }
  .cta-band p{ margin:0 auto; }
}
@media (max-width: 640px){
  .usp-strip .container{ grid-template-columns: 1fr 1fr; }
  .products-grid{ grid-template-columns: 1fr; }
  .steps{ grid-template-columns: 1fr; }
  .form-grid{ grid-template-columns: 1fr; }
  .faces-grid{ grid-template-columns: repeat(3,1fr); }
  .hero__stats{ gap:24px; }
}
