/* =========================================================
   FLAWLESS BANNER – FULL VERSION (ไรเดอร์อัปเดตล่าสุด)
   ========================================================= */

/* SECTION WRAPPER */
.flawless-banner-section {
  position: relative;
  border-radius: 26px;
  overflow: visible; /* ✅ เพื่อให้รูปทะลุกรอบได้ */
  border: 1px solid rgba(255, 128, 0, 0.25);
  margin: 60px auto;
  padding: 80px 60px;
  max-width: 1320px;
  width: 100%;
  transition: all 0.4s ease;
}

/* glow เบาๆ รอบกรอบ */
.flawless-banner-section::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(circle at top right, rgba(224,191,168,0.25), transparent 70%);
  z-index: 0;
}

.flawless-banner-section:hover {
  box-shadow: 0 0 45px rgba(224, 191, 168, 0.35);
}

/* CONTAINER */
.flawless-banner-section .container {
  position: relative;
  z-index: 2;
  max-width: 1600px;
  margin: 0 auto;
  padding: 0 25px;
}

/* TITLE */
.text-gradient-flawless {
  background: linear-gradient(90deg, #f2c9a4, #c18e69);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  font-weight: 700;
  font-size: 2.4rem;
  margin-bottom: 20px;
}

/* DESC */
.flawless-desc {
  color: #c8c8c8;
  font-size: 1.1rem;
  margin-bottom: 35px;
  max-width: 550px;
  line-height: 1.7;
}

/* BUTTONS */
.btn-flawless-primary {
  background: linear-gradient(135deg, #f2c9a4 0%, #c18e69 100%);
  color: #1a1a1a;
  font-weight: 600;
  border: none;
  border-radius: 50px;
  padding: 12px 30px;
  transition: all 0.3s ease;
  box-shadow: 0 0 14px rgba(193, 142, 105, 0.4);
  cursor: pointer;
  display: inline-block;
  text-decoration: none;
}
.btn-flawless-primary:hover {
  transform: translateY(-3px);
  box-shadow: 0 0 28px rgba(224, 191, 168, 0.75);
  background: linear-gradient(135deg, #f8d8b5, #d7a579);
}

.btn-flawless-outline {
  border: 2px solid #e0bfa8;
  color: #e0bfa8;
  font-weight: 600;
  border-radius: 50px;
  background: transparent;
  padding: 12px 30px;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-block;
}
.btn-flawless-outline:hover {
  background: rgba(224, 191, 168, 0.15);
  box-shadow: 0 0 25px rgba(224, 191, 168, 0.4);
  transform: translateY(-3px);
}

/* ================== HERO IMAGES — Timeline ใหม่ ================== */
/* กลุ่มรูป: ชิดขอบล่าง และเลื่อนลงจากกรอบนิดหน่อย */
.flw-hero-stack.flw-bottom{
  --w: 480px;
  --h: 367px;
  --offset: -169px;                 /* ปรับสูง/ต่ำ (ลบ = ลง) */
  position: absolute;
  left: 58%;
  bottom: var(--offset);
  transform: translateX(-50%);
  width: var(--w);
  height: var(--h);
  pointer-events: none;
  overflow: visible;
  z-index: 5;
}

/* ทำขอบล่างรูปให้ละลาย ลดความแข็งของเส้นตัด */
.flw-hero-img{
  position:absolute; bottom:0;
  height:112%; width:auto; object-fit:contain; display:block;
  filter:none; /* ไม่มีเงา */
  transform-origin:bottom center;
  -webkit-mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 78%, rgba(0,0,0,0) 100%);
          mask-image: linear-gradient(to bottom, rgba(0,0,0,1) 78%, rgba(0,0,0,0) 100%);
}

/* ===== ตำแหน่งปลาย (หลังอนิเมชันจบ) ===== */
.flw-hero-img.i1{ left:52%; transform:translateX(-50%) scale(1.00); z-index:3; }
.flw-hero-img.i2{ left:24%; transform:translateX(-50%) scale(.94);  z-index:2; }
.flw-hero-img.i3{ left:76%; transform:translateX(-50%) scale(.92);  z-index:1; }

/* ===== ลำดับอนิเมชัน =====
   1) กลาง pop-in ก่อน
   2) ซ้าย + ขวา fade-in พร้อมพุ่ง "ออกจากกลาง" ไปยังตำแหน่งปลาย
*/
.flw-hero-img.i1{
  opacity:0;
  animation: center-pop .8s cubic-bezier(.35,.9,.25,1) .00s forwards;
}
.flw-hero-img.i2{
  /* เริ่มจากอยู่กลางก่อน แล้วพุ่งออกซ้าย */
  left:52%;
  opacity:0;
  animation: side-left-out 1.1s cubic-bezier(.25,.8,.25,1) .35s forwards;
}
.flw-hero-img.i3{
  /* เริ่มจากอยู่กลางก่อน แล้วพุ่งออกขวา */
  left:52%;
  opacity:0;
  animation: side-right-out 1.1s cubic-bezier(.25,.8,.25,1) .42s forwards;
}

/* ===== Keyframes ===== */
/* รูปกลาง: โผล่ขึ้น (pop) เบา ๆ แล้วนิ่ง */
@keyframes center-pop{
  0%   { opacity:0; transform:translateX(-50%) translateY(24px) scale(.90); }
  70%  { opacity:1; transform:translateX(-50%) translateY(-6px) scale(1.02); }
  100% { opacity:1; transform:translateX(-50%) translateY(0)    scale(1.00); }
}

/* ซ้าย: fade-in + พุ่งออกจากกลางไปซ้าย แล้วจางลงเล็กน้อย */
@keyframes side-left-out{
  0%   { opacity:0; transform:translateX(-50%) translateY(16px) scale(.90); }
  35%  { opacity:1; transform:translateX(calc(-50% - 6px))  translateY(0) scale(.98); }
  100% { opacity:.82; transform:translateX(calc(-50% - 70%)) translateY(0) scale(.94); }
}

/* ขวา: fade-in + พุ่งออกจากกลางไปขวา แล้วจางลงเล็กน้อย */
@keyframes side-right-out{
  0%   { opacity:0; transform:translateX(-50%) translateY(16px) scale(.90); }
  35%  { opacity:1; transform:translateX(calc(-50% + 6px))  translateY(0) scale(.98); }
  100% { opacity:.82; transform:translateX(calc(-50% + 70%)) translateY(0) scale(.94); }
}

/* ===== Mobile: ลดระยะพุ่งเพื่อไม่หลุดจอ ===== */
@media (max-width: 991.98px){
  .flw-hero-stack.flw-bottom{
    position:relative; left:50%; bottom:0; transform:translateX(-50%);
    --w: min(92vw, 380px);
    --h: calc(var(--w) * 1.25);
    width:var(--w); height:var(--h); margin-top:18px;
  }
  .flw-hero-img{ height:108%; }

  .flw-hero-img.i1{ animation-delay: .00s; }
  .flw-hero-img.i2{ animation: side-left-mobile 1s ease-out .35s forwards; }
  .flw-hero-img.i3{ animation: side-right-mobile 1s ease-out .42s forwards; }

  @keyframes side-left-mobile{
    0%   { opacity:0; transform:translateX(-50%) translateY(12px) scale(.90); }
    40%  { opacity:1; transform:translateX(-60%) translateY(0)    scale(.96); }
    100% { opacity:.82; transform:translateX(-92%) translateY(0)   scale(.92); }
  }
  @keyframes side-right-mobile{
    0%   { opacity:0; transform:translateX(-50%) translateY(12px) scale(.90); }
    40%  { opacity:1; transform:translateX(-40%) translateY(0)    scale(.96); }
    100% { opacity:.82; transform:translateX(-8%) translateY(0)   scale(.92); }
  }
}

/* ลดแอนิเมชันถ้าผู้ใช้ไม่ชอบ motion */
@media (prefers-reduced-motion: reduce){
  .flw-hero-img{ animation: none !important; opacity:1 !important; transform: none !important; }
}


/* =============================
   Flawless — Text & Buttons (scoped, no HTML change)
   ============================= */

/* หัวข้อ (mobile-first) */
.flawless-banner-section .text-gradient-flawless{
  font-size: clamp(28px, 7.2vw, 48px);
  line-height: 1.15;
  letter-spacing: .2px;
  word-break: keep-all;
  hyphens: auto;
}

/* คำอธิบาย (mobile-first) */
.flawless-banner-section .flawless-desc{
  font-size: clamp(14px, 4vw, 18px);
  line-height: 1.75;
  color:#6f6f6f;                /* อ่านง่ายขึ้นบนมือถือ */
  max-width: 560px;
  margin-inline: auto;          /* จอเล็กจัดกลางให้อ่านสบาย */
}

/* ปุ่ม: touch target ใหญ่ขึ้น */
.flawless-banner-section .btn-flawless-primary,
.flawless-banner-section .btn-flawless-outline{
  font-size: clamp(15px, 3.8vw, 16px);
  padding: clamp(12px, 3.6vw, 14px) clamp(22px, 6.2vw, 30px);
}

/* ปุ่มบนจอเล็กเต็มแถว / ตัด <br> ในหัวข้อให้ยืดหยุ่น */
@media (max-width: 576px){
  .flawless-banner-section .btn-flawless-primary,
  .flawless-banner-section .btn-flawless-outline{ width: 100%; }
  .flawless-banner-section .text-gradient-flawless br{ display:none; }
}

/* =============================
   AOS-lite (fade/slide-in) – ไม่ต้องแก้ HTML
   JS จะเติม .anim-watch ให้ element เป้าหมายอัตโนมัติ
   ============================= */

.flawless-banner-section .anim-watch{
  opacity: 0;
  transform: translate3d(0,14px,0);
  transition: transform .7s cubic-bezier(.2,.7,.1,1), opacity .7s ease;
  will-change: transform, opacity;
}

/* ทิศทางเริ่มต้น (ถ้า JS ตั้ง data-dir ให้) */
.flawless-banner-section .anim-watch[data-dir="slide-up"]    { transform: translate3d(0,22px,0); }
.flawless-banner-section .anim-watch[data-dir="fade-up"]     { transform: translate3d(0,14px,0); }
.flawless-banner-section .anim-watch[data-dir="slide-right"] { transform: translate3d(-22px,0,0); }
.flawless-banner-section .anim-watch[data-dir="slide-left"]  { transform: translate3d(22px,0,0); }

.flawless-banner-section .anim-watch.is-in{
  opacity: 1;
  transform: none;
}

/* ผู้ใช้ที่ลด motion */
@media (prefers-reduced-motion: reduce){
  .flawless-banner-section .anim-watch{
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* =============================
   ปุ่ม Glow / Shine (วิ้งผ่านปุ่ม)
   (ไม่ต้องเพิ่มคลาสใหม่ ใช้กับ .btn-flawless-primary)
   ============================= */

.flawless-banner-section .btn-flawless-primary{
  position: relative;
  overflow: hidden;               /* ซ่อนแสงไว้ในปุ่ม */
  isolation: isolate;
  box-shadow: 0 8px 20px rgba(193,142,105,.18);
}

/* แสงกวาด */
.flawless-banner-section .btn-flawless-primary::before{
  content:"";
  position:absolute;
  inset:0;
  background: linear-gradient(120deg,
              transparent 0%,
              rgba(255,255,255,.55) 35%,
              rgba(255,255,255,.18) 55%,
              transparent 75%);
  transform: translateX(-120%);
  animation: flwbtn-shine 2.6s ease-in-out infinite;
  mix-blend-mode: screen;
  pointer-events:none;
}

@keyframes flwbtn-shine{
  0%   { transform: translateX(-120%); }
  45%  { transform: translateX(120%);  }
  100% { transform: translateX(120%);  }
}

/* Hover ยกนิด ๆ (desktop เท่านั้น) */
@media (hover:hover){
  .flawless-banner-section .btn-flawless-primary:hover{
    box-shadow: 0 12px 26px rgba(224,191,168,.35);
    transform: translateY(-2px);
  }
}




