/* ===== Flash Sale (หน้าแรก การ์ดสินค้า และหลังบ้าน) ใช้ token จาก /assets/css/ui.css ===== */
:root { --pl-flash: #ff4d6d; --pl-flash-2: #ff9f43; --pl-flash-soft: rgba(255, 77, 109, .14); --pl-flash-line: rgba(255, 77, 109, .45); }
.pl-flash-cd { font-variant-numeric: tabular-nums; font-weight: 800; letter-spacing: .02em; white-space: nowrap; }
.pl-flash-tag { display: flex; align-items: center; justify-content: space-between; gap: .4rem; flex-wrap: wrap; margin: 0 0 .45rem; }
.pl-flash-label { display: inline-flex; align-items: center; gap: .3rem; padding: .16rem .55rem; border-radius: 50px; font-size: .72rem; font-weight: 800;
    color: #fff !important; background: linear-gradient(90deg, var(--pl-flash), var(--pl-flash-2)); box-shadow: 0 4px 14px rgba(255, 77, 109, .35); }
.pl-flash-label i { color: #fff !important; animation: plFlashZap 1.6s ease-in-out infinite; }
.pl-flash-ends { font-size: .72rem; color: #ffb3c1 !important; }
.pl-flash-bar { height: 6px; border-radius: 50px; background: rgba(255, 255, 255, .08); overflow: hidden; margin: .2rem 0 .3rem; }
.pl-flash-bar span { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--pl-flash-2), var(--pl-flash)); }
.pl-flash-left { font-size: .74rem; color: var(--ui-muted, #aab) !important; margin-bottom: .45rem; }
.pl-flash-left b { color: #fff !important; }
.ui-product.pl-flash-card { border-color: var(--pl-flash-line); box-shadow: 0 0 0 1px rgba(255, 77, 109, .12), 0 14px 34px rgba(255, 77, 109, .10); }
.ui-product-price .pl-flash-off { padding: .1rem .45rem; border-radius: 50px; background: var(--pl-flash-soft); color: #ff8fa3 !important; font-size: .72rem; font-weight: 800; }
@keyframes plFlashZap { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .pl-flash-label i { animation: none; } }

/* ส่วน Flash Sale หน้าแรก */
.pl-flash-section .pl-flash-head { position: relative; overflow: hidden; display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .9rem 1.2rem;
    padding: 1rem 1.2rem; margin-bottom: 1rem; border-radius: var(--ui-radius, 20px); border: 1px solid var(--pl-flash-line);
    background: radial-gradient(circle at 0% 0%, rgba(255, 77, 109, .28), transparent 55%), radial-gradient(circle at 100% 100%, rgba(255, 159, 67, .18), transparent 50%), rgba(14, 18, 32, .9); }
.pl-flash-section h2 { display: flex; align-items: center; gap: .6rem; margin: 0; font-size: clamp(1.25rem, 2.6vw, 1.6rem); font-weight: 900; color: #fff !important; }
.pl-flash-section h2 .pl-flash-bolt { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 12px;
    background: linear-gradient(135deg, var(--pl-flash), var(--pl-flash-2)); color: #fff !important; box-shadow: 0 8px 22px rgba(255, 77, 109, .4); }
.pl-flash-section h2 .pl-flash-bolt i { color: #fff !important; }
.pl-flash-section .pl-flash-sub { margin: .25rem 0 0; font-size: .88rem; color: var(--ui-muted, #aab) !important; }
.pl-flash-timer { display: flex; align-items: center; gap: .55rem; font-size: .85rem; color: #ffd1d9 !important; }
.pl-flash-timer .pl-flash-cd { padding: .35rem .7rem; border-radius: 10px; background: rgba(0, 0, 0, .35); border: 1px solid var(--pl-flash-line); color: #fff !important; font-size: 1.05rem; }
.pl-flash-section .pl-flash-item { display: flex; flex-direction: column; width: 100%; color: inherit; text-decoration: none; text-align: left; padding: 0; font: inherit; }
.pl-flash-section .pl-flash-item .ui-product-img { position: relative; }
.pl-flash-section .pl-flash-item .ui-product-img img { max-height: 200px; object-fit: contain; }
.pl-flash-section .pl-flash-item .ui-product-foot { margin-top: auto; }
.pl-flash-ribbon { position: absolute; top: 8px; left: 8px; z-index: 2; padding: .2rem .55rem; border-radius: 9px; font-size: .78rem; font-weight: 900;
    color: #fff !important; background: linear-gradient(135deg, var(--pl-flash), var(--pl-flash-2)); box-shadow: 0 6px 16px rgba(255, 77, 109, .4); }
.pl-flash-item.is-soon .pl-flash-ribbon { background: rgba(0, 0, 0, .6); border: 1px solid rgba(251, 191, 36, .5); color: #fbbf24 !important; box-shadow: none; }
.pl-flash-item.is-soldout .ui-product-img img { filter: grayscale(1); opacity: .5; }
.pl-flash-soon-note { font-size: .76rem; color: #fbbf24 !important; margin-bottom: .45rem; }
.pl-flash-scroller { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(200px, 1fr); gap: 1rem; overflow-x: auto; padding-bottom: .4rem; scroll-snap-type: x mandatory; }
.pl-flash-scroller > * { scroll-snap-align: start; display: flex; }
@media (min-width: 992px) { .pl-flash-scroller { grid-auto-columns: calc((100% - 3rem) / 4); } }
@media (max-width: 575.98px) { .pl-flash-scroller { grid-auto-columns: 72%; } .pl-flash-section .pl-flash-item .ui-product-img img { max-height: 150px; } }

/* ===== แคมเปญ + ธีมตกแต่ง (ตั้งที่ /admin/flashsale) ===== */
.pl-flash-section { --pl-flash-bg1: rgba(255, 77, 109, .30); --pl-flash-bg2: rgba(255, 159, 67, .20); --pl-flash-title: linear-gradient(90deg, #fff 0%, #ffd1d9 40%, #ffb36b 60%, #fff 100%); }
.pl-flash-section .pl-flash-head { isolation: isolate; padding: 1.25rem 1.4rem; min-height: 110px;
    background: radial-gradient(circle at 0% 0%, var(--pl-flash-bg1), transparent 55%), radial-gradient(circle at 100% 100%, var(--pl-flash-bg2), transparent 55%), rgba(14, 18, 32, .92); }
.pl-flash-section .pl-flash-head::before { content: ''; position: absolute; inset: -1px; z-index: -1; border-radius: inherit; padding: 1px;
    background: linear-gradient(110deg, transparent 20%, var(--pl-flash) 40%, var(--pl-flash-2) 60%, transparent 80%); background-size: 250% 100%;
    -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude; animation: plFlashBorder 4s linear infinite; }
.pl-flash-head-text { position: relative; z-index: 1; min-width: 0; }
.pl-flash-kicker { display: inline-flex; align-items: center; gap: .35rem; margin-bottom: .35rem; padding: .15rem .6rem; border-radius: 50px; font-size: .7rem; font-weight: 800; letter-spacing: .08em;
    color: #fff !important; background: linear-gradient(90deg, var(--pl-flash), var(--pl-flash-2)); box-shadow: 0 4px 16px color-mix(in srgb, var(--pl-flash) 45%, transparent); }
.pl-flash-kicker i { color: #fff !important; }
.pl-flash-section h2 .pl-flash-bolt { font-size: 1.25rem; background: linear-gradient(135deg, var(--pl-flash), var(--pl-flash-2)); }
.pl-flash-title-text { background: var(--pl-flash-title); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent !important;
    animation: plFlashShine 5s linear infinite; overflow-wrap: anywhere; }
.pl-flash-section .pl-flash-timer { position: relative; z-index: 1; }
.pl-flash-section .pl-flash-timer .pl-flash-cd { border-color: color-mix(in srgb, var(--pl-flash) 55%, transparent); box-shadow: 0 0 18px color-mix(in srgb, var(--pl-flash) 30%, transparent); }
.pl-flash-deco { position: absolute; inset: 0; overflow: hidden; pointer-events: none; z-index: 0; border-radius: inherit; }
.pl-flash-deco span { position: absolute; bottom: -30px; left: calc(var(--i) * 11% + 3%); font-size: calc(15px + var(--i) * 1.6px); opacity: .0;
    animation: plFlashFloat calc(7s + var(--i) * .8s) linear infinite; animation-delay: calc(var(--i) * -1.3s); filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .4)); }
@keyframes plFlashFloat { 0% { transform: translateY(0) rotate(0); opacity: 0; } 15% { opacity: .55; } 85% { opacity: .45; } 100% { transform: translateY(-160px) rotate(25deg); opacity: 0; } }
@keyframes plFlashShine { to { background-position: -200% 0; } }
@keyframes plFlashBorder { to { background-position: -250% 0; } }
@media (prefers-reduced-motion: reduce) { .pl-flash-deco span, .pl-flash-title-text, .pl-flash-section .pl-flash-head::before { animation: none; } .pl-flash-deco span { opacity: .35; bottom: 10px; } }
.pl-flash-section .pl-flash-card { border-color: color-mix(in srgb, var(--pl-flash) 45%, transparent); }
.pl-flash-section .pl-flash-ribbon, .pl-flash-section .pl-flash-label { background: linear-gradient(90deg, var(--pl-flash), var(--pl-flash-2)); }
.pl-flash-section .pl-flash-bar span { background: linear-gradient(90deg, var(--pl-flash-2), var(--pl-flash)); }
.pl-flash-from { font-size: .7rem; font-weight: 600; color: var(--ui-muted, #aab) !important; }

/* ธีมตามโอกาส */
.pl-flash-theme-loykrathong { --pl-flash: #3b82f6; --pl-flash-2: #fbbf24; --pl-flash-bg1: rgba(59, 130, 246, .32); --pl-flash-bg2: rgba(251, 191, 36, .22); --pl-flash-title: linear-gradient(90deg, #fff, #bfdbfe 35%, #fde68a 60%, #fff); }
.pl-flash-theme-newyear { --pl-flash: #a855f7; --pl-flash-2: #facc15; --pl-flash-bg1: rgba(168, 85, 247, .32); --pl-flash-bg2: rgba(250, 204, 21, .22); --pl-flash-title: linear-gradient(90deg, #fff, #e9d5ff 35%, #fde047 60%, #fff); }
.pl-flash-theme-christmas { --pl-flash: #dc2626; --pl-flash-2: #16a34a; --pl-flash-bg1: rgba(220, 38, 38, .30); --pl-flash-bg2: rgba(22, 163, 74, .25); --pl-flash-title: linear-gradient(90deg, #fff, #fecaca 35%, #bbf7d0 60%, #fff); }
.pl-flash-theme-chinese { --pl-flash: #dc2626; --pl-flash-2: #f59e0b; --pl-flash-bg1: rgba(220, 38, 38, .38); --pl-flash-bg2: rgba(245, 158, 11, .26); --pl-flash-title: linear-gradient(90deg, #fde68a, #fff 40%, #fbbf24 60%, #fde68a); }
.pl-flash-theme-songkran { --pl-flash: #06b6d4; --pl-flash-2: #ec4899; --pl-flash-bg1: rgba(6, 182, 212, .32); --pl-flash-bg2: rgba(236, 72, 153, .20); --pl-flash-title: linear-gradient(90deg, #fff, #a5f3fc 35%, #fbcfe8 60%, #fff); }
.pl-flash-theme-valentine { --pl-flash: #ec4899; --pl-flash-2: #f43f5e; --pl-flash-bg1: rgba(236, 72, 153, .34); --pl-flash-bg2: rgba(244, 63, 94, .22); --pl-flash-title: linear-gradient(90deg, #fff, #fbcfe8 40%, #fecdd3 60%, #fff); }
.pl-flash-theme-halloween { --pl-flash: #f97316; --pl-flash-2: #8b5cf6; --pl-flash-bg1: rgba(249, 115, 22, .32); --pl-flash-bg2: rgba(139, 92, 246, .26); --pl-flash-title: linear-gradient(90deg, #fed7aa, #fff 40%, #ddd6fe 60%, #fed7aa); }
.pl-flash-theme-megasale { --pl-flash: #f43f5e; --pl-flash-2: #a855f7; --pl-flash-bg1: rgba(244, 63, 94, .32); --pl-flash-bg2: rgba(168, 85, 247, .26); --pl-flash-title: linear-gradient(90deg, #fff, #fecdd3 35%, #e9d5ff 60%, #fff); }
.pl-flash-theme-payday { --pl-flash: #10b981; --pl-flash-2: #facc15; --pl-flash-bg1: rgba(16, 185, 129, .30); --pl-flash-bg2: rgba(250, 204, 21, .22); --pl-flash-title: linear-gradient(90deg, #fff, #a7f3d0 35%, #fef08a 60%, #fff); }
.pl-flash-theme-anniversary { --pl-flash: #8b5cf6; --pl-flash-2: #22d3ee; --pl-flash-bg1: rgba(139, 92, 246, .32); --pl-flash-bg2: rgba(34, 211, 238, .22); --pl-flash-title: linear-gradient(90deg, #fff, #ddd6fe 35%, #a5f3fc 60%, #fff); }

/* แบนเนอร์บนหน้าเช่าเว็บ/โฮสต์ */
.pl-flash-rental { display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem; margin: 0 0 1rem; padding: .8rem 1rem; border-radius: 16px;
    border: 1px solid color-mix(in srgb, var(--pl-flash) 50%, transparent); color: #fff;
    background: radial-gradient(circle at 0% 0%, var(--pl-flash-bg1, rgba(255, 77, 109, .3)), transparent 60%), rgba(14, 18, 32, .92); }
.pl-flash-rental .pl-flash-label { background: linear-gradient(90deg, var(--pl-flash), var(--pl-flash-2)); }
.pl-flash-rental-text { flex: 1 1 260px; font-size: .9rem; color: #f1f5f9 !important; }
.pl-flash-rental-text b { color: #fff !important; }
.pl-flash-rental-end { font-size: .85rem; color: #ffd1d9 !important; }

/* ===== ตัวเลื่อนการ์ด Flash Sale: ปุ่มลูกศร ลากด้วยเมาส์ และจุดบอกตำแหน่ง ===== */
.pl-flash-carousel { position: relative; }
.pl-flash-section .pl-flash-scroller { scrollbar-width: none; scroll-behavior: smooth; padding: 4px 2px 6px; cursor: grab; outline: none; }
.pl-flash-section .pl-flash-scroller::-webkit-scrollbar { display: none; }
.pl-flash-section .pl-flash-scroller.is-dragging { cursor: grabbing; scroll-behavior: auto; scroll-snap-type: none; user-select: none; }
.pl-flash-section .pl-flash-scroller.is-dragging a, .pl-flash-section .pl-flash-scroller.is-dragging img { pointer-events: none; }
.pl-flash-section .pl-flash-scroller img { -webkit-user-drag: none; user-select: none; }
.pl-flash-nav { position: absolute; top: 42%; z-index: 5; width: 46px; height: 46px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
    border: 1px solid color-mix(in srgb, var(--pl-flash) 55%, transparent); color: #fff; font-size: 1rem; cursor: pointer;
    background: linear-gradient(135deg, var(--pl-flash), var(--pl-flash-2)); box-shadow: 0 8px 24px rgba(0, 0, 0, .5), 0 0 18px color-mix(in srgb, var(--pl-flash) 40%, transparent);
    transition: transform .15s, opacity .2s; }
.pl-flash-nav i { color: #fff !important; }
.pl-flash-nav:hover { transform: scale(1.08); }
.pl-flash-nav:active { transform: scale(.95); }
.pl-flash-nav.prev { left: -14px; }
.pl-flash-nav.next { right: -14px; }
.pl-flash-nav[hidden] { display: none; }
.pl-flash-dots { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin-top: .8rem; }
.pl-flash-dots button { width: 10px; height: 10px; padding: 0; border: 0; border-radius: 50px; background: rgba(255, 255, 255, .22); cursor: pointer; transition: width .25s, background .25s; }
.pl-flash-dots button.is-active { width: 28px; background: linear-gradient(90deg, var(--pl-flash), var(--pl-flash-2)); }
@media (max-width: 575.98px) { .pl-flash-nav { width: 38px; height: 38px; } .pl-flash-nav.prev { left: -6px; } .pl-flash-nav.next { right: -6px; } }
.pl-flash-pct { color: #ff8fa3 !important; } .pl-flash-pct small { margin-left: 6px; }

/* แถบ Flash Sale ใต้ราคาในการ์ดสินค้า (เช่น /discord-shop) */
.pl-flash-strip { position: relative; overflow: hidden; display: flex; align-items: center; justify-content: space-between; gap: 6px; flex-wrap: wrap; margin: 2px 0 8px; padding: 5px 6px 5px 5px; border-radius: 999px; background: linear-gradient(90deg, rgba(255, 59, 92, .18), rgba(255, 138, 0, .14)); border: 1px solid rgba(255, 99, 132, .45); box-shadow: 0 0 14px rgba(255, 59, 92, .18); }
.pl-flash-strip::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, transparent 30%, rgba(255, 255, 255, .22) 50%, transparent 70%); transform: translateX(-100%); animation: pl-flash-strip-shine 3.2s ease-in-out infinite; pointer-events: none; }
.pl-flash-strip-tag { display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; background: linear-gradient(90deg, #ff3b5c, #ff8a00); color: #fff !important; font-size: .68rem; font-weight: 800; letter-spacing: .03em; white-space: nowrap; box-shadow: 0 2px 8px rgba(255, 59, 92, .4); }
.pl-flash-strip-tag i { animation: pl-flash-strip-bolt 1.4s ease-in-out infinite; }
.pl-flash-strip-save { font-size: .72rem; color: #ffd2dc !important; white-space: nowrap; padding-right: 4px; }
.pl-flash-strip-save b { color: #fff !important; }
@keyframes pl-flash-strip-shine { 0%, 55% { transform: translateX(-100%); } 100% { transform: translateX(100%); } }
@keyframes pl-flash-strip-bolt { 0%, 100% { opacity: 1; } 50% { opacity: .45; } }
@media (prefers-reduced-motion: reduce) { .pl-flash-strip::after, .pl-flash-strip-tag i { animation: none; } }
.pl-flash-strip[hidden] { display: none !important; }
#cc-preview-flash { margin: -6px 0 12px; border-radius: 14px; }

/* รูปการ์ดบริการทั้งหมวด: ไอคอนฟองจากภาพ "บริการของเรา" หน้าแรก (3x3) */
.pl-flash-svc { position: relative; isolation: isolate; overflow: hidden; display: grid; place-items: center; width: 100%; aspect-ratio: 1672 / 941; border-radius: 12px; background: linear-gradient(155deg, #263e91, #743f9a); }
.pl-flash-svc::before { content: ""; position: absolute; z-index: -2; left: 0; right: 0; top: 50%; aspect-ratio: 1672 / 941; transform: translateY(-50%); background: url('/assets/storefront-covers/home-services-v2.png') var(--sx) var(--sy) / 300% 300% no-repeat; transition: transform .35s ease; }
.pl-flash-svc::after { content: ""; position: absolute; z-index: -1; inset: 0; pointer-events: none; background: linear-gradient(90deg, transparent 19%, #18133c88 39%, #18133c88 61%, transparent 81%); }
.pl-flash-svc strong { max-width: 48%; text-align: center; color: #fff !important; font-weight: 700; font-size: clamp(.72rem, 1.05vw, .9rem); line-height: 1.3; text-shadow: 0 2px 4px #190d41, 0 0 9px #20114c; }
.pl-flash-card:hover .pl-flash-svc::before { transform: translateY(-50%) scale(1.04); }
.pl-flash-item.is-soldout .pl-flash-svc { filter: grayscale(1); opacity: .5; }
