/* AffWeb Modern Theme Enhancements - Red Theme */
:root {
    --primary-color: #DC2626;
    --primary-hover: #B91C1C;
    --primary-dark: #991B1B;
    --primary-light: #FEF2F2;
    --primary-rgb: 220, 38, 38;
    --bs-primary: #DC2626;
    --bs-primary-rgb: 220, 38, 38;
    --dark-bg: #0f172a;
    --card-border: #e2e8f0;
}

/* Global Red Palette Overrides */
.text-success, a.text-success, .text-success-emphasis {
    color: #DC2626 !important;
}
.btn-success {
    background-color: #DC2626 !important;
    border-color: #DC2626 !important;
    color: #ffffff !important;
}
.btn-success:hover, .btn-success:focus, .btn-success:active, .btn-success.active {
    background-color: #B91C1C !important;
    border-color: #B91C1C !important;
    color: #ffffff !important;
}
.btn-outline-success {
    color: #DC2626 !important;
    border-color: #DC2626 !important;
}
.btn-outline-success:hover, .btn-outline-success:focus, .btn-outline-success:active {
    background-color: #DC2626 !important;
    border-color: #DC2626 !important;
    color: #ffffff !important;
}
.bg-success {
    background-color: #DC2626 !important;
}
.bg-success-subtle {
    background-color: #FEF2F2 !important;
    color: #DC2626 !important;
}
.border-success {
    border-color: #DC2626 !important;
}
.badge-success {
    background-color: #DC2626 !important;
    color: #ffffff !important;
}
.badge-soft-success {
    background: rgba(220, 38, 38, 0.1) !important;
    color: #DC2626 !important;
    border: 1px solid rgba(220, 38, 38, 0.2) !important;
}
.hover-success:hover {
    color: #DC2626 !important;
}
.hover-success-bg:hover {
    background-color: #DC2626 !important;
    color: #ffffff !important;
}
.hover-danger:hover {
    color: #DC2626 !important;
}

/* Glassmorphism Sticky Navbar */
.navbar-modern {
    background: rgba(15, 23, 42, 0.94) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    transition: background-color 0.25s ease, box-shadow 0.25s ease;
}

/* Fast Interactive Cards */
.card-hover-lift {
    transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.22s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: transform;
}
.card-hover-lift:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.09) !important;
}

