/* ========================================
   Formosa SS Dalas – Premium Animations
   ======================================== */

/* --- Scroll Progress Bar --- */
#scroll-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 3px;
    background: linear-gradient(90deg, var(--primary_color, #0d6f3f) 0%, #2ecc71 100%);
    z-index: 99999;
    transition: width 0.08s linear;
    pointer-events: none;
}

/* --- Page Entrance --- */
@keyframes fsd-pageEnter {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}
body {
    animation: fsd-pageEnter 0.4s ease-out both;
}

/* --- Logo Entrance Animation --- */
@keyframes fsd-logoEntrance {
    0%   { opacity: 0; transform: scale(0.65) translateY(-18px); }
    55%  { transform: scale(1.1) translateY(3px); }
    75%  { transform: scale(0.96) translateY(0); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}
.logo img:not(.lazy),
.mobile_logo:not(.lazy) {
    animation: fsd-logoEntrance 0.7s cubic-bezier(0.34, 1.56, 0.64, 1) both;
}
.logo a {
    display: inline-block;
}
.logo a:hover img {
    transform: scale(1.06) rotate(1.5deg);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* --- Product Card Scroll-in Animation --- */
@keyframes fsd-cardUp {
    from { opacity: 0; transform: translateY(35px); }
    to   { opacity: 1; transform: translateY(0); }
}
.fsd-anim {
    opacity: 0;
    animation: fsd-cardUp 0.55s ease forwards;
}

/* Product card hover lift */
.c_hpp_single_pro,
.sp_box,
.c_hpps_thumb {
    transition: transform 0.28s ease, box-shadow 0.28s ease;
}
.c_hpp_single_pro:hover {
    transform: translateY(-7px);
    box-shadow: 0 14px 30px rgba(0, 0, 0, 0.10);
}

/* --- Brand/Category Box Hover --- */
.sbbl_box {
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}
.sbbl_box:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.09);
}

/* --- Hero Slider Entrance --- */
@keyframes fsd-heroIn {
    from { opacity: 0; transform: scale(1.04); }
    to   { opacity: 1; transform: scale(1); }
}
.slider_section {
    animation: fsd-heroIn 0.7s ease both;
}
.carousel-caption {
    animation: fsd-pageEnter 0.7s ease 0.35s both;
}

/* --- Section Title Underline Grow --- */
@keyframes fsd-lineGrow {
    from { width: 0; opacity: 0; }
    to   { width: 48px; opacity: 1; }
}
.c_hp_main_cat,
.section_name h2,
.c_hpp_cat_title a {
    position: relative;
}
.c_hpp_cat_title a::after,
.section_name h2::after {
    content: '';
    position: absolute;
    bottom: -4px;
    left: 0;
    height: 2px;
    width: 0;
    background: var(--primary_color, #0d6f3f);
    border-radius: 2px;
}
.fsd-title-visible .c_hpp_cat_title a::after,
.fsd-title-visible .section_name h2::after {
    animation: fsd-lineGrow 0.5s ease forwards;
}

/* --- Product Detail Page Entrance --- */
@keyframes fsd-slideLeft {
    from { opacity: 0; transform: translateX(-28px); }
    to   { opacity: 1; transform: translateX(0); }
}
@keyframes fsd-slideRight {
    from { opacity: 0; transform: translateX(28px); }
    to   { opacity: 1; transform: translateX(0); }
}
.single_product_page .col-lg-6:first-child {
    animation: fsd-slideLeft 0.55s ease 0.1s both;
}
.single_product_page .col-lg-6:last-child {
    animation: fsd-slideRight 0.55s ease 0.2s both;
}
/* Thumbnail hover */
.zoom-gallery .selectors a {
    transition: opacity 0.2s, border-color 0.2s, transform 0.2s;
    display: inline-block;
}
.zoom-gallery .selectors a:hover {
    opacity: 0.8;
    transform: scale(1.08);
    border-color: var(--primary_color, #0d6f3f);
}

/* --- Category Page Entrance --- */
@keyframes fsd-catReveal {
    from { opacity: 0; transform: scale(1.06); }
    to   { opacity: 1; transform: scale(1); }
}
.cat_page_header {
    animation: fsd-catReveal 0.65s ease;
}
@keyframes fsd-slideUp {
    from { opacity: 0; transform: translateY(22px); }
    to   { opacity: 1; transform: translateY(0); }
}
.category_name {
    animation: fsd-slideUp 0.5s ease 0.25s both;
}
.category_title {
    animation: fsd-slideUp 0.5s ease 0.4s both;
}

/* --- WhatsApp Floating Button Pulse --- */
@keyframes fsd-waPulse {
    0%   { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0.55); }
    70%  { box-shadow: 0 0 0 14px rgba(37, 211, 102, 0); }
    100% { box-shadow: 0 0 0 0 rgba(37, 211, 102, 0); }
}
a[href*="wa.me"],
a[href*="whatsapp.com/send"],
.whatsapp_float,
.whatsapp_btn {
    animation: fsd-waPulse 2.2s ease infinite;
    border-radius: 50%;
}

/* --- Add to Cart / Buy Button Hover --- */
.add_to_cart_btn,
.buy_now_btn,
.btn.btn-warning,
.btn.btn-danger {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    overflow: hidden;
}
.add_to_cart_btn:hover,
.buy_now_btn:hover,
.btn.btn-warning:hover,
.btn.btn-danger:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
}
/* Ripple on click */
.add_to_cart_btn::after,
.buy_now_btn::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.3);
    border-radius: inherit;
    transform: scale(0);
    opacity: 1;
    transition: transform 0.4s, opacity 0.4s;
}
.add_to_cart_btn:active::after,
.buy_now_btn:active::after {
    transform: scale(2);
    opacity: 0;
}

