/* Brand color overrides for Kamdhenu Ecommerce */
:root {
    --primary: var(--tenant-primary, #90090C);
    --secondary: var(--tenant-secondary, #D2691E);
    --bg-4: rgba(144, 9, 12, 0.1);
}

/* Ensure header is always on top (over product active-dropdown z-index: 1100) */
header,
.tf-header {
    z-index: 2000 !important;
}

/* Ensure bottom toolbar is above everything else (products, dropdowns, etc.) */
.tf-toolbar-bottom {
    z-index: 2500 !important;
}

/* Ensure Go Top button is above products and variant dropdowns */
#goTop {
    z-index: 2600 !important;
}



/* Fix for modal and offcanvas overlapping header with high z-index */
.modal-backdrop,
.offcanvas-backdrop {
    z-index: 2040 !important;
}

.modal,
.offcanvas {
    z-index: 2050 !important;
}

/* Button backgrounds */
.btn-main,
.tf-btn,
.tf-btn.btn-main {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
}

.tf-btn:hover,
.btn-main:hover {
    filter: brightness(0.9) !important;
}

/* Text primary color */
.text-main,
.link-main {
    color: var(--primary) !important;
}

/* Border primary */
.border-main {
    border-color: var(--primary) !important;
}

/* Background primary */
.bg-main {
    background-color: var(--primary) !important;
}

/* ── Custom Variant Dropdown UI ── */
.custom-variant-container {
    position: relative;
    width: 100%;
    margin-top: 8px;
    z-index: 100;
}

/* Fix for dropdown clipping: ensure the active card floats above others and allows overflow */
.card-product.active-dropdown {
    z-index: 1100 !important;
    overflow: visible !important;
}

.swiper-slide:has(.active-dropdown) {
    z-index: 1100 !important;
    overflow: visible !important;
}

.tf-swiper:has(.active-dropdown) {
    overflow: visible !important;
}

.custom-variant-trigger {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 20px 8px 16px !important;
    height: 42px !important;
    background: #ffffff !important;
    border: 1px solid #e5e7eb !important;
    border-radius: 100px !important;
    cursor: pointer;
    font-size: 13px !important;
    font-weight: 700 !important;
    color: #1a1a1a !important;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.06) !important;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    user-select: none;
}

.custom-variant-trigger:hover {
    border-color: var(--primary) !important;
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(144, 9, 12, 0.12) !important;
}

.custom-variant-trigger i {
    font-size: 12px;
    color: var(--primary);
    transition: transform 0.3s ease;
}

.custom-variant-container.active .custom-variant-trigger i {
    transform: rotate(180deg);
}

.custom-variant-menu {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #ffffff;
    border: 1px solid #eee;
    border-radius: 20px !important;
    /* Rounded dropdown menu */
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15) !important;
    padding: 8px !important;
    display: none;
    z-index: 1000;
    overflow: hidden;
    animation: customFadeInDown 0.2s ease-out;
}

.custom-variant-container.active .custom-variant-menu {
    display: block;
}

.custom-variant-option {
    padding: 10px 16px !important;
    border-radius: 100px !important;
    /* Pill shaped options */
    font-size: 13px !important;
    font-weight: 500 !important;
    color: #4b5563 !important;
    cursor: pointer;
    transition: all 0.2s;
    margin-bottom: 2px;
}

.custom-variant-option:hover {
    background: #f9fafb !important;
    color: var(--primary) !important;
    padding-left: 22px !important;
}

.custom-variant-option.active {
    background: rgba(144, 9, 12, 0.05) !important;
    color: var(--primary) !important;
    font-weight: 700 !important;
}

@keyframes customFadeInDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Keep native select hidden when custom one is present */
.variant-select {
    display: none !important;
}

/* Nav dropdown anchor fix — sub-menu must position relative to its menu-item */
.box-nav-menu .menu-item {
    position: relative;
}

