/* Brand color overrides for Kamdhenu Ecommerce */
:root {
    --primary: #90090C;
    --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;
}

/* 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: #90090C !important;
    border-color: #90090C !important;
}

.tf-btn:hover,
.btn-main:hover {
    background-color: #6e0709 !important;
    border-color: #6e0709 !important;
}

/* Text primary color */
.text-main,
.link-main {
    color: #90090C !important;
}

/* Border primary */
.border-main {
    border-color: #90090C !important;
}

/* Background primary */
.bg-main {
    background-color: #90090C !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: #90090C !important;
    border-color: #90090C !important;
    color: #ffffff !important;
}

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

/* Selection state for radio/check buttons */
.btn-check:checked+.btn-stroke.price-preset,
.btn-check:checked+.btn-stroke.btn-primary-custom {
    background-color: #90090C !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: #90090C !important;
    }

    .btn-stroke.price-preset,
    .btn-stroke.btn-primary-custom {
        color: #90090C !important;
        background-color: transparent !important;
    }

    .btn-check:checked+.btn-stroke.price-preset {
        color: #ffffff !important;
        background-color: #90090C !important;
    }
}