/* ==========================================================================
   Cửa hàng (cua-hang.html) — page styles, scoped under .p-shop (body class from boot()).
   Also loaded by san-pham.html for the shared "recently viewed" block (.shop-recent).
   ========================================================================== */

/* ---------- page header pills ---------- */
.p-shop .shop-pills{ display:flex; flex-wrap:wrap; gap:8px; }
.shop-pill{ display:inline-flex; align-items:center; gap:7px; padding:6px 12px; border-radius:var(--ta-r-pill); background:rgba(255,255,255,.12); border:1px solid rgba(255,231,163,.35); color:#FFF6E2; font-size:12.5px; font-weight:700; -webkit-backdrop-filter:blur(4px); backdrop-filter:blur(4px); }
.shop-pill b{ color:#FFE27A; font-weight:900; }
.shop-pill .ta-ico{ width:15px; height:15px; color:#FFD66B; }

/* ---------- flash strip ---------- */
.p-shop .shop-flash-wrap{ margin-top:18px; }
.p-shop .shop-flash{
  position:relative; overflow:hidden; display:grid; grid-template-columns:auto minmax(0,1fr); align-items:center; gap:10px 14px; padding:14px 16px;
  border-radius:var(--ta-r-xl); color:#fff; background:radial-gradient(70% 90% at 50% 0%, rgba(255,255,255,.16), transparent 70%), var(--ta-g-flash);
  box-shadow:var(--ta-sh-flash); border:1px solid rgba(255,255,255,.18);
}
.p-shop .shop-flash::before{ content:""; position:absolute; inset:0; pointer-events:none; background:var(--ta-tx-seigaiha); background-size:36px 18px; opacity:.3; }
.p-shop .shop-flash > *{ position:relative; }
.shop-flash__icon{ width:44px; height:44px; border-radius:50%; display:grid; place-items:center; background:var(--ta-g-orb); box-shadow:0 0 0 4px rgba(255,255,255,.18), 0 6px 14px rgba(120,10,10,.35); color:#7A1A00; }
.shop-flash__icon svg{ width:22px; height:22px; }
.shop-flash__text{ display:grid; gap:2px; min-width:0; }
.shop-flash__text b{ font-family:var(--ta-font-title); font-size:19px; line-height:1.2; }
.shop-flash__text span{ font-size:12.5px; line-height:1.45; color:rgba(255,246,225,.92); }
.p-shop .shop-flash .ta-countdown{ grid-column:1 / -1; flex-direction:row; justify-content:flex-start; gap:10px; }
.p-shop .shop-flash .ta-countdown__label{ color:#fff; font-size:12.5px; }
.shop-flash__cta{ grid-column:1 / -1; justify-self:start; color:var(--ta-buy) !important; }
@media (min-width:768px){
  .p-shop .shop-flash{ grid-template-columns:auto minmax(0,1fr) auto auto; padding:14px 20px; }
  .p-shop .shop-flash .ta-countdown{ grid-column:auto; }
  .shop-flash__cta{ grid-column:auto; justify-self:end; }
}

/* ---------- mobile category bar ---------- */
.p-shop .shop-catbar{ margin-top:16px; margin-inline:calc(-1 * var(--ta-gutter)); }
.shop-catbar__track{ display:flex; gap:8px; overflow-x:auto; padding:2px var(--ta-gutter) 6px; scrollbar-width:none; scroll-snap-type:x proximity; }
.shop-catbar__track::-webkit-scrollbar{ display:none; }
.shop-catbar__chip{ flex:0 0 auto; display:inline-flex; align-items:center; gap:6px; padding:8px 14px; border-radius:var(--ta-r-pill); background:#fff; border:1px solid var(--ta-line-2); font-size:13px; font-weight:800; color:var(--ta-text-2); white-space:nowrap; scroll-snap-align:start; box-shadow:0 2px 6px rgba(0,0,0,.04); }
.shop-catbar__chip small{ font-size:11px; font-weight:800; color:var(--ta-muted-2); }
.shop-catbar__chip.is-active{ background:var(--ta-maroon-600); border-color:var(--ta-maroon-600); color:#fff; box-shadow:0 6px 14px rgba(142,26,30,.25); }
.shop-catbar__chip.is-active small{ color:#FFD66B; }
@media (min-width:1024px){ .p-shop .shop-catbar{ display:none; } }

/* ---------- layout ---------- */
.p-shop .shop{ display:grid; grid-template-columns:minmax(0,1fr); gap:20px; margin-top:16px; }
.p-shop .shop-rail{ display:none; }
@media (min-width:1024px){
  .p-shop .shop{ grid-template-columns:262px minmax(0,1fr); gap:24px; align-items:start; margin-top:26px; }
  .p-shop .shop-rail{ display:grid; gap:16px; position:sticky; top:calc(var(--ta-sticky-h, 80px) + 16px); max-height:calc(100vh - calc(var(--ta-sticky-h, 80px) + 16px) - 16px); overflow:auto; overscroll-behavior:contain; scrollbar-width:thin; scrollbar-color:#E2D6C8 transparent; padding:2px 4px 6px 2px; margin:-2px -4px 0 -2px; }
  .p-shop .shop-f__cats a{ padding-block:6px; }
}
.p-shop .shop-main{ min-width:0; }

/* ---------- filter panel ---------- */
.shop-f{ background:#fff; border:1px solid #EFE6DC; border-radius:var(--ta-r-xl); box-shadow:0 8px 22px rgba(60,20,10,.06); padding:6px 14px 10px; display:grid; }
.shop-f--skel{ gap:12px; padding:18px; }
.shop-f--drawer{ border:0; box-shadow:none; padding:0; }
.shop-f__search{ padding:10px 0 12px; border-bottom:1px dashed var(--ta-line-2); }
.shop-f__searchbox{ position:relative; }
.shop-f__searchbox > .ta-ico{ position:absolute; left:12px; top:50%; transform:translateY(-50%); width:17px; height:17px; color:var(--ta-muted); pointer-events:none; }
.shop-f__searchbox .ta-input{ min-height:42px; padding-left:38px; font-size:14px; border-radius:var(--ta-r-pill); background:#FFFCF8; }
.shop-f__group{ margin:0; padding:12px 0; border:0; border-bottom:1px dashed var(--ta-line-2); min-width:0; }
.shop-f__group:last-of-type{ border-bottom:0; }
.shop-f__title{ display:flex; align-items:center; gap:8px; padding:0; margin:0 0 8px; font-size:12px; font-weight:900; letter-spacing:.1em; text-transform:uppercase; color:var(--ta-maroon-600); }
.shop-f__title .ta-ico{ width:15px; height:15px; color:var(--ta-red); }
.shop-f__cats{ list-style:none; display:grid; gap:2px; }
.shop-f__cats a{ position:relative; display:flex; align-items:center; gap:10px; padding:7px 8px; border-radius:var(--ta-r-md); font-size:13px; font-weight:700; color:var(--ta-text-2); transition:background .15s, color .15s; }
.shop-f__cats a:hover{ background:var(--ta-cream); color:var(--ta-maroon-500); }
.shop-f__cats a.is-active{ background:var(--ta-rose-50); color:var(--ta-maroon-500); box-shadow:inset 3px 0 0 var(--ta-red); }
.shop-f__icon{ width:28px; height:28px; flex:0 0 auto; border-radius:9px; display:grid; place-items:center; background:var(--ta-cream); color:var(--ta-red); border:1px solid #F1DEC0; }
.shop-f__cats a.is-active .shop-f__icon{ background:var(--ta-red); border-color:var(--ta-red); color:#fff; }
.shop-f__icon .ta-ico{ width:15px; height:15px; }
.shop-f__name{ flex:1; min-width:0; line-height:1.3; }
.shop-f__count{ flex:0 0 auto; min-width:24px; padding:1px 7px; border-radius:99px; background:#F6F0E8; font-size:11px; font-weight:800; color:var(--ta-muted); text-align:center; }
.shop-f__cats a.is-active .shop-f__count{ background:#fff; color:var(--ta-maroon-500); }
.shop-f__opts{ display:grid; gap:2px; }
.shop-f__opt{ display:flex; align-items:center; gap:10px; padding:6px 8px; border-radius:var(--ta-r-sm); font-size:13.5px; font-weight:600; color:var(--ta-text-2); cursor:pointer; }
.shop-f__opt:hover{ background:var(--ta-cream); }
.shop-f__opt input{ flex:0 0 auto; width:17px; height:17px; margin:0; accent-color:var(--ta-buy); }
.shop-f__opt span{ flex:1; min-width:0; }
.shop-f__opt small{ font-size:11.5px; font-weight:700; color:var(--ta-muted-2); }
.shop-f__opt.is-zero{ opacity:.5; }
.shop-f__opt:has(input:checked){ color:var(--ta-maroon-500); font-weight:800; }
.shop-f__range{ display:grid; grid-template-columns:minmax(0,1fr) auto minmax(0,1fr); align-items:center; gap:6px; margin-top:8px; }
.shop-f__range .ta-input{ min-height:38px; padding:7px 10px; font-size:13px; -moz-appearance:textfield; }
.shop-f__range .ta-input::-webkit-outer-spin-button,.shop-f__range .ta-input::-webkit-inner-spin-button{ -webkit-appearance:none; margin:0; }
.shop-f__range span{ color:var(--ta-muted); }
.shop-f__range .ta-btn{ grid-column:1 / -1; }
.shop-f__switch{ display:flex; align-items:center; gap:10px; font-size:13.5px; font-weight:700; color:var(--ta-text-2); cursor:pointer; padding:2px 0; }
.shop-f__switch input{ position:absolute; opacity:0; width:1px; height:1px; }
.shop-f__track{ position:relative; flex:0 0 auto; width:40px; height:23px; border-radius:99px; background:#E5DCD2; transition:background .18s; }
.shop-f__track::after{ content:""; position:absolute; top:3px; left:3px; width:17px; height:17px; border-radius:50%; background:#fff; box-shadow:0 1px 3px rgba(0,0,0,.25); transition:transform .18s var(--ta-ease); }
.shop-f__switch input:checked + .shop-f__track{ background:var(--ta-buy); }
.shop-f__switch input:checked + .shop-f__track::after{ transform:translateX(17px); }
.shop-f__switch input:focus-visible + .shop-f__track{ outline:3px solid rgba(232,38,44,.45); outline-offset:2px; }
.shop-f__reset{ display:inline-flex; align-items:center; justify-content:center; gap:6px; margin:4px 0 4px; padding:8px; border:1px dashed rgba(224,38,45,.45); border-radius:var(--ta-r-md); background:var(--ta-rose-50); color:var(--ta-buy); font-size:12.5px; font-weight:800; }
.shop-f__reset .ta-ico{ width:14px; height:14px; }

/* promo card (rail) */
.shop-promo{ position:relative; display:block; border-radius:var(--ta-r-xl); overflow:hidden; aspect-ratio:4/4.4; color:#fff; box-shadow:0 10px 24px rgba(60,20,10,.14); isolation:isolate; }
.shop-promo img{ position:absolute; inset:0; width:100%; height:100%; object-fit:cover; object-position:50% 30%; z-index:-2; transition:transform .4s var(--ta-ease); }
.shop-promo::after{ content:""; position:absolute; inset:0; z-index:-1; background:linear-gradient(180deg, rgba(67,10,13,0) 30%, rgba(67,10,13,.88) 78%); }
.shop-promo:hover img{ transform:scale(1.04); }
.shop-promo__body{ position:absolute; left:0; right:0; bottom:0; display:grid; gap:5px; padding:14px; }
.shop-promo__kicker{ font-size:10.5px; font-weight:900; letter-spacing:.14em; text-transform:uppercase; color:#FDE68A; }
.shop-promo__title{ font-family:var(--ta-font-title); font-weight:700; font-size:17px; line-height:1.25; }
.shop-promo__cta{ display:inline-flex; align-items:center; gap:6px; justify-self:start; margin-top:4px; padding:6px 12px; border-radius:var(--ta-r-sm); background:#fff; color:var(--ta-text); font-size:12px; font-weight:900; }
.shop-promo__cta .ta-ico{ width:13px; height:13px; }

/* ---------- toolbar ---------- */
.shop-bar{ display:flex; flex-wrap:wrap; align-items:center; gap:10px 12px; padding:10px 12px; background:#fff; border:1px solid #EFE6DC; border-radius:var(--ta-r-lg); box-shadow:0 4px 12px rgba(60,20,10,.04); }
.shop-bar__filter{ position:relative; min-height:40px; padding:8px 14px; }
.shop-bar__badge{ display:grid; place-items:center; min-width:20px; height:20px; padding:0 6px; border-radius:99px; background:var(--ta-buy); color:#fff; font-size:11px; font-weight:900; }
.shop-bar__count{ flex:1 1 180px; min-width:0; font-size:13.5px; color:var(--ta-muted); order:3; }
.shop-bar__count b{ color:var(--ta-text); font-weight:800; }
.shop-bar__sort{ display:flex; align-items:center; gap:8px; margin-left:auto; }
.shop-bar__sortlbl{ font-size:12.5px; font-weight:800; color:var(--ta-muted); white-space:nowrap; }
.shop-bar__sort .ta-select{ height:40px; line-height:38px; min-height:40px; width:auto; min-width:150px; font-size:13.5px; font-weight:700; }
@media (max-width:599px){
  .shop-bar{ padding:8px; gap:8px; }
  .shop-bar__filter{ flex:1 1 0; }
  .shop-bar__sort{ flex:1.3 1 0; margin:0; }
  .shop-bar__sortlbl{ display:none; }
  .shop-bar__sort .ta-select{ width:100%; min-width:0; }
  .shop-bar__count{ flex-basis:100%; padding:0 4px; font-size:12.5px; }
}
@media (min-width:600px){ .shop-bar__count{ order:0; } }
@media (min-width:1024px){ .shop-bar__filter{ display:none; } .shop-bar{ padding:10px 14px; } }

/* ---------- active chips ---------- */
.shop-chips{ display:flex; flex-wrap:wrap; align-items:center; gap:8px; margin-top:12px; }
.shop-chips__lbl{ font-size:12.5px; font-weight:800; color:var(--ta-muted); }
.shop-chip{ display:inline-flex; align-items:center; gap:6px; padding:5px 8px 5px 12px; border-radius:var(--ta-r-pill); border:1px solid var(--ta-rose-200); background:var(--ta-rose-50); color:var(--ta-maroon-500); font-size:12.5px; font-weight:800; max-width:100%; }
.shop-chip > span:first-child{ white-space:nowrap; overflow:hidden; text-overflow:ellipsis; min-width:0; }
.shop-chip .ta-ico{ width:14px; height:14px; flex:0 0 auto; padding:2px; border-radius:50%; background:#fff; }
.shop-chip:hover{ border-color:var(--ta-buy); }
.shop-chips__clear{ border:0; background:transparent; padding:5px 6px; font-size:12.5px; font-weight:800; color:var(--ta-ink-700); text-decoration:underline; text-underline-offset:3px; }

/* ---------- grid ---------- */
.p-shop .shop-grid{ margin-top:14px; }
@media (min-width:768px){ .p-shop .shop-grid{ grid-template-columns:repeat(3, minmax(0,1fr)); } }
@media (min-width:1280px){ .p-shop .shop-grid{ grid-template-columns:repeat(4, minmax(0,1fr)); gap:16px; } }
.p-shop .shop-grid > .ta-empty, .p-shop .shop-grid > .shop-error{ grid-column:1 / -1; }
.p-shop .shop-pager{ margin-top:22px; }
.p-shop .shop-pager:empty{ display:none; }
.p-shop .shop-format{ margin-top:16px; }
.shop-error{ grid-column:1 / -1; display:grid; justify-items:start; gap:12px; padding:16px; background:#fff; border-radius:var(--ta-r-xl); border:1px solid #EFE6DC; }

/* ---------- combos / recent ---------- */
.p-shop .shop-combos .ta-grid{ grid-template-columns:repeat(2, minmax(0,1fr)); }
@media (min-width:1024px){ .p-shop .shop-combos .ta-grid{ grid-template-columns:repeat(4, minmax(0,1fr)); } }
.shop-recent__clear{ border:0; background:transparent; cursor:pointer; padding:4px 0; }
.shop-recent__clear .ta-ico{ width:14px; height:14px; }
.shop-recent__grid{ grid-template-columns:repeat(2, minmax(0,1fr)); }
@media (min-width:768px){ .shop-recent__grid{ grid-template-columns:repeat(3, minmax(0,1fr)); } }
@media (min-width:1024px){ .shop-recent__grid{ grid-template-columns:repeat(5, minmax(0,1fr)); } }
@media (max-width:767px){ .shop-recent__grid > :nth-child(n+5){ display:none; } }

/* ---------- help card ---------- */
.shop-help__card{
  position:relative; overflow:hidden; isolation:isolate; display:grid; grid-template-columns:1fr; border-radius:var(--ta-r-2xl); color:#fff;
  background:var(--ta-tx-gold-lattice), var(--ta-tx-seigaiha), radial-gradient(110% 160% at 15% 0%, #9B1D22 0%, #741318 45%, #4E0B0F 100%);
  background-size:44px 44px, 36px 18px, auto; border:1px solid rgba(255,231,163,.25); box-shadow:0 18px 40px rgba(60,10,12,.22);
}
.shop-help__card::after{ content:""; position:absolute; z-index:-1; right:-30px; bottom:-30px; width:180px; height:180px; background:var(--ta-ic-blossom-gold) center/contain no-repeat; opacity:.14; }
.shop-help__media{ margin:0; position:relative; aspect-ratio:16/10; overflow:hidden; }
.shop-help__media img{ width:100%; height:100%; object-fit:cover; object-position:50% 35%; }
.shop-help__body{ display:grid; gap:10px; align-content:center; padding:20px 18px 22px; }
.shop-help__kicker{ font-size:11px; font-weight:900; letter-spacing:.16em; text-transform:uppercase; color:#FDE68A; }
.shop-help__title{ font-family:var(--ta-font-title); font-weight:700; font-size:clamp(22px, 1rem + 1vw, 30px); line-height:1.2; color:#fff; text-wrap:balance; }
.shop-help__text{ font-size:14.5px; line-height:1.65; color:rgba(255,246,225,.92); max-width:56ch; }
.shop-help__ctas{ display:flex; flex-wrap:wrap; align-items:center; gap:10px; margin-top:6px; }
.shop-help__ctas .ta-btn{ flex:1 1 200px; }
.shop-help__link{ flex-basis:100%; display:inline-flex; align-items:center; gap:6px; font-size:13.5px; font-weight:800; color:#FFE7A3; }
.shop-help__link:hover{ text-decoration:underline; text-underline-offset:3px; }
.shop-help__link .ta-ico{ width:14px; height:14px; }
@media (min-width:768px){
  .shop-help__card{ grid-template-columns:minmax(0,.9fr) minmax(0,1.1fr); }
  .shop-help__media{ aspect-ratio:auto; min-height:320px; }
  .shop-help__media img{ position:absolute; inset:0; }
  .shop-help__body{ padding:30px 34px; }
  .shop-help__ctas .ta-btn{ flex:0 0 auto; }
}

/* ---------- drawer (mobile filters) ---------- */
.shop-drawer-panel .ta-drawer__body{ padding-top:4px; }
.shop-drawer__foot{ display:grid; grid-template-columns:1fr 1.6fr; gap:8px; }

@media (prefers-reduced-motion: reduce){
  .shop-promo:hover img{ transform:none; }
  .shop-f__track,.shop-f__track::after{ transition:none; }
}
.p-shop .shop-f__count.is-zero{ min-width:0; background:transparent; font-weight:600; color:var(--ta-muted); white-space:nowrap; }