/* card info spacing */
.card-product_info .variant-wrap {
    display: block;
    width: 100%;
    margin-top: 8px;
    margin-bottom: 0;
}

.card-product_info .price-wrap {
    margin-top: 8px;
    margin-bottom: 2px;
}

.card-product_info .price-new {
    font-size: 15px;
    font-weight: 600;
}

.card-product_info .price-old {
    font-size: 11px;
    margin-left: 4px;
    text-decoration: line-through;
}

/* ── Product detail page fixes ── */

/* Remove template's default top margin so image and info columns align */
.tf-product-info-wrap {
    margin-top: 0 !important;
}

/* Size variant buttons: auto-width so long ShortDescriptions aren't clipped */
.tf-product-info-wrap .variant-size .size-btn:not(.select-item) {
    width: auto !important;
    height: auto !important;
    padding: 8px 16px !important;
    min-width: 44px !important;
    min-height: 44px !important;
    white-space: normal;
    line-height: 1.3;
    font-size: 13px;
    text-align: center;
}

/* Brand colors & Button overrides (Login Modal & Shop) */
.price-preset,
.btn-primary-custom {
    background-color: var(--primary) !important;
    border-color: var(--primary) !important;
    color: #ffffff !important;
}

/* Outlined brand buttons (e.g. toggle buttons) */
.btn-stroke.price-preset,
.btn-stroke.btn-primary-custom,
.tf-btn.btn-stroke {
    background-color: transparent !important;
    color: var(--primary) !important;
    border-color: var(--primary) !important;
}

/* Selection state for radio/check buttons */
.btn-check:checked+.btn-stroke.price-preset,
.btn-check:checked+.btn-stroke.btn-primary-custom,
.btn-check:checked+.tf-btn.btn-stroke {
    background-color: var(--primary) !important;
    color: #ffffff !important;
}

/* Ensure consistent text visibility on mobile for these buttons */
@media (max-width: 767.98px) {

    .price-preset,
    .btn-primary-custom,
    .tf-btn.price-preset {
        color: #ffffff !important;
        background-color: var(--primary) !important;
    }

    .btn-stroke.price-preset,
    .btn-stroke.btn-primary-custom,
    .tf-btn.btn-stroke {
        color: var(--primary) !important;
        background-color: transparent !important;
    }

    .btn-check:checked+.btn-stroke.price-preset {
        color: #ffffff !important;
        background-color: var(--primary) !important;
    }

    /* Prevent mobile toolbar from hiding bottom content in cart */
    .offcanvas .wrap,
    .offcanvas .canvas-body,
    .tf-mini-cart-wrap {
        padding-bottom: 30px !important;
    }

    /* Improve Layout of Empty Cart Buttons */
    .shop-empty_bot {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }
}

/* Navigation Active State (Desktop & Mobile) */
.menu-item.active .item-link,
.nav-mb-item.active .item-link {
    color: var(--primary) !important;
}

.menu-item.active .item-link::after,
.nav-mb-item.active .item-link::after {
    display: block !important;
}

.menu-item.active .item-link .cus-text::after {
    right: auto;
    left: 0;
    width: 100%;
}

/* Navigation Dropdown Items Hover/Active State */
.dropdown-item:hover,
.dropdown-item:focus {
    background-color: #f9fafb !important;
    color: var(--primary) !important;
}

.dropdown-item.active,
.dropdown-item:active {
    background-color: var(--bg-4) !important;
    color: var(--primary) !important;
}

/* ==========================================================================
   FLY-TO-CART MICRO-INTERACTION STYLES
   ========================================================================== */
.fly-to-cart-particle {
    position: absolute;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    border: 2px solid #ffffff;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2), 0 4px 10px rgba(0, 0, 0, 0.15);
    object-fit: cover;
    z-index: 100000;
    pointer-events: none;
}

