/* SEO DISCOUNT / ANGEBOT - scoped */
.seo-sale-floating-btn{
    position: fixed;
    right: 24px;
    top: 96px;
    z-index: 1500;
    width: min(260px, calc(100vw - 34px));
    display: flex;
    flex-direction: column;
    gap: 3px;
    padding: 14px 18px 14px 58px;
    border-radius: 22px;
    text-decoration: none !important;
    color: #fff !important;
    background:
        radial-gradient(circle at top left, rgba(255, 235, 91, .38), transparent 34%),
        linear-gradient(135deg, rgba(28, 13, 1, .94), rgba(172, 9, 24, .94));
    border: 1px solid rgba(255, 216, 75, .42);
    box-shadow: 0 18px 46px rgba(0,0,0,.38), 0 0 22px rgba(255, 31, 66, .24);
    overflow: hidden;
    isolation: isolate;
    transform: translateZ(0);
    transition: transform .25s ease, box-shadow .25s ease, filter .25s ease;
}

.seo-sale-floating-btn::before{
    content: "★";
    position: absolute;
    left: 16px;
    top: 50%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: #5a1800;
    font-weight: 900;
    background: linear-gradient(135deg, #fff68d, #e5a70d);
    box-shadow: inset 0 1px 0 rgba(255,255,255,.75), 0 8px 20px rgba(0,0,0,.28);
}

.seo-sale-floating-btn::after{
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(110deg, transparent 0%, rgba(255,255,255,.26) 44%, transparent 62%);
    transform: translateX(-120%);
    animation: seoSaleShine 4s infinite;
    z-index: -1;
}

.seo-sale-floating-btn:hover{
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 24px 56px rgba(0,0,0,.45), 0 0 32px rgba(255, 216, 75, .32);
    filter: brightness(1.06);
}

.seo-sale-pill{
    width: fit-content;
    padding: 3px 10px;
    border-radius: 999px;
    background: linear-gradient(135deg, #ffea63, #cc8506);
    color: #310f00;
    font-size: 12px;
    font-weight: 950;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.seo-sale-floating-btn strong{
    font-size: 15px;
    line-height: 1.2;
    font-weight: 900;
    text-shadow: 0 2px 12px rgba(0,0,0,.35);
}

.seo-sale-floating-btn small{
    color: rgba(255,255,255,.82);
    font-size: 12px;
    font-weight: 700;
}

@keyframes seoSaleShine{
    0%, 55%{transform: translateX(-130%)}
    72%, 100%{transform: translateX(130%)}
}

.seo-page-shell{
    min-height: 100vh;
    background:
        radial-gradient(circle at top right, rgba(227, 15, 48, .22), transparent 32%),
        radial-gradient(circle at bottom left, rgba(255, 213, 73, .15), transparent 30%),
        linear-gradient(135deg, #262626, #343434 45%, #1f1f1f);
    padding: 24px 0 40px;
}

.seo-page-container{
    display: flex;
    gap: 18px;
    align-items: flex-start;
}

.seo-content{
    width: 100%;
}

.seo-hero{
    position: relative;
    overflow: hidden;
    padding: 28px;
    margin-bottom: 24px;
    border-radius: 30px;
    color: #fff;
    background:
        radial-gradient(circle at top left, rgba(255, 230, 96, .24), transparent 32%),
        linear-gradient(135deg, rgba(9,9,9,.94), rgba(132, 11, 24, .92));
    border: 1px solid rgba(255, 218, 76, .22);
    box-shadow: 0 24px 56px rgba(0,0,0,.32);
}

.seo-hero h1{
    margin: 0 0 10px;
    font-size: clamp(32px, 5vw, 64px);
    line-height: .95;
    font-weight: 950;
    letter-spacing: .02em;
    color: #fff;
    text-shadow: 0 6px 26px rgba(0,0,0,.46);
}

.seo-hero p{
    margin: 0;
    max-width: 840px;
    color: rgba(255,255,255,.84);
    font-size: 16px;
    line-height: 1.75;
}

.seo-countdown-card{
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 18px;
    padding: 16px 18px;
    border-radius: 20px;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.12);
    backdrop-filter: blur(6px);
}

.seo-countdown-card span{
    color: #ffe36a;
    font-weight: 950;
    text-transform: uppercase;
    letter-spacing: .05em;
}

.seo-countdown{
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    font-weight: 950;
    font-size: clamp(18px, 2vw, 28px);
}

.seo-products-grid{
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px;
}

.seo-products-grid .product_costum{
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
}

.seo-discount-badge{
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 3;
    padding: 7px 10px;
    border-radius: 999px;
    color: #2a0d00;
    font-size: 12px;
    font-weight: 950;
    background: linear-gradient(135deg, #fff16a, #d3940c);
    box-shadow: 0 8px 18px rgba(0,0,0,.32);
}

.seo-regular-price{
    display: block;
    margin-top: 2px;
    color: rgba(255,255,255,.68);
    font-size: 12px;
    text-align: center;
    text-decoration: line-through;
}

.seo-empty{
    padding: 30px;
    border-radius: 28px;
    color: #fff;
    text-align: center;
    background: rgba(0,0,0,.34);
    border: 1px solid rgba(255,255,255,.1);
}

@media(max-width: 1199px){
    .seo-products-grid{grid-template-columns: repeat(3, minmax(0, 1fr));}
}

@media(max-width: 767px){
    .seo-sale-floating-btn{
        top: auto;
        right: 12px;
        bottom: 84px;
        width: min(230px, calc(100vw - 24px));
        padding: 12px 14px 12px 52px;
    }
    .seo-page-container{display:block;}
    .seo-hero{padding:22px 18px;border-radius:22px;}
    .seo-countdown-card{align-items:flex-start;flex-direction:column;}
    .seo-products-grid{grid-template-columns: repeat(2, minmax(0, 1fr)); gap:12px;}
    .seo-products-grid .title_product{font-size:12px;}
    .seo-products-grid .price_new{font-size:14px;}
}

.list_product{position:relative;}
.seo-products-grid .product_costum{list-style:none;}

/* =====================================================
   PATCH: SEO badge đỏ bên trái + hiệu ứng dư chấn
   ===================================================== */
.product_costum,
.list_product {
    position: relative !important;
    overflow: visible !important;
}

.seo-discount-badge {
    position: absolute !important;
    top: 10px !important;
    left: 10px !important;
    right: auto !important;
    z-index: 20 !important;
    min-width: 62px !important;
    min-height: 28px !important;
    padding: 7px 12px !important;
    border-radius: 999px !important;
    color: #ffffff !important;
    font-size: 11px !important;
    font-weight: 950 !important;
    letter-spacing: .03em !important;
    text-transform: uppercase !important;
    background: linear-gradient(135deg, #ff2444 0%, #d80022 52%, #87000d 100%) !important;
    border: 1px solid rgba(255,255,255,.82) !important;
    box-shadow: 0 0 0 0 rgba(255, 36, 68, .55), 0 10px 22px rgba(0,0,0,.38), 0 0 24px rgba(255,36,68,.38) !important;
    animation: seoShockBadge 1.45s ease-in-out infinite !important;
    pointer-events: none !important;
}

.seo-discount-badge::before,
.seo-discount-badge::after {
    content: "";
    position: absolute;
    inset: -5px;
    border-radius: inherit;
    border: 1px solid rgba(255, 36, 68, .42);
    opacity: 0;
    animation: seoShockWave 1.45s ease-out infinite;
}

.seo-discount-badge::after {
    animation-delay: .28s;
}

@keyframes seoShockBadge {
    0%, 100% { transform: translateX(0) scale(1); filter: brightness(1); }
    10% { transform: translateX(-2px) scale(1.06); filter: brightness(1.25); }
    18% { transform: translateX(2px) scale(1.03); }
    26% { transform: translateX(-1px) scale(1.05); }
    42% { transform: translateX(0) scale(1); }
}

@keyframes seoShockWave {
    0% { transform: scale(.92); opacity: .65; }
    75% { transform: scale(1.42); opacity: 0; }
    100% { transform: scale(1.42); opacity: 0; }
}

@media (max-width: 767px) {
    .seo-discount-badge {
        top: 6px !important;
        left: 6px !important;
        min-width: 50px !important;
        min-height: 22px !important;
        padding: 5px 8px !important;
        font-size: 9px !important;
    }
}

/* =====================================================
   PATCH: hiệu ứng card theo cấu hình dashboard
   ===================================================== */
.home_product_carousel.product-display-effect-soft_fade .home_card_enter {
    animation: productSoftFadeIn .68s ease both !important;
}
.home_product_carousel.product-display-effect-soft_fade .home_card_exit {
    animation: productSoftFadeOut .42s ease both !important;
}
.home_product_carousel.product-display-effect-bounce .home_card_enter {
    animation: productBounceIn .72s cubic-bezier(.2,.88,.2,1.22) both !important;
}
.home_product_carousel.product-display-effect-bounce .home_card_exit {
    animation: productBounceOut .42s ease both !important;
}
.home_product_carousel.product-display-effect-zoom_glow .home_card_enter {
    animation: productZoomGlowIn .72s ease both !important;
}
.home_product_carousel.product-display-effect-zoom_glow .home_card_exit {
    animation: productZoomGlowOut .42s ease both !important;
}

@keyframes productSoftFadeIn {
    from { opacity: 0; transform: translateX(42px); filter: blur(3px); }
    to { opacity: 1; transform: translateX(0); filter: blur(0); }
}
@keyframes productSoftFadeOut {
    from { opacity: 1; transform: translateX(0); filter: blur(0); }
    to { opacity: 0; transform: translateX(-22px); filter: blur(3px); }
}
@keyframes productBounceIn {
    0% { opacity: 0; transform: translateX(80px) translateY(-26px) scale(.86); }
    58% { opacity: 1; transform: translateX(-8px) translateY(5px) scale(1.04); }
    100% { opacity: 1; transform: translateX(0) translateY(0) scale(1); }
}
@keyframes productBounceOut {
    from { opacity: 1; transform: translateY(0) scale(1); }
    to { opacity: 0; transform: translateY(18px) scale(.94); }
}
@keyframes productZoomGlowIn {
    0% { opacity: 0; transform: translateX(62px) scale(.78); filter: blur(3px) brightness(1); }
    68% { opacity: 1; transform: translateX(-4px) scale(1.06); filter: blur(0) brightness(1.2); box-shadow: 0 0 32px rgba(255,218,70,.28); }
    100% { opacity: 1; transform: translateX(0) scale(1); filter: blur(0) brightness(1); }
}
@keyframes productZoomGlowOut {
    from { opacity: 1; transform: scale(1); filter: blur(0); }
    to { opacity: 0; transform: scale(.9); filter: blur(3px); }
}

/* Badge SEO trong sidebar không che chữ */
.menu-seo-corner,
.mobile-seo-corner {
    top: 50% !important;
    right: 10px !important;
    transform: translateY(-50%) !important;
    font-size: 9px !important;
    min-width: 45px !important;
    min-height: 20px !important;
    padding: 3px 7px !important;
}
.sidebar-menu li a.has-seo-badge,
.mobile-menu a.has-seo-badge,
.mobile-menu ul li a.has-seo-badge {
    padding-right: 76px !important;
}

/* Quick view giữ gọn giữa mọi màn hình */
.quick_view_box {
    max-height: 90svh !important;
}
.quick_view_content {
    max-height: 90svh !important;
}
@media (max-width: 767px) {
    .quick_view_box {
        max-height: 91svh !important;
    }
    .quick_view_img {
        height: clamp(90px, 20svh, 150px) !important;
    }
    .quick_view_info {
        padding: 11px 13px 13px !important;
    }
}

/* =====================================================
   FINAL PATCH: SEO badge không che tên món + nút card gọn hơn
   Áp dụng sau cùng cho home, danh mục, trang SEO, sản phẩm liên quan.
   ===================================================== */
.product_costum .seo-discount-badge,
.list_product .seo-discount-badge,
.seo-products-grid .seo-discount-badge {
    top: 8px !important;
    left: 8px !important;
    min-width: 0 !important;
    width: auto !important;
    min-height: 0 !important;
    height: auto !important;
    max-width: 58px !important;
    padding: 5px 9px !important;
    border-radius: 999px !important;
    font-size: 9px !important;
    line-height: 1 !important;
    white-space: nowrap !important;
    letter-spacing: .01em !important;
    z-index: 45 !important;
}

.product_costum .seo-discount-badge::before,
.product_costum .seo-discount-badge::after,
.list_product .seo-discount-badge::before,
.list_product .seo-discount-badge::after,
.seo-products-grid .seo-discount-badge::before,
.seo-products-grid .seo-discount-badge::after {
    inset: -3px !important;
}

.product_costum:has(.seo-discount-badge) .title_product,
.list_product:has(.seo-discount-badge) .title_product,
.seo-products-grid .product_costum:has(.seo-discount-badge) .title_product {
    padding-left: 68px !important;
    padding-right: 8px !important;
}

.home_product_carousel .product_costum:has(.seo-discount-badge) .title_product {
    min-height: 42px !important;
    align-items: center !important;
}

.product_costum .btn_active,
.list_product .btn_active,
.home_product_carousel .btn_active,
.seo-products-grid .btn_active {
    gap: 6px !important;
    padding: 8px 10px 12px !important;
    margin: 0 !important;
}

.product_costum .btn_active button,
.list_product .btn_active button,
.home_product_carousel .btn_active button,
.seo-products-grid .btn_active button,
.product_costum .btn_add_cart,
.product_costum .btn_order_buy,
.product_costum .quit_view,
.list_product .btn_add_cart,
.list_product .btn_order_buy,
.list_product .quit_view {
    min-height: 30px !important;
    height: auto !important;
    padding: 8px 10px !important;
    border-radius: 10px !important;
    font-size: 10px !important;
    line-height: 1.05 !important;
    font-weight: 800 !important;
}

.product_costum .btn_add_cart,
.list_product .btn_add_cart,
.home_product_carousel .btn_add_cart,
.seo-products-grid .btn_add_cart {
    box-shadow: 0 7px 16px rgba(213, 151, 35, .22) !important;
}

@media (max-width: 1199px) {
    .product_costum .btn_active,
    .list_product .btn_active,
    .home_product_carousel .btn_active,
    .seo-products-grid .btn_active {
        gap: 5px !important;
        padding: 7px 8px 10px !important;
    }

    .product_costum .btn_active button,
    .list_product .btn_active button,
    .home_product_carousel .btn_active button,
    .seo-products-grid .btn_active button,
    .product_costum .btn_add_cart,
    .product_costum .btn_order_buy,
    .product_costum .quit_view,
    .list_product .btn_add_cart,
    .list_product .btn_order_buy,
    .list_product .quit_view {
        min-height: 28px !important;
        padding: 7px 8px !important;
        border-radius: 9px !important;
        font-size: 9px !important;
    }
}

@media (max-width: 767px) {
    .product_costum .seo-discount-badge,
    .list_product .seo-discount-badge,
    .seo-products-grid .seo-discount-badge {
        top: 6px !important;
        left: 6px !important;
        max-width: 46px !important;
        padding: 4px 7px !important;
        font-size: 7.8px !important;
    }

    .product_costum:has(.seo-discount-badge) .title_product,
    .list_product:has(.seo-discount-badge) .title_product,
    .seo-products-grid .product_costum:has(.seo-discount-badge) .title_product {
        padding-left: 52px !important;
        padding-right: 5px !important;
    }

    .product_costum .btn_active,
    .list_product .btn_active,
    .home_product_carousel .btn_active,
    .seo-products-grid .btn_active {
        gap: 4px !important;
        padding: 6px 7px 8px !important;
    }

    .product_costum .btn_active button,
    .list_product .btn_active button,
    .home_product_carousel .btn_active button,
    .seo-products-grid .btn_active button,
    .product_costum .btn_add_cart,
    .product_costum .btn_order_buy,
    .product_costum .quit_view,
    .list_product .btn_add_cart,
    .list_product .btn_order_buy,
    .list_product .quit_view {
        min-height: 25px !important;
        padding: 6px 6px !important;
        border-radius: 8px !important;
        font-size: 8px !important;
        line-height: 1 !important;
    }

    .home_product_carousel .price_new,
    .seo-products-grid .price_new {
        font-size: 11px !important;
    }
}

@media (max-width: 480px) {
    .product_costum .seo-discount-badge,
    .list_product .seo-discount-badge,
    .seo-products-grid .seo-discount-badge {
        top: 5px !important;
        left: 5px !important;
        max-width: 42px !important;
        padding: 4px 6px !important;
        font-size: 7px !important;
    }

    .product_costum:has(.seo-discount-badge) .title_product,
    .list_product:has(.seo-discount-badge) .title_product,
    .seo-products-grid .product_costum:has(.seo-discount-badge) .title_product {
        padding-left: 47px !important;
        padding-right: 4px !important;
    }

    .product_costum .btn_active button,
    .list_product .btn_active button,
    .home_product_carousel .btn_active button,
    .seo-products-grid .btn_active button,
    .product_costum .btn_add_cart,
    .product_costum .btn_order_buy,
    .product_costum .quit_view,
    .list_product .btn_add_cart,
    .list_product .btn_order_buy,
    .list_product .quit_view {
        min-height: 23px !important;
        padding: 5px 5px !important;
        border-radius: 7px !important;
        font-size: 7.4px !important;
    }
}


/* =====================================================
   PATCH 29-06-2026 B: SEO badge tương phản cao - load sau cùng
   ===================================================== */
.menu-seo-corner,
.mobile-seo-corner,
.category-seo-corner,
#content .category-grid .category-item .category-seo-corner,
.category-grid .category-item .category-seo-corner,
.front-theme-preview .preview-category span {
    background: linear-gradient(180deg, #ff2b2b 0%, #b80000 58%, #690000 100%) !important;
    color: #ffffff !important;
    border: 1px solid #fff2a8 !important;
    text-shadow: 0 1px 2px rgba(0,0,0,.85), 0 0 8px rgba(255,255,255,.38) !important;
    box-shadow: 0 0 0 2px rgba(255,255,255,.18), 0 0 0 4px rgba(255,210,64,.18), 0 9px 20px rgba(0,0,0,.45), inset 0 1px 0 rgba(255,255,255,.38) !important;
    font-weight: 1000 !important;
    letter-spacing: .035em !important;
}
.menu-seo-corner,.mobile-seo-corner{min-width:50px!important;min-height:23px!important;font-size:10px!important;}
#content .category-grid .category-item.has-seo-badge,
.category-grid .category-item.has-seo-badge{padding-right:82px!important;}
#content .category-grid .category-item .category-seo-corner,
.category-grid .category-item .category-seo-corner{right:16px!important;min-width:48px!important;min-height:24px!important;font-size:10px!important;}


/* =====================================================
   FINAL PATCH 29-06-2026 C: Buttons distinct contrast + toast below header
   ===================================================== */
.product_costum .btn_active .btn_add_cart,
.list_product .btn_active .btn_add_cart,
.home_product_carousel .btn_active .btn_add_cart,
.seo-products-grid .btn_active .btn_add_cart,
button.btn_add_cart {
    color: #211400 !important;
    background: linear-gradient(135deg, #fff178 0%, #ffc400 48%, #d48600 100%) !important;
    border: 1px solid rgba(255,239,145,.75) !important;
    text-shadow: 0 1px 0 rgba(255,255,255,.35) !important;
    box-shadow: 0 12px 24px rgba(255,196,0,.25), inset 0 1px 0 rgba(255,255,255,.72) !important;
}
.product_costum .btn_active .btn_order_buy,
.list_product .btn_active .btn_order_buy,
.home_product_carousel .btn_active .btn_order_buy,
.seo-products-grid .btn_active .btn_order_buy,
button.btn_order_buy {
    color: #fff !important;
    background: linear-gradient(135deg, #19c37d 0%, #07884f 54%, #034f30 100%) !important;
    border: 1px solid rgba(158,255,211,.42) !important;
    text-shadow: 0 1px 2px rgba(0,0,0,.55) !important;
    box-shadow: 0 12px 24px rgba(7,136,79,.25), inset 0 1px 0 rgba(255,255,255,.20) !important;
}
.product_costum .btn_active .quit_view,
.list_product .btn_active .quit_view,
.home_product_carousel .btn_active .quit_view,
.seo-products-grid .btn_active .quit_view,
button.quit_view {
    color: #fff !important;
    background: linear-gradient(135deg, #3677ff 0%, #1741c7 54%, #091b66 100%) !important;
    border: 1px solid rgba(174,204,255,.46) !important;
    text-shadow: 0 1px 2px rgba(0,0,0,.60) !important;
    box-shadow: 0 12px 24px rgba(23,65,199,.25), inset 0 1px 0 rgba(255,255,255,.20) !important;
}
.product_costum .btn_active .btn_add_cart:hover,
.product_costum .btn_active .btn_order_buy:hover,
.product_costum .btn_active .quit_view:hover,
.list_product .btn_active .btn_add_cart:hover,
.list_product .btn_active .btn_order_buy:hover,
.list_product .btn_active .quit_view:hover,
.home_product_carousel .btn_active .btn_add_cart:hover,
.home_product_carousel .btn_active .btn_order_buy:hover,
.home_product_carousel .btn_active .quit_view:hover,
.seo-products-grid .btn_active .btn_add_cart:hover,
.seo-products-grid .btn_active .btn_order_buy:hover,
.seo-products-grid .btn_active .quit_view:hover {
    filter: brightness(1.08) saturate(1.08) !important;
    transform: translateY(-2px) !important;
}
#toast_cart, #cart-toast {
    top: calc(82px + env(safe-area-inset-top, 0px)) !important;
    right: 18px !important;
    left: auto !important;
    z-index: 2147483000 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transform: translateY(-10px) scale(.98) !important;
    pointer-events: none !important;
}
#toast_cart.show, #cart-toast.show {
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) scale(1) !important;
}
@media (max-width:1024px){
    #toast_cart, #cart-toast {
        top: calc(92px + env(safe-area-inset-top, 0px)) !important;
        left: 14px !important;
        right: 14px !important;
        width: auto !important;
        text-align: center !important;
        padding: 14px 16px !important;
        font-size: 14px !important;
    }
}
