/* ============================================================
   Loja de livros — página dedicada
   ============================================================ */

/* ---------- hero da loja ---------- */
.shop-hero{
  position:relative;
  min-height:64vh;
  display:flex; align-items:center;
  padding:clamp(150px,18vw,190px) 0 clamp(70px,8vw,100px);
  background:
    radial-gradient(ellipse 80% 60% at 50% 0%, rgba(217,138,79,.12), transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, #0e0c0a 100%);
  overflow:hidden;
}
.shop-hero::before{
  content:"";
  position:absolute; inset:0;
  background-image:repeating-linear-gradient(0deg, rgba(243,236,226,.025) 0 1px, transparent 1px 3px);
  pointer-events:none;
}
.shop-hero-inner{ position:relative; z-index:2; max-width:640px; }
.shop-hero-title{
  font-size:clamp(2.1rem,5vw,3.6rem); line-height:1.1;
  font-weight:600; margin-bottom:20px;
}
.shop-hero-title em{ font-style:italic; color:var(--accent-2); font-weight:400; }
.shop-hero-lede{ color:var(--text-dim); font-size:1.02rem; max-width:480px; margin-bottom:8px; }

.shop-hero-books{
  position:absolute; inset:0; z-index:1; pointer-events:none;
}
.floating-book{
  position:absolute;
  width:78px; height:104px; border-radius:10px;
  display:flex; align-items:center; justify-content:center;
  font-size:1.6rem; color:rgba(255,255,255,.85);
  box-shadow:0 24px 50px -18px rgba(0,0,0,.65);
  animation:floatBook 7s ease-in-out infinite;
  opacity:.9;
}
.fb-a{ background:linear-gradient(160deg,#7c5636,#d98a4f 70%); top:14%; right:14%; transform:rotate(-8deg); animation-delay:0s; }
.fb-b{ background:linear-gradient(160deg,#3d3128,#8a736a 70%); top:46%; right:26%; transform:rotate(6deg) scale(.82); animation-delay:1.2s; }
.fb-c{ background:linear-gradient(160deg,#4a5340,#8a9a7c 70%); top:8%; right:34%; transform:rotate(4deg) scale(.68); animation-delay:2.4s; }
.fb-alt{ top:62%; right:8%; transform:rotate(-10deg) scale(.6); animation-delay:3.6s; }
@keyframes floatBook{
  0%,100%{ transform:translateY(0) rotate(var(--r,-8deg)); }
  50%{ transform:translateY(-18px) rotate(var(--r,-8deg)); }
}
@media (max-width:920px){ .shop-hero-books{ opacity:.5; } .fb-c{ display:none; } }
@media (max-width:640px){ .shop-hero-books{ display:none; } }

/* ---------- toolbar ---------- */
.shop-toolbar{
  display:flex; align-items:center; justify-content:space-between; gap:20px;
  flex-wrap:wrap;
  padding-bottom:36px;
}
.shop-search{
  flex:1; min-width:220px; max-width:380px;
  display:flex; align-items:center; gap:10px;
  padding:12px 18px; border-radius:999px;
  border:1px solid var(--line-strong); background:var(--surface);
  transition:border-color .25s ease;
}
.shop-search:focus-within{ border-color:var(--accent); }
.shop-search i{ color:var(--text-faint); }
.shop-search input{
  flex:1; background:none; border:none; outline:none; color:var(--text); font-size:.92rem;
}
.shop-search input::placeholder{ color:var(--text-faint); }
.shop-sort{ display:flex; align-items:center; gap:10px; }
.shop-sort label{ font-size:.78rem; color:var(--text-faint); text-transform:uppercase; letter-spacing:.08em; }
.shop-sort select{
  padding:11px 16px; border-radius:999px; border:1px solid var(--line-strong);
  background:var(--surface); color:var(--text); font-size:.88rem; outline:none;
  transition:border-color .25s ease;
}
.shop-sort select:focus{ border-color:var(--accent); }

/* ---------- grid & cards ---------- */
.shop-catalog{ background:var(--bg); padding-top:0; }
.shop-empty{
  text-align:center; color:var(--text-faint); padding:60px 0; font-size:.95rem;
}
.shop-book{ position:relative; }
.shop-book.is-target .book-cover{
  box-shadow:0 0 0 3px var(--accent), 0 24px 50px -20px rgba(0,0,0,.6);
}
.shop-buy{ display:flex; flex-direction:column; gap:14px; }
.shop-buy-row{ display:flex; align-items:center; justify-content:space-between; gap:12px; }

.qty-stepper{
  display:inline-flex; align-items:center; gap:2px;
  border:1px solid var(--line-strong); border-radius:999px; overflow:hidden;
}
.qty-btn{
  width:30px; height:30px; display:flex; align-items:center; justify-content:center;
  color:var(--text-dim); font-size:1rem; transition:background .2s ease, color .2s ease;
}
.qty-btn:hover{ background:var(--accent-soft); color:var(--accent-2); }
.qty-value{ min-width:26px; text-align:center; font-size:.88rem; font-variant-numeric:tabular-nums; }
.qty-stepper.small .qty-btn{ width:24px; height:24px; font-size:.85rem; }

.add-to-cart{ width:100%; justify-content:center; position:relative; overflow:hidden; }
.add-to-cart.is-added{ background:var(--sage); }
.add-to-cart .fa-check{ display:none; }
.add-to-cart.is-added .fa-cart-plus{ display:none; }
.add-to-cart.is-added .fa-check{ display:inline; }

@keyframes popIn{
  0%{ transform:scale(1); }
  40%{ transform:scale(1.06); }
  100%{ transform:scale(1); }
}
.shop-book.is-bumped .book-cover{ animation:popIn .4s ease; }

/* ---------- floating cart button ---------- */
.cart-fab{
  position:fixed; right:clamp(18px,4vw,32px); bottom:clamp(18px,4vw,32px);
  z-index:250;
  width:60px; height:60px; border-radius:50%;
  background:var(--accent); color:#1a1310;
  display:flex; align-items:center; justify-content:center;
  font-size:1.3rem;
  box-shadow:0 18px 40px -14px rgba(217,138,79,.65);
  transition:transform .3s cubic-bezier(.16,1,.3,1);
}
.cart-fab:hover{ transform:translateY(-3px) scale(1.04); }
.cart-fab.is-pulsing{ animation:cartPulse .5s ease; }
@keyframes cartPulse{
  0%{ transform:scale(1); }
  35%{ transform:scale(1.18); }
  100%{ transform:scale(1); }
}
.cart-count{
  position:absolute; top:-4px; right:-4px;
  min-width:22px; height:22px; padding:0 5px; border-radius:999px;
  background:#1a1310; color:var(--accent-2);
  font-size:.7rem; font-weight:700;
  display:flex; align-items:center; justify-content:center;
  border:2px solid var(--bg);
}

/* ---------- cart drawer ---------- */
.cart-overlay{
  position:fixed; inset:0; z-index:300;
  background:rgba(10,9,8,.6); backdrop-filter:blur(2px);
  opacity:0; pointer-events:none;
  transition:opacity .3s ease;
}
.cart-overlay.is-open{ opacity:1; pointer-events:auto; }

.cart-drawer{
  position:fixed; top:0; right:0; bottom:0; z-index:301;
  width:min(420px,92vw);
  background:var(--bg-alt); border-left:1px solid var(--line);
  display:flex; flex-direction:column;
  transform:translateX(100%);
  transition:transform .4s cubic-bezier(.16,1,.3,1);
}
.cart-drawer.is-open{ transform:translateX(0); }

.cart-drawer-head{
  display:flex; align-items:center; justify-content:space-between;
  padding:24px 26px; border-bottom:1px solid var(--line);
}
.cart-drawer-head h2{
  font-size:1.15rem; display:flex; align-items:center; gap:10px;
}
.cart-close{
  width:34px; height:34px; border-radius:50%; border:1px solid var(--line-strong);
  display:flex; align-items:center; justify-content:center; font-size:1.1rem;
  color:var(--text-dim); transition:all .2s ease; line-height:1;
}
.cart-close:hover{ color:var(--text); border-color:var(--accent); }

.cart-items{ flex:1; overflow-y:auto; padding:12px 20px; }
.cart-empty{ text-align:center; padding:60px 20px; color:var(--text-faint); }
.cart-empty i{ font-size:2rem; margin-bottom:14px; display:block; color:var(--text-faint); }

.cart-item{
  display:flex; gap:14px; padding:16px 6px; border-bottom:1px solid var(--line);
  animation:itemIn .3s ease;
}
@keyframes itemIn{ from{ opacity:0; transform:translateX(12px); } to{ opacity:1; transform:translateX(0); } }
.cart-item-cover{
  flex:none; width:52px; height:68px; border-radius:8px; overflow:hidden;
  display:flex; align-items:center; justify-content:center; color:#fff; font-size:1.1rem;
  background-size:cover; background-position:center;
}
.cart-item-info{ flex:1; min-width:0; }
.cart-item-info h4{
  font-family:var(--font-body); font-weight:600; font-size:.9rem; margin-bottom:6px;
  color:var(--text); overflow:hidden; text-overflow:ellipsis; white-space:nowrap;
}
.cart-item-price{ font-size:.78rem; color:var(--text-faint); display:block; margin-bottom:8px; }
.cart-item-end{
  flex:none; display:flex; flex-direction:column; align-items:flex-end; justify-content:space-between;
}
.cart-item-subtotal{ font-family:var(--font-display); font-size:.95rem; color:var(--accent-2); }
.cart-item-remove{
  color:var(--text-faint); font-size:.82rem; transition:color .2s ease;
}
.cart-item-remove:hover{ color:#ff647c; }

.cart-summary{ padding:20px 24px 26px; border-top:1px solid var(--line); }
.cart-total-row{
  display:flex; align-items:center; justify-content:space-between;
  font-size:1rem; margin-bottom:18px;
}
.cart-total-row strong{ font-family:var(--font-display); font-size:1.3rem; color:var(--accent-2); }
.cart-checkout{ width:100%; justify-content:center; margin-bottom:10px; }
.cart-clear{
  width:100%; text-align:center; font-size:.82rem; color:var(--text-faint);
  padding:8px; transition:color .2s ease;
}
.cart-clear:hover{ color:#ff647c; }

/* ---------- toast ---------- */
.toast{
  position:fixed; left:50%; bottom:28px; z-index:400;
  transform:translate(-50%,20px);
  background:var(--surface-2); border:1px solid var(--line-strong);
  color:var(--text); padding:14px 22px; border-radius:999px;
  font-size:.86rem; display:flex; align-items:center; gap:10px;
  box-shadow:var(--shadow);
  opacity:0; pointer-events:none;
  transition:opacity .3s ease, transform .3s ease;
}
.toast.is-visible{ opacity:1; transform:translate(-50%,0); }
.toast i{ color:var(--sage); }

@media (prefers-reduced-motion:reduce){
  .floating-book{ animation:none; }
  .cart-fab.is-pulsing{ animation:none; }
  .shop-book.is-bumped .book-cover{ animation:none; }
}

@media (max-width:760px){
  .shop-toolbar{ flex-direction:column; align-items:stretch; }
  .shop-search{ max-width:none; }
  .shop-sort{ justify-content:space-between; }
}
