/* ===========================================================
   Тот Книги — витрина в стил Stripe (бял фон)
   =========================================================== */

.totb-shop{
  --bg:#ffffff; --soft:#f6f9fc; --line:#e6ebf1; --line2:#eef1f6;
  --ink:#0a2540; --ink2:#425466; --ink3:#8898aa;
  --brand:#635bff; --brand2:#7a73ff; --bsoft:#f0efff;
  --teal:#00d4b1; --green:#0fa85f; --pink:#ff5996;
  --disp:'Jost','Montserrat',system-ui,sans-serif;
  --body:'Montserrat',system-ui,-apple-system,sans-serif;
  --shadow:0 2px 5px -1px rgba(50,50,93,.10),0 1px 3px -1px rgba(0,0,0,.06);
  --shadow-lg:0 15px 35px -5px rgba(50,50,93,.10),0 5px 15px -5px rgba(0,0,0,.06);
  font-family:var(--body); color:var(--ink); margin:32px 0;
  -webkit-font-smoothing:antialiased;
}
.totb-shop *{box-sizing:border-box}

/* ---------- ГОЛЯМА ВИТРИНА ---------- */
.totb-product{
  display:grid; grid-template-columns:minmax(230px,320px) 1fr; gap:44px;
  background:var(--bg); border:1px solid var(--line);
  border-radius:16px; padding:44px 44px; margin-bottom:28px; align-items:start;
  box-shadow:var(--shadow);
}

/* --- Корица с лека 3D перспектива --- */
.totb-p-cover{position:sticky; top:24px}
.totb-shelf{position:relative; padding:4px 0 26px; perspective:1600px}

.totb-book3d{
  position:relative; display:block; width:100%;
  transform:rotateY(-11deg) rotateX(1deg); transform-style:preserve-3d;
  transition:transform .55s cubic-bezier(.16,1,.3,1);
  filter:drop-shadow(14px 22px 30px rgba(10,37,64,.20)) drop-shadow(3px 5px 9px rgba(10,37,64,.10));
}
.totb-product:hover .totb-book3d{transform:rotateY(-5deg) rotateX(.5deg) translateY(-5px)}

.totb-book3d img{
  display:block; width:100%; height:auto; border-radius:2px 6px 6px 2px;
  border:1px solid rgba(10,37,64,.08);
}
.totb-spine{
  position:absolute; left:0; top:0; bottom:0; width:12px; border-radius:2px 0 0 2px;
  background:linear-gradient(90deg,rgba(10,37,64,.34) 0%,rgba(10,37,64,.12) 44%,rgba(255,255,255,.30) 84%,rgba(10,37,64,.08) 100%);
  z-index:2; pointer-events:none;
}
.totb-book3d::after{
  content:''; position:absolute; inset:0; border-radius:2px 6px 6px 2px; z-index:3;
  background:linear-gradient(105deg,rgba(255,255,255,.30) 0%,rgba(255,255,255,0) 40%);
  pointer-events:none;
}
.totb-shelf::after{
  content:''; position:absolute; left:6%; right:2%; bottom:6px; height:14px;
  background:radial-gradient(ellipse at center,rgba(10,37,64,.18) 0%,rgba(10,37,64,0) 72%);
  z-index:-1;
}

