/* Public Site Shared Styles (Dùng chung cho toàn bộ trang ngoài Public) */
:root {
    --primary-color: #2563eb;
    --primary-hover: #1d4ed8;
    --secondary-color: #0f172a;
    --accent-color: #f59e0b;
    --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 8px 16px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
}

body.public-layout {
    font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color: #334155;
    background-color: #f8fafc;
}

/* Header Styling */
.public-header .navbar {
    transition: all 0.3s ease;
    backdrop-filter: blur(12px);
    background-color: rgba(255, 255, 255, 0.98) !important;
}

.brand-logo-img {
    height: 44px;
    max-width: 220px;
    object-fit: contain;
}

.max-w-150 {
    max-width: 150px;
}

.max-w-450 {
    max-width: 450px;
}

.max-w-500 {
    max-width: 500px;
}

.max-w-700 {
    max-width: 700px;
}

.max-w-1000 {
    max-width: 1000px;
}

.whitespace-nowrap {
    white-space: nowrap;
}

.btn-xs {
    padding: 0.15rem 0.5rem;
    font-size: 0.725rem;
    line-height: 1.35;
    border-radius: 0.25rem;
}

.rounded-pill-left {
    border-top-left-radius: 50rem !important;
    border-bottom-left-radius: 50rem !important;
    padding-left: 1.25rem;
}

.rounded-pill-right {
    border-top-right-radius: 50rem !important;
    border-bottom-right-radius: 50rem !important;
    padding-right: 1.25rem;
}

.bg-primary-soft {
    background-color: #eff6ff !important;
    color: var(--primary-color) !important;
}

.price-orig-val {
    text-decoration: line-through !important;
    color: #94a3b8 !important;
}

/* Category Filter Bar & Horizontal Carousel Track (Dùng chung cho Trang Chủ & Trang Sản Phẩm) */
.category-filter-wrapper {
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.category-filter-track-container {
    max-width: 860px;
    scroll-behavior: smooth;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 10px 6px !important;
}

.category-filter-track-container::-webkit-scrollbar {
    display: none;
}

.category-scroll-btn {
    transition: all 0.25s ease;
    color: #0f172a;
    background-color: #ffffff;
}

.category-scroll-btn:hover {
    background-color: var(--primary-color) !important;
    color: #ffffff !important;
    border-color: var(--primary-color) !important;
    transform: scale(1.1);
}

.category-filter-bar .category-filter-btn {
    font-weight: 600;
    font-size: 0.925rem;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-color: #cbd5e1;
    color: #475569;
    background-color: #ffffff;
    margin-right: 0.5rem !important;
    margin-top: 2px;
    margin-bottom: 2px;
}

.category-filter-bar .category-filter-btn:last-child {
    margin-right: 0 !important;
}

.category-filter-bar .category-filter-btn:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background-color: #eff6ff;
    transform: translateY(-2px);
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.22);
}

.category-filter-bar .category-filter-btn.active {
    background-color: var(--primary-color) !important;
    border-color: var(--primary-color) !important;
    color: #ffffff !important;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35) !important;
}

/* Section Titles */
.section-title-wrapper {
    margin-bottom: 2.5rem;
}

.section-title {
    font-size: 1.85rem;
    font-weight: 700;
    color: #0f172a;
    position: relative;
    display: inline-block;
}

.section-subtitle {
    color: #64748b;
    font-size: 1rem;
}

/* Product Card Column Vertical Spacing */
.product-card-col {
    margin-bottom: 2rem !important;
}

/* Base Card Styling & Micro-animations */
.product-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
}

.product-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: #cbd5e1;
}

/* Real Fiery Moving Animated Card Border for Promotion Products */
.product-card.promo-fire-card {
    position: relative;
    border: none !important;
    border-radius: 20px !important;
    background: #ffffff;
    z-index: 1;
    overflow: visible;
}

.product-card.promo-fire-card::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: 24px;
    background: linear-gradient(120deg, #ff0055, #ff5000, #ffea00, #ec4899, #ff0055);
    background-size: 300% 300%;
    z-index: -1;
    animation: fireBorderMove 3s ease infinite, fireGlowPulse 2s ease-in-out infinite alternate;
}

