/**
 * Cart/Truck Toggle Switch
 * Half-and-half sliding switch design
 * Cart = default (left), Truck = active on truck page (right)
 */

/* ==========================================================================
   Header Mode Toggle (on gradient background)
   ========================================================================== */

.header-mode-toggle {
    display: flex;
    align-items: center;
    position: relative;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 20px;
    padding: 0;
    border: 1px solid rgba(255, 255, 255, 0.15);
    box-shadow:
        inset 0 2px 4px rgba(0, 0, 0, 0.3),
        0 1px 0 rgba(255, 255, 255, 0.1);
    overflow: hidden;
}

/* Sliding half-pill - edge to edge, no gaps */
.header-mode-toggle::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 50%;
    height: 100%;
    background: linear-gradient(180deg,
        rgba(255, 255, 255, 0.3) 0%,
        rgba(255, 255, 255, 0.18) 100%
    );
    border-radius: 19px;
    box-shadow:
        inset 0 1px 0 rgba(255, 255, 255, 0.4);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
}

/* Move pill to right half when truck is active */
.header-mode-toggle.truck-active::before {
    transform: translateX(100%);
}

.toggle-option {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 32px;
    border-radius: 15px;
    text-decoration: none !important;
    color: rgba(255, 255, 255, 0.5) !important;
    background: transparent;
    transition: all 0.25s ease;
    position: relative;
    z-index: 2;
}

.toggle-option i {
    font-size: 15px;
    color: rgba(255, 255, 255, 0.5) !important;
    transition: all 0.25s ease;
}

/* Cart icon - bright white (active by default) */
.toggle-option:first-child i {
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Truck icon - dimmer (inactive) */
.toggle-option:last-child i {
    color: rgba(255, 255, 255, 0.5) !important;
}

/* When truck is active: swap brightness */
.header-mode-toggle.truck-active .toggle-option:first-child i {
    color: rgba(255, 255, 255, 0.5) !important;
    text-shadow: none;
}

.header-mode-toggle.truck-active .toggle-option:last-child i {
    color: #ffffff !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.3);
}

/* Hover effects */
.toggle-option:hover i {
    color: rgba(255, 255, 255, 0.8) !important;
}

/* ==========================================================================
   Cart Badge on Toggle
   ========================================================================== */

.toggle-badge {
    position: absolute;
    top: -6px;
    right: -6px;
    background: linear-gradient(135deg, #FF6B6B 0%, #ee5a5a 100%);
    color: #ffffff;
    font-size: 10px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(255, 107, 107, 0.4);
    border: 2px solid rgba(255, 255, 255, 0.5);
    z-index: 3;
}

/* ==========================================================================
   Standalone Toggle (if needed elsewhere)
   ========================================================================== */

.page-mode-toggle {
    display: flex;
    justify-content: center;
    padding: 16px 20px;
    background: linear-gradient(180deg, #f8f9fa 0%, #ffffff 100%);
    border-bottom: 1px solid #eee;
}

.header-mode-toggle.standalone {
    background: #ddd;
    border: 1px solid #ccc;
    box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.15);
}

.header-mode-toggle.standalone::before {
    background: rgba(0, 167, 225, 0.3);
    border-color: rgba(0, 167, 225, 0.5);
}

.header-mode-toggle.standalone.truck-active::before {
    background: rgba(0, 167, 225, 0.4);
}

.header-mode-toggle.standalone .toggle-option i {
    color: #666 !important;
}

.header-mode-toggle.standalone .toggle-option:first-child i {
    color: #333 !important;
}

.header-mode-toggle.standalone.truck-active .toggle-option:first-child i {
    color: #999 !important;
}

.header-mode-toggle.standalone.truck-active .toggle-option:last-child i {
    color: #00A7E1 !important;
}

/* ==========================================================================
   Responsive Adjustments
   ========================================================================== */

@media (max-width: 375px) {
    .header-mode-toggle {
        border-radius: 18px;
    }

    .toggle-option {
        width: 34px;
        height: 28px;
        border-radius: 14px;
    }

    .toggle-option i {
        font-size: 13px;
    }

    .header-mode-toggle::before {
        border-radius: 15px;
    }
}

@media (min-width: 430px) {
    .header-mode-toggle {
        border-radius: 22px;
    }

    .toggle-option {
        width: 44px;
        height: 38px;
        border-radius: 19px;
    }

    .toggle-option i {
        font-size: 16px;
    }

    .header-mode-toggle::before {
        border-radius: 21px;
    }
}