.fly-to-cart-particle-dot {
    position: absolute;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background-color: var(--primary, #90090C);
    box-shadow: 0 0 12px var(--primary, #90090C), 0 0 4px rgba(255, 255, 255, 0.8);
    z-index: 100000;
    pointer-events: none;
}

/* Bounce effect on the shopping bag trigger */
@keyframes cart-bounce {
    0%, 100% {
        transform: scale(1);
    }
    30% {
        transform: scale(1.3);
    }
    50% {
        transform: scale(0.9);
    }
    70% {
        transform: scale(1.15);
    }
    85% {
        transform: scale(0.95);
    }
}

.cart-bounce-animation {
    animation: cart-bounce 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) both !important;
}

/* ==========================================================================
   WISHLIST DISPLAY & COLOR-INVERSION STYLE ENHANCEMENTS
   ========================================================================== */
/* Keep active wishlist button always visible without needing card hover */
.product-action_list:has(.btn-add-wishlist.active),
.product-action_list li:has(.btn-add-wishlist.active) {
    opacity: 1 !important;
    visibility: visible !important;
    transform: none !important;
}

/* Inactive state layout for wishlist button (White circle, tenant primary heart icon) */
.btn-add-wishlist:not(.active) {
    background: #ffffff !important;
    border-color: #e5e7eb !important;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05) !important;
}
.btn-add-wishlist:not(.active) .icon,
.btn-add-wishlist:not(.active) .icon-heart:before,
.btn-add-wishlist:not(.active) .icon-HeartStraight:before {
    color: var(--primary) !important;
}

/* Active state layout for wishlist button (Tenant primary background circle, white heart icon) */
.btn-add-wishlist.active {
    background: var(--primary) !important;
    border-color: var(--primary) !important;
    box-shadow: 0 4px 12px color-mix(in srgb, var(--primary) 35%, transparent) !important;
    color: #ffffff !important;
}

/* Swap to solid filled heart icon when active, colored in white */
.btn-add-wishlist.active .icon-heart:before,
.btn-add-wishlist.active .icon-Heart:before,
.btn-add-wishlist.active .icon-HeartStraight:before {
    font-family: "Font Awesome 6 Free" !important;
    font-weight: 900 !important;
    content: "\f004" !important;
    color: #ffffff !important;
}
.btn-add-wishlist.active .icon {
    color: #ffffff !important;
}

/* --- Hover tooltips color-inversion --- */
/* Inactive Tooltip: White background, tenant primary border and text */
.btn-add-wishlist:not(.active) .tooltip {
    background-color: #ffffff !important;
    color: var(--primary) !important;
    border: 1px solid var(--primary) !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
}
.btn-add-wishlist:not(.active) .tooltip::before {
    background: #ffffff !important;
    border-left: 1px solid var(--primary) !important;
    border-top: 1px solid var(--primary) !important;
}

/* Active Tooltip: Tenant primary background, white text */
.btn-add-wishlist.active .tooltip {
    background-color: var(--primary) !important;
    color: #ffffff !important;
    border: none !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1) !important;
}
.btn-add-wishlist.active .tooltip::before {
    background: var(--primary) !important;
    border: none !important;
}

/* ==========================================================================
   QUANTITY CONTROL WIDGET STYLE OVERRIDES
   ========================================================================== */
/* Slimmed down pill layout with tenant primary tint background */
.quantity-control {
    background-color: color-mix(in srgb, var(--primary) 8%, #ffffff) !important;
    border: none !important;
    padding: 2px !important;
    height: 36px !important;
    border-radius: 100px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.03) !important;
}

.quantity-control .qty-btn {
    width: 32px !important;
    height: 32px !important;
    color: var(--primary) !important;
    font-size: 14px !important;
    background: transparent !important;
    border: none !important;
    transition: transform 0.15s ease !important;
}

.quantity-control .qty-btn:hover {
    background: transparent !important;
    transform: scale(1.15) !important; /* Soft tactile feedback */
}

.quantity-control .qty-value {
    color: var(--primary) !important;
    font-size: 14px !important;
    min-width: 32px !important;
    font-weight: 700 !important;
}