/* --- Mobile: Reduce motion, keep snappy --- */
@media (max-width: 767px) {
    .single_product_page .col-lg-6:first-child,
    .single_product_page .col-lg-6:last-child {
        animation: fsd-pageEnter 0.4s ease both;
    }
    .c_hpp_single_pro:hover {
        transform: none;
        box-shadow: none;
    }
    .logo a:hover img {
        transform: none;
    }
}

/* --- Respect prefers-reduced-motion --- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
    #scroll-progress { display: none; }
}
/* =============================================
   Formosa SS Dalas – Animations v2
   Appended to animations.css
   ============================================= */

/* --- Back to Top Button --- */
#fsd-back-top {
    position: fixed;
    bottom: 80px;
    right: 18px;
    width: 42px;
    height: 42px;
    background: var(--primary_color, #0d6f3f);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    z-index: 9000;
    box-shadow: 0 4px 14px rgba(0,0,0,0.18);
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease, background 0.2s;
    pointer-events: none;
}
#fsd-back-top.fsd-btt-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}
#fsd-back-top:hover {
    background: #0a5a33;
    transform: translateY(-3px);
}

/* --- Category Page: Product Image Hover Zoom --- */
.c_hpp_single_pro .c_hpps_thumb {
    overflow: hidden;
    border-radius: 4px;
}
.c_hpp_single_pro .c_hpps_thumb img {
    transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    display: block;
    width: 100%;
}
.c_hpp_single_pro:hover .c_hpps_thumb img {
    transform: scale(1.1);
}

/* --- Sticky Mobile Buy Now Bar --- */
.fsd-sticky-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    gap: 0;
    z-index: 8999;
    transform: translateY(100%);
    transition: transform 0.35s cubic-bezier(0.34, 1.2, 0.64, 1);
    box-shadow: 0 -4px 16px rgba(0,0,0,0.14);
}
.fsd-sticky-bar.fsd-sticky-visible {
    transform: translateY(0);
}
.fsd-sticky-wa {
    flex: 0 0 auto;
    background: #25D366;
    color: #fff !important;
    text-decoration: none !important;
    padding: 12px 14px;
    font-size: 13px;
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
}
.fsd-sticky-wa i { font-size: 18px; }
.fsd-sticky-atc {
    flex: 1;
    background: var(--secondary_color, #616361);
    color: #fff;
    border: none;
    padding: 12px 10px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}
.fsd-sticky-atc:hover { background: #444; }
.fsd-sticky-buy {
    flex: 1;
    background: var(--primary_color, #0d6f3f);
    color: #fff;
    border: none;
    padding: 12px 10px;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
}
.fsd-sticky-buy:hover { background: #0a5a33; }

/* --- Product Page: More Thumbnail Hover Effects --- */
.zoom-gallery .selectors {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 10px;
}
.zoom-gallery .selectors a {
    border: 2px solid transparent;
    border-radius: 4px;
    overflow: hidden;
    transition: border-color 0.2s, transform 0.2s;
    display: block;
}
.zoom-gallery .selectors a.active,
.zoom-gallery .selectors a:hover {
    border-color: var(--primary_color, #0d6f3f);
    transform: scale(1.08);
}

/* --- Section reveal: fade-in on scroll via IntersectionObserver class --- */
.fsd-section-reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 0.55s ease, transform 0.55s ease;
}
.fsd-section-reveal.fsd-revealed {
    opacity: 1;
    transform: translateY(0);
}

/* --- Product card name hover color --- */
.c_hpp_single_pro .c_hpp_name,
.c_hpp_single_pro h3,
.c_hpp_single_pro h4 {
    transition: color 0.2s ease;
}
.c_hpp_single_pro:hover .c_hpp_name,
.c_hpp_single_pro:hover h3,
.c_hpp_single_pro:hover h4 {
    color: var(--primary_color, #0d6f3f);
}

/* --- Footer links hover --- */
footer a {
    transition: color 0.2s ease, padding-left 0.2s ease;
    display: inline-block;
}
footer a:hover {
    color: var(--primary_color, #0d6f3f) !important;
    padding-left: 4px;
}

/* --- Mobile sticky bar: don't show on desktop --- */
@media (min-width: 768px) {
    .fsd-sticky-bar { display: none !important; }
    #fsd-back-top { bottom: 24px; right: 24px; }
}
