@use 'design-system' as *;

.customMenu {
    display: none;
    padding-right: $spacing-size-2;
    margin-right: auto;
    user-select: none;

    @media screen and (min-width: 440px) {
        display: block;
    }

    @media screen and (max-width: 1180px) {
        display: none;
    }

    @media screen and (min-width: $breakpoint-hero-small) {
        position: relative;
    }
}

.customTrigger {
    padding: 12px;
    padding-top: $spacing-size-1;
    padding-bottom: $spacing-size-1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition:
        background-color 0.3s,
        color 0.3s;
    font-weight: 500;
    font-size: 17px;
    border: none;
    border-radius: var(--radius-3xl);

    #{$selector-darkmode}:has([data-is-homepage='false']) &,
    #{$selector-darkmode}:has([data-is-homepage='true'] :global(.header-scrolled)) & {
        background-color: var(--color-bg-primary);
        border-radius: var(--radius-3xl);
        border: none;
        opacity: 0.8;
        color: var(--color-fg-white);
    }
}

.customTrigger:hover {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    border-radius: var(--radius-3xl);
}

.customTrigger.open .arrow {
    margin-top: 4px;
    transform: rotate(225deg);
}

.customTrigger.open {
    background: rgba(255, 255, 255, 0.1);
    border: none;
}

.arrow {
    display: inline-block;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    padding: 3px;
    transform: rotate(45deg);
    transition: transform 0.3s;
    margin-left: 12px;
    margin-bottom: 2px;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(-0.5rem) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.customContent {
    position: absolute;
    top: 52px;
    width: calc(100% - #{$spacing-size-3 * 2});
    left: $spacing-size-3;
    padding: $spacing-size-2;
    border-radius: var(--radius-md);
    background: var(--color-bg-primary);
    border: 1px solid var(--color-border-primary);
    box-shadow: var(--shadow-sm);
    opacity: 0;
    z-index: 2;
    transform: translateY(10px) scale(0.95);
    transition:
        opacity 0.15s ease,
        transform 0.15s ease;

    #{$selector-darkmode}:has([data-is-homepage='false']) &,
    #{$selector-darkmode}:has([data-is-homepage='true'] :global(.header-scrolled)) & {
        background: color-mix(in srgb, var(--color-bg-primary), var(--color-fg-white) 5%);
    }

    @media screen and (min-width: $breakpoint-hero-small) {
        top: 100%;
        left: 0;
        width: 380px;
    }
}

.customMenu.open .customContent {
    animation: fadeInUp 0.15s ease-in-out;
    opacity: 1;
    transform: translateY(0) scale(1);
}

.productTitle {
    font-weight: var(--text-semibold);

    #{$selector-darkmode}:has([data-is-homepage='false']) &,
    #{$selector-darkmode}:has([data-is-homepage='true'] :global(.header-scrolled)) & {
        color: var(--color-fg-primary);
    }
}

.productDescription {
    color: var(--color-text-secondary);
    opacity: 0.85;
    font-size: var(--text-fs-sm);
    font-weight: var(--text-regular);
}

.itemsWrapper {
    display: flex;
    padding: 8px;
    border-radius: var(--radius-md);
    transition: 0.5s all;
}

.itemsWrapper:first-child {
    display: flex;
    margin-bottom: $spacing-size-3;
}

.productsWrapper {
    display: flex;
    flex-direction: column;
    padding-left: $spacing-size-3;
}

.placeholderIcon {
    background: var(--color-util-brand-100);
    padding: 12px;
    border-radius: var(--radius-md);

    #{$selector-darkmode}:has([data-is-homepage='false']) &,
    #{$selector-darkmode}:has([data-is-homepage='true'] :global(.header-scrolled)) & {
        background: color-mix(in srgb, var(--color-fg-white), var(--color-bg-primary) 85%);
        box-shadow: var(--shadow-lg);
    }
}

.itemsWrapper:hover {
    background: var(--color-util-brand-50);
    cursor: pointer;
    transition: 0.3s all ease-in-out;

    #{$selector-darkmode}:has([data-is-homepage='false']) &,
    #{$selector-darkmode}:has([data-is-homepage='true'] :global(.header-scrolled)) & {
        background: color-mix(in srgb, var(--color-fg-white), var(--color-bg-primary) 85%);
    }
}

.iconLight {
    #{$selector-darkmode}:has([data-is-homepage='false']) &,
    #{$selector-darkmode}:has([data-is-homepage='true'] :global(.header-scrolled)) & {
        display: none;
    }
}

.iconDark {
    display: none;

    #{$selector-darkmode}:has([data-is-homepage='false']) &,
    #{$selector-darkmode}:has([data-is-homepage='true'] :global(.header-scrolled)) & {
        display: block;
    }
}
