.shop { max-width: 1320px; }
.hero-text { margin: 6px 0 12px; color: #cdd6e0; }
.steps { display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; }
.steps span { font-size: 12px; padding: 3px 10px; border-radius: 99px; background: var(--accent-soft); color: var(--accent); }
.btn.wide { width: 100%; justify-content: center; padding: 10px; }
.total { font-size: 22px; font-weight: 800; color: var(--accent); padding-top: 4px; }
.footer { font-size: 12px; margin-top: 18px; }

/* ---------- bố cục cửa hàng: kệ | lối đi | kệ ---------- */
.store {
  --wood-dark: #3b2414; --wood: #6b4226; --wood-light: #a0703f; --wall: #151b26;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 330px) minmax(0, 1fr);
  gap: 22px; align-items: start; padding-bottom: 210px; /* chừa chỗ cho Rắn Bán Rong ở góc */
}

/* ---------- kệ hàng ---------- */
.shelf {
  position: relative; border-radius: 12px 12px 4px 4px; padding: 44px 16px 10px;
  background:
    repeating-linear-gradient(90deg, #ffffff05 0 2px, transparent 2px 22px),
    linear-gradient(180deg, #2a1a10, #20140c);
  border: 10px solid var(--wood-dark); border-top-width: 14px;
  box-shadow: inset 0 0 40px #000a, 0 18px 30px #0008;
}
.shelf::after { /* chân kệ */
  content: ''; position: absolute; left: -10px; right: -10px; bottom: -26px; height: 16px;
  background: linear-gradient(90deg, var(--wood-dark) 0 22px, transparent 22px calc(100% - 22px), var(--wood-dark) calc(100% - 22px));
}
.shelf-sign {
  position: absolute; top: -4px; left: 50%; transform: translateX(-50%);
  background: #f3e2c3; color: #4a2e18; font-weight: 800; font-size: 13px; letter-spacing: .5px;
  padding: 5px 16px; border-radius: 0 0 8px 8px; box-shadow: 0 3px 8px #0007; white-space: nowrap;
}
.tier { position: relative; display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-items: end; min-height: 200px; padding: 0 4px 22px; margin-bottom: 18px; }
.tier::after { /* tấm ván */
  content: ''; position: absolute; left: -16px; right: -16px; bottom: 0; height: 16px; border-radius: 2px;
  background: linear-gradient(180deg, var(--wood-light), var(--wood) 60%, var(--wood-dark));
  box-shadow: 0 8px 12px #000b;
}

/* ---------- món hàng trên kệ ---------- */
.item {
  position: relative; z-index: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end;
  background: none; border: 0; padding: 6px 4px 0; cursor: pointer; color: var(--text); text-align: center;
  transition: transform .2s ease;
}
.item .goods {
  font-size: 62px; line-height: 1; filter: drop-shadow(0 8px 6px #000c); transition: transform .25s cubic-bezier(.3, 1.6, .5, 1);
}
.item .goods img { width: 96px; height: 96px; object-fit: cover; border-radius: 10px; display: block; }
.item .tag {
  position: relative; margin-top: 10px; background: #fff7e6; color: #3d2a17; border-radius: 4px;
  padding: 5px 9px 4px; font-size: 12px; line-height: 1.3; min-width: 92px; max-width: 100%;
  box-shadow: 0 3px 6px #0008; transform: rotate(-2deg); transform-origin: top center;
}
.item:nth-child(2n) .tag { transform: rotate(2deg); }
.item .tag::before { content: ''; position: absolute; top: 3px; left: 6px; width: 5px; height: 5px; border-radius: 50%; background: #c8b28d; }
.item .name { display: block; font-weight: 700; overflow: hidden; text-overflow: ellipsis; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.item .price { display: block; font-weight: 800; color: #c0392b; font-size: 14px; }
.item .stock { display: block; font-size: 10px; color: #8a7458; }
.item:hover .goods, .item:focus-visible .goods { transform: translateY(-10px) scale(1.08); }
.item:hover .tag, .item:focus-visible .tag { animation: swing .9s ease-in-out; }
.item:hover::before, .item:focus-visible::before { /* đèn rọi */
  content: ''; position: absolute; inset: -6px -2px 26px; z-index: -1; border-radius: 50% 50% 10px 10px;
  background: radial-gradient(ellipse at 50% 70%, #f5a62340, transparent 70%);
}
.item:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 8px; }
.item.out { cursor: not-allowed; }
.item.out .goods { filter: grayscale(1) brightness(.6); }
.item.out .stamp {
  position: absolute; top: 24px; left: 50%; transform: translateX(-50%) rotate(-14deg); z-index: 2;
  border: 2px solid #e5534b; color: #e5534b; font-weight: 800; font-size: 12px; padding: 1px 6px; border-radius: 4px; background: #1a0f0fcc;
}
.slot-prop { align-self: end; justify-self: center; font-size: 40px; opacity: .35; filter: grayscale(.4) drop-shadow(0 6px 4px #000a); padding-bottom: 4px; }

/* ---------- lối đi giữa ---------- */
.aisle { text-align: center; padding-top: 34px; position: sticky; top: 12px; }
.signboard {
  position: relative; display: inline-block; padding: 14px 26px 12px; margin-bottom: 14px;
  background: linear-gradient(180deg, var(--wood-light), var(--wood)); border: 4px solid var(--wood-dark); border-radius: 10px;
  box-shadow: 0 10px 22px #000a; transform-origin: top center; animation: sway 6s ease-in-out infinite;
}
.signboard h1 { margin: 0; font-size: 22px; color: #fff4e0; text-shadow: 0 2px 0 #3b2414; }
.signboard .open { font-size: 11px; font-weight: 800; color: #b6f5c4; letter-spacing: 1px; margin-top: 2px; }
.signboard .rope { position: absolute; top: -34px; width: 2px; height: 34px; background: #8b6a48; }
.signboard .rope.l { left: 24px; } .signboard .rope.r { right: 24px; }
.watch-link { display: inline-block; margin-top: 14px; font-size: 13px; font-weight: 600; }

/* ---------- Rắn Bán Rong ở góc ---------- */
.corner { position: fixed; bottom: -8px; z-index: 30; width: 190px; pointer-events: none; animation: peek-in .9s cubic-bezier(.3, 1.4, .5, 1) both; }
.corner.left { left: 10px; }
.corner.right { right: 10px; }
.corner .pet { width: 100%; margin: 0; }
.corner .pet.flip .pet-svg { transform: scaleX(-1); }
.corner .pet-kb, .corner .pet-cup, .corner .pet-coins { display: none; }
.corner-bubble {
  position: absolute; bottom: 100%; width: max-content; max-width: min(300px, calc(100vw - 40px));
  background: #1d2533; border: 1px solid #f5a62388; color: var(--text); border-radius: 14px; padding: 9px 13px;
  font-size: 13px; line-height: 1.4; box-shadow: 0 8px 20px #0008; opacity: 0; transform: translateY(6px);
  transition: opacity .2s, transform .2s;
}
.corner.left .corner-bubble { left: 30px; }
.corner.right .corner-bubble { right: 30px; }
.corner-bubble.show { opacity: 1; transform: none; }
.corner-bubble b { color: var(--accent); }
.corner-bubble::after {
  content: ''; position: absolute; top: 100%; border: 8px solid transparent; border-top-color: #f5a62388;
}
.corner.left .corner-bubble::after { left: 40px; }
.corner.right .corner-bubble::after { right: 40px; }

/* ---------- thanh toán ---------- */
.pay { text-align: center; }
.qr { width: 260px; max-width: 100%; aspect-ratio: 1; background: #fff; border-radius: 10px; padding: 6px; }
.pay-info { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; text-align: left; margin: 14px 0 8px; font-size: 13px; }
.pay-info dt { color: var(--muted); }
.pay-info dd { margin: 0; display: flex; align-items: center; gap: 6px; flex-wrap: wrap; word-break: break-all; }
.warn { font-size: 12px; color: #e3b341; margin: 6px 0 12px; }
.waiting { display: flex; align-items: center; justify-content: center; gap: 8px; font-size: 13px; color: var(--muted); }
.spinner { width: 14px; height: 14px; border: 2px solid var(--border); border-top-color: var(--accent); border-radius: 50%; display: inline-block; animation: spin .8s linear infinite; vertical-align: -2px; }
.done-pet { width: 170px; margin: 0 auto; }
.thanks { margin: 14px 0; padding: 12px 14px; border-left: 3px solid var(--accent); background: var(--panel-2); border-radius: 6px; text-align: left; font-size: 15px; }

.confetti { position: fixed; top: -20px; font-size: 22px; z-index: 70; pointer-events: none; animation: fall linear forwards; }

@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fall { to { transform: translateY(110vh) rotate(540deg); } }
@keyframes swing { 0%, 100% { rotate: 0deg; } 25% { rotate: 6deg; } 60% { rotate: -4deg; } }
@keyframes sway { 0%, 100% { transform: rotate(-1.2deg); } 50% { transform: rotate(1.2deg); } }
@keyframes peek-in { from { transform: translateY(110%); } to { transform: none; } }

@media (max-width: 900px) {
  .store { grid-template-columns: minmax(0, 1fr); gap: 34px; padding-bottom: 150px; }
  .aisle { order: -1; position: static; padding-top: 30px; }
  .corner { width: 120px; }
  .item .goods { font-size: 52px; }
  .tier { min-height: 170px; }
}

/* ---------- bình luận sau thanh toán ---------- */
.comment-form { text-align: left; margin-top: 12px; }
.comment-form textarea { resize: vertical; }
.comment-meta { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.comment-done { font-size: 13px; color: var(--green); margin: 12px 0 0; }
#pay-done .btn.wide { margin-top: 14px; }

/* ---------- nút trong form mua ---------- */
.buy-actions { display: flex; gap: 10px; }
.buy-actions .btn { flex: 1; }

/* ---------- chi tiết sản phẩm ---------- */
.detail-modal { width: min(720px, 100%); }
.gallery-stage {
  position: relative; aspect-ratio: 16 / 10; background: #070b11; border-radius: 10px; overflow: hidden;
  display: grid; place-items: center; border: 1px solid var(--border);
}
.gallery-stage img, .gallery-stage video, .gallery-stage iframe { width: 100%; height: 100%; object-fit: contain; border: 0; display: block; }
.gallery-stage .tiktok { aspect-ratio: 9 / 16; width: auto; height: 100%; }
.gallery-stage .emoji-big { font-size: 110px; filter: drop-shadow(0 10px 10px #000c); }
.gallery-stage .nav {
  position: absolute; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; border-radius: 50%;
  border: 0; background: #000a; color: #fff; font-size: 18px; cursor: pointer;
}
.gallery-stage .nav:hover { background: var(--accent); color: #1a1205; }
.gallery-stage .nav.prev { left: 8px; } .gallery-stage .nav.next { right: 8px; }
.gallery-thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 8px 0 2px; }
.gallery-thumbs button {
  flex: 0 0 68px; height: 50px; border-radius: 6px; border: 2px solid transparent; padding: 0; overflow: hidden;
  background: #1d2533; cursor: pointer; position: relative; color: var(--text); font-size: 20px;
}
.gallery-thumbs button.on { border-color: var(--accent); }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }
.gallery-thumbs .play { position: absolute; inset: 0; display: grid; place-items: center; background: #0006; font-size: 16px; }
.detail-modal h3 { margin: 12px 0 4px; }
.d-meta { display: flex; align-items: baseline; gap: 10px; margin-bottom: 6px; }
.d-price { font-size: 22px; font-weight: 800; color: var(--accent); }
.d-short { color: #cdd6e0; margin: 0 0 8px; }
.d-details { white-space: pre-line; font-size: 14px; line-height: 1.6; color: #dfe6ee; background: var(--panel-2); border: 1px solid var(--border); border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; max-height: 260px; overflow-y: auto; }
.d-details:empty { display: none; }
.d-details a { word-break: break-all; }

@media (max-width: 500px) {
  .buy-actions { flex-direction: column-reverse; }
}
