/* =========================================================
   FOH · Theme Halloween
   Bật khi <html> có class "theme-halloween".
   Giữ nền kem + font cũ của FOH, chỉ đổi điểm nhấn sang
   cam bí ngô + tím mận, thêm dây cờ vải may tay.
   ========================================================= */

html.theme-halloween {
  --bg: #F7EFE4;
  --rose: #D9692A;        /* cam bí ngô: nút, badge, điểm nhấn */
  --rose-soft: #FBE3CF;
  --sage: #5B3A6B;        /* tím mận: chữ nhỏ trên tiêu đề, link phụ */
  --sage-soft: #ECE2EF;
  --sun: #F2B33D;
  --line: #E8D9C8;
}

/* ---------- Thanh thông báo trên cùng ---------- */
.hw-bar {
  background: #3B2742;
  color: #FBE3CF;
  text-align: center;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: .02em;
  padding: 8px 16px;
}
.hw-bar b { color: #F2B33D; font-weight: 600; }

/* ---------- Dây cờ vải dưới header ---------- */
.hw-bunting {
  height: 30px;
  background-repeat: repeat-x;
  background-position: center top;
  background-size: 90px 30px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='30' viewBox='0 0 90 30'%3E%3Cpath d='M0 2.5 Q45 6 90 2.5' fill='none' stroke='%233A2E2A' stroke-width='1.2'/%3E%3Cpolygon points='3,3 27,4 15,26' fill='%23D9692A'/%3E%3Cpolygon points='7,6 23,6.5 15,21' fill='none' stroke='%23fff' stroke-opacity='.65' stroke-width='.9' stroke-dasharray='2 2'/%3E%3Cpolygon points='33,4.5 57,4.5 45,27' fill='%235B3A6B'/%3E%3Cpolygon points='37,7.5 53,7.5 45,22' fill='none' stroke='%23fff' stroke-opacity='.6' stroke-width='.9' stroke-dasharray='2 2'/%3E%3Cpolygon points='63,4 87,3 75,26' fill='%23F2B33D'/%3E%3Cpolygon points='67,6.5 83,6 75,21' fill='none' stroke='%233A2E2A' stroke-opacity='.45' stroke-width='.9' stroke-dasharray='2 2'/%3E%3C/svg%3E");
  pointer-events: none;
}
.site-foot .hw-bunting { margin-bottom: 24px; }

/* ---------- Bí ngô nhỏ cạnh logo ---------- */
html.theme-halloween .logo { position: relative; }
html.theme-halloween .logo::after {
  content: "";
  position: absolute;
  right: -14px;
  bottom: 2px;
  width: 20px;
  height: 20px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 6c-.3-2 .5-3.4 2-4' fill='none' stroke='%232F6B3A' stroke-width='1.8' stroke-linecap='round'/%3E%3Cellipse cx='7.5' cy='14' rx='5.5' ry='7' fill='%23C95A1F'/%3E%3Cellipse cx='16.5' cy='14' rx='5.5' ry='7' fill='%23C95A1F'/%3E%3Cellipse cx='12' cy='14' rx='5' ry='7.5' fill='%23E07A2E'/%3E%3Cpath d='M12 7v14' stroke='%23B5501B' stroke-width='.8' stroke-dasharray='1.6 1.4'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* ---------- Chữ nhỏ trên tiêu đề: thêm bí ngô ---------- */
html.theme-halloween .eyebrow {
  color: var(--sage);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
html.theme-halloween .eyebrow::before {
  content: "";
  width: 13px;
  height: 13px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 6c-.3-2 .5-3.4 2-4' fill='none' stroke='%232F6B3A' stroke-width='2' stroke-linecap='round'/%3E%3Cellipse cx='7.5' cy='14' rx='5.5' ry='7' fill='%23C95A1F'/%3E%3Cellipse cx='16.5' cy='14' rx='5.5' ry='7' fill='%23C95A1F'/%3E%3Cellipse cx='12' cy='14' rx='5' ry='7.5' fill='%23E07A2E'/%3E%3C/svg%3E") no-repeat center / contain;
}

/* ---------- Badge trên banner ---------- */
html.theme-halloween .slide-badge {
  background: var(--rose);
  color: #fff;
}

/* ---------- Vài con dơi bay nhẹ ở góc banner ---------- */
html.theme-halloween #ban-tin { position: relative; }
.hw-bats {
  position: absolute;
  top: 18px;
  right: 8%;
  width: 150px;
  height: 80px;
  pointer-events: none;
  z-index: 3;
}
.hw-bats span {
  position: absolute;
  width: 40px;
  height: 20px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 20'%3E%3Cpath d='M20 8c-1-2-1-3 0-4 1 1 1 2 0 4 2-1 3-1 4 0 3-4 9-5 16-3-4 1-6 4-6 8-2-2-4-2-6 0-1-2-3-3-5-2 0 2-1 3-3 4-2-1-3-2-3-4-2-1-4 0-5 2-2-2-4-2-6 0 0-4-2-7-6-8 7-2 13-1 16 3 1-1 2-1 4 0z' fill='%23F4E7D6'/%3E%3C/svg%3E") no-repeat center / contain;
  animation: hw-float 4.5s ease-in-out infinite;
  opacity: .9;
}
.hw-bats span:nth-child(1) { left: 0;    top: 24px; }
.hw-bats span:nth-child(2) { left: 58px; top: 0;    width: 30px; height: 15px; animation-delay: -1.5s; }
.hw-bats span:nth-child(3) { left: 108px; top: 40px; width: 24px; height: 12px;  animation-delay: -3s; }
@keyframes hw-float {
  0%, 100% { transform: translate(0, 0) rotate(-4deg); }
  50%      { transform: translate(6px, -8px) rotate(4deg); }
}
@media (prefers-reduced-motion: reduce) {
  .hw-bats span { animation: none; }
}

/* ---------- Thẻ sản phẩm: viền cam nhẹ khi rê chuột ---------- */
html.theme-halloween .card:hover,
html.theme-halloween .cat-tile:hover {
  box-shadow: 0 0 0 2px var(--rose-soft), 0 8px 24px rgba(91, 58, 107, .10);
}

/* ---------- Banner Halloween (thay ảnh slide đầu trong mùa lễ) ---------- */
.hw-hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  align-items: center;
  gap: 24px;
  width: 100%;
  height: 100%;
  min-height: 100%;
  padding: 48px 7% 56px;
  box-sizing: border-box;
  color: #F4E7D6;
  background:
    radial-gradient(circle at 78% 30%, rgba(242,179,61,.18), transparent 45%),
    radial-gradient(rgba(244,231,214,.07) 1.2px, transparent 1.4px) 0 0 / 14px 14px,
    #3B2742;
  overflow: hidden;
}
.hw-hero-txt { position: relative; z-index: 2; }
.hw-hero .hw-pill {
  display: inline-block;
  background: #D9692A;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  padding: 7px 14px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.hw-hero h2 {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(34px, 5.2vw, 72px);
  line-height: 1.05;
  margin: 0 0 16px;
  color: #FBF3E8;
  text-transform: none;
  letter-spacing: 0;
}
.hw-hero h2 em { font-style: italic; color: #F2B33D; white-space: nowrap; }
.hw-hero p {
  font-size: clamp(15px, 1.4vw, 18px);
  line-height: 1.55;
  max-width: 30em;
  margin: 0 0 24px;
  color: #E9DCCB;
}
.hw-hero .hw-cta {
  display: inline-block;
  background: #F4E7D6;
  color: #3B2742;
  font-weight: 600;
  padding: 12px 22px;
  border-radius: 999px;
}
.hw-hero-pics { position: relative; height: 100%; min-height: 300px; }
.hw-photo {
  position: absolute;
  background: #FBF3E8;
  padding: 10px 10px 34px;
  box-shadow: 0 14px 30px rgba(0,0,0,.35);
}
.hw-photo img { display: block; width: 100%; height: 100%; object-fit: cover; }
.hw-photo::before { /* băng dính vải */
  content: "";
  position: absolute;
  top: -12px; left: 50%;
  width: 78px; height: 24px;
  transform: translateX(-50%) rotate(-3deg);
  background: repeating-linear-gradient(45deg, #D9692A 0 6px, #E88A4C 6px 12px);
  opacity: .92;
}
.hw-photo.p1 { width: 46%; height: 72%; left: 6%;  top: 8%;  transform: rotate(-6deg); }
.hw-photo.p2 { width: 44%; height: 66%; right: 4%; top: 22%; transform: rotate(5deg); }
.hw-photo.p2::before { background: repeating-linear-gradient(45deg, #5B3A6B 0 6px, #7A5689 6px 12px); }
.hw-pumpkin {
  position: absolute;
  width: 74px; height: 74px;
  bottom: 6%; left: 40%;
  z-index: 3;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 6c-.3-2 .5-3.4 2-4' fill='none' stroke='%234E8A4A' stroke-width='1.6' stroke-linecap='round'/%3E%3Cellipse cx='7.5' cy='14' rx='5.5' ry='7' fill='%23C95A1F'/%3E%3Cellipse cx='16.5' cy='14' rx='5.5' ry='7' fill='%23C95A1F'/%3E%3Cellipse cx='12' cy='14' rx='5' ry='7.5' fill='%23E07A2E'/%3E%3Cpath d='M12 7v14M7.5 7.5v13M16.5 7.5v13' stroke='%23B5501B' stroke-width='.6' stroke-dasharray='1.4 1.2'/%3E%3C/svg%3E") no-repeat center / contain;
  filter: drop-shadow(0 6px 10px rgba(0,0,0,.3));
}
.hw-pumpkin.sm { width: 46px; height: 46px; bottom: 10%; left: auto; right: 2%; }
.hw-hero .hw-bunting { position: absolute; top: 0; left: 0; right: 0; z-index: 1; }

/* điện thoại: giữ banner ngang 2:1 như máy tính (chữ trái, ảnh phải), thu nhỏ cho vừa */
@media (max-width: 760px) {
  .hw-hero { grid-template-columns: 1.2fr 1fr; padding: 14px 3% 14px 16px; gap: 4px; }
  .hw-hero-pics { min-height: 0; height: 100%; }
  .hw-hero .hw-pill { font-size: 9.5px; padding: 3px 8px; margin-bottom: 6px; }
  .hw-hero h2 { font-size: clamp(17px, 5vw, 30px); margin-bottom: 6px; }
  .hw-hero p { font-size: 11px; line-height: 1.4; margin-bottom: 8px; }
  .hw-hero .hw-cta { font-size: 11px; padding: 5px 11px; }
  .hw-photo { padding: 4px 4px 12px; box-shadow: 0 6px 14px rgba(0,0,0,.35); }
  .hw-photo::before { width: 34px; height: 10px; top: -5px; }
  .hw-photo.p1 { width: 52%; height: 70%; left: 2%; top: 12%; }
  .hw-photo.p2 { width: 48%; height: 62%; right: 2%; top: 28%; }
  .hw-pumpkin { width: 30px; height: 30px; left: 40%; bottom: 2%; }
  .hw-pumpkin.sm { display: none; }
  .hw-hero .hw-spider { width: 20px; --len: 26px !important; }
  .hw-hero .hw-spider::after { width: 20px; height: 20px; }
  .hw-hero .hw-spider.s2 { display: none; }
}
@media (max-width: 480px) { .hw-hero p { display: none; } }

/* ---------- Mạng nhện góc ---------- */
.hw-web {
  position: absolute;
  width: 170px; height: 170px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cpath d='M0 0L204.0 0.0M0 0L197.9 49.4M0 0L178.4 98.9M0 0L144.2 144.2M0 0L98.9 178.4M0 0L49.4 197.9M0 0L0.0 204.0M22.0 0.0Q18.8 2.3 21.3 5.3M21.3 5.3Q17.6 6.9 19.2 10.7M19.2 10.7Q15.1 11.4 15.6 15.6M15.6 15.6Q11.4 15.1 10.7 19.2M10.7 19.2Q6.9 17.6 5.3 21.3M5.3 21.3Q2.3 18.8 0.0 22.0M48.0 0.0Q41.0 5.0 46.6 11.6M46.6 11.6Q38.4 15.1 42.0 23.3M42.0 23.3Q33.0 24.8 33.9 33.9M33.9 33.9Q24.8 33.0 23.3 42.0M23.3 42.0Q15.1 38.4 11.6 46.6M11.6 46.6Q5.0 41.0 0.0 48.0M78.0 0.0Q66.6 8.2 75.7 18.9M75.7 18.9Q62.4 24.6 68.2 37.8M68.2 37.8Q53.6 40.4 55.2 55.2M55.2 55.2Q40.4 53.6 37.8 68.2M37.8 68.2Q24.6 62.4 18.9 75.7M18.9 75.7Q8.2 66.6 0.0 78.0M112.0 0.0Q95.6 11.7 108.7 27.1M108.7 27.1Q89.6 35.3 98.0 54.3M98.0 54.3Q76.9 58.0 79.2 79.2M79.2 79.2Q58.0 76.9 54.3 98.0M54.3 98.0Q35.3 89.6 27.1 108.7M27.1 108.7Q11.7 95.6 0.0 112.0M150.0 0.0Q128.0 15.7 145.5 36.3M145.5 36.3Q120.0 47.3 131.2 72.7M131.2 72.7Q103.0 77.6 106.1 106.1M106.1 106.1Q77.6 103.0 72.7 131.2M72.7 131.2Q47.3 120.0 36.3 145.5M36.3 145.5Q15.7 128.0 0.0 150.0M192.0 0.0Q163.9 20.1 186.3 46.4M186.3 46.4Q153.6 60.5 167.9 93.1M167.9 93.1Q131.9 99.4 135.8 135.8M135.8 135.8Q99.4 131.9 93.1 167.9M93.1 167.9Q60.5 153.6 46.4 186.3M46.4 186.3Q20.1 163.9 0.0 192.0' fill='none' stroke='%233A2E2A' stroke-opacity='0.42' stroke-width='1.1' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat 0 0 / contain;
  pointer-events: none;
  z-index: 0;
}
.hw-web.light { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 200 200'%3E%3Cpath d='M0 0L204.0 0.0M0 0L197.9 49.4M0 0L178.4 98.9M0 0L144.2 144.2M0 0L98.9 178.4M0 0L49.4 197.9M0 0L0.0 204.0M22.0 0.0Q18.8 2.3 21.3 5.3M21.3 5.3Q17.6 6.9 19.2 10.7M19.2 10.7Q15.1 11.4 15.6 15.6M15.6 15.6Q11.4 15.1 10.7 19.2M10.7 19.2Q6.9 17.6 5.3 21.3M5.3 21.3Q2.3 18.8 0.0 22.0M48.0 0.0Q41.0 5.0 46.6 11.6M46.6 11.6Q38.4 15.1 42.0 23.3M42.0 23.3Q33.0 24.8 33.9 33.9M33.9 33.9Q24.8 33.0 23.3 42.0M23.3 42.0Q15.1 38.4 11.6 46.6M11.6 46.6Q5.0 41.0 0.0 48.0M78.0 0.0Q66.6 8.2 75.7 18.9M75.7 18.9Q62.4 24.6 68.2 37.8M68.2 37.8Q53.6 40.4 55.2 55.2M55.2 55.2Q40.4 53.6 37.8 68.2M37.8 68.2Q24.6 62.4 18.9 75.7M18.9 75.7Q8.2 66.6 0.0 78.0M112.0 0.0Q95.6 11.7 108.7 27.1M108.7 27.1Q89.6 35.3 98.0 54.3M98.0 54.3Q76.9 58.0 79.2 79.2M79.2 79.2Q58.0 76.9 54.3 98.0M54.3 98.0Q35.3 89.6 27.1 108.7M27.1 108.7Q11.7 95.6 0.0 112.0M150.0 0.0Q128.0 15.7 145.5 36.3M145.5 36.3Q120.0 47.3 131.2 72.7M131.2 72.7Q103.0 77.6 106.1 106.1M106.1 106.1Q77.6 103.0 72.7 131.2M72.7 131.2Q47.3 120.0 36.3 145.5M36.3 145.5Q15.7 128.0 0.0 150.0M192.0 0.0Q163.9 20.1 186.3 46.4M186.3 46.4Q153.6 60.5 167.9 93.1M167.9 93.1Q131.9 99.4 135.8 135.8M135.8 135.8Q99.4 131.9 93.1 167.9M93.1 167.9Q60.5 153.6 46.4 186.3M46.4 186.3Q20.1 163.9 0.0 192.0' fill='none' stroke='%23F4E7D6' stroke-opacity='0.5' stroke-width='1.1' stroke-linecap='round'/%3E%3C/svg%3E"); }
.hw-web.tl { top: 0; left: 0; }
.hw-web.tr { top: 0; right: 0; transform: scaleX(-1); }
.hw-web.bl { bottom: 0; left: 0; transform: scaleY(-1); }
.hw-web.br { bottom: 0; right: 0; transform: scale(-1,-1); }
.hw-web.sm { width: 110px; height: 110px; }
html.theme-halloween .site-head { position: sticky; }
html.theme-halloween .site-head .head-in { position: relative; z-index: 1; }
html.theme-halloween .site-foot,
html.theme-halloween #ghe-quay .wrap > * { position: relative; }
@media (max-width: 760px) {
  .hw-web { width: 96px; height: 96px; }
  .hw-web.sm { width: 72px; height: 72px; }
}

/* ---------- Nhện thả tơ ---------- */
.hw-spider {
  position: absolute;
  top: 0;
  width: 34px;
  z-index: 4;
  pointer-events: none;
  transform-origin: top center;
  animation: hw-sway 5s ease-in-out infinite;
}
.hw-spider::before { /* sợi tơ */
  content: "";
  display: block;
  width: 1px;
  height: var(--len, 90px);
  margin: 0 auto;
  background: linear-gradient(rgba(244,231,214,.25), rgba(244,231,214,.85));
  animation: hw-drop 6s ease-in-out infinite;
}
.hw-spider::after {
  content: "";
  display: block;
  width: 34px; height: 34px;
  margin-top: -4px;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 40 40'%3E%3Cg fill='none' stroke='%23F4E7D6' stroke-width='1.6' stroke-linecap='round'%3E%3Cpath d='M15 18 Q8 12 4 14M15 21 Q7 19 3 23M16 24 Q9 27 6 33M17 26 Q13 32 12 37M25 18 Q32 12 36 14M25 21 Q33 19 37 23M24 24 Q31 27 34 33M23 26 Q27 32 28 37'/%3E%3C/g%3E%3Cellipse cx='20' cy='23' rx='6' ry='7.5' fill='%23F4E7D6'/%3E%3Ccircle cx='20' cy='14.5' r='4' fill='%23F4E7D6'/%3E%3Ccircle cx='18.4' cy='14' r='1' fill='%23F2B33D'/%3E%3Ccircle cx='21.6' cy='14' r='1' fill='%23F2B33D'/%3E%3C/svg%3E") no-repeat center / contain;
}
.hw-spider.s2 { width: 24px; animation-duration: 6.5s; animation-delay: -2s; }
.hw-spider.s2::after { width: 24px; height: 24px; }
.hw-spider.s2::before { animation-delay: -3s; }
@keyframes hw-sway { 0%,100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
@keyframes hw-drop { 0%,100% { height: var(--len, 90px); } 50% { height: calc(var(--len, 90px) + 26px); } }

/* ---------- Chiều sâu 3D nhẹ ---------- */
.hw-hero-pics { perspective: 900px; }
.hw-photo { transition: transform .25s ease-out; will-change: transform; }
html.theme-halloween .cats { perspective: 800px; }
html.theme-halloween .cat-tile { transition: transform .25s ease, box-shadow .25s ease; }
html.theme-halloween .cat-tile:hover { transform: rotateX(6deg) rotateY(-6deg) translateY(-4px); }

@media (prefers-reduced-motion: reduce) {
  .hw-spider, .hw-spider::before { animation: none; }
  html.theme-halloween .cat-tile:hover { transform: none; }
}

/* Chữ nhỏ trên khối tối (Ghé quầy) cần sáng hơn */
html.theme-halloween #ghe-quay .eyebrow { color: #F2B33D; }

.slide.hw { color: inherit; }

/* chỉnh thêm cho bản gắn vào web */
html.theme-halloween .logo::after { right: -24px; bottom: 6px; }
@media (max-width: 640px) { .hw-bar-more { display: none; } }
@media (min-width: 1080px) { .cats[data-n="3"] { grid-template-columns: repeat(3, 1fr); } .cats[data-n="4"] { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 759px) { .cats[data-n="3"] { grid-template-columns: repeat(3, 1fr); gap: 8px; } .cats[data-n="3"] .cat-name { padding: 8px 8px 10px; } .cats[data-n="3"] .cat-name b { font-size: 15px; } .cats[data-n="3"] .cat-name small { font-size: 11.5px; } }

/* ngoài mùa Halloween: ẩn hết đồ trang trí */
html:not(.theme-halloween) .hw-bar,
html:not(.theme-halloween) .hw-bats,
html:not(.theme-halloween) .hw-bunting,
html:not(.theme-halloween) .hw-web { display: none; }