.product-card.promo-fire-card::after {
    content: '';
    position: absolute;
    top: -7px;
    left: -7px;
    right: -7px;
    bottom: -7px;
    border-radius: 26px;
    background: linear-gradient(120deg, #ff0055, #ff5000, #ffea00, #ec4899, #ff0055);
    background-size: 300% 300%;
    z-index: -2;
    filter: blur(12px);
    opacity: 0.85;
    animation: fireBorderMove 3s ease infinite;
}

@keyframes fireBorderMove {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes fireGlowPulse {
    0% {
        filter: drop-shadow(0 0 10px rgba(255, 80, 0, 0.6));
    }

    100% {
        filter: drop-shadow(0 0 25px rgba(255, 0, 85, 0.9));
    }
}

/* Floating Fire Embers Dancing Upwards */
.fire-ember-wrapper {
    position: absolute;
    inset: -12px;
    pointer-events: none;
    z-index: 2;
    overflow: hidden;
    border-radius: 24px;
}

.fire-ember-particle {
    position: absolute;
    bottom: 0;
    width: 6px;
    height: 6px;
    background: #ffea00;
    border-radius: 50%;
    box-shadow: 0 0 8px #ff5000, 0 0 16px #ff0055;
    opacity: 0;
    animation: floatEmber 2.4s infinite ease-out;
}

.fire-ember-particle.p0 {
    left: 8%;
    animation-delay: 0s;
    width: 5px;
    height: 5px;
}

.fire-ember-particle.p1 {
    left: 24%;
    animation-delay: 0.4s;
    width: 7px;
    height: 7px;
}

.fire-ember-particle.p2 {
    left: 45%;
    animation-delay: 0.9s;
    width: 4px;
    height: 4px;
}

.fire-ember-particle.p3 {
    left: 62%;
    animation-delay: 1.3s;
    width: 6px;
    height: 6px;
}

.fire-ember-particle.p4 {
    left: 80%;
    animation-delay: 1.7s;
    width: 8px;
    height: 8px;
}

.fire-ember-particle.p5 {
    left: 93%;
    animation-delay: 0.6s;
    width: 5px;
    height: 5px;
}

@keyframes floatEmber {
    0% {
        transform: translateY(0) scale(1) rotate(0deg);
        opacity: 0.95;
    }

    50% {
        opacity: 0.85;
    }

    100% {
        transform: translateY(-240px) scale(0.15) rotate(180deg) translateX(20px);
        opacity: 0;
    }
}

/* Fiery Flame Flicker Icon & Badge Animation */
.product-promo-badge {
    background: linear-gradient(135deg, #ff0055 0%, #ff5000 50%, #ffea00 100%);
    background-size: 200% 200%;
    animation: flameGradient 2.5s ease infinite, fireBadgePulse 1.5s infinite ease-in-out;
    box-shadow: 0 4px 14px rgba(255, 0, 85, 0.55);
    font-size: 0.775rem;
    letter-spacing: 0.03em;
    border: 1px solid rgba(255, 255, 255, 0.4);
}

.fire-flicker {
    display: inline-block;
    color: #ffffff;
    animation: flameFlicker 1s infinite alternate ease-in-out;
}

@keyframes flameFlicker {
    0% {
        transform: scale(1) rotate(-6deg);
        filter: drop-shadow(0 0 4px #ffea00);
    }

    100% {
        transform: scale(1.35) rotate(7deg);
        filter: drop-shadow(0 0 10px #ff5000);
    }
}

@keyframes flameGradient {
    0% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }

    100% {
        background-position: 0% 50%;
    }
}

@keyframes fireBadgePulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.05);
    }
}

.product-card .card-img-wrapper {
    width: 100%;
    height: 200px;
    background-color: #ffffff;
    display: block;
    overflow: hidden;
    position: relative;
    padding: 0;
    margin: 0;
    border-top-left-radius: 18px;
    border-top-right-radius: 18px;
}

.product-card .card-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.product-card:hover .card-img-wrapper img {
    transform: scale(1.05);
}

/* Product Card Mini Image Carousel Controls */
.product-mini-carousel .mini-control {
    width: 32px;
    height: 100%;
    opacity: 0;
    transition: opacity 0.25s ease;
    background: transparent;
    border: none;
}

.product-card:hover .product-mini-carousel .mini-control {
    opacity: 1;
}

.product-mini-carousel .mini-control span {
    width: 26px;
    height: 26px;
    background-color: rgba(15, 23, 42, 0.65);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-size: 0.8rem;
    backdrop-filter: blur(4px);
    transition: background-color 0.2s ease;
}

.product-mini-carousel .mini-control:hover span {
    background-color: var(--primary-color);
}

.product-unit-pill {
    font-size: 0.725rem;
    padding: 0.15rem 0.5rem;
    border-radius: 50rem;
    font-weight: 600;
    line-height: 1.35;
    transition: all 0.25s ease;
}

.product-unit-pill.btn-outline-secondary {
    border-color: #cbd5e1;
    color: #64748b;
    background-color: #f8fafc;
}

.product-unit-pill.btn-outline-secondary:hover {
    border-color: var(--primary-color);
    color: var(--primary-color);
    background-color: #eff6ff;
}

/* Footer Styling */
.public-footer {
    background-color: var(--secondary-color) !important;
}

.hover-white:hover {
    color: #ffffff !important;
}

/* Select2 Custom Styling for Public Site (Matches CMS Internal Theme) */
.select2-container--default .select2-selection--single {
    height: 42px !important;
    border-radius: 50rem !important;
    border: 1px solid #cbd5e1 !important;
    padding: 4px 14px !important;
    display: flex !important;
    align-items: center !important;
    background-color: #ffffff !important;
    transition: all 0.2s ease !important;
}

.select2-container--default.select2-container--open .select2-selection--single,
.select2-container--default.select2-container--focus .select2-selection--single {
    border-color: #2563eb !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
}

.select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 32px !important;
    color: #1e293b !important;
    padding-left: 4px !important;
    font-size: 0.925rem !important;
    font-weight: 500 !important;
}

