/* === ASSISTIVETOUCH CSS === */

/* Only show AT button on smaller screens */
@media (min-width: 1025px) {
    #radial-nav-container {
        display: none !important;
    }
}

/* Mobile/Tablet layout restructuring when AT is active */
@media (max-width: 1024px) {
    /* Hide redundant elements */
    .nav-hamburger,
    .nav-cta-btn,
    .nav-links,
    .nav-actions a[href*="profile"] {
        display: none !important;
    }

    /* Layout structure */
    .nav-inner {
        position: relative;
    }

    /* Absolutely center logo */
    .nav-inner .nav-logo {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate(-50%, -50%);
        margin: 0;
        z-index: 2; /* keep above icons if they overlap */
    }

    /* Spread remaining icons (Search & Cart) to left and right edges */
    .nav-actions {
        width: 100%;
        justify-content: space-between;
        padding: 0 15px;
    }
}

/* === RADIAL FLOATING NAVIGATION === */

#radial-nav-container {
    position: fixed;
    z-index: 2147483647; /* Absolute maximum to stay above ALL overlays/filters */
    /* Initial position; will be updated by JS */
    bottom: 30px;
    right: 20px;
    touch-action: none; /* Crucial for dragging */
    width: 64px;
    height: 64px;
    /* We don't hide overflow here because items expand radially outside the 64x64 bounds */
}

/* Main Floating Button */
#radial-center-btn {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    /* glassmorphism pink */
    background: linear-gradient(135deg, rgba(255, 179, 193, 0.9), rgba(251, 111, 146, 0.9));
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: grab;
    position: relative;
    z-index: 30;
    box-shadow: 0 8px 32px rgba(251, 111, 146, 0.3);
    border: 1px solid rgba(255, 255, 255, 0.4);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    /* Add pulse animation by default */
    animation: assistivePulse 2.5s infinite;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}


@keyframes assistivePulse {
    0% { box-shadow: 0 0 0 0 rgba(251, 111, 146, 0.6); }
    70% { box-shadow: 0 0 0 15px rgba(251, 111, 146, 0); }
    100% { box-shadow: 0 0 0 0 rgba(251, 111, 146, 0); }
}

/* When expanded, stop the pulse and shrink slightly */
.radial-expanded #radial-center-btn {
    animation: none;
    transform: scale(0.95);
    box-shadow: 0 4px 15px rgba(251, 111, 146, 0.4);
}

/* Animated Wave Icon */
#wave-icon {
    display: flex;
    flex-direction: column;
    gap: 5px;
    align-items: center;
    justify-content: center;
    width: 26px;
    height: 24px;
}

#wave-icon span {
    display: block;
    height: 3px;
    background: white;
    border-radius: 3px;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Waving animation on the 3 layers */
#wave-icon span:nth-child(1) { width: 26px; animation: waving 1.5s ease-in-out infinite alternate; }
#wave-icon span:nth-child(2) { width: 20px; animation: waving 1.5s ease-in-out infinite alternate 0.2s; }
#wave-icon span:nth-child(3) { width: 14px; animation: waving 1.5s ease-in-out infinite alternate 0.4s; }

@keyframes waving {
    0% { transform: translateX(-4px); }
    100% { transform: translateX(4px); }
}

/* Morph to X when expanded */
.radial-expanded #wave-icon span {
    animation: none !important;
    width: 26px !important;
    transform-origin: center;
}

.radial-expanded #wave-icon span:nth-child(1) {
    transform: translateY(8px) rotate(45deg);
}
.radial-expanded #wave-icon span:nth-child(2) {
    opacity: 0;
}
.radial-expanded #wave-icon span:nth-child(3) {
    transform: translateY(-8px) rotate(-45deg);
}

/* Radial Items Wrapper */
#radial-items-wrapper {
    position: absolute;
    top: 32px; /* Center of the 64px container */
    left: 32px;
    width: 0;
    height: 0;
    pointer-events: none; /* Container shouldn't block clicks */
    z-index: 20; /* Ensure items render ABOVE the center button */
}

/* Curved Scrollbar SVG */
#radial-scrollbar {
    position: absolute;
    top: 32px;
    left: 0px;
    width: 240px;
    height: 240px;
    /* Center the 240x240 SVG perfectly on the 64x64 button */
    margin-top: -120px;
    margin-left: -120px;
    pointer-events: none;
    z-index: 15;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#radial-nav-container.radial-expanded #radial-scrollbar {
    opacity: 1;
    transform: scale(1);
}

.radial-track {
    stroke: rgba(251, 111, 146, 0.2);
}

.radial-thumb {
    stroke: var(--prism-rose);
    transition: stroke-dashoffset 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
    /* Glow effect on thumb */
    filter: drop-shadow(0 0 8px rgba(251, 111, 146, 0.6));
}

/* Individual Radial Items */
.radial-item {
    position: absolute;
    width: 56px;
    height: 56px;
    /* Center the item's origin at 0,0 */
    margin-left: -28px;
    margin-top: -28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 214, 224, 0.8);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.06);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    pointer-events: auto; /* Re-enable clicks */
    /* Animation initial state */
    opacity: 0;
    transform: translate(var(--tx, 0px), var(--ty, 0px)) scale(0.5);
    /* We use custom variables set by JS for the expanded transform */
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.radial-item.show-item {
    opacity: 0.5; /* Default visible but unfocused state */
    transform: translate(var(--tx, 0px), var(--ty, 0px)) scale(0.85); /* Slightly smaller */
    filter: blur(1.5px);
    z-index: 20;
}

/* Focused Middle Item */
.radial-item.show-item.focused-item {
    opacity: 1;
    transform: translate(var(--tx, 0px), var(--ty, 0px)) scale(1.15); /* Slightly larger */
    filter: blur(0px);
    z-index: 25; /* Always on top */
    box-shadow: 0 8px 25px rgba(251, 111, 146, 0.25);
    border-color: rgba(251, 111, 146, 0.8);
}

.radial-item i {
    font-size: 1.5rem;
    color: #333333;
    transition: color 0.3s ease;
}

.radial-item.show-item.focused-item i {
    color: var(--prism-rose);
}
.radial-item.active-route i {
    color: var(--prism-rose);
}

.radial-item:active {
    transform: scale(0.9) !important; /* Overrides the JS transform slightly during tap */
}




/* Badge for cart count */
.radial-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: var(--prism-rose);
    color: white;
    font-size: 0.65rem;
    font-weight: 700;
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    border: 2px solid white;
}