/* High-Converting CTA Button */
.btn-affiliate-cta {
    background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%);
    color: #ffffff !important;
    font-weight: 700;
    letter-spacing: 0.2px;
    border: none;
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.35);
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.btn-affiliate-cta:hover {
    background: linear-gradient(135deg, #B91C1C 0%, #991B1B 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 38, 38, 0.45);
}

/* Image Aspect Ratio & Shimmer Skeleton */
.img-skeleton {
    background: #f1f5f9;
    position: relative;
    overflow: hidden;
}
.img-skeleton::after {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: linear-gradient(90deg, rgba(255,255,255,0) 0%, rgba(255,255,255,0.4) 50%, rgba(255,255,255,0) 100%);
    animation: shimmer 1.8s infinite;
}
@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

/* Hero Section Gradient */
.hero-gradient {
    background: linear-gradient(180deg, #f8fafc 0%, #ffffff 100%);
    border-bottom: 1px solid #e2e8f0;
}

/* Badges */
.badge-soft-primary {
    background: rgba(13, 110, 253, 0.1);
    color: #0d6efd;
    border: 1px solid rgba(13, 110, 253, 0.2);
}
.badge-soft-success {
    background: rgba(220, 38, 38, 0.1);
    color: #198754;
    border: 1px solid rgba(220, 38, 38, 0.2);
}
.badge-soft-danger {
    background: rgba(220, 53, 69, 0.1);
    color: #dc3545;
    border: 1px solid rgba(220, 53, 69, 0.2);
}

/* ========================================================
   WoodMart Unified Product Card Component
   ======================================================== */
.product-woodmart-card {
    background: #ffffff;
    border: 1px solid #ebebeb;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}
.product-woodmart-card:hover {
    border-color: #ff7676;
    box-shadow: 0 10px 24px rgba(255, 71, 71, 0.12);
    transform: translateY(-4px);
}
.product-woodmart-card.compact {
    font-size: 0.85rem;
}
.product-woodmart-img-wrap {
    position: relative;
    background: #fafafa;
    padding-top: 85%;
    overflow: hidden;
    width: 100%;
}
.product-woodmart-card.compact .product-woodmart-img-wrap {
    padding-top: 80%;
}
.product-woodmart-img-wrap img,
.product-woodmart-img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 12px;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}
.product-woodmart-card.compact .product-woodmart-img-wrap img,
.product-woodmart-card.compact .product-woodmart-img {
    padding: 8px;
}
.product-woodmart-card:hover .product-woodmart-img-wrap img,
.product-woodmart-card:hover .product-woodmart-img {
    transform: scale(1.08);
}

/* Discount & Status Badges */
.badge-discount-bf,
.wm-card-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: #ff4747;
    background: linear-gradient(135deg, #ff4747 0%, #e53935 100%);
    color: #ffffff;
    font-weight: 800;
    font-size: 0.72rem;
    padding: 3px 8px;
    border-radius: 4px;
    z-index: 3;
    letter-spacing: 0.3px;
    box-shadow: 0 2px 6px rgba(255, 71, 71, 0.35);
    line-height: 1.2;
    text-transform: uppercase;
}
.badge-discount-bf.badge-hot,
.wm-card-badge.badge-hot {
    background: linear-gradient(135deg, #ff5722 0%, #e64a19 100%);
    box-shadow: 0 2px 6px rgba(230, 74, 25, 0.35);
}
.badge-discount-bf.badge-new,
.wm-card-badge.badge-new {
    background: linear-gradient(135deg, #DC2626 0%, #B91C1C 100%);
    box-shadow: 0 2px 6px rgba(220, 38, 38, 0.35);
}

/* Ranking Badges (#1, #2, #3, #4+) */
.badge-ranking-bf {
    position: absolute;
    top: 10px;
    right: 10px;
    color: #ffffff;
    font-weight: 800;
    font-size: 0.72rem;
    padding: 3px 8px;
    border-radius: 4px;
    z-index: 3;
    display: inline-flex;
    align-items: center;
    gap: 3px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.18);
    letter-spacing: 0.4px;
    line-height: 1.2;
}
.badge-ranking-bf.rank-1 {
    background: linear-gradient(135deg, #FFB800 0%, #FF8C00 100%);
    color: #212529;
    box-shadow: 0 2px 8px rgba(255, 184, 0, 0.4);
}
.badge-ranking-bf.rank-2 {
    background: linear-gradient(135deg, #9E9E9E 0%, #757575 100%);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(117, 117, 117, 0.35);
}
.badge-ranking-bf.rank-3 {
    background: linear-gradient(135deg, #BCAAA4 0%, #8D6E63 100%);
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(141, 110, 99, 0.35);
}
.badge-ranking-bf.rank-default {
    background: linear-gradient(135deg, #475569 0%, #1e293b 100%);
    color: #ffffff;
}

/* Product Card Content Body */
.product-woodmart-body {
    padding: 0.85rem;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}
.product-woodmart-card.compact .product-woodmart-body {
    padding: 0.65rem;
}
.product-card-title {
    font-weight: 700;
    margin-bottom: 0.35rem;
    line-height: 1.35;
}
.product-card-title a {
    color: #242424;
    text-decoration: none;
    transition: color 0.2s ease;
}
.product-woodmart-card:hover .product-card-title a {
    color: #e53935;
}
.product-card-rating {
    font-size: 0.72rem;
    margin-bottom: 0.35rem;
    display: flex;
    align-items: center;
}
.product-card-prices {
    display: flex;
    align-items: baseline;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
}
.product-card-price-current {
    font-weight: 800;
    color: #ff4747;
    font-size: 1.05rem;
}
.product-woodmart-card.compact .product-card-price-current {
    font-size: 0.95rem;
}
.product-card-price-old {
    color: #94a3b8;
    text-decoration: line-through;
    font-size: 0.78rem;
}

/* Stock Progress */
.product-card-stock {
    margin-top: auto;
    margin-bottom: 0.5rem;
}
.product-card-stock-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: #64748b;
    margin-bottom: 0.25rem;
}
.product-card-stock-bar {
    height: 5px;
    border-radius: 4px;
    background-color: #f1f5f9;
    overflow: hidden;
}
.product-card-stock-progress {
    height: 100%;
    background: linear-gradient(90deg, #ff4747 0%, #ff7676 100%);
    border-radius: 4px;
    transition: width 0.6s ease;
}

/* Actions & Buttons */
.product-card-actions {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}
.product-card-buy-btn {
    background: linear-gradient(135deg, #ff4747 0%, #e53935 100%);
    border: none;
    color: #ffffff !important;
    font-weight: 700;
    border-radius: 50rem;
    transition: all 0.22s ease;
    box-shadow: 0 3px 10px rgba(255, 71, 71, 0.25);
    flex-grow: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
}
.product-card-buy-btn:hover {
    background: linear-gradient(135deg, #e53935 0%, #c62828 100%);
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(255, 71, 71, 0.35);
    color: #ffffff !important;
}
.product-card-quickview-btn {
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    border: 1px solid #e2e8f0;
    color: #64748b;
    background: #ffffff;
    transition: all 0.2s ease;
}
.product-card-quickview-btn:hover {
    background: #0f172a;
    border-color: #0f172a;
    color: #ffffff;
    transform: scale(1.08);
}

/* --- Multi-line Ellipsis Clamping --- */
.text-truncate-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.text-truncate-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- Standardize Custom Half-Step Spacing Utilities --- */
.p-3\.5 { padding: 0.875rem !important; }
.py-1\.5 { padding-top: 0.375rem !important; padding-bottom: 0.375rem !important; }
.py-2\.5 { padding-top: 0.625rem !important; padding-bottom: 0.625rem !important; }
.px-2\.5 { padding-left: 0.625rem !important; padding-right: 0.625rem !important; }
.gap-1\.5 { gap: 0.375rem !important; }
.gap-2\.5 { gap: 0.625rem !important; }
.me-0\.5 { margin-right: 0.125rem !important; }
.mb-3\.5 { margin-bottom: 0.875rem !important; }

/* --- Additional Badge Categories --- */
.badge-discount-bf.badge-bestseller {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%) !important;
    box-shadow: 0 2px 6px rgba(124, 58, 237, 0.35);
}
.badge-discount-bf.badge-trending {
    background: linear-gradient(135deg, #0284c7 0%, #0369a1 100%) !important;
    box-shadow: 0 2px 6px rgba(2, 132, 199, 0.35);
}

/* --- Plus Button Hover --- */
.wm-card-plus-btn:hover {
    background-color: #DC2626 !important;
    border-color: #DC2626 !important;
    color: #ffffff !important;
}

/* --- Swiper Anti-CLS Pre-render --- */
.swiper:not(.swiper-initialized) .swiper-wrapper {
    display: flex;
    overflow-x: hidden;
}

/* Fractional Spacing Utilities for Bootstrap 5 */
.p-3\.5 { padding: 1.25rem !important; }
.p-4\.5 { padding: 1.75rem !important; }
.px-3\.5 { padding-left: 1.25rem !important; padding-right: 1.25rem !important; }
.py-1\.5 { padding-top: 0.375rem !important; padding-bottom: 0.375rem !important; }
.py-3\.5 { padding-top: 1.25rem !important; padding-bottom: 1.25rem !important; }
.m-3\.5 { margin: 1.25rem !important; }
.my-1\.5 { margin-top: 0.375rem !important; margin-bottom: 0.375rem !important; }
.mb-3\.5 { margin-bottom: 1.25rem !important; }
.mt-3\.5 { margin-top: 1.25rem !important; }
.gap-1\.5 { gap: 0.375rem !important; }
.gap-2\.5 { gap: 0.625rem !important; }
.gap-3\.5 { gap: 1.25rem !important; }

/* Safe padding rules for WoodMart lifestyle, promo banners, and cards */
.wm-fashion-banner {
    padding: 1.5rem 1.35rem !important;
}
.wm-lifestyle-tile {
    padding: 1.35rem 1.4rem !important;
}
.wm-hero-promo-card {
    padding: 1.35rem 1.4rem !important;
}
.wm-spotlight-card {
    padding: 1.5rem 1.4rem !important;
}

/* ==========================================================================
   WoodMart Custom Pagination Styles
   ========================================================================== */
.pagination,
.wm-pagination {
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
}

.pagination .page-item,
.wm-pagination .page-item {
    margin: 0 !important;
}

.pagination .page-link,
.wm-pagination .page-link {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    min-width: 40px !important;
    height: 40px !important;
    padding: 0 14px !important;
    font-family: 'Plus Jakarta Sans', -apple-system, sans-serif !important;
    font-size: 0.92rem !important;
    font-weight: 600 !important;
    color: #2d3748 !important;
    background-color: #ffffff !important;
    border: 1.5px solid #e2e8f0 !important;
    border-radius: 10px !important;
    text-decoration: none !important;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04) !important;
}

.pagination .page-link:hover,
.wm-pagination .page-link:hover {
    color: #7F1D1D !important;
    background-color: #FEF2F2 !important;
    border-color: #DC2626 !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 10px rgba(220, 38, 38, 0.15) !important;
}

.pagination .page-link:focus,
.wm-pagination .page-link:focus {
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.2) !important;
    border-color: #DC2626 !important;
    outline: none !important;
}

.pagination .page-item.active .page-link,
.wm-pagination .page-item.active .page-link {
    z-index: 3 !important;
    color: #ffffff !important;
    background-color: #DC2626 !important;
    border-color: #DC2626 !important;
    font-weight: 700 !important;
    box-shadow: 0 4px 14px rgba(220, 38, 38, 0.35) !important;
    transform: translateY(-1px) !important;
}

.pagination .page-item.disabled .page-link,
.wm-pagination .page-item.disabled .page-link {
    color: #94a3b8 !important;
    background-color: #f8fafc !important;
    border-color: #e2e8f0 !important;
    opacity: 0.65 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
    transform: none !important;
}

.pagination .page-link i,
.wm-pagination .page-link i {
    font-size: 0.78rem !important;
}

.wm-pagination-info {
    color: #64748b !important;
    font-size: 0.88rem !important;
    font-weight: 500 !important;
}

.wm-pagination-info .fw-bold {
    color: #151515 !important;
    font-weight: 700 !important;
}

.wm-pagination-container {
    padding-top: 1.5rem !important;
    border-top: 1px solid #f1f5f9 !important;
}

/* ========================================================================= */
/* WoodMart Luxury Scrollbar Styling (Vertical & Horizontal)                 */
/* ========================================================================= */
html {
    scroll-behavior: smooth;
}

/* Firefox & W3C Standard Scrollbar */
html, body {
    scrollbar-width: thin;
    scrollbar-color: #DC2626 #f4f6f8;
}
* {
    scrollbar-width: thin;
    scrollbar-color: #DC2626 transparent;
}

/* WebKit (Chrome, Edge, Safari, Opera) Window Global Scrollbar */
::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
::-webkit-scrollbar-track {
    background: #f4f6f8;
    border-radius: 999px;
}
::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #DC2626 0%, #B91C1C 100%);
    border-radius: 999px;
    border: 2px solid #f4f6f8;
    transition: background 0.3s ease, border-color 0.3s ease;
}
::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #B91C1C 0%, #991B1B 100%);
    border: 1.5px solid #f4f6f8;
}
::-webkit-scrollbar-thumb:active {
    background: #7F1D1D;
}

/* Horizontal Scrollbar Customization */
::-webkit-scrollbar:horizontal {
    height: 8px;
}
::-webkit-scrollbar-thumb:horizontal {
    background: linear-gradient(90deg, #DC2626 0%, #B91C1C 100%);
    border-radius: 999px;
    border: 2px solid #f4f6f8;
}
::-webkit-scrollbar-thumb:horizontal:hover {
    background: linear-gradient(90deg, #B91C1C 0%, #991B1B 100%);
}

/* Corner styling where horizontal and vertical meet */
::-webkit-scrollbar-corner {
    background: #f4f6f8;
}

/* Dedicated Slim Scrollbar for Inner Containers (Tabs, Tables, Dropdowns, Offcanvas, Modal) */
.overflow-x-auto::-webkit-scrollbar,
.overflow-y-auto::-webkit-scrollbar,
.overflow-auto::-webkit-scrollbar,
.table-responsive::-webkit-scrollbar,
#wmArrivalsCatTabs::-webkit-scrollbar,
#wmTrendingTabs::-webkit-scrollbar,
.dropdown-menu::-webkit-scrollbar,
.offcanvas-body::-webkit-scrollbar,
.modal-body::-webkit-scrollbar,
pre::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}
.overflow-x-auto::-webkit-scrollbar-track,
.overflow-y-auto::-webkit-scrollbar-track,
.overflow-auto::-webkit-scrollbar-track,
.table-responsive::-webkit-scrollbar-track,
#wmArrivalsCatTabs::-webkit-scrollbar-track,
#wmTrendingTabs::-webkit-scrollbar-track,
.dropdown-menu::-webkit-scrollbar-track,
.offcanvas-body::-webkit-scrollbar-track,
.modal-body::-webkit-scrollbar-track,
pre::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.03);
    border-radius: 999px;
}
.overflow-x-auto::-webkit-scrollbar-thumb,
.overflow-y-auto::-webkit-scrollbar-thumb,
.overflow-auto::-webkit-scrollbar-thumb,
.table-responsive::-webkit-scrollbar-thumb,
#wmArrivalsCatTabs::-webkit-scrollbar-thumb,
#wmTrendingTabs::-webkit-scrollbar-thumb,
.dropdown-menu::-webkit-scrollbar-thumb,
.offcanvas-body::-webkit-scrollbar-thumb,
.modal-body::-webkit-scrollbar-thumb,
pre::-webkit-scrollbar-thumb {
    background: #DC2626;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.6);
}
.overflow-x-auto::-webkit-scrollbar-thumb:hover,
.overflow-y-auto::-webkit-scrollbar-thumb:hover,
.overflow-auto::-webkit-scrollbar-thumb:hover,
.table-responsive::-webkit-scrollbar-thumb:hover,
#wmArrivalsCatTabs::-webkit-scrollbar-thumb:hover,
#wmTrendingTabs::-webkit-scrollbar-thumb:hover,
.dropdown-menu::-webkit-scrollbar-thumb:hover,
.offcanvas-body::-webkit-scrollbar-thumb:hover,
.modal-body::-webkit-scrollbar-thumb:hover,
pre::-webkit-scrollbar-thumb:hover {
    background: #991B1B;
}