.select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 40px !important;
    right: 12px !important;
}

.select2-dropdown {
    border-radius: 14px !important;
    border: 1px solid #e2e8f0 !important;
    box-shadow: 0 12px 30px rgba(15, 23, 42, 0.12) !important;
    padding: 8px !important;
    background: #ffffff !important;
    z-index: 1060 !important;
}

/* Nav Category Dropdown Hover & Styling */
.dropdown-menu-category {
    display: none;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: opacity 0.25s cubic-bezier(0.16, 1, 0.3, 1), transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.25s ease;
    background: #ffffff;
    box-shadow: 0 12px 32px rgba(15, 23, 42, 0.15) !important;
    border: 1px solid rgba(226, 232, 240, 0.8) !important;
}

@media (min-width: 992px) {
    .category-nav-dropdown:hover > .dropdown-menu-category {
        display: block !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: translateY(0) !important;
        pointer-events: auto !important;
    }
}

.dropdown-menu-category.show,
.category-nav-dropdown.show > .dropdown-menu-category {
    display: block !important;
    opacity: 1 !important;
    visibility: visible !important;
    transform: translateY(0) !important;
    pointer-events: auto !important;
}

@media (max-width: 991.98px) {
    .dropdown-menu-category {
        position: absolute !important;
        left: 50% !important;
        top: 100% !important;
        transform: translateX(-50%) translateY(10px) !important;
        width: 290px !important;
        max-width: 90vw !important;
        z-index: 1060 !important;
    }

    .dropdown-menu-category.show,
    .category-nav-dropdown.show > .dropdown-menu-category {
        transform: translateX(-50%) translateY(0) !important;
    }
}

.category-nav-item {
    font-size: 0.9rem;
    transition: all 0.2s ease;
    color: #334155 !important;
}

.category-nav-item:hover {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.08) 0%, rgba(56, 189, 248, 0.04) 100%) !important;
    color: #2563eb !important;
    transform: translateX(4px);
}

.category-nav-item:hover .nav-item-arrow {
    color: #2563eb !important;
    transform: translateX(2px);
}

.select2-search--dropdown {
    padding: 4px 4px 8px 4px !important;
}

.select2-search--dropdown .select2-search__field {
    border: 1px solid #cbd5e1 !important;
    border-radius: 8px !important;
    padding: 8px 12px !important;
    font-size: 0.9rem !important;
    color: #1e293b !important;
    outline: none !important;
    background-color: #f8fafc !important;
    transition: all 0.2s ease !important;
}

.select2-search--dropdown .select2-search__field:focus {
    border-color: #2563eb !important;
    background-color: #ffffff !important;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15) !important;
}

.select2-results__options {
    max-height: 250px !important;
    padding-right: 4px !important;
}

.select2-results__option {
    border-radius: 8px !important;
    padding: 9px 14px !important;
    font-size: 0.9rem !important;
    color: #334155 !important;
    transition: all 0.2s cubic-bezier(0.25, 0.8, 0.25, 1) !important;
    margin-bottom: 3px !important;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background: linear-gradient(90deg, rgba(37, 99, 235, 0.12) 0%, rgba(56, 189, 248, 0.08) 100%) !important;
    color: #2563eb !important;
    font-weight: 600 !important;
    transform: translateX(4px) !important;
}

.select2-container--default .select2-results__option[aria-selected=true] {
    background: #2563eb !important;
    color: #ffffff !important;
    font-weight: 600 !important;
}

/* POS Sales-style Header Search Dropdown Styles */
#publicSearchResultDropdown {
    min-width: 380px;
    right: 0;
    left: auto;
    border-radius: 12px !important;
    box-shadow: 0 10px 30px rgba(15, 23, 42, 0.18) !important;
    border: 1px solid #cbd5e1 !important;
    background-color: #ffffff !important;
    z-index: 9999 !important;
}

#publicSearchResultDropdown.show,
#publicSearchResultDropdown:not(.d-none) {
    display: block !important;
}

@media (max-width: 576px) {
    #publicSearchResultDropdown {
        min-width: 300px;
        width: 100%;
        left: 0;
    }
}

.pos-search-result-item {
    transition: all 0.15s ease-in-out;
}

.pos-search-result-item:hover {
    background-color: #f1f5f9 !important;
    transform: translateX(2px);
}