/* корица по подразбиране */
.totb-book3d--blank .totb-blankface{
  aspect-ratio:2/3; display:flex; flex-direction:column; justify-content:center;
  align-items:center; text-align:center; padding:32px 24px; border-radius:2px 6px 6px 2px;
  background:linear-gradient(150deg,#635bff 0%,#7a73ff 50%,#635bff 100%);
}
.totb-blank-t{font-family:var(--disp); font-size:24px; line-height:1.25; color:#fff; font-weight:600}
.totb-blank-a{font-family:var(--body); font-size:11px; letter-spacing:.18em; text-transform:uppercase; color:rgba(255,255,255,.85); margin-top:14px}

/* лента */
.totb-badge{
  position:absolute; top:14px; left:-7px; z-index:6;
  background:var(--brand); color:#fff;
  font-family:var(--body); font-size:10px; font-weight:600;
  letter-spacing:.12em; text-transform:uppercase;
  padding:7px 14px; border-radius:6px;
  box-shadow:0 6px 16px rgba(99,91,255,.34);
}

/* факти */
.totb-facts{
  list-style:none; margin:24px 0 0; padding:20px 0 0; display:flex; gap:6px;
  border-top:1px solid var(--line); text-align:center;
}
.totb-facts li{flex:1}
.totb-facts b{
  display:block; font-family:var(--disp); font-weight:600;
  font-size:22px; color:var(--ink); line-height:1.1;
}
.totb-facts span{
  display:block; font-family:var(--body); font-size:9px;
  letter-spacing:.12em; text-transform:uppercase; color:var(--ink3); margin-top:5px;
}
.totb-langflag{color:var(--brand)!important}

/* --- Дясна колона --- */
.totb-p-author{
  font-family:var(--body); font-size:12px; font-weight:600; letter-spacing:.14em;
  text-transform:uppercase; color:var(--brand); margin-bottom:14px;
}
.totb-p-title{
  font-family:var(--disp); font-weight:600; font-size:clamp(28px,4vw,40px);
  line-height:1.14; color:var(--ink); margin:0 0 12px; letter-spacing:-.025em;
}
.totb-p-sub{
  font-family:var(--body); font-size:17px; color:var(--ink2);
  margin:0 0 4px; line-height:1.5;
}
.totb-rule{width:44px; height:3px; border-radius:2px; background:var(--brand); margin:22px 0 24px}

.totb-p-blurb{
  font-size:19px; line-height:1.6; color:var(--ink); margin:0 0 20px; font-weight:500;
}
.totb-p-desc p{font-size:16px; line-height:1.7; color:var(--ink2); margin:0 0 15px}

/* какво съдържа */
.totb-p-inside{
  background:var(--soft); border:1px solid var(--line);
  border-radius:12px; padding:24px 26px; margin:26px 0 6px;
}
.totb-inside-h{
  font-family:var(--body); font-size:12px; font-weight:600; letter-spacing:.1em;
  text-transform:uppercase; color:var(--ink3); margin-bottom:15px;
}
.totb-p-inside ul{list-style:none; margin:0; padding:0}
.totb-p-inside li{
  position:relative; padding-left:28px; margin-bottom:11px;
  font-size:15px; line-height:1.5; color:var(--ink2);
}
.totb-p-inside li:last-child{margin-bottom:0}
.totb-p-inside li::before{
  content:'✓'; position:absolute; left:0; top:0;
  width:19px; height:19px; border-radius:50%; background:var(--bsoft); color:var(--brand);
  font-size:11px; font-weight:700; display:flex; align-items:center; justify-content:center;
}

/* --- Кутия за покупка --- */
.totb-buybox{
  margin-top:30px; padding:24px; border:1px solid var(--line);
  border-radius:14px; background:var(--bg); box-shadow:var(--shadow);
}
.totb-langs{
  display:inline-flex; background:var(--soft); border:1px solid var(--line);
  border-radius:9px; padding:3px; margin-bottom:20px; gap:2px;
}
.totb-lang{
  font-family:var(--body); font-size:13px; font-weight:500; padding:7px 16px;
  background:transparent; color:var(--ink2); border:0; border-radius:6px; cursor:pointer;
  transition:.15s;
}
.totb-lang.is-on{background:#fff; color:var(--brand); font-weight:600; box-shadow:var(--shadow)}
.totb-lang:focus-visible{outline:2px solid var(--brand); outline-offset:2px}
.totb-langs--sm .totb-lang{padding:6px 12px; font-size:12px}

.totb-pricerow{display:flex; align-items:baseline; gap:12px; flex-wrap:wrap; margin-bottom:20px}
.totb-price{
  font-family:var(--disp); font-weight:600; font-size:38px;
  line-height:1; color:var(--ink); letter-spacing:-.02em;
}
.totb-price--sm{font-size:26px}
.totb-oldprice{
  font-family:var(--disp); font-size:20px; color:var(--ink3);
  text-decoration:line-through; text-decoration-thickness:1px;
}
.totb-save{
  font-family:var(--body); font-size:11px; font-weight:600;
  letter-spacing:.04em; text-transform:uppercase;
  background:#e3f9ed; color:var(--green); padding:5px 11px; border-radius:20px;
}

.totb-form{margin:0}
.totb-buy{
  display:block; width:100%; text-align:center; text-decoration:none;
  background:var(--brand); color:#fff; border:0; border-radius:10px;
  font-family:var(--body); font-size:16px; font-weight:600; letter-spacing:.01em;
  padding:15px 24px; cursor:pointer;
  transition:background .2s,transform .15s,box-shadow .2s;
  box-shadow:0 4px 14px rgba(99,91,255,.32);
}
.totb-buy:hover{background:var(--brand2); color:#fff; transform:translateY(-1px); box-shadow:0 8px 22px rgba(99,91,255,.4)}
.totb-buy:active{transform:translateY(0)}
.totb-buy:focus-visible{outline:2px solid var(--brand); outline-offset:3px}
.totb-buy--sm{font-size:14px; padding:12px 20px; border-radius:9px}

.totb-sample{
  display:block; text-align:center; margin-top:11px; text-decoration:none;
  font-family:var(--body); font-size:14px; font-weight:500; color:var(--ink2);
  padding:12px; border:1px solid var(--line); border-radius:10px;
  transition:.15s; background:#fff;
}
.totb-sample:hover{background:var(--soft); border-color:var(--brand); color:var(--brand)}

.totb-secure{
  font-family:var(--body); font-size:12px; color:var(--ink3);
  text-align:center; margin:16px 0 0; display:flex; align-items:center;
  justify-content:center; gap:6px;
}
.totb-secure::before{content:'🔒'; font-size:11px}

/* ---------- КОМПАКТНА РЕШЕТКА ---------- */
.totb-shop--compact{
  display:grid; grid-template-columns:repeat(auto-fit,minmax(250px,1fr)); gap:24px;
}
.totb-card{
  background:var(--bg); border:1px solid var(--line);
  border-radius:14px; padding:26px 24px 28px; display:flex; flex-direction:column;
  transition:.2s; box-shadow:var(--shadow);
}
.totb-card:hover{border-color:var(--brand); transform:translateY(-3px); box-shadow:var(--shadow-lg)}
.totb-c-cover{position:relative; perspective:1000px; margin-bottom:22px; text-align:center}
.totb-book3d--sm{max-width:168px; margin:0 auto}
.totb-book3d--sm .totb-blankface{
  aspect-ratio:2/3; display:flex; align-items:center; justify-content:center;
  text-align:center; padding:18px; border-radius:2px 5px 5px 2px;
  background:linear-gradient(150deg,#635bff,#7a73ff 55%,#635bff);
}
.totb-book3d--sm .totb-blank-t{font-size:16px}
.totb-c-body{display:flex; flex-direction:column; flex:1}
.totb-c-title{
  font-family:var(--disp); font-weight:600; font-size:20px;
  line-height:1.28; color:var(--ink); margin:0 0 9px; letter-spacing:-.01em;
}
.totb-c-blurb{font-size:14.5px; line-height:1.55; color:var(--ink2); margin:0 0 18px; flex:1}
.totb-shop--compact .totb-langs{margin-bottom:14px; align-self:flex-start}
.totb-shop--compact .totb-pricerow{margin-bottom:14px}

/* ---------- БЛАГОДАРСТВЕНА СТРАНИЦА ---------- */
.totb-thanks{
  --bg:#fff; --soft:#f6f9fc; --line:#e6ebf1; --ink:#0a2540; --ink2:#425466; --ink3:#8898aa;
  --brand:#635bff; --disp:'Jost','Montserrat',sans-serif; --body:'Montserrat',sans-serif;
  max-width:500px; margin:44px auto; padding:44px 36px; text-align:center;
  background:var(--bg); border:1px solid var(--line); border-radius:16px;
  font-family:var(--body); box-shadow:0 15px 35px -5px rgba(50,50,93,.12);
}
.totb-thanks-cover{perspective:900px; margin-bottom:24px}
.totb-thanks-cover img{
  max-width:140px; width:100%; height:auto; display:inline-block;
  transform:rotateY(-10deg); border-radius:2px 5px 5px 2px;
  filter:drop-shadow(10px 16px 24px rgba(10,37,64,.22));
}
.totb-thanks-mark{
  width:56px; height:56px; border-radius:16px; margin:0 auto 20px;
  background:linear-gradient(135deg,#635bff,#ff5996); color:#fff;
  display:flex; align-items:center; justify-content:center; font-size:28px;
}
.totb-thanks h2{
  font-family:var(--disp); font-weight:600; font-size:26px;
  color:var(--ink); margin:0 0 8px; line-height:1.2; letter-spacing:-.02em;
}
.totb-thanks-title{font-size:17px; color:var(--ink2); margin:0 0 26px}
.totb-thanks .totb-buy{display:inline-block; width:auto; padding:15px 40px}
.totb-thanks .totb-secure{margin-top:18px}

/* ---------- АДАПТИВНОСТ ---------- */
@media(max-width:900px){
  .totb-product{grid-template-columns:1fr; gap:32px; padding:32px 26px}
  .totb-p-cover{position:static; max-width:260px; margin:0 auto}
  .totb-p-author{text-align:center}
  .totb-p-title,.totb-p-sub{text-align:center}
  .totb-rule{margin-left:auto; margin-right:auto}
  /* текстът и списъкът остават ляво подравнени — центрирани четат зле */
  .totb-p-blurb,.totb-p-desc,.totb-p-inside{text-align:left}
  .totb-buybox{max-width:440px; margin-left:auto; margin-right:auto}
}
@media(max-width:520px){
  .totb-product{padding:24px 18px; border-radius:14px}
  .totb-p-cover{max-width:190px}
  .totb-price{font-size:30px}
  .totb-p-title{font-size:26px}
  .totb-p-blurb{font-size:16px}
  .totb-p-desc p{font-size:15px}
  .totb-buybox{padding:18px}
  .totb-facts b{font-size:19px}
  .totb-shop--compact{grid-template-columns:1fr}
  .totb-shop{margin:20px 0}
}
@media(prefers-reduced-motion:reduce){
  .totb-book3d,.totb-buy,.totb-card{transition:none}
  .totb-product:hover .totb-book3d{transform:rotateY(-11deg) rotateX(1deg)}
}

/* ---------- БУТОНЪТ ЗА ПОРЪЧКА ИЗЛИЗА ВИСОКО ---------- */
/* Дясната колона е flex, за да подредим кутията за покупка веднага
   след заглавието — купувачът вижда цената и бутона без скролване. */
.totb-p-info{display:flex; flex-direction:column}
.totb-p-author{order:1}
.totb-p-title{order:2}
.totb-p-sub{order:3}
.totb-buybox{order:4; margin-top:24px}
.totb-rule{order:5}
.totb-p-blurb{order:6}
.totb-p-desc{order:7}
.totb-p-inside{order:8}

/* ===========================================================
   HERO блок — корица + два бутона (като на дизайна)
   =========================================================== */
.totb-shop--hero{margin:40px 0}
.totb-hero{
  display:grid; grid-template-columns:minmax(280px,440px) 1fr; gap:64px;
  align-items:center; max-width:1180px; margin:0 auto; padding:20px;
}
.totb-hero-cover{perspective:1800px}
.totb-hero-cover .totb-book3d{
  transform:rotateY(-15deg) rotateX(2deg);
  filter:drop-shadow(26px 34px 46px rgba(10,37,64,.26)) drop-shadow(6px 10px 16px rgba(10,37,64,.14));
}
.totb-hero:hover .totb-hero-cover .totb-book3d{transform:rotateY(-8deg) rotateX(1deg) translateY(-6px)}
.totb-hero-cover .totb-book3d img{border-radius:3px 8px 8px 3px}
.totb-hero-cover .totb-spine{width:16px}

.totb-hero-body{max-width:560px}
.totb-hero-kicker{
  position:relative; font-family:var(--body); font-size:12px; font-weight:600;
  letter-spacing:.22em; text-transform:uppercase; color:var(--brand);
  padding-left:48px; margin-bottom:22px;
}
.totb-hero-kicker::before{
  content:''; position:absolute; left:0; top:50%; width:34px; height:2px;
  background:var(--brand); transform:translateY(-50%);
}
.totb-hero-title{
  font-family:var(--disp); font-weight:600; font-size:clamp(30px,4.4vw,46px);
  line-height:1.1; letter-spacing:-.03em; color:var(--ink); margin:0 0 18px;
}
.totb-hero-sub{
  font-family:var(--body); font-style:italic; font-size:20px; font-weight:500;
  color:var(--brand); margin:0 0 22px; line-height:1.45;
}
.totb-hero-text{font-size:17px; line-height:1.7; color:var(--ink2); margin:0 0 26px}

.totb-hero-tags{display:flex; flex-wrap:wrap; gap:12px; margin-bottom:34px}
.totb-hero-tag{
  display:inline-flex; align-items:center; gap:9px;
  font-family:var(--body); font-size:14px; font-weight:500; color:var(--ink2);
  background:#fff; border:1px solid var(--line); border-radius:40px;
  padding:9px 20px; box-shadow:var(--shadow);
}
.totb-hero-tag i{color:var(--brand); font-style:normal; font-size:13px}

.totb-hero-btns{display:flex; gap:16px; flex-wrap:wrap}
.totb-hero-btn{
  display:inline-flex; align-items:center; gap:12px;
  font-family:var(--body); font-size:16px; font-weight:600; text-decoration:none;
  padding:17px 34px; border-radius:12px; transition:.2s; cursor:pointer;
}
.totb-hero-btn span{transition:transform .2s}
.totb-hero-btn:hover span{transform:translateX(4px)}
.totb-hero-btn.primary{
  background:var(--brand); color:#fff; border:1px solid var(--brand);
  box-shadow:0 6px 18px rgba(99,91,255,.32);
}
.totb-hero-btn.primary:hover{background:var(--brand2); transform:translateY(-2px); box-shadow:0 10px 26px rgba(99,91,255,.4)}
.totb-hero-btn.ghost{
  background:#fff; color:var(--ink); border:1px solid var(--line); box-shadow:var(--shadow);
}
.totb-hero-btn.ghost:hover{border-color:var(--brand); color:var(--brand); transform:translateY(-2px)}

@media(max-width:860px){
  .totb-hero{grid-template-columns:1fr; gap:36px; text-align:center; padding:16px}
  .totb-hero-cover{max-width:250px; margin:0 auto}
  .totb-hero-kicker{padding-left:0}
  .totb-hero-kicker::before{display:none}
  .totb-hero-body{max-width:none}
  .totb-hero-tags,.totb-hero-btns{justify-content:center}
  .totb-hero-text{text-align:left}
}
@media(max-width:480px){
  .totb-hero{gap:28px}
  .totb-hero-cover{max-width:190px}
  .totb-hero-title{font-size:28px}
  .totb-hero-sub{font-size:18px}
  .totb-hero-text{font-size:15px}
  .totb-hero-tags{gap:8px}
  .totb-hero-tag{font-size:13px; padding:8px 16px}
  .totb-hero-btns{flex-direction:column}
  .totb-hero-btn{width:100%; justify-content:center}
}

/* ===========================================================
   БУТОН + POPUP за отделна книга
   =========================================================== */
.totb-openbtn{
  --red:#8b1e1e; --red2:#a32424; --ink:#0a2540; --line:#e6ebf1;
  display:inline-flex; align-items:center; gap:11px;
  font-family:'Montserrat',system-ui,sans-serif; font-weight:600;
  color:#fff; background:var(--red); border:1px solid var(--red);
  padding:14px 30px; border-radius:11px; cursor:pointer; text-decoration:none;
  box-shadow:0 5px 16px rgba(139,30,30,.28); transition:.2s; letter-spacing:.06em;
  text-transform:uppercase; font-size:13px;
}
.totb-openbtn span{transition:transform .2s}
.totb-openbtn:hover{background:var(--red2); color:#fff; transform:translateY(-2px); box-shadow:0 9px 24px rgba(139,30,30,.38)}
.totb-openbtn:hover span{transform:translateX(4px)}
.totb-openbtn.ghost{background:#fff; color:var(--red); border-color:rgba(139,30,30,.3); box-shadow:0 2px 5px -1px rgba(50,50,93,.1)}
.totb-openbtn.ghost:hover{border-color:var(--red); color:var(--red); background:#fdf6f6}
@media(max-width:400px){
  .totb-openbtn{padding:13px 22px; font-size:12px; letter-spacing:.04em; width:100%; justify-content:center}
}

.totb-modal[hidden]{display:none}
.totb-modal{
  position:fixed; inset:0; z-index:99999; display:flex;
  align-items:center; justify-content:center; padding:24px 18px; overflow-y:auto;
}
.totb-modal-back{
  position:fixed; inset:0; background:rgba(10,37,64,.62);
  backdrop-filter:blur(4px); -webkit-backdrop-filter:blur(4px);
  animation:totb-fade .2s ease;
}
.totb-modal-box{
  position:relative; z-index:1; width:100%; max-width:760px; margin:auto;
  animation:totb-pop .28s cubic-bezier(.16,1,.3,1);
}
@keyframes totb-fade{from{opacity:0}to{opacity:1}}
@keyframes totb-pop{from{opacity:0;transform:translateY(16px) scale(.98)}to{opacity:1;transform:none}}
.totb-modal-x{
  position:absolute; top:16px; right:16px; z-index:3;
  width:34px; height:34px; border-radius:50%; border:0; cursor:pointer;
  background:#f6f9fc; color:#425466; font-size:20px; line-height:1;
  display:flex; align-items:center; justify-content:center;
  transition:.15s;
}
.totb-modal-x:hover{background:#635bff; color:#fff; transform:rotate(90deg)}

/* --- Компактната карта вътре --- */
.totb-mc{
  --bg:#fff; --soft:#f6f9fc; --line:#e6ebf1; --ink:#0a2540; --ink2:#425466; --ink3:#8898aa;
  --brand:#635bff; --brand2:#7a73ff; --green:#0fa85f;
  --disp:'Jost','Montserrat',sans-serif; --body:'Montserrat',sans-serif;
  display:grid; grid-template-columns:190px 1fr; gap:32px;
  background:#fff; border-radius:20px; padding:34px 38px 32px; align-items:center;
  box-shadow:0 30px 70px -12px rgba(10,37,64,.4);
  font-family:var(--body); color:var(--ink);
}
.totb-mc-cover{perspective:1200px}
.totb-mc-cover .totb-book3d{
  transform:rotateY(-12deg) rotateX(1deg);
  filter:drop-shadow(12px 18px 26px rgba(10,37,64,.24));
}
.totb-mc-cover .totb-book3d img{width:100%; height:auto; border-radius:2px 6px 6px 2px; border:1px solid rgba(10,37,64,.08)}
.totb-mc-cover .totb-blankface{
  aspect-ratio:2/3; display:flex; align-items:center; justify-content:center;
  text-align:center; padding:20px; border-radius:2px 6px 6px 2px;
  background:linear-gradient(150deg,#635bff,#7a73ff 55%,#635bff); color:#fff;
  font-family:var(--disp); font-size:15px; font-weight:600;
}
.totb-mc-facts{
  display:flex; justify-content:space-between; margin-top:16px; padding-top:14px;
  border-top:1px solid var(--line); text-align:center; font-size:10px; color:var(--ink3);
}
.totb-mc-facts b{display:block; font-family:var(--disp); font-size:15px; color:var(--ink); font-weight:600}
.totb-mc-facts .totb-langflag b{color:var(--brand)}

.totb-mc-author{
  font-family:var(--body); font-size:11px; font-weight:600; letter-spacing:.14em;
  text-transform:uppercase; color:var(--brand); margin-bottom:8px;
}
.totb-mc-title{
  font-family:var(--disp); font-weight:600; font-size:26px; line-height:1.14;
  letter-spacing:-.02em; color:var(--ink); margin:0 0 12px;
}
.totb-mc-text{font-size:14.5px; line-height:1.6; color:var(--ink2); margin:0 0 6px}
.totb-mc-desc{margin:0 0 20px}
.totb-mc-more{
  display:inline-flex; align-items:center; gap:6px; background:none; border:0;
  padding:0; cursor:pointer; font-family:var(--body); font-size:13px; font-weight:600;
  color:var(--brand); transition:.15s;
}
.totb-mc-more:hover{color:var(--brand2)}
.totb-mc-more i{font-style:normal; transition:transform .2s}
.totb-mc-more.is-open i{transform:rotate(180deg)}

.totb-mc-buy{
  background:var(--soft); border:1px solid var(--line);
  border-radius:14px; padding:18px 20px;
}
.totb-mc-buy .totb-langs{margin-bottom:16px}
/* цена и бутон един до друг — спестява височина */
.totb-mc-priceline{display:flex; align-items:center; gap:18px; flex-wrap:wrap}
.totb-mc-priceline .totb-pricerow{margin:0; flex:none}
.totb-mc-priceline .totb-price{font-size:30px}
.totb-mc-priceline .totb-form{flex:1; min-width:160px}
.totb-mc-buy .totb-buy{font-size:15px; padding:14px 24px}
.totb-mc-buy .totb-secure{margin-top:14px; justify-content:flex-start}

@media(max-width:600px){
  .totb-modal{padding:12px 10px; align-items:flex-start}
  .totb-modal-box{max-height:calc(100vh - 24px)}
  .totb-mc{
    grid-template-columns:1fr; gap:18px; padding:24px 20px 22px; text-align:center;
    max-height:calc(100vh - 24px); overflow-y:auto;
  }
  .totb-mc-cover{max-width:130px; margin:0 auto}
  .totb-mc-facts{max-width:200px; margin-left:auto; margin-right:auto}
  .totb-mc-title{font-size:22px}
  .totb-mc-desc{text-align:left}
  .totb-mc-buy{text-align:left}
  /* цена отгоре, бутон широк отдолу — по-удобно за палец */
  .totb-mc-priceline{flex-direction:column; align-items:stretch; gap:12px}
  .totb-mc-priceline .totb-pricerow{justify-content:center}
  .totb-mc-priceline .totb-form{width:100%}
  .totb-mc-buy .totb-buy{width:100%}
  .totb-mc-buy .totb-secure{justify-content:center}
  .totb-mc-buy .totb-langs{display:flex; width:100%}
  .totb-mc-buy .totb-lang{flex:1; text-align:center}
  .totb-modal-x{top:8px; right:8px}
}

/* ===========================================================
   2.0 — отделни издания
   =========================================================== */

/* Скритите издания не бива да се показват, каквото и display да имат. */
.totb-group > [hidden], .totb-modal-in > [hidden]{display:none!important}

/* Превключвател между изданията — всеки бутон носи своята цена */
.totb-eds{
  display:flex; flex-wrap:wrap; gap:8px; margin:0 0 20px;
}
.totb-ed{
  flex:1 1 0; min-width:96px; display:flex; flex-direction:column; align-items:flex-start; gap:2px;
  padding:10px 14px; border:1px solid var(--line,#e6ebf1); border-radius:10px;
  background:var(--soft,#f6f9fc); color:var(--ink2,#425466); text-decoration:none;
  font-family:var(--body,'Montserrat',sans-serif); transition:.15s; cursor:pointer;
}
.totb-ed:hover{border-color:var(--brand,#635bff); color:var(--ink,#0a2540)}
.totb-ed.is-on{
  background:#fff; border-color:var(--brand,#635bff); color:var(--ink,#0a2540);
  box-shadow:0 0 0 3px rgba(99,91,255,.12);
}
.totb-ed:focus-visible{outline:2px solid var(--brand,#635bff); outline-offset:2px}
.totb-ed-l{font-size:13px; font-weight:600; line-height:1.3}
.totb-ed-p{font-size:12px; color:var(--ink3,#8898aa); font-variant-numeric:tabular-nums}
.totb-ed.is-on .totb-ed-p{color:var(--brand,#635bff); font-weight:600}

.totb-saleend{
  font-family:var(--body,'Montserrat',sans-serif); font-size:12.5px; color:#8a5a0b;
  background:#fff8e6; border-radius:8px; padding:7px 12px; margin:-8px 0 18px; display:inline-block;
}

/* Езиков етикет върху малката корица */
.totb-c-lang{
  position:absolute; right:6px; top:8px; z-index:6;
  background:rgba(10,37,64,.86); color:#fff; font-family:var(--body,'Montserrat',sans-serif);
  font-size:10px; font-weight:600; letter-spacing:.08em; padding:4px 8px; border-radius:6px;
}
.totb-c-title a{color:inherit; text-decoration:none}
.totb-c-title a:hover{color:var(--brand,#635bff)}
.totb-card .totb-pricerow{margin-bottom:14px}

/* Цената в бутоните на hero блока */
.totb-hero-btn small{font-size:.82em; opacity:.8; font-weight:500; margin-left:2px}

/* Бутонът „Купи" докато се отваря Stripe */
.totb-buy.is-busy{opacity:.7; pointer-events:none; position:relative}
.totb-buy.is-busy::after{
  content:''; display:inline-block; width:14px; height:14px; margin-left:10px; vertical-align:-2px;
  border:2px solid rgba(255,255,255,.5); border-top-color:#fff; border-radius:50%;
  animation:totb-spin .7s linear infinite;
}
@keyframes totb-spin{to{transform:rotate(360deg)}}

/* Собствена страница на книгата */
.totb-bookpage{padding:clamp(16px,4vw,48px) 16px}
.totb-shop--page{max-width:1120px; margin:0 auto}

/* Китайски и японски текст — без разредени главни букви */
.totb-product[lang="zh"] .totb-p-author, .totb-product[lang="ja"] .totb-p-author,
.totb-mc[lang="zh"] .totb-mc-author, .totb-mc[lang="ja"] .totb-mc-author{letter-spacing:.04em}

@media(max-width:520px){
  .totb-ed{min-width:calc(50% - 4px)}
}
@media(prefers-reduced-motion:reduce){
  .totb-buy.is-busy::after{animation:none}
}

/* Витрината се нарежда според ширината на колоната, в която е поставена,
   а не само според екрана — в тясна колона на темата не се реже вдясно. */
.totb-shop{container-type:inline-size; width:100%}
@container (max-width:760px){
  .totb-product{grid-template-columns:1fr; gap:32px; padding:32px 26px}
  .totb-p-cover{position:static; max-width:260px; margin:0 auto}
  .totb-p-author,.totb-p-title,.totb-p-sub{text-align:center}
  .totb-rule{margin-left:auto; margin-right:auto}
  .totb-p-blurb,.totb-p-desc,.totb-p-inside{text-align:left}
  .totb-buybox{max-width:460px; width:100%; margin-left:auto; margin-right:auto}
  .totb-hero{grid-template-columns:1fr; gap:36px; text-align:center; padding:16px}
  .totb-hero-cover{max-width:250px; margin:0 auto}
  .totb-hero-kicker{padding-left:0}
  .totb-hero-kicker::before{display:none}
  .totb-hero-body{max-width:none}
  .totb-hero-tags,.totb-hero-btns{justify-content:center}
  .totb-hero-text{text-align:left}
}
@container (max-width:480px){
  .totb-product{padding:24px 18px; border-radius:14px}
  .totb-p-cover{max-width:190px}
  .totb-price{font-size:30px}
  .totb-p-title{font-size:26px}
  .totb-buybox{padding:18px}
  .totb-hero-btns{flex-direction:column}
  .totb-hero-btn{width:100%; justify-content:center}
}

/* Темите често оцветяват всички бутони и връзки — нашите остават свои. */
.totb-shop .totb-buy, .totb-modal .totb-buy, .totb-thanks .totb-buy{
  background:var(--brand,#635bff)!important; color:#fff!important; border:0!important;
  text-decoration:none!important; text-transform:none; letter-spacing:.01em;
}
.totb-shop .totb-buy:hover, .totb-modal .totb-buy:hover, .totb-thanks .totb-buy:hover{background:var(--brand2,#7a73ff)!important}
.totb-ed, .totb-ed *, .totb-hero-btn, .totb-sample{text-decoration:none!important}
.totb-modal .totb-modal-x{
  width:34px!important; height:34px!important; min-width:0!important; padding:0!important;
  line-height:34px!important; font-size:20px!important; border-radius:50%!important;
}
.totb-modal .totb-mc-more{background:none!important; color:var(--brand,#635bff)!important; padding:4px 0!important; border:0!important}
.totb-mc-author{padding-right:34px}

/* ---------- Купи от Amazon ---------- */
.totb-amz{margin:12px 0 0;display:flex;flex-direction:column;align-items:center;gap:8px}
.totb-amz-or{font-size:11px;letter-spacing:.12em;text-transform:uppercase;color:var(--ink3,#8898aa);display:flex;align-items:center;gap:10px;width:100%}
.totb-amz-or::before,.totb-amz-or::after{content:'';flex:1;height:1px;background:var(--line,#e6ebf1)}
.totb-amz-btn{display:flex;align-items:center;justify-content:center;gap:9px;width:100%;min-height:46px;padding:10px 18px;border-radius:10px;
  background:#fff;border:1px solid #d5d9e0;color:#111!important;font-family:var(--body,'Montserrat',sans-serif);font-size:15px;font-weight:600;
  text-decoration:none!important;transition:border-color .15s,box-shadow .15s}
.totb-amz-btn:hover{border-color:#f0a43a;box-shadow:0 4px 14px -6px rgba(240,164,58,.6)}
.totb-amz-btn svg{color:#f08c00}
.totb-amz-btn.has-badge{background:transparent;border:0;padding:0;min-height:0;box-shadow:none}
.totb-amz-btn.has-badge img{height:44px;width:auto;display:block}
.totb-amz--sm .totb-amz-btn{min-height:42px;font-size:14px